From def805b60bbb5d21e38adc13bb3314f6de3802af Mon Sep 17 00:00:00 2001 From: theonlytails Date: Thu, 9 Nov 2023 00:06:34 +0200 Subject: [PATCH] Refactored the search system to use form actions. Search filtering is now done in the navbar. Filters are now saved to local storage and URL params. Added manual theme switching. Removed the Scroll to Top button from word pages. Added handling if word etymology data is missing. Made the UCSUR link more visible. Rounded the luka pona videos' corners. Removed unused components. Added LightningCSS minifiying. Updated deps. --- .vscode/extensions.json | 14 +- package.json | 13 +- pnpm-lock.yaml | 325 +++++++++++++----- postcss.config.js | 3 +- src/app.postcss | 89 ++--- src/lib/components/Filter.svelte | 86 ----- src/lib/components/LukaPonaEntry.svelte | 50 --- src/lib/components/Navbar.svelte | 108 +++++- src/lib/components/ui/avatar/index.ts | 2 +- src/lib/components/ui/button/index.ts | 21 +- src/lib/components/ui/card/index.ts | 2 +- src/lib/components/ui/checkbox/index.ts | 2 +- .../dropdown-menu-checkbox-item.svelte | 35 ++ .../dropdown-menu-content.svelte | 25 ++ .../dropdown-menu/dropdown-menu-item.svelte | 31 ++ .../dropdown-menu/dropdown-menu-label.svelte | 19 + .../dropdown-menu-radio-group.svelte | 11 + .../dropdown-menu-radio-item.svelte | 35 ++ .../dropdown-menu-separator.svelte | 14 + .../dropdown-menu-shortcut.svelte | 16 + .../dropdown-menu-sub-content.svelte | 30 ++ .../dropdown-menu-sub-trigger.svelte | 32 ++ src/lib/components/ui/dropdown-menu/index.ts | 48 +++ src/lib/components/ui/input/index.ts | 2 +- src/lib/components/ui/label/index.ts | 2 +- src/lib/components/ui/select/index.ts | 2 +- src/lib/components/ui/separator/index.ts | 2 +- src/lib/components/ui/skeleton/index.ts | 2 +- src/lib/components/ui/tooltip/index.ts | 2 +- src/lib/state.ts | 17 + src/lib/types.ts | 2 +- src/routes/(words)/+layout.server.ts | 16 +- src/routes/(words)/+layout.svelte | 25 +- src/routes/(words)/+page.svelte | 27 +- src/routes/(words)/search/+page.server.ts | 13 +- src/routes/(words)/words/[word]/+page.svelte | 77 +++-- src/routes/+layout.svelte | 2 + tailwind.config.ts | 3 +- vite.config.ts | 3 + 39 files changed, 806 insertions(+), 402 deletions(-) delete mode 100644 src/lib/components/Filter.svelte delete mode 100644 src/lib/components/LukaPonaEntry.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte create mode 100644 src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte create mode 100644 src/lib/components/ui/dropdown-menu/index.ts diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 9d00bea..0ca08ca 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,8 @@ { - "recommendations": [ - "antfu.iconify", - "svelte.svelte-vscode", - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint" - ] -} \ No newline at end of file + "recommendations": [ + "antfu.iconify", + "svelte.svelte-vscode", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint" + ] +} diff --git a/package.json b/package.json index bce5b53..3363dd0 100644 --- a/package.json +++ b/package.json @@ -12,16 +12,19 @@ "format": "prettier --plugin-search-dir . --write ." }, "devDependencies": { - "@iconify/json": "^2.2.137", + "@iconify/json": "^2.2.139", "@sveltejs/adapter-auto": "^2.1.1", "@sveltejs/kit": "^1.27.3", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", "clsx": "^2.0.0", "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-svelte": "^2.34.1", + "eslint-plugin-svelte": "^2.35.0", "fastest-levenshtein": "^1.0.16", + "lightningcss": "^1.22.1", + "mode-watcher": "^0.0.7", + "postcss-nesting": "^12.0.1", "prettier": "^3.0.3", "prettier-plugin-svelte": "^3.0.3", "svelte": "^4.2.2", @@ -37,6 +40,6 @@ }, "type": "module", "dependencies": { - "bits-ui": "^0.9.0" + "bits-ui": "^0.9.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f90bb1e..ee8f31a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,13 +6,13 @@ settings: dependencies: bits-ui: - specifier: ^0.9.0 - version: 0.9.0(svelte@4.2.2) + specifier: ^0.9.1 + version: 0.9.1(svelte@4.2.2) devDependencies: '@iconify/json': - specifier: ^2.2.137 - version: 2.2.137 + specifier: ^2.2.139 + version: 2.2.139 '@sveltejs/adapter-auto': specifier: ^2.1.1 version: 2.1.1(@sveltejs/kit@1.27.3) @@ -20,11 +20,11 @@ devDependencies: specifier: ^1.27.3 version: 1.27.3(svelte@4.2.2)(vite@4.5.0) '@typescript-eslint/eslint-plugin': - specifier: ^6.9.1 - version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2) + specifier: ^6.10.0 + version: 6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^6.9.1 - version: 6.9.1(eslint@8.53.0)(typescript@5.2.2) + specifier: ^6.10.0 + version: 6.10.0(eslint@8.53.0)(typescript@5.2.2) clsx: specifier: ^2.0.0 version: 2.0.0 @@ -35,11 +35,20 @@ devDependencies: specifier: ^9.0.0 version: 9.0.0(eslint@8.53.0) eslint-plugin-svelte: - specifier: ^2.34.1 - version: 2.34.1(eslint@8.53.0)(svelte@4.2.2) + specifier: ^2.35.0 + version: 2.35.0(eslint@8.53.0)(svelte@4.2.2) fastest-levenshtein: specifier: ^1.0.16 version: 1.0.16 + lightningcss: + specifier: ^1.22.1 + version: 1.22.1 + mode-watcher: + specifier: ^0.0.7 + version: 0.0.7(svelte@4.2.2) + postcss-nesting: + specifier: ^12.0.1 + version: 12.0.1(postcss@8.4.31) prettier: specifier: ^3.0.3 version: 3.0.3 @@ -75,7 +84,7 @@ devDependencies: version: 0.17.3 vite: specifier: ^4.5.0 - version: 4.5.0 + version: 4.5.0(lightningcss@1.22.1) packages: @@ -114,6 +123,15 @@ packages: regenerator-runtime: 0.14.0 dev: true + /@csstools/selector-specificity@3.0.0(postcss-selector-parser@6.0.13): + resolution: {integrity: sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss-selector-parser: ^6.0.13 + dependencies: + postcss-selector-parser: 6.0.13 + dev: true + /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -391,8 +409,8 @@ packages: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} dev: true - /@iconify/json@2.2.137: - resolution: {integrity: sha512-3FGpECgBVywCUoYwGP192fo50QiNynUnVEKRiiIFTtMyY6bCFAJP/ra/uJeiqwXQm4qBDIuUqKBDe5odFCSUfg==} + /@iconify/json@2.2.139: + resolution: {integrity: sha512-RQrUtjDN7qzGP+75I4lqH4XO2/PjOA7g9yQEoVB/DQf3S1ND7qLxlgbMa5vZV7oFMydl0ifmeIzBtgKL78B11Q==} dependencies: '@iconify/types': 2.0.0 pathe: 1.1.1 @@ -497,7 +515,7 @@ packages: vite: ^4.0.0 dependencies: '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.2.2)(vite@4.5.0) - '@types/cookie': 0.5.3 + '@types/cookie': 0.5.4 cookie: 0.5.0 devalue: 4.3.2 esm-env: 1.0.0 @@ -510,7 +528,7 @@ packages: svelte: 4.2.2 tiny-glob: 0.2.9 undici: 5.26.5 - vite: 4.5.0 + vite: 4.5.0(lightningcss@1.22.1) transitivePeerDependencies: - supports-color dev: true @@ -526,7 +544,7 @@ packages: '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.2.2)(vite@4.5.0) debug: 4.3.4 svelte: 4.2.2 - vite: 4.5.0 + vite: 4.5.0(lightningcss@1.22.1) transitivePeerDependencies: - supports-color dev: true @@ -545,33 +563,33 @@ packages: magic-string: 0.30.5 svelte: 4.2.2 svelte-hmr: 0.15.3(svelte@4.2.2) - vite: 4.5.0 + vite: 4.5.0(lightningcss@1.22.1) vitefu: 0.2.5(vite@4.5.0) transitivePeerDependencies: - supports-color dev: true - /@types/cookie@0.5.3: - resolution: {integrity: sha512-SLg07AS9z1Ab2LU+QxzU8RCmzsja80ywjf/t5oqw+4NSH20gIGlhLOrBDm1L3PBWzPa4+wkgFQVZAjE6Ioj2ug==} + /@types/cookie@0.5.4: + resolution: {integrity: sha512-7z/eR6O859gyWIAjuvBWFzNURmf2oPBmJlfVWkwehU5nzIyjwBsTh7WMmEEV4JFnHuQ3ex4oyTvfKzcyJVDBNA==} dev: true - /@types/estree@1.0.4: - resolution: {integrity: sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==} + /@types/estree@1.0.5: + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - /@types/json-schema@7.0.14: - resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==} + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true - /@types/pug@2.0.8: - resolution: {integrity: sha512-QzhsZ1dMGyJbn/D9V80zp4GIA4J4rfAjCCxc3MP+new0E8dyVdSkR735Lx+n3LIaHNFcjHL5+TbziccuT+fdoQ==} + /@types/pug@2.0.9: + resolution: {integrity: sha512-Yg4LkgFYvn1faISbDNWmcAC1XoDT8IoMUFspp5mnagKk+UvD2N0IWt5A7GRdMubsNWqgCLmrkf8rXkzNqb4szA==} dev: true - /@types/semver@7.5.4: - resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} + /@types/semver@7.5.5: + resolution: {integrity: sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==} dev: true - /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} + /@typescript-eslint/eslint-plugin@6.10.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -582,11 +600,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/type-utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.1 + '@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/type-utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 eslint: 8.53.0 graphemer: 1.4.0 @@ -599,8 +617,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.1(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} + /@typescript-eslint/parser@6.10.0(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -609,10 +627,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/types': 6.9.1 - '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.1 + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 eslint: 8.53.0 typescript: 5.2.2 @@ -620,16 +638,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.9.1: - resolution: {integrity: sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==} + /@typescript-eslint/scope-manager@6.10.0: + resolution: {integrity: sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.1 - '@typescript-eslint/visitor-keys': 6.9.1 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 dev: true - /@typescript-eslint/type-utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} + /@typescript-eslint/type-utils@6.10.0(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -638,8 +656,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2) + '@typescript-eslint/utils': 6.10.0(eslint@8.53.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.53.0 ts-api-utils: 1.0.3(typescript@5.2.2) @@ -648,13 +666,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.9.1: - resolution: {integrity: sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==} + /@typescript-eslint/types@6.10.0: + resolution: {integrity: sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.9.1(typescript@5.2.2): - resolution: {integrity: sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==} + /@typescript-eslint/typescript-estree@6.10.0(typescript@5.2.2): + resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -662,8 +680,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.9.1 - '@typescript-eslint/visitor-keys': 6.9.1 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -674,18 +692,18 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} + /@typescript-eslint/utils@6.10.0(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) - '@types/json-schema': 7.0.14 - '@types/semver': 7.5.4 - '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/types': 6.9.1 - '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.5 + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2) eslint: 8.53.0 semver: 7.5.4 transitivePeerDependencies: @@ -693,11 +711,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.9.1: - resolution: {integrity: sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==} + /@typescript-eslint/visitor-keys@6.10.0: + resolution: {integrity: sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/types': 6.10.0 eslint-visitor-keys: 3.4.3 dev: true @@ -783,13 +801,13 @@ packages: engines: {node: '>=8'} dev: true - /bits-ui@0.9.0(svelte@4.2.2): - resolution: {integrity: sha512-wEVWMnR4or4t8dY+UP+G4jVugzsfhMcuIrTOoJh8V6t/JcHWne/z1nnBA/yD1E1cn391IUurSatRkv7qTJXMww==} + /bits-ui@0.9.1(svelte@4.2.2): + resolution: {integrity: sha512-cpA2eMtPwBewEKWbouV9fAesha5xXBUC4bNpFmMtPPHgPqadtqu6TUk5Q2Ywi2a4lsQOYeNz7wJObPt7d9e+BA==} peerDependencies: svelte: ^4.0.0 dependencies: '@melt-ui/svelte': 0.57.2(svelte@4.2.2) - nanoid: 5.0.2 + nanoid: 5.0.3 svelte: 4.2.2 dev: false @@ -853,7 +871,7 @@ packages: resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - '@types/estree': 1.0.4 + '@types/estree': 1.0.5 acorn: 8.11.2 estree-walker: 3.0.3 periscopic: 3.1.0 @@ -935,6 +953,12 @@ packages: engines: {node: '>=8'} dev: true + /detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /devalue@4.3.2: resolution: {integrity: sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==} dev: true @@ -1000,6 +1024,15 @@ packages: engines: {node: '>=10'} dev: true + /eslint-compat-utils@0.1.2(eslint@8.53.0): + resolution: {integrity: sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 8.53.0 + dev: true + /eslint-config-prettier@9.0.0(eslint@8.53.0): resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true @@ -1009,8 +1042,8 @@ packages: eslint: 8.53.0 dev: true - /eslint-plugin-svelte@2.34.1(eslint@8.53.0)(svelte@4.2.2): - resolution: {integrity: sha512-HnLzYevh9bLL0Rj2d4dmZY9EutN0BL5JsJRHqtJFIyaEmdxxd3ZuY5zNoSjIFhctFMSntsClbd6TwYjgaOY0Xw==} + /eslint-plugin-svelte@2.35.0(eslint@8.53.0)(svelte@4.2.2): + resolution: {integrity: sha512-3WDFxNrkXaMlpqoNo3M1ZOQuoFLMO9+bdnN6oVVXaydXC7nzCJuGy9a0zqoNDHMSRPYt0Rqo6hIdHMEaI5sQnw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0-0 @@ -1023,6 +1056,7 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 debug: 4.3.4 eslint: 8.53.0 + eslint-compat-utils: 0.1.2(eslint@8.53.0) esutils: 2.0.3 known-css-properties: 0.29.0 postcss: 8.4.31 @@ -1132,7 +1166,7 @@ packages: /estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: - '@types/estree': 1.0.4 + '@types/estree': 1.0.5 /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -1158,8 +1192,8 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob@3.3.1: - resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -1303,7 +1337,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.3.1 + fast-glob: 3.3.2 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -1409,7 +1443,7 @@ packages: /is-reference@3.0.2: resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} dependencies: - '@types/estree': 1.0.4 + '@types/estree': 1.0.5 /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} @@ -1475,6 +1509,104 @@ packages: type-check: 0.4.0 dev: true + /lightningcss-darwin-arm64@1.22.1: + resolution: {integrity: sha512-ldvElu+R0QimNTjsKpaZkUv3zf+uefzLy/R1R19jtgOfSRM+zjUCUgDhfEDRmVqJtMwYsdhMI2aJtJChPC6Osg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-darwin-x64@1.22.1: + resolution: {integrity: sha512-5p2rnlVTv6Gpw4PlTLq925nTVh+HFh4MpegX8dPDYJae+NFVjQ67gY7O6iHIzQjLipDiYejFF0yHrhjU3XgLBQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /lightningcss-freebsd-x64@1.22.1: + resolution: {integrity: sha512-1FaBtcFrZqB2hkFbAxY//Pnp8koThvyB6AhjbdVqKD4/pu13Rl91fKt2N9qyeQPUt3xy7ORUvSO+dPk3J6EjXg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm-gnueabihf@1.22.1: + resolution: {integrity: sha512-6rub98tYGfE5I5j0BP8t/2d4BZyu1S7Iz9vUkm0H26snAFHYxLfj3RbQn0xHHIePSetjLnhcg3QlfwUAkD/FYg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-gnu@1.22.1: + resolution: {integrity: sha512-nYO5qGtb/1kkTZu3FeTiM+2B2TAb7m2DkLCTgQIs2bk2o9aEs7I96fwySKcoHWQAiQDGR9sMux9vkV4KQXqPaQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-arm64-musl@1.22.1: + resolution: {integrity: sha512-MCV6RuRpzXbunvzwY644iz8cw4oQxvW7oer9xPkdadYqlEyiJJ6wl7FyJOH7Q6ZYH4yjGAUCvxDBxPbnDu9ZVg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-gnu@1.22.1: + resolution: {integrity: sha512-RjNgpdM20VUXgV7us/VmlO3Vn2ZRiDnc3/bUxCVvySZWPiVPprpqW/QDWuzkGa+NCUf6saAM5CLsZLSxncXJwg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-linux-x64-musl@1.22.1: + resolution: {integrity: sha512-ZgO4C7Rd6Hv/5MnyY2KxOYmIlzk4rplVolDt3NbkNR8DndnyX0Q5IR4acJWNTBICQ21j3zySzKbcJaiJpk/4YA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /lightningcss-win32-x64-msvc@1.22.1: + resolution: {integrity: sha512-4pozV4eyD0MDET41ZLHAeBo+H04Nm2UEYIk5w/ts40231dRFV7E0cjwbnZvSoc1DXFgecAhiC0L16ruv/ZDCpg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /lightningcss@1.22.1: + resolution: {integrity: sha512-Fy45PhibiNXkm0cK5FJCbfO8Y6jUpD/YcHf/BtuI+jvYYqSXKF4muk61jjE8YxCR9y+hDYIWSzHTc+bwhDE6rQ==} + engines: {node: '>= 12.0.0'} + dependencies: + detect-libc: 1.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.22.1 + lightningcss-darwin-x64: 1.22.1 + lightningcss-freebsd-x64: 1.22.1 + lightningcss-linux-arm-gnueabihf: 1.22.1 + lightningcss-linux-arm64-gnu: 1.22.1 + lightningcss-linux-arm64-musl: 1.22.1 + lightningcss-linux-x64-gnu: 1.22.1 + lightningcss-linux-x64-musl: 1.22.1 + lightningcss-win32-x64-msvc: 1.22.1 + dev: true + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -1587,6 +1719,15 @@ packages: ufo: 1.3.1 dev: true + /mode-watcher@0.0.7(svelte@4.2.2): + resolution: {integrity: sha512-3/RXHKzg9TjhkYo8YTx++Ai7a2Qd7BkYS3RFWaIhj0NPonXAF5JNegiZ3CTk1Q/k0wyhPQUlsWW0Y5ByCp6Y1g==} + peerDependencies: + svelte: ^4.0.0 + dependencies: + svelte: 4.2.2 + svelte-persisted-store: 0.7.0(svelte@4.2.2) + dev: true + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -1609,8 +1750,8 @@ packages: thenify-all: 1.6.0 dev: true - /nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -1621,8 +1762,8 @@ packages: hasBin: true dev: false - /nanoid@5.0.2: - resolution: {integrity: sha512-2ustYUX1R2rL/Br5B/FMhi8d5/QzvkJ912rBYxskcpu0myTHzSZfTr1LAS2Sm7jxRUObRrSBFoyzwAhL49aVSg==} + /nanoid@5.0.3: + resolution: {integrity: sha512-I7X2b22cxA4LIHXPSqbBCEQSL+1wv8TuoefejsX4HFWyC6jc5JG7CEaxOltiKjc1M+YCS2YkrZZcj4+dytw9GA==} engines: {node: ^18 || >=20} hasBin: true dev: false @@ -1730,7 +1871,7 @@ packages: /periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} dependencies: - '@types/estree': 1.0.4 + '@types/estree': 1.0.5 estree-walker: 3.0.3 is-reference: 3.0.2 @@ -1827,6 +1968,17 @@ packages: postcss-selector-parser: 6.0.13 dev: true + /postcss-nesting@12.0.1(postcss@8.4.31): + resolution: {integrity: sha512-6LCqCWP9pqwXw/njMvNK0hGY44Fxc4B2EsGbn6xDcxbNRzP8GYoxT7yabVVMLrX3quqOJ9hg2jYMsnkedOf8pA==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss: ^8.4 + dependencies: + '@csstools/selector-specificity': 3.0.0(postcss-selector-parser@6.0.13) + postcss: 8.4.31 + postcss-selector-parser: 6.0.13 + dev: true + /postcss-safe-parser@6.0.0(postcss@8.4.31): resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} engines: {node: '>=12.0'} @@ -1861,7 +2013,7 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 dev: true @@ -2090,7 +2242,7 @@ packages: dependencies: '@jridgewell/trace-mapping': 0.3.20 chokidar: 3.5.3 - fast-glob: 3.3.1 + fast-glob: 3.3.2 import-fresh: 3.3.0 picocolors: 1.0.0 sade: 1.8.1 @@ -2182,7 +2334,7 @@ packages: typescript: optional: true dependencies: - '@types/pug': 2.0.8 + '@types/pug': 2.0.9 detect-indent: 6.1.0 magic-string: 0.27.0 postcss: 8.4.31 @@ -2244,7 +2396,7 @@ packages: chokidar: 3.5.3 didyoumean: 1.2.2 dlv: 1.1.3 - fast-glob: 3.3.1 + fast-glob: 3.3.2 glob-parent: 6.0.2 is-glob: 4.0.3 jiti: 1.21.0 @@ -2397,7 +2549,7 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /vite@4.5.0: + /vite@4.5.0(lightningcss@1.22.1): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -2426,6 +2578,7 @@ packages: optional: true dependencies: esbuild: 0.18.20 + lightningcss: 1.22.1 postcss: 8.4.31 rollup: 3.29.4 optionalDependencies: @@ -2440,7 +2593,7 @@ packages: vite: optional: true dependencies: - vite: 4.5.0 + vite: 4.5.0(lightningcss@1.22.1) dev: true /webpack-sources@3.2.3: diff --git a/postcss.config.js b/postcss.config.js index 6cb737b..d5d5633 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,6 @@ import tailwindcss from "tailwindcss"; +import tailwindNesting from "tailwindcss/nesting"; export default { - plugins: [tailwindcss()], + plugins: [tailwindNesting("postcss-nesting"), tailwindcss()], }; diff --git a/src/app.postcss b/src/app.postcss index 14aee88..16ef2fd 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -13,80 +13,61 @@ :root { --background: 0 0% 100%; --foreground: 240 10% 3.9%; - - --muted: 240 4.8% 95.9%; - --muted-foreground: 240 3.8% 46.1%; - - --popover: 0 0% 100%; - --popover-foreground: 240 10% 3.9%; - --card: 0 0% 100%; --card-foreground: 240 10% 3.9%; - - --border: 240 5.9% 90%; - --input: 240 5.9% 90%; - + --popover: 0 0% 100%; + --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-foreground: 0 0% 98%; - --secondary: 240 4.8% 95.9%; --secondary-foreground: 240 5.9% 10%; - + --muted: 240 4.8% 95.9%; + --muted-foreground: 240 3.8% 46.1%; --accent: 240 4.8% 95.9%; --accent-foreground: 240 5.9% 10%; - - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; - - --ring: 240 10% 3.9%; - + --border: 240 5.9% 90%; + --input: 240 5.9% 90%; + --ring: 240 5.9% 10%; --radius: 0.5rem; } - @media (prefers-color-scheme: dark) { - :root { - --background: 240 10% 3.9%; - --foreground: 0 0% 98%; - - --muted: 240 3.7% 15.9%; - --muted-foreground: 240 5% 64.9%; - - --popover: 240 10% 3.9%; - --popover-foreground: 0 0% 98%; - - --card: 240 10% 3.9%; - --card-foreground: 0 0% 98%; - - --border: 240 3.7% 15.9%; - --input: 240 3.7% 15.9%; - - --primary: 0 0% 98%; - --primary-foreground: 240 5.9% 10%; - - --secondary: 240 3.7% 15.9%; - --secondary-foreground: 0 0% 98%; - - --accent: 240 3.7% 15.9%; - --accent-foreground: 0 0% 98%; - - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 0% 98%; - - --ring: 240 4.9% 83.9%; - } + .dark { + --background: 240 10% 3.9%; + --foreground: 0 0% 98%; + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; + --primary: 0 0% 98%; + --primary-foreground: 240 5.9% 10%; + --secondary: 240 3.7% 15.9%; + --secondary-foreground: 0 0% 98%; + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 64.9%; + --accent: 240 3.7% 15.9%; + --accent-foreground: 0 0% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 240 3.7% 15.9%; + --input: 240 3.7% 15.9%; + --ring: 240 4.9% 83.9%; } -} -@layer base { * { @apply border-border; } + body { @apply bg-background text-foreground scroll-smooth min-h-screen; + scrollbar-gutter: stable; } - input[type="search"]::-webkit-search-cancel-button, - input[type="search"]::-webkit-calendar-picker-indicator { - @apply !hidden; + input[type="search"] { + &::-webkit-search-cancel-button, + &::-webkit-calendar-picker-indicator { + @apply !hidden; + } } } diff --git a/src/lib/components/Filter.svelte b/src/lib/components/Filter.svelte deleted file mode 100644 index 312d9f1..0000000 --- a/src/lib/components/Filter.svelte +++ /dev/null @@ -1,86 +0,0 @@ - - -
-

Search options:

- -
- - -
- -
- {#each keys(books) as book (book)} - {@const id = book.replace(/\s/g, "-")} -
- - - - {#if books.none && book === "none"} - - - - - - Most words in the "none" book category are obscure or rare, so don't forget to enable - the filter options for those! - - - {/if} -
- {/each} -
- -
- {#each keys(categories) as category (category)} -
- - -
- {/each} -
-
diff --git a/src/lib/components/LukaPonaEntry.svelte b/src/lib/components/LukaPonaEntry.svelte deleted file mode 100644 index 0afb49d..0000000 --- a/src/lib/components/LukaPonaEntry.svelte +++ /dev/null @@ -1,50 +0,0 @@ - - -
- -
{word['word']}
-
{word['usage_category']} · {word['book']}
-
{definition}
- -
- - diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 9e51ccb..c70bb2d 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -1,14 +1,31 @@ + + + + + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte new file mode 100644 index 0000000..81de2e2 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte @@ -0,0 +1,25 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte new file mode 100644 index 0000000..c8e6719 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte @@ -0,0 +1,31 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte new file mode 100644 index 0000000..a7fb3c4 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte new file mode 100644 index 0000000..1c74ae1 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte @@ -0,0 +1,11 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte new file mode 100644 index 0000000..2516504 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte new file mode 100644 index 0000000..775f8fe --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte @@ -0,0 +1,14 @@ + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte new file mode 100644 index 0000000..caf24ad --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte new file mode 100644 index 0000000..6690085 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte @@ -0,0 +1,30 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte new file mode 100644 index 0000000..0278d4b --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte @@ -0,0 +1,32 @@ + + + + + + diff --git a/src/lib/components/ui/dropdown-menu/index.ts b/src/lib/components/ui/dropdown-menu/index.ts new file mode 100644 index 0000000..c1749e9 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/index.ts @@ -0,0 +1,48 @@ +import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; +import Item from "./dropdown-menu-item.svelte"; +import Label from "./dropdown-menu-label.svelte"; +import Content from "./dropdown-menu-content.svelte"; +import Shortcut from "./dropdown-menu-shortcut.svelte"; +import RadioItem from "./dropdown-menu-radio-item.svelte"; +import Separator from "./dropdown-menu-separator.svelte"; +import RadioGroup from "./dropdown-menu-radio-group.svelte"; +import SubContent from "./dropdown-menu-sub-content.svelte"; +import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; +import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; + +const Sub = DropdownMenuPrimitive.Sub; +const Root = DropdownMenuPrimitive.Root; +const Trigger = DropdownMenuPrimitive.Trigger; +const Group = DropdownMenuPrimitive.Group; + +export { + Sub, + Root, + Item, + Label, + Group, + Trigger, + Content, + Shortcut, + Separator, + RadioItem, + SubContent, + SubTrigger, + RadioGroup, + CheckboxItem, + // + Root as DropdownMenu, + Sub as DropdownMenuSub, + Item as DropdownMenuItem, + Label as DropdownMenuLabel, + Group as DropdownMenuGroup, + Content as DropdownMenuContent, + Trigger as DropdownMenuTrigger, + Shortcut as DropdownMenuShortcut, + RadioItem as DropdownMenuRadioItem, + Separator as DropdownMenuSeparator, + RadioGroup as DropdownMenuRadioGroup, + SubContent as DropdownMenuSubContent, + SubTrigger as DropdownMenuSubTrigger, + CheckboxItem as DropdownMenuCheckboxItem, +}; diff --git a/src/lib/components/ui/input/index.ts b/src/lib/components/ui/input/index.ts index 914dce5..f65da0f 100644 --- a/src/lib/components/ui/input/index.ts +++ b/src/lib/components/ui/input/index.ts @@ -21,5 +21,5 @@ export type InputEvents = { export { Root, // - Root as Input + Root as Input, }; diff --git a/src/lib/components/ui/label/index.ts b/src/lib/components/ui/label/index.ts index 2c3128c..8bfca0b 100644 --- a/src/lib/components/ui/label/index.ts +++ b/src/lib/components/ui/label/index.ts @@ -3,5 +3,5 @@ import Root from "./label.svelte"; export { Root, // - Root as Label + Root as Label, }; diff --git a/src/lib/components/ui/select/index.ts b/src/lib/components/ui/select/index.ts index b3bc630..7c435b3 100644 --- a/src/lib/components/ui/select/index.ts +++ b/src/lib/components/ui/select/index.ts @@ -29,5 +29,5 @@ export { Value as SelectValue, Content as SelectContent, Trigger as SelectTrigger, - Separator as SelectSeparator + Separator as SelectSeparator, }; diff --git a/src/lib/components/ui/separator/index.ts b/src/lib/components/ui/separator/index.ts index dbfb139..82442d2 100644 --- a/src/lib/components/ui/separator/index.ts +++ b/src/lib/components/ui/separator/index.ts @@ -3,5 +3,5 @@ import Root from "./separator.svelte"; export { Root, // - Root as Separator + Root as Separator, }; diff --git a/src/lib/components/ui/skeleton/index.ts b/src/lib/components/ui/skeleton/index.ts index 2be5c50..186db21 100644 --- a/src/lib/components/ui/skeleton/index.ts +++ b/src/lib/components/ui/skeleton/index.ts @@ -3,5 +3,5 @@ import Root from "./skeleton.svelte"; export { Root, // - Root as Skeleton + Root as Skeleton, }; diff --git a/src/lib/components/ui/tooltip/index.ts b/src/lib/components/ui/tooltip/index.ts index f4d446d..7d0444d 100644 --- a/src/lib/components/ui/tooltip/index.ts +++ b/src/lib/components/ui/tooltip/index.ts @@ -11,5 +11,5 @@ export { // Root as Tooltip, Content as TooltipContent, - Trigger as TooltipTrigger + Trigger as TooltipTrigger, }; diff --git a/src/lib/state.ts b/src/lib/state.ts index ef35a65..b1f7db4 100644 --- a/src/lib/state.ts +++ b/src/lib/state.ts @@ -3,6 +3,7 @@ import GridViewIcon from "$lib/assets/grid.png"; import LukaPonaIcon from "$lib/assets/luka-pona.png"; import { persisted } from "svelte-persisted-store/dist/index.mjs"; import { writable } from "svelte/store"; +import type { UsageCategory, BookName } from "./types"; export const siteLanguage = persisted("langauge", "en"); @@ -23,3 +24,19 @@ export const viewTypes = { export const viewType = persisted("view_type", "basic"); export const searchQuery = writable(""); + +export const books = persisted>("books", { + pu: true, + "ku suli": true, + "ku lili": false, + none: false, +}); + +export const categories = persisted>("usage_categories", { + core: true, + widespread: true, + common: false, + uncommon: false, + rare: false, + obscure: false, +}); diff --git a/src/lib/types.ts b/src/lib/types.ts index eaf5989..25968f8 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -93,7 +93,7 @@ export type Word = { * A human-readable description of the word's etymology(ies), including the original word(s), definition(s), and other metadata. */ etymology?: string; - etymology_data: { + etymology_data?: { /** * List of languages the word derives from, split on `;`. */ diff --git a/src/routes/(words)/+layout.server.ts b/src/routes/(words)/+layout.server.ts index 5835fc1..81b9e57 100644 --- a/src/routes/(words)/+layout.server.ts +++ b/src/routes/(words)/+layout.server.ts @@ -1,17 +1,15 @@ import type { Linku } from "$lib/types"; -import { error } from "@sveltejs/kit"; +import { error, redirect } from "@sveltejs/kit"; import type { LayoutServerLoad } from "./$types"; -export const load = (async ({ fetch }) => { +export const load = (async ({ fetch, url, setHeaders }) => { try { - const linku = await fetch("/data").then((res) => res.json()); + const rawData = await fetch("/data").then((res) => res.json()); + const dictWithIds = Object.fromEntries( + Object.entries(rawData.data).map(([id, w]) => [id, { ...w, id }]), + ); - return { - linku: { - ...linku, - data: Object.fromEntries(Object.entries(linku.data).map(([id, w]) => [id, { ...w, id }])), - }, - }; + return { linku: { ...rawData, data: dictWithIds } }; } catch { throw error(500, { message: "Dictionary data could not be receieved!", diff --git a/src/routes/(words)/+layout.svelte b/src/routes/(words)/+layout.svelte index 9097746..9bd9243 100644 --- a/src/routes/(words)/+layout.svelte +++ b/src/routes/(words)/+layout.svelte @@ -1,7 +1,8 @@ - -
    {#each sorted_filtered_dictionary as word (word.id)} diff --git a/src/routes/(words)/search/+page.server.ts b/src/routes/(words)/search/+page.server.ts index e6ec030..8ceaf84 100644 --- a/src/routes/(words)/search/+page.server.ts +++ b/src/routes/(words)/search/+page.server.ts @@ -1,8 +1,8 @@ import { redirect } from "@sveltejs/kit"; -import type { PageServerLoad } from "./$types"; +import type { Actions, PageServerLoad } from "./$types"; import { wordSearch } from "$lib/components/search"; -export const prerender = false +export const prerender = false; export const load: PageServerLoad = async ({ url, parent }) => { const query = url.searchParams.get("q"); @@ -38,3 +38,12 @@ export const load: PageServerLoad = async ({ url, parent }) => { query, }; }; + +export const actions: Actions = { + search: async ({ url }) => { + const searchPage = new URL(url); + searchPage.pathname = "/search"; + + throw redirect(300, searchPage); + }, +}; diff --git a/src/routes/(words)/words/[word]/+page.svelte b/src/routes/(words)/words/[word]/+page.svelte index c4ebb70..ae265a5 100644 --- a/src/routes/(words)/words/[word]/+page.svelte +++ b/src/routes/(words)/words/[word]/+page.svelte @@ -48,8 +48,10 @@

    ku definitions - - + + Each ku definition is assigned a frequency index from ½ to 5, which describes @@ -114,9 +116,14 @@ {#if word.ucsur}
    -

    - - UCSUR Codepoint +

    + UCSUR Codepoint + +

    @@ -132,7 +139,7 @@ {#if word.luka_pona}

    luka pona

    -