diff --git a/.gitignore b/.gitignore index 3f7bebcd..4be230b0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,13 +27,16 @@ openapi-ts*.log # vscode setting folder .vscode/ -# Claude Code +# AI skills files CLAUDE.md +AGENTS.md #Other yarn.lock .wrangler/ +./graphify-out + .pnpm-store *storybook.log storybook-static diff --git a/astro.config.mjs b/astro.config.mjs index 00c8e593..216e47e7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -99,6 +99,13 @@ export default defineConfig({ routeRules, + /** + * Shiki colours code blocks with inline `style` attributes, which the CSP below is not + * meant to rely on. No Markdown here has code blocks, so highlighting is off. If that + * changes, use `"prism"` (class-based) plus a Prism theme stylesheet. + */ + markdown: { syntaxHighlight: false }, + security: { /** * On a server-rendered page Astro sends this as a `content-security-policy` response diff --git a/db/migrations/0006_proposed_campaigns.sql b/db/migrations/0006_proposed_campaigns.sql new file mode 100644 index 00000000..9e069b98 --- /dev/null +++ b/db/migrations/0006_proposed_campaigns.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS proposed_campaigns ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + date_created INTEGER NOT NULL DEFAULT (unixepoch() * 1000), + date_updated INTEGER NOT NULL DEFAULT (unixepoch() * 1000) +); + +CREATE TABLE IF NOT EXISTS proposed_campaign_slots ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + proposal_id INTEGER NOT NULL REFERENCES proposed_campaigns(id) ON DELETE CASCADE, + tab TEXT NOT NULL CHECK (tab IN ('ending-soon', 'most-successful')), + position INTEGER NOT NULL, + project_id TEXT NOT NULL, + UNIQUE(proposal_id, tab, position) +); diff --git a/db/migrations/0007_site_settings.sql b/db/migrations/0007_site_settings.sql new file mode 100644 index 00000000..161576f8 --- /dev/null +++ b/db/migrations/0007_site_settings.sql @@ -0,0 +1,9 @@ +-- Site-wide settings edited from /admin/customize, one JSON document per key +-- (e.g. 'footer'). A missing key means the built-in defaults in code apply. +-- Timestamps are milliseconds (Date.getTime()), matching the repository layer. +CREATE TABLE + IF NOT EXISTS site_settings ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL, + date_updated INTEGER NOT NULL DEFAULT (unixepoch() * 1000) + ); diff --git a/db/migrations/0008_theme_colors.sql b/db/migrations/0008_theme_colors.sql new file mode 100644 index 00000000..ee5d199d --- /dev/null +++ b/db/migrations/0008_theme_colors.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS theme_colors ( + id INTEGER PRIMARY KEY CHECK (id = 1), + light_colors TEXT NOT NULL DEFAULT '{}', + dark_colors TEXT NOT NULL DEFAULT '{}', + date_updated INTEGER NOT NULL DEFAULT (unixepoch() * 1000) +); diff --git a/db/migrations/0009_header_logo.sql b/db/migrations/0009_header_logo.sql new file mode 100644 index 00000000..1de4c0cd --- /dev/null +++ b/db/migrations/0009_header_logo.sql @@ -0,0 +1,12 @@ +-- Header logo managed from /admin/customize/logo +-- Timestamps are milliseconds (Date.getTime()), matching the repository layer. +-- The header shows the most recently uploaded logo; when the table is empty it +-- falls back to the built-in logo. +CREATE TABLE + IF NOT EXISTS header_logo ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + media_url TEXT NOT NULL, + media_type TEXT NOT NULL, + alt_text TEXT NOT NULL DEFAULT 'Goteo', + date_created INTEGER NOT NULL DEFAULT (unixepoch() * 1000) + ); diff --git a/package.json b/package.json index b7cad49a..109f7d19 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "bits-ui": "^2.18.1", "chart.js": "^4.5.1", "csrf": "^3.1.0", + "dequal": "^2.0.3", "dexie": "^4.4.2", "dinero.js": "^2.0.2", "dotenv": "^17.4.2", @@ -57,6 +58,8 @@ "marked": "^18.0.6", "media-icons": "^1.1.5", "murmurhash-js": "^1.0.0", + "observable-slim": "^0.2.2", + "polished": "^4.3.1", "stdnum": "^1.12.6", "svelte": "^5.56.6", "tailwind-merge": "^3.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce682de0..a7e1aeaf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: version: 14.4.1(@types/node@26.6.5)(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))(esbuild@0.28.2)(jiti@2.7.0)(wrangler@4.151.3(@cloudflare/workers-types@5.20261019.1)(@types/node@26.6.5))(yaml@2.9.1) '@astrojs/node': specifier: ^11.1.5 - version: 11.1.9(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))(supports-color@10.2.2) + version: 11.1.9(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1)) '@astrojs/svelte': specifier: ^9.0.1 version: 9.1.0(@types/node@26.6.5)(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))(esbuild@0.28.2)(jiti@2.7.0)(svelte@5.57.2(@typescript-eslint/types@8.72.0))(typescript@5.9.3)(yaml@2.9.1) @@ -74,6 +74,9 @@ importers: csrf: specifier: ^3.1.0 version: 3.1.0 + dequal: + specifier: ^2.0.3 + version: 2.0.3 dexie: specifier: ^4.4.2 version: 4.4.6 @@ -85,7 +88,7 @@ importers: version: 17.4.2 file-type: specifier: ^22.0.1 - version: 22.2.0(supports-color@10.2.2) + version: 22.2.0 flickity: specifier: ^3.0.0 version: 3.0.0 @@ -101,6 +104,12 @@ importers: murmurhash-js: specifier: ^1.0.0 version: 1.0.0 + observable-slim: + specifier: ^0.2.2 + version: 0.2.2 + polished: + specifier: ^4.3.1 + version: 4.3.1 stdnum: specifier: ^1.12.6 version: 1.12.6 @@ -125,7 +134,7 @@ importers: version: 5.20261019.1 '@eslint/js': specifier: ^10.0.1 - version: 10.0.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) + version: 10.0.1(eslint@9.39.5(jiti@2.7.0)) '@storybook/addon-a11y': specifier: ^10.5.2 version: 10.6.2(storybook@10.6.2(@types/react@19.3.0)(prettier@3.9.5)(react@19.3.1)) @@ -152,10 +161,10 @@ importers: version: 26.6.5 '@typescript-eslint/eslint-plugin': specifier: ^8.64.0 - version: 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + version: 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@typescript-eslint/parser': specifier: ^8.64.0 - version: 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + version: 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@vitest/browser-playwright': specifier: ^4.1.10 version: 4.1.12(playwright@1.64.1)(vite@8.3.4(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))(vitest@4.1.12) @@ -164,19 +173,19 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint: specifier: ^9.39.5 - version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + version: 9.39.5(jiti@2.7.0) eslint-plugin-import: specifier: ^2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 2.32.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)) eslint-plugin-storybook: specifier: ^10.5.2 - version: 10.6.2(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + version: 10.6.2(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) eslint-plugin-svelte: specifier: ^3.22.0 - version: 3.23.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(svelte@5.57.2(@typescript-eslint/types@8.72.0)) + version: 3.23.1(eslint@9.39.5(jiti@2.7.0))(svelte@5.57.2(@typescript-eslint/types@8.72.0)) eslint-plugin-unused-imports: specifier: ^4.4.1 - version: 4.4.1(@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) + version: 4.4.1(@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)) flowbite: specifier: ^3.1.2 version: 3.1.2 @@ -206,7 +215,7 @@ importers: version: 0.8.1(prettier-plugin-astro@0.14.1)(prettier-plugin-svelte@4.1.1(prettier@3.9.5)(svelte@5.57.2(@typescript-eslint/types@8.72.0)))(prettier@3.9.5) start-server-and-test: specifier: ^3.0.11 - version: 3.0.13(supports-color@10.2.2) + version: 3.0.13 storybook: specifier: ^10.5.2 version: 10.6.2(@types/react@19.3.0)(prettier@3.9.5)(react@19.3.1) @@ -221,7 +230,7 @@ importers: version: 4.1.1(svelte@5.57.2(@typescript-eslint/types@8.72.0)) typescript-eslint: specifier: ^8.64.0 - version: 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + version: 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) vite: specifier: ^8.3.0 version: 8.3.4(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1) @@ -230,7 +239,7 @@ importers: version: 4.1.12(@types/node@26.6.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(vite@8.3.4(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1)) wait-on: specifier: ^9.0.10 - version: 9.5.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) + version: 9.5.1(debug@4.4.3) wrangler: specifier: ^4.151.3 version: 4.151.3(@cloudflare/workers-types@5.20261019.1)(@types/node@26.6.5) @@ -279,28 +288,24 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@astrojs/compiler-binding-linux-arm64-musl@0.5.2': resolution: {integrity: sha512-GRGyby3AZWw5d6JQzidyxPyvGgHWsSusrpgKyFVpDTKctABF7L3Pd5V1cRJbV36/rcu+Eh292/wL7pF7MkmGkQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@astrojs/compiler-binding-linux-x64-gnu@0.5.2': resolution: {integrity: sha512-9XAqGTMQAtIslMsjK3xdyY6OI9d59OZqcLBB6pvD/DcoR0daYswfrKx2azdDERDY4AqAnWPC7odVM1BmxYv3Vw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@astrojs/compiler-binding-linux-x64-musl@0.5.2': resolution: {integrity: sha512-jOViewGeTh9bSfS8vK72ECxoy2yvmA+Pd/ZcEvBI5c7+7IcfHwZ5qA4L9fRYuOhSrAifvQ2dV4vm1XAtloaWBw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@astrojs/compiler-binding-wasm32-wasi@0.5.2': resolution: {integrity: sha512-Z7p64doar1uvR5C9Xs6j1CV9lGlPVQX7OQ2aAtZ/xKC5aGS6GB13nyc2UfQXTQLvZrvVwsyaflTQy6ziY5Bekw==} @@ -500,25 +505,21 @@ packages: resolution: {integrity: sha512-glkYXZCJywjP13v67eAyAMSJdF+ncvEbYvgi/wOtffL9tQ27lr/zsyzUfgs+ovjJ9d8JNQKiXeiArJcX8PJL9w==} cpu: [arm64] os: [linux] - libc: [glibc] '@bruits/satteri-linux-arm64-musl@0.10.5': resolution: {integrity: sha512-yWdgG1g17Nh2QyGVlFUxGRa3FEFwiMcpZEyMNWkbM3deC94cmVc+/i9OuyFpdKuWo3GkgoCtYVOoxk1uCnCZIA==} cpu: [arm64] os: [linux] - libc: [musl] '@bruits/satteri-linux-x64-gnu@0.10.5': resolution: {integrity: sha512-FVaLoPT1fBgGl0J+AYebyyXJYBachGl8Oyyrf1lye4RTqCB4S0Gwkj1uM9RJyThUOvx5VUmAT1CnNh1SFHA+kw==} cpu: [x64] os: [linux] - libc: [glibc] '@bruits/satteri-linux-x64-musl@0.10.5': resolution: {integrity: sha512-EHpVAx2bqW3GINHTKkljtxVfQmVDGWIuwOYOP5YghTj+0PkBa2o8oKPRtQ9Kbsr1Fye8jtUcDjhwj2jMNugZKg==} cpu: [x64] os: [linux] - libc: [musl] '@bruits/satteri-wasm32-wasi@0.10.5': resolution: {integrity: sha512-ypz8c/Zmipxp4IoeDa228Gstv6TLzVmNs3yC6wKCoNSOjx1iwpgzu87Y3hTkXFdwChVGU85qeUDuOIarGUZQLw==} @@ -1000,105 +1001,89 @@ packages: resolution: {integrity: sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-arm@1.3.4': resolution: {integrity: sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.3.4': resolution: {integrity: sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.3.4': resolution: {integrity: sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-s390x@1.3.4': resolution: {integrity: sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-x64@1.3.4': resolution: {integrity: sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.3.4': resolution: {integrity: sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.3.4': resolution: {integrity: sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-linux-arm64@0.35.5': resolution: {integrity: sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-linux-arm@0.35.5': resolution: {integrity: sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==} engines: {node: '>=20.9.0'} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-linux-ppc64@0.35.5': resolution: {integrity: sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==} engines: {node: '>=20.9.0'} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-linux-riscv64@0.35.5': resolution: {integrity: sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==} engines: {node: '>=20.9.0'} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-linux-s390x@0.35.5': resolution: {integrity: sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==} engines: {node: '>=20.9.0'} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-linux-x64@0.35.5': resolution: {integrity: sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-linuxmusl-arm64@0.35.5': resolution: {integrity: sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-linuxmusl-x64@0.35.5': resolution: {integrity: sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-wasm32@0.35.5': resolution: {integrity: sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==} @@ -1229,56 +1214,48 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@oxc-parser/binding-linux-arm64-musl@0.127.0': resolution: {integrity: sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@oxc-parser/binding-linux-ppc64-gnu@0.127.0': resolution: {integrity: sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@oxc-parser/binding-linux-riscv64-gnu@0.127.0': resolution: {integrity: sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [glibc] '@oxc-parser/binding-linux-riscv64-musl@0.127.0': resolution: {integrity: sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [musl] '@oxc-parser/binding-linux-s390x-gnu@0.127.0': resolution: {integrity: sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@oxc-parser/binding-linux-x64-gnu@0.127.0': resolution: {integrity: sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@oxc-parser/binding-linux-x64-musl@0.127.0': resolution: {integrity: sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@oxc-parser/binding-openharmony-arm64@0.127.0': resolution: {integrity: sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==} @@ -1354,49 +1331,41 @@ packages: resolution: {integrity: sha512-CUEYvlX1Fk7E9kUMzuswru1J9HLxMwnpDeQGjQuI4ZH+iNCoa2X9T+pvyzrbsgl7WnIeTFTlNlHsRfVdf5g9/g==} cpu: [arm64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@11.21.2': resolution: {integrity: sha512-ViN1ZibQyxwC67GpoP33oo+S9UyUnkog13vzQb9+v9bCNvrVzJuk0MRdacjtv/9xfRMVF/eqHFyl8YOeykI10Q==} cpu: [arm64] os: [linux] - libc: [musl] '@oxc-resolver/binding-linux-ppc64-gnu@11.21.2': resolution: {integrity: sha512-CU1sCqWnhGqYD5I1HedHk5pujrn7ssDkNB/AEQd/pd3D/EojVSgJUlpbafwIbyhia3PgIfkvdFpRPWSALzVumA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-riscv64-gnu@11.21.2': resolution: {integrity: sha512-jWVyZtIHca4Gb96x7dag+y69vlei7ffjrsveLkmf2ZhqEAz6ZSBnY1GWvgZUaZlwZP62A3xD092BW97Q5VGc+g==} cpu: [riscv64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-riscv64-musl@11.21.2': resolution: {integrity: sha512-LF29obFqNgBUgDX7rmUK7M4D0JQG5LxhYzn3xXmECcHU9aQAdWG7NiY052qybtesEdwHQXKNTWYQ7mTsybNvWg==} cpu: [riscv64] os: [linux] - libc: [musl] '@oxc-resolver/binding-linux-s390x-gnu@11.21.2': resolution: {integrity: sha512-+NYcm+cCHBbtdQQ3A4phQTSuVRYnNHz7wrl9XRAPEovcdoqi0mb1K5ZOl+jN54ZD+q1zz3V0vltbFJmzecJKmw==} cpu: [s390x] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-x64-gnu@11.21.2': resolution: {integrity: sha512-UQqZDdG2r2HhAOsZEgufkIWHPQ886IUyuJQkoZByvzhW8j51R4UNzGBJFkTiTnLhQnggwJRdJgFWK4uY6ZVIMw==} cpu: [x64] os: [linux] - libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@11.21.2': resolution: {integrity: sha512-3Q9PMRjalWkT6NZ4jfujuqTCFwoWErg3y3BnOgb544B8IMw4PktiwWOigMfOHNRLMghZeJ7hpfpZf4CP7rV7Og==} cpu: [x64] os: [linux] - libc: [musl] '@oxc-resolver/binding-openharmony-arm64@11.21.2': resolution: {integrity: sha512-Eljeq3ndtyKhM+Es8LITi4Zl2htzuRZcrPMF3kMCsrILztvU6AjZ3FuEhHHKobPUB9rMpzLpJP5bDqXI7r+iog==} @@ -1474,42 +1443,36 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.2.14': resolution: {integrity: sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.2.14': resolution: {integrity: sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.2.14': resolution: {integrity: sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.2.14': resolution: {integrity: sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-musl@1.2.14': resolution: {integrity: sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@rolldown/binding-openharmony-arm64@1.2.14': resolution: {integrity: sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==} @@ -1785,28 +1748,24 @@ packages: engines: {node: '>= 20'} cpu: [arm64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.3.3': resolution: {integrity: sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] - libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.3.3': resolution: {integrity: sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==} engines: {node: '>= 20'} cpu: [x64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.3.3': resolution: {integrity: sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==} engines: {node: '>= 20'} cpu: [x64] os: [linux] - libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.3.3': resolution: {integrity: sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==} @@ -2199,30 +2158,15 @@ packages: '@volar/language-server@2.4.28': resolution: {integrity: sha512-NqcLnE5gERKuS4PUFwlhMxf6vqYo7hXtbMFbViXcbVkbZ905AIVWhnSo0ZNBC2V127H1/2zP7RvVOVnyITFfBw==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true '@volar/language-service@2.4.28': resolution: {integrity: sha512-Rh/wYCZJrI5vCwMk9xyw/Z+MsWxlJY1rmMZPsxUoJKfzIRjS/NF1NmnuEcrMbEVGja00aVpCsInJfixQTMdvLw==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true '@volar/source-map@2.4.28': resolution: {integrity: sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==} '@volar/typescript@2.4.28': resolution: {integrity: sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true '@vscode/emmet-helper@2.11.0': resolution: {integrity: sha512-QLxjQR3imPZPQltfbWRnHU6JecWTF1QSWhx3GAKQpslx7y3Dp6sIIXhKjiUJ/BR9FX8PVthjr9PD6pNwOJfAzw==} @@ -3564,56 +3508,48 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-gnu@1.33.0: resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-arm64-musl@1.33.0: resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-gnu@1.33.0: resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-linux-x64-musl@1.33.0: resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} @@ -3858,6 +3794,10 @@ packages: resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} + observable-slim@0.2.2: + resolution: {integrity: sha512-YY8fgqgx31w2oAyk2PKLvwbnqoRxKpPiFrLWKq8caC4vQ+XSaZV9mueJCkhnqJkz+eT9vi8b5segk+Qd0A8JrQ==} + engines: {node: '>=18'} + obug@2.2.1: resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} engines: {node: '>=12.20.0'} @@ -3997,6 +3937,10 @@ packages: resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} engines: {node: '>=14.19.0'} + polished@4.3.1: + resolution: {integrity: sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==} + engines: {node: '>=10'} + possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -5004,23 +4948,17 @@ packages: resolution: {integrity: sha512-9K2k72s4n7rV9s4bX0MyjbX9iBribvKZbBJKuEmTCZfeWJXs6Yh7bGpY4eoc7UufAjvpheBqwyZCOIPBvxCv0A==} peerDependencies: '@volar/language-service': ~2.4.0 - typescript: '*' peerDependenciesMeta: '@volar/language-service': optional: true - typescript: - optional: true volar-service-typescript@0.0.71: resolution: {integrity: sha512-yTtM/BVT6hoyEYnDtaCyAtNhdNeS/mhTTABlBOdw3NNiRBUin3IznFJpgfjer4c6RYopiPjjQjc9VFhxVl1mLw==} peerDependencies: '@volar/language-service': ~2.4.0 - typescript: '*' peerDependenciesMeta: '@volar/language-service': optional: true - typescript: - optional: true volar-service-yaml@0.0.71: resolution: {integrity: sha512-qYGWGuVpUTnZGu5P/CR4KLK4aIR8RrcVnmfZ2eRcj9q/I8VZCoC5yy9FtEvfNvnDp4MU17yhdJcvpQPIqhJS2Q==} @@ -5348,17 +5286,17 @@ snapshots: '@astrojs/yaml2ts': 0.2.4 '@volar/kit': 2.4.28(typescript@5.9.3) '@volar/language-core': 2.4.28 - '@volar/language-server': 2.4.28(typescript@5.9.3) - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-server': 2.4.28 + '@volar/language-service': 2.4.28 muggle-string: 0.4.1 tinyglobby: 0.2.17 - volar-service-css: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)) - volar-service-emmet: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)) - volar-service-html: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)) - volar-service-prettier: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(prettier@3.9.5) - volar-service-typescript: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(typescript@5.9.3) - volar-service-typescript-twoslash-queries: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(typescript@5.9.3) - volar-service-yaml: 0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)) + volar-service-css: 0.0.71(@volar/language-service@2.4.28) + volar-service-emmet: 0.0.71(@volar/language-service@2.4.28) + volar-service-html: 0.0.71(@volar/language-service@2.4.28) + volar-service-prettier: 0.0.71(@volar/language-service@2.4.28)(prettier@3.9.5) + volar-service-typescript: 0.0.71(@volar/language-service@2.4.28) + volar-service-typescript-twoslash-queries: 0.0.71(@volar/language-service@2.4.28) + volar-service-yaml: 0.0.71(@volar/language-service@2.4.28) vscode-html-languageservice: 5.6.2 vscode-uri: 3.2.0 optionalDependencies: @@ -5375,11 +5313,11 @@ snapshots: github-slugger: 2.0.0 satteri: 0.10.5 - '@astrojs/node@11.1.9(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))(supports-color@10.2.2)': + '@astrojs/node@11.1.9(astro@7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1))': dependencies: '@astrojs/internal-helpers': 0.13.0 astro: 7.4.1(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1) - send: 1.2.1(supports-color@10.2.2) + send: 1.2.1 server-destroy: 1.0.1 transitivePeerDependencies: - supports-color @@ -5893,17 +5831,17 @@ snapshots: '@esbuild/win32-x64@0.28.2': optional: true - '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))': + '@eslint-community/eslint-utils@4.10.1(eslint@9.39.5(jiti@2.7.0))': dependencies: - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.21.2(supports-color@10.2.2)': + '@eslint/config-array@0.21.2': dependencies: '@eslint/object-schema': 2.1.7 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 minimatch: 3.1.5 transitivePeerDependencies: - supports-color @@ -5916,10 +5854,10 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.7(supports-color@10.2.2)': + '@eslint/eslintrc@3.3.7': dependencies: ajv: 6.15.0 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -5930,9 +5868,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@10.0.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))': + '@eslint/js@10.0.1(eslint@9.39.5(jiti@2.7.0))': optionalDependencies: - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) '@eslint/js@9.39.5': {} @@ -6890,9 +6828,9 @@ snapshots: react: 19.3.1 react-dom: 19.3.1(react@19.3.1) - '@tokenizer/inflate@0.5.1(supports-color@10.2.2)': + '@tokenizer/inflate@0.5.1': dependencies: - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 token-types: 6.1.2 transitivePeerDependencies: - supports-color @@ -6952,15 +6890,15 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@typescript-eslint/scope-manager': 8.72.0 - '@typescript-eslint/type-utils': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/type-utils': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.72.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) ignore: 7.0.13 natural-compare: 1.4.0 ts-api-utils: 2.5.0(typescript@5.9.3) @@ -6968,23 +6906,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@typescript-eslint/scope-manager': 8.72.0 '@typescript-eslint/types': 8.72.0 - '@typescript-eslint/typescript-estree': 8.72.0(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.72.0 - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + debug: 4.4.3 + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.72.0(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/project-service@8.72.0(typescript@5.9.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@5.9.3) '@typescript-eslint/types': 8.72.0 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -6998,13 +6936,13 @@ snapshots: dependencies: typescript: 5.9.3 - '@typescript-eslint/type-utils@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 8.72.0 - '@typescript-eslint/typescript-estree': 8.72.0(supports-color@10.2.2)(typescript@5.9.3) - '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + debug: 4.4.3 + eslint: 9.39.5(jiti@2.7.0) ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: @@ -7012,13 +6950,13 @@ snapshots: '@typescript-eslint/types@8.72.0': {} - '@typescript-eslint/typescript-estree@8.72.0(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.72.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/project-service': 8.72.0(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/project-service': 8.72.0(typescript@5.9.3) '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@5.9.3) '@typescript-eslint/types': 8.72.0 '@typescript-eslint/visitor-keys': 8.72.0 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 minimatch: 10.2.6 semver: 7.8.5 tinyglobby: 0.2.17 @@ -7027,13 +6965,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3)': + '@typescript-eslint/utils@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) + '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) '@typescript-eslint/scope-manager': 8.72.0 '@typescript-eslint/types': 8.72.0 - '@typescript-eslint/typescript-estree': 8.72.0(supports-color@10.2.2)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -7156,8 +7094,8 @@ snapshots: '@volar/kit@2.4.28(typescript@5.9.3)': dependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) - '@volar/typescript': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 + '@volar/typescript': 2.4.28 typesafe-path: 0.2.2 typescript: 5.9.3 vscode-languageserver-textdocument: 1.0.15 @@ -7167,38 +7105,32 @@ snapshots: dependencies: '@volar/source-map': 2.4.28 - '@volar/language-server@2.4.28(typescript@5.9.3)': + '@volar/language-server@2.4.28': dependencies: '@volar/language-core': 2.4.28 - '@volar/language-service': 2.4.28(typescript@5.9.3) - '@volar/typescript': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 + '@volar/typescript': 2.4.28 path-browserify: 1.0.1 request-light: 0.7.0 vscode-languageserver: 9.0.1 vscode-languageserver-protocol: 3.18.4 vscode-languageserver-textdocument: 1.0.15 vscode-uri: 3.2.0 - optionalDependencies: - typescript: 5.9.3 - '@volar/language-service@2.4.28(typescript@5.9.3)': + '@volar/language-service@2.4.28': dependencies: '@volar/language-core': 2.4.28 vscode-languageserver-protocol: 3.18.4 vscode-languageserver-textdocument: 1.0.15 vscode-uri: 3.2.0 - optionalDependencies: - typescript: 5.9.3 '@volar/source-map@2.4.28': {} - '@volar/typescript@2.4.28(typescript@5.9.3)': + '@volar/typescript@2.4.28': dependencies: '@volar/language-core': 2.4.28 path-browserify: 1.0.1 vscode-uri: 3.2.0 - optionalDependencies: - typescript: 5.9.3 '@vscode/emmet-helper@2.11.0': dependencies: @@ -7220,9 +7152,9 @@ snapshots: acorn@8.19.0: {} - agent-base@6.0.2(supports-color@10.2.2): + agent-base@6.0.2: dependencies: - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -7453,11 +7385,11 @@ snapshots: axe-core@4.14.0: {} - axios@1.20.0(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2): + axios@1.20.0(debug@4.4.3): dependencies: - follow-redirects: 1.16.1(debug@4.4.3(supports-color@10.2.2)) + follow-redirects: 1.16.1(debug@4.4.3) form-data: 4.0.6 - https-proxy-agent: 5.0.1(supports-color@10.2.2) + https-proxy-agent: 5.0.1 proxy-from-env: 2.1.0 transitivePeerDependencies: - debug @@ -7684,17 +7616,13 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - debug@3.2.7(supports-color@10.2.2): + debug@3.2.7: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 10.2.2 - debug@4.4.3(supports-color@10.2.2): + debug@4.4.3: dependencies: ms: 2.1.3 - optionalDependencies: - supports-color: 10.2.2 dedent-js@1.0.1: {} @@ -7942,36 +7870,36 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-import-resolver-node@0.3.10(supports-color@10.2.2): + eslint-import-resolver-node@0.3.10: dependencies: - debug: 3.2.7(supports-color@10.2.2) + debug: 3.2.7 is-core-module: 2.17.0 resolve: 2.0.0-next.7 transitivePeerDependencies: - supports-color - eslint-module-utils@2.14.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10(supports-color@10.2.2))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): + eslint-module-utils@2.14.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint@9.39.5(jiti@2.7.0)): dependencies: - debug: 3.2.7(supports-color@10.2.2) + debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) - eslint-import-resolver-node: 0.3.10(supports-color@10.2.2) + '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) + eslint-import-resolver-node: 0.3.10 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.2.0 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 - debug: 3.2.7(supports-color@10.2.2) + debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) - eslint-import-resolver-node: 0.3.10(supports-color@10.2.2) - eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10(supports-color@10.2.2))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) + eslint-import-resolver-node: 0.3.10 + eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint@9.39.5(jiti@2.7.0)) hasown: 2.0.4 is-core-module: 2.17.0 is-glob: 4.0.3 @@ -7983,26 +7911,26 @@ snapshots: string.prototype.trimend: 1.0.10 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-storybook@10.6.2(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3): + eslint-plugin-storybook@10.6.2(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): dependencies: '@typescript-eslint/types': 8.72.0 - '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) transitivePeerDependencies: - supports-color - typescript - eslint-plugin-svelte@3.23.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(svelte@5.57.2(@typescript-eslint/types@8.72.0)): + eslint-plugin-svelte@3.23.1(eslint@9.39.5(jiti@2.7.0))(svelte@5.57.2(@typescript-eslint/types@8.72.0)): dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) + '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) '@jridgewell/sourcemap-codec': 1.6.0 - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) esutils: 2.0.3 globals: 16.5.0 known-css-properties: 0.37.0 @@ -8016,11 +7944,11 @@ snapshots: transitivePeerDependencies: - ts-node - eslint-plugin-unused-imports@4.4.1(@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)): + eslint-plugin-unused-imports@4.4.1(@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)): dependencies: - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + eslint: 9.39.5(jiti@2.7.0) optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) + '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) eslint-scope@8.4.0: dependencies: @@ -8033,14 +7961,14 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2): + eslint@9.39.5(jiti@2.7.0): dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) + '@eslint-community/eslint-utils': 4.10.1(eslint@9.39.5(jiti@2.7.0)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.2(supports-color@10.2.2) + '@eslint/config-array': 0.21.2 '@eslint/config-helpers': 0.4.2 '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.7(supports-color@10.2.2) + '@eslint/eslintrc': 3.3.7 '@eslint/js': 9.39.5 '@eslint/plugin-kit': 0.4.1 '@humanfs/node': 0.16.8 @@ -8050,7 +7978,7 @@ snapshots: ajv: 6.15.0 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 escape-string-regexp: 4.0.0 eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 @@ -8167,9 +8095,9 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-type@22.2.0(supports-color@10.2.2): + file-type@22.2.0: dependencies: - '@tokenizer/inflate': 0.5.1(supports-color@10.2.2) + '@tokenizer/inflate': 0.5.1 strtok3: 10.6.2 token-types: 6.1.2 uint8array-extras: 1.6.0 @@ -8232,6 +8160,8 @@ snapshots: '@popperjs/core': 2.11.8 flowbite-datepicker: 1.3.2 mini-svg-data-uri: 1.4.4 + transitivePeerDependencies: + - rollup flowbite@3.1.2: dependencies: @@ -8244,9 +8174,9 @@ snapshots: fnv1a-64@0.1.2: {} - follow-redirects@1.16.1(debug@4.4.3(supports-color@10.2.2)): + follow-redirects@1.16.1(debug@4.4.3): optionalDependencies: - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 fontace@0.4.1: dependencies: @@ -8422,10 +8352,10 @@ snapshots: statuses: 2.0.2 toidentifier: 1.0.1 - https-proxy-agent@5.0.1(supports-color@10.2.2): + https-proxy-agent@5.0.1: dependencies: - agent-base: 6.0.2(supports-color@10.2.2) - debug: 4.4.3(supports-color@10.2.2) + agent-base: 6.0.2 + debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -8982,6 +8912,8 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.2 + observable-slim@0.2.2: {} + obug@2.2.1: {} obug@3.0.0: {} @@ -9154,6 +9086,10 @@ snapshots: pngjs@7.0.0: {} + polished@4.3.1: + dependencies: + '@babel/runtime': 7.29.10 + possible-typed-array-names@1.1.0: {} postcss-load-config@3.1.4(postcss@8.5.31): @@ -9491,9 +9427,9 @@ snapshots: semver@7.8.5: {} - send@1.2.1(supports-color@10.2.2): + send@1.2.1: dependencies: - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -9633,15 +9569,15 @@ snapshots: stackback@0.0.2: {} - start-server-and-test@3.0.13(supports-color@10.2.2): + start-server-and-test@3.0.13: dependencies: arg: 5.0.2 check-more-types: 2.24.0 - debug: 4.4.3(supports-color@10.2.2) + debug: 4.4.3 execa: 5.1.1 lazy-ass: 2.0.3 tree-kill: 1.2.2 - wait-on: 9.5.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) + wait-on: 9.5.1(debug@4.4.3) transitivePeerDependencies: - supports-color @@ -9959,13 +9895,13 @@ snapshots: dependencies: semver: 7.8.5 - typescript-eslint@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3): + typescript-eslint@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - '@typescript-eslint/typescript-estree': 8.72.0(supports-color@10.2.2)(typescript@5.9.3) - '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.3) - eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) + '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/parser': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3) + eslint: 9.39.5(jiti@2.7.0) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -10132,46 +10068,45 @@ snapshots: transitivePeerDependencies: - msw - volar-service-css@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)): + volar-service-css@0.0.71(@volar/language-service@2.4.28): dependencies: vscode-css-languageservice: 6.3.10 vscode-languageserver-textdocument: 1.0.15 vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 - volar-service-emmet@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)): + volar-service-emmet@0.0.71(@volar/language-service@2.4.28): dependencies: '@emmetio/css-parser': 0.4.1 '@emmetio/html-matcher': 1.3.0 '@vscode/emmet-helper': 2.11.0 vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 - volar-service-html@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)): + volar-service-html@0.0.71(@volar/language-service@2.4.28): dependencies: vscode-html-languageservice: 5.6.2 vscode-languageserver-textdocument: 1.0.15 vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 - volar-service-prettier@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(prettier@3.9.5): + volar-service-prettier@0.0.71(@volar/language-service@2.4.28)(prettier@3.9.5): dependencies: vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 prettier: 3.9.5 - volar-service-typescript-twoslash-queries@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(typescript@5.9.3): + volar-service-typescript-twoslash-queries@0.0.71(@volar/language-service@2.4.28): dependencies: vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) - typescript: 5.9.3 + '@volar/language-service': 2.4.28 - volar-service-typescript@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3))(typescript@5.9.3): + volar-service-typescript@0.0.71(@volar/language-service@2.4.28): dependencies: path-browserify: 1.0.1 semver: 7.8.5 @@ -10180,15 +10115,14 @@ snapshots: vscode-nls: 5.2.0 vscode-uri: 3.2.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) - typescript: 5.9.3 + '@volar/language-service': 2.4.28 - volar-service-yaml@0.0.71(@volar/language-service@2.4.28(typescript@5.9.3)): + volar-service-yaml@0.0.71(@volar/language-service@2.4.28): dependencies: vscode-uri: 3.2.0 yaml-language-server: 1.23.0 optionalDependencies: - '@volar/language-service': 2.4.28(typescript@5.9.3) + '@volar/language-service': 2.4.28 vscode-css-languageservice@6.3.10: dependencies: @@ -10242,9 +10176,9 @@ snapshots: w3c-keyname@2.2.8: {} - wait-on@9.5.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2): + wait-on@9.5.1(debug@4.4.3): dependencies: - axios: 1.20.0(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) + axios: 1.20.0(debug@4.4.3) joi: 18.3.0 lodash: 4.18.1 rxjs: 7.8.2 diff --git a/src/actions/footer.ts b/src/actions/footer.ts new file mode 100644 index 00000000..1af523df --- /dev/null +++ b/src/actions/footer.ts @@ -0,0 +1,93 @@ +import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; + +import { labels } from "../i18n/locales"; +import { footerRepository } from "../repositories/footer"; +import { FOOTER_SECTIONS, FOOTER_SOCIAL_NETWORKS } from "../types/footer"; + +import type { ActionAPIContext } from "astro:actions"; + +const defaultLocale = import.meta.env.PUBLIC_DEFAULT_LANGUAGE as keyof typeof labels; + +// Site paths, anchors and http(s)/mailto URLs only: anything else (javascript:, data:) +// would end up as a clickable link on every page. +const href = z + .string() + .trim() + .refine((value) => { + if (value.startsWith("/") || value.startsWith("#")) { + return true; + } + + try { + return ["http:", "https:", "mailto:"].includes(new URL(value).protocol); + } catch { + return false; + } + }, "pages.admin.customize.footer.errors.invalidUrl"); + +// The default locale is required, so every visitor gets a text through the fallback. +const localizedText = z + .object( + Object.fromEntries( + Object.keys(labels).map((locale) => [locale, z.string().trim().optional()]), + ), + ) + .refine((text) => !!text[defaultLocale], "pages.admin.customize.footer.errors.missingText"); + +const link = z.object({ label: localizedText, href }); + +const partner = z.object({ + src: z.string().trim().min(1, "pages.admin.customize.footer.errors.missingImage"), + alt: z.string().trim().min(1, "system.constraint.text.notEmpty"), + href: z.union([z.literal(""), href]).optional(), +}); + +const footerSchema = z.object({ + hidden: z.record(z.enum(FOOTER_SECTIONS), z.boolean()), + partnerGroups: z.array(z.object({ title: localizedText, partners: z.array(partner) })), + navColumns: z.array(z.object({ title: localizedText, links: z.array(link) })), + legalLinks: z.array(link), + social: z.array(z.object({ network: z.enum(FOOTER_SOCIAL_NETWORKS), href })), +}); + +/** + * Actions are posted to /_actions/*, which the /admin firewall rule does not + * match, so the role has to be checked here. + * @param context The action context + */ +function assertAdmin({ locals: { session, t } }: ActionAPIContext) { + if (!session?.user.roles?.includes("ROLE_ADMIN")) { + throw new ActionError({ + code: "FORBIDDEN", + message: t("pages.admin.customize.footer.errors.forbidden"), + }); + } +} + +export const saveFooter = defineAction({ + input: z.object({ config: z.string() }), + handler: async ({ config }, context) => { + assertAdmin(context); + + const { t } = context.locals; + + let parsed: unknown; + + try { + parsed = JSON.parse(config); + } catch { + parsed = undefined; + } + + const result = footerSchema.safeParse(parsed); + + if (!result.success) { + const [issue] = result.error.issues; + + throw new ActionError({ code: "BAD_REQUEST", message: t(issue.message) }); + } + + await footerRepository.save(result.data); + }, +}); diff --git a/src/actions/headerLogo.ts b/src/actions/headerLogo.ts new file mode 100644 index 00000000..da46be0e --- /dev/null +++ b/src/actions/headerLogo.ts @@ -0,0 +1,83 @@ +import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; + +import { headerLogoRepository } from "../repositories/headerLogo"; + +const LOGO_MEDIA_TYPES = ["image/png", "image/jpeg", "image/webp"] as const; + +const mediaUrl = z.string().refine((value) => { + if (value.startsWith("/")) { + return true; + } + + try { + const url = new URL(value); + + return url.protocol === "http:" || url.protocol === "https:"; + } catch { + return false; + } +}, "system.constraint.text.expectedUrl"); + +const logoInputSchema = z.object({ + mediaUrl, + mediaType: z.enum(LOGO_MEDIA_TYPES), + altText: z.string().trim().min(1, "system.constraint.text.notEmpty"), +}); + +/** + * The header is public, but its management lives under /admin/customize. Actions + * are posted to /_actions/*, which the /admin firewall rule does not match, so + * the role has to be checked here. + */ +function assertAdmin(session: App.Locals["session"], t: App.Locals["t"]): void { + if (!session?.user.roles?.includes("ROLE_ADMIN")) { + throw new ActionError({ + code: "FORBIDDEN", + message: t("pages.admin.customize.logo.errors.forbidden"), + }); + } +} + +export const createHeaderLogo = defineAction({ + accept: "form", + input: logoInputSchema, + handler: async (input, context) => { + const { session, t } = context.locals; + + assertAdmin(session, t); + + await headerLogoRepository.create({ + mediaUrl: input.mediaUrl, + mediaType: input.mediaType, + altText: input.altText, + dateCreated: new Date(), + }); + }, +}); + +export const getHeaderLogoData = defineAction({ + handler: async (_input, context) => { + const { session, t } = context.locals; + + assertAdmin(session, t); + + return { + logos: await headerLogoRepository.getAll(), + }; + }, +}); + +export const deleteHeaderLogo = defineAction({ + accept: "form", + input: z.object({ + id: z.coerce.number().int().positive(), + }), + handler: async (input, context) => { + const { session, t } = context.locals; + + assertAdmin(session, t); + + await headerLogoRepository.delete(input.id); + }, +}); diff --git a/src/actions/index.ts b/src/actions/index.ts index 5581b1ab..023243eb 100644 --- a/src/actions/index.ts +++ b/src/actions/index.ts @@ -1,6 +1,8 @@ import { deleteBanner, saveBanner } from "./banners"; import { saveBlogPost, setBlogPostPublished } from "./blog"; import { saveFeaturedUsers } from "./featuredUsers"; +import { saveFooter } from "./footer"; +import { createHeaderLogo, deleteHeaderLogo, getHeaderLogoData } from "./headerLogo"; import { createHomeHero, deleteHomeHero, getHomeHeroData, updateHomeHero } from "./hero"; import { deleteHighlights, saveHighlights } from "./highlights"; import { payment } from "./payment"; @@ -10,8 +12,10 @@ import { updateReviewAreaRisk, updateReviewProjectStatus, } from "./projectReview"; +import { saveProposedCampaigns } from "./proposedCampaigns"; import { updatePublicProfile } from "./publicProfile"; import { register } from "./register"; +import { resetThemeColors, saveThemeColors } from "./themeColors"; export const server = { register, @@ -21,15 +25,22 @@ export const server = { saveBlogPost, setBlogPostPublished, createHomeHero, + createHeaderLogo, + deleteHeaderLogo, deleteHomeHero, + getHeaderLogoData, getHomeHeroData, updateHomeHero, saveHighlights, deleteHighlights, saveFeaturedUsers, + saveFooter, updatePublicProfile, updatePersonalProfile, updateReviewAreaRisk, updateReviewProjectStatus, sendReviewAreaComment, + saveProposedCampaigns, + saveThemeColors, + resetThemeColors, }; diff --git a/src/actions/personalProfile.ts b/src/actions/personalProfile.ts index 3134da59..052b0abb 100644 --- a/src/actions/personalProfile.ts +++ b/src/actions/personalProfile.ts @@ -1,25 +1,35 @@ import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; import { setSession } from "../auth/session.ts"; import { apiUsersIdOrHandleGet, + apiUsersIdorganizationPatch, apiUsersIdPatch, apiUsersIdpersonGet, apiUsersIdpersonPatch, - type UserUserUpdationDto, + type OrganizationJsonMergePatch, + type PersonJsonMergePatch, + type UserUserUpdationDtoJsonMergePatch, } from "../openapi/client/index.ts"; import { zPersonalProfileForm } from "../validation/personalProfileValidation.ts"; +const TERRITORY_FIELDS = ["country", "subLvl1", "subLvl2"]; + /** - * Saves the private part of the profile: the `Person` record, the `Territory` on the `User` and - * the identity row (avatar, bio, social networks) that this section shares with the public one. + * Saves the private part of the profile: the `Person` and `Organization` records, the `Territory` + * and the private flags on the `User`, and the identity row (avatar, bio, social networks) that this section shares with the public one. * The email is deliberately left out: changing it needs a confirmation flow the API does not * expose here. */ export const updatePersonalProfile = defineAction({ accept: "json", - input: zPersonalProfileForm, - handler: async (input, context) => { + input: z.object({ + form: zPersonalProfileForm, + // Fields the user edited since the last save, tracked by the form + changed: z.array(zPersonalProfileForm.keyof()), + }), + handler: async ({ form: input, changed: changedFields }, context) => { const { t, session } = context.locals; if (!session) { @@ -33,77 +43,96 @@ export const updatePersonalProfile = defineAction({ const headers = session.token.asHttpHeaders; const isOrganization = input.type === "organization"; - try { - const userPatch: Partial = input; + // Only send what the user edited: the API re-validates every field it gets, and rejects + // an unchanged handle as already in use + const changed = new Set(changedFields); + // Switching type moves the tax id to the other record, send all of its fields + const typeChanged = changed.has("type"); + const pick = (values: T, all = false) => + Object.fromEntries( + Object.entries(values).filter(([key]) => all || changed.has(key)), + ) as Partial; + const hasFields = (values: object) => Object.keys(values).length > 0; - if (input.country) { - const currentTerritory = session.user.territory; - const newTerritory = { + try { + const userPatch: UserUserUpdationDtoJsonMergePatch = pick({ + handle: input.handle, + type: input.type, + shareLocation: input.shareLocation, + referralSource: input.referralSource || null, + }); + + if (input.country && TERRITORY_FIELDS.some((field) => changed.has(field))) { + userPatch.territory = { country: input.country, subLvl1: input.subLvl1 || null, subLvl2: input.subLvl2 || null, - address: input.address.trim() || null, + // The API replaces the whole Territory, keep the address this form does not edit + address: session.user.territory?.address ?? null, }; - if ( - !currentTerritory || - currentTerritory.country !== newTerritory.country || - (currentTerritory.subLvl1 ?? null) !== newTerritory.subLvl1 || - (currentTerritory.subLvl2 ?? null) !== newTerritory.subLvl2 || - (currentTerritory.address ?? null) !== newTerritory.address - ) { - userPatch.territory = newTerritory; - } - } else if (session.user.territory?.country) { - // Country cleared in the form: do not send territory at all - userPatch.territory = undefined; } - let userError: unknown; - if (Object.keys(userPatch).length > 0) { + if (hasFields(userPatch)) { const { error } = await apiUsersIdPatch({ path: { id }, headers, - body: userPatch as UserUserUpdationDto, + body: userPatch, }); - userError = error; + + if (error) { + throw error; + } } - if (userError) { - throw userError; + const organizationPatch: OrganizationJsonMergePatch = pick( + { + legalName: input.legalName.trim(), + businessName: input.businessName.trim(), + taxId: input.taxId.trim(), + taxIdType: input.taxIdType || null, + legalForm: input.legalForm || null, + publicEntity: input.publicEntity, + }, + typeChanged, + ); + + if (isOrganization && hasFields(organizationPatch)) { + const { error } = await apiUsersIdorganizationPatch({ + path: { id }, + headers, + body: organizationPatch, + }); + + if (error) { + throw error; + } } - let personError: unknown; - if (!isOrganization) { - const currentPerson = await apiUsersIdpersonGet({ path: { id }, headers }).then( - (r) => r.data, - ); - const personPatch: Record = {}; - const firstNameTrim = input.firstName.trim(); - if ((currentPerson?.firstName ?? "") !== firstNameTrim) { - personPatch.firstName = firstNameTrim; - } - const lastNameTrim = input.lastName.trim(); - if ((currentPerson?.lastName ?? "") !== lastNameTrim) { - personPatch.lastName = lastNameTrim; - } - const taxIdTrim = input.taxId.trim(); - if ((currentPerson?.taxId ?? "") !== taxIdTrim) { - personPatch.taxId = taxIdTrim; - } - if (Object.keys(personPatch).length > 0) { - const { error } = await apiUsersIdpersonPatch({ - path: { id }, - headers, - body: personPatch as any, - }); - personError = error; - } - } else { - personError = null; - } + const personPatch: PersonJsonMergePatch = { + ...pick({ firstName: input.firstName.trim(), lastName: input.lastName.trim() }), + // On organizations the tax id belongs to the Organization record + ...(!isOrganization && + pick( + { + taxId: input.taxId.trim(), + taxIdType: input.taxIdType || null, + birthYear: input.birthYear ? Number(input.birthYear) : null, + gender: input.gender || null, + }, + typeChanged, + )), + }; - if (personError) { - throw personError; + if (hasFields(personPatch)) { + const { error } = await apiUsersIdpersonPatch({ + path: { id }, + headers, + body: personPatch, + }); + + if (error) { + throw error; + } } // The names feed the display name, refresh the cookie so the header stays in sync diff --git a/src/actions/proposedCampaigns.ts b/src/actions/proposedCampaigns.ts new file mode 100644 index 00000000..821f47cc --- /dev/null +++ b/src/actions/proposedCampaigns.ts @@ -0,0 +1,27 @@ +import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; + +import { proposedCampaignsRepository } from "../repositories/proposedCampaigns"; + +export const saveProposedCampaigns = defineAction({ + accept: "json", + input: z.object({ + "ending-soon": z.array(z.number().int().positive()), + "most-successful": z.array(z.number().int().positive()), + }), + handler: async (input, context) => { + const { session, t } = context.locals; + + if (!session?.user.roles?.includes("ROLE_ADMIN")) { + throw new ActionError({ + code: "FORBIDDEN", + message: t("pages.admin.comm.banners.errors.forbidden"), + }); + } + + await proposedCampaignsRepository.save({ + "ending-soon": input["ending-soon"], + "most-successful": input["most-successful"], + }); + }, +}); diff --git a/src/actions/publicProfile.ts b/src/actions/publicProfile.ts index d371442b..fe77f03e 100644 --- a/src/actions/publicProfile.ts +++ b/src/actions/publicProfile.ts @@ -1,4 +1,5 @@ import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; import { setSession } from "../auth/session.ts"; import { apiUsersIdOrHandleGet, apiUsersIdPatch } from "../openapi/client/index.ts"; @@ -7,8 +8,12 @@ import { zProfileForm } from "../validation/publicProfileValidation.ts"; export const updatePublicProfile = defineAction({ accept: "json", - input: zProfileForm, - handler: async (input, context) => { + input: z.object({ + form: zProfileForm, + // Fields the user edited since the last save, tracked by the form + changed: z.array(zProfileForm.keyof()), + }), + handler: async ({ form: input, changed: changedFields }, context) => { const { t, session } = context.locals; if (!session) { @@ -32,20 +37,23 @@ export const updatePublicProfile = defineAction({ }), ]; - try { - // User first: switching to `organization` makes the API create the Organization record - const { error: userError } = await apiUsersIdPatch({ - path: { id }, - headers, - body: { - avatar: input.avatar, - description: input.description.trim(), - links, - }, - }); + // Only send what the user edited: the API re-validates every field it gets + const changed = new Set(changedFields); + const userPatch = Object.fromEntries( + Object.entries({ + avatar: input.avatar, + description: input.description.trim(), + links, + }).filter(([key]) => changed.has(key)), + ); - if (userError) { - throw userError; + try { + if (Object.keys(userPatch).length > 0) { + const { error } = await apiUsersIdPatch({ path: { id }, headers, body: userPatch }); + + if (error) { + throw error; + } } // Keep the session cookie in sync so header and profile pages show fresh data diff --git a/src/actions/themeColors.ts b/src/actions/themeColors.ts new file mode 100644 index 00000000..f5a478ea --- /dev/null +++ b/src/actions/themeColors.ts @@ -0,0 +1,44 @@ +import { ActionError, defineAction } from "astro:actions"; +import { z } from "zod"; + +import { themeColorsRepository } from "../repositories/themeColors"; +import { DARK_THEME_COLOR_TOKENS, THEME_COLOR_TOKENS, isHexColor } from "../utils/themeColors"; + +const hexColorSchema = z + .string() + .refine(isHexColor, "Colors must use #RRGGBB or #RRGGBBAA notation"); + +function assertAdmin( + session: { user: { roles?: string[] } } | undefined, + t: (key: string) => string, +) { + if (!session?.user.roles?.includes("ROLE_ADMIN")) { + throw new ActionError({ + code: "FORBIDDEN", + message: t("pages.admin.customize.colors.errors.forbidden"), + }); + } +} + +export const saveThemeColors = defineAction({ + accept: "json", + input: z.object({ + lightColors: z.record(z.enum(THEME_COLOR_TOKENS), hexColorSchema), + darkColors: z.record(z.enum(DARK_THEME_COLOR_TOKENS), hexColorSchema), + }), + handler: async (input, context) => { + assertAdmin(context.locals.session, context.locals.t); + + await themeColorsRepository.save(input.lightColors, input.darkColors); + }, +}); + +export const resetThemeColors = defineAction({ + accept: "json", + input: z.object({}), + handler: async (_input, context) => { + assertAdmin(context.locals.session, context.locals.t); + + await themeColorsRepository.reset(); + }, +}); diff --git a/src/auth/store.ts b/src/auth/store.ts index 9c9ed489..ab2b0a0a 100644 --- a/src/auth/store.ts +++ b/src/auth/store.ts @@ -1,5 +1,45 @@ -import { writable, type Writable } from "svelte/store"; +import { get, writable, type Writable } from "svelte/store"; import type { Session } from "./types"; export const session: Writable = writable(); + +let pendingRefresh: Promise | undefined; + +/** + * Re-reads the session from the server. `/api/session` refreshes an expired access + * token before returning it, which keeps long-lived tabs signed in instead of + * sending a token the API will reject. + * + * Concurrent callers share the same request: several API calls can notice the stale + * token at once (the project preview fetches the owner and the accounting in parallel). + */ +export function refreshSession(): Promise { + pendingRefresh ??= (async () => { + try { + const response = await fetch("/api/session", { + headers: { Accept: "application/json" }, + cache: "no-store", + }); + + if (!response.ok) { + return get(session); + } + + const data = (await response.json()) as Session | null; + const current = data ? { ...data, expires_at: new Date(data.expires_at) } : undefined; + + session.set(current); + + return current; + } catch (error) { + console.error("Session refresh failed:", error); + + return get(session); + } + })().finally(() => { + pendingRefresh = undefined; + }); + + return pendingRefresh; +} diff --git a/src/components/address/AddressForm.svelte b/src/components/address/AddressForm.svelte index 8f4dc153..bfd269d9 100644 --- a/src/components/address/AddressForm.svelte +++ b/src/components/address/AddressForm.svelte @@ -10,6 +10,7 @@ import { locale, t } from "../../i18n/store"; import { apiAddressesIdPatch, apiAddressesPost } from "../../openapi/client"; import { getCountries } from "../../utils/countries"; + import { useFormDraft, restoreFields } from "../../utils/forms/useFormDraft.svelte"; import Select from "../library/inputs/Select.svelte"; import TextInput from "../library/inputs/TextInput.svelte"; @@ -18,10 +19,13 @@ let { address, userIri, + draftId = "address", }: { /** Address to edit. Absent, a new one is created. */ address?: Address; userIri: string; + /** Identifies the draft of this form, so two of them do not write over each other. */ + draftId?: string; } = $props(); // Seeded once: parents mount a fresh form for every address they edit. @@ -42,6 +46,26 @@ let countries = $derived(getCountries($locale)); + /** + * Addresses hold nothing sensitive, so all of it can be kept. + */ + const { restored } = useFormDraft( + untrack(() => draftId), + () => ({ + firstName: form.firstName, + lastName: form.lastName, + line1: form.line1, + line2: form.line2, + city: form.city, + postCode: form.postCode, + country: form.country, + }), + ); + + if (restored) { + restoreFields(form, restored); + } + /** Saves the Address. Resolves to it, or to `undefined` with the errors shown. */ export async function save(): Promise
{ error = undefined; diff --git a/src/components/admin/AdminSidebar.svelte b/src/components/admin/AdminSidebar.svelte index 3e9f2835..52985a7c 100644 --- a/src/components/admin/AdminSidebar.svelte +++ b/src/components/admin/AdminSidebar.svelte @@ -38,34 +38,48 @@ function navItemClass(item: AdminSidebarItem): string { return twMerge( - "hover:bg-variant1 flex content-center items-center w-fit gap-2 rounded-lg px-4 py-2 text-base font-bold whitespace-nowrap transition-colors duration-300 text-secondary", + "hover:bg-variant1 flex h-10 items-center gap-3 rounded-lg px-3 text-base font-bold whitespace-nowrap transition-colors duration-300 text-secondary", isActive(item) && "bg-variant2 hover:bg-variant3", ); } - - + + event.key === "Escape" && closeMobile()} /> diff --git a/src/components/admin/ContentFooter.svelte b/src/components/admin/ContentFooter.svelte index e4e1bb3b..c75f8592 100644 --- a/src/components/admin/ContentFooter.svelte +++ b/src/components/admin/ContentFooter.svelte @@ -3,7 +3,11 @@ import { t } from "../../i18n/store"; import AnnotationIcon from "../icons/Comments.svelte"; - const { id } = $props<{ id: string }>(); + interface Props { + id: string; + } + + const { id }: Props = $props(); let date = $state(null); let time = $state(null); diff --git a/src/components/admin/DetailsRow.svelte b/src/components/admin/DetailsRow.svelte index d6625529..6f05a7c9 100644 --- a/src/components/admin/DetailsRow.svelte +++ b/src/components/admin/DetailsRow.svelte @@ -3,7 +3,7 @@ export interface DetailsField { label: string; - value: string | number | undefined; + value?: string | number; /** Custom content painted instead of `value`, for fields that are not plain text. */ snippet?: Snippet; /** Hover text; defaults to the value. */ diff --git a/src/components/admin/ExportCsv.svelte b/src/components/admin/ExportCsv.svelte index fc38fa8f..c61a642f 100644 --- a/src/components/admin/ExportCsv.svelte +++ b/src/components/admin/ExportCsv.svelte @@ -8,6 +8,15 @@ import Spinner from "../icons/status/Spinner.svelte"; import Button from "../library/buttons/Button.svelte"; + interface Props { + endpoint?: string; + queryParams?: Record; + filenamePrefix?: string; + totalItems?: number; + size?: "sm" | "md"; + disabled?: boolean; + } + let { endpoint = "/v4/gateway_charges", queryParams = {}, @@ -15,14 +24,7 @@ totalItems = undefined, size = "sm", disabled = false, - } = $props<{ - endpoint?: string; - queryParams?: Record; - filenamePrefix?: string; - totalItems?: number; - size?: "sm" | "md"; - disabled?: boolean; - }>(); + }: Props = $props(); const iconSize = $derived(size === "md" ? "24" : "16"); diff --git a/src/components/admin/FiltersTags.svelte b/src/components/admin/FiltersTags.svelte index bb189320..ecddab65 100644 --- a/src/components/admin/FiltersTags.svelte +++ b/src/components/admin/FiltersTags.svelte @@ -15,17 +15,14 @@ const dateRegex = /^(dateCreated|dateUpdated)\[(after|before|strictly_after|strictly_before)\]$/; - let { - title, - filters, - onCloseFilter, - resource = undefined, - } = $props<{ + interface Props { title: string; filters?: Record; onCloseFilter: (filters: Record) => void; resource?: FilterResource; - }>(); + } + + let { title, filters, onCloseFilter, resource = undefined }: Props = $props(); let tags: FilterTag[] = $state([]); diff --git a/src/components/admin/GatewaysSummary.svelte b/src/components/admin/GatewaysSummary.svelte index 95e73cae..58759f0f 100644 --- a/src/components/admin/GatewaysSummary.svelte +++ b/src/components/admin/GatewaysSummary.svelte @@ -4,9 +4,11 @@ import type { Gateway } from "../../openapi/client"; - const { gateways } = $props<{ + interface Props { gateways: Gateway[]; - }>(); + } + + const { gateways }: Props = $props();
diff --git a/src/components/admin/Tooltip.svelte b/src/components/admin/Tooltip.svelte index 70e8e2e3..7255257d 100644 --- a/src/components/admin/Tooltip.svelte +++ b/src/components/admin/Tooltip.svelte @@ -1,19 +1,21 @@ + +
+
+
+
+ + {$t("pages.admin.categorization.title")} + +

+ {$t("pages.admin.categorization.description")} +

+
+
+ + +
+
+ + +
+
+ + + + diff --git a/src/components/admin/categorization/CategorizationTable.svelte b/src/components/admin/categorization/CategorizationTable.svelte new file mode 100644 index 00000000..c8e1c418 --- /dev/null +++ b/src/components/admin/categorization/CategorizationTable.svelte @@ -0,0 +1,102 @@ + + + + + + {#snippet children(row: CategorizationRow)} + + {row.item.name} + + + {row.item.slug ?? "—"} + + + {(row.item.locales ?? []) + .map((code: string) => getLanguageDisplayName(code) ?? code) + .join(", ") || "—"} + + + + {row.type === "category" + ? $t("pages.admin.categorization.table.types.category") + : $t("pages.admin.categorization.table.types.theme")} + + + +
+ + +
+
+ {/snippet} +
diff --git a/src/components/admin/categorization/CreateEditCategorizationModal.svelte b/src/components/admin/categorization/CreateEditCategorizationModal.svelte new file mode 100644 index 00000000..04e7c00b --- /dev/null +++ b/src/components/admin/categorization/CreateEditCategorizationModal.svelte @@ -0,0 +1,323 @@ + + + + {#snippet header()} + + {mode === "create" + ? type === "category" + ? $t("pages.admin.categorization.modal.createCategory") + : $t("pages.admin.categorization.modal.createTheme") + : type === "category" + ? $t("pages.admin.categorization.modal.editCategory") + : $t("pages.admin.categorization.modal.editTheme")} + + {/snippet} + +
+ (texts[code] = emptyTexts())} + onRemove={(code) => delete texts[code]} + onSelect={() => (errorMessage = "")} + /> + +
+ + {$t("pages.admin.categorization.modal.name")} + + active.name, (value) => (active.name = String(value))} + placeholder={$t("pages.admin.categorization.modal.name")} + disabled={isLoading || isSubmitting} + /> +
+ + {#if mode === "edit" && (originalSlug || originalId)} +
+
+ + {$t("pages.admin.categorization.modal.slug")} + + {originalSlug ?? "—"} +
+
+ + {$t("pages.admin.categorization.modal.locales")} + + + {originalLocales.join(", ") || "—"} + +
+
+ {/if} + + {#if errorMessage} +

{errorMessage}

+ {/if} +
+ + {#snippet footer()} + + + {/snippet} +
diff --git a/src/components/admin/charges/CreateChargeModal.svelte b/src/components/admin/charges/CreateChargeModal.svelte index 31764a9e..3a7305bf 100644 --- a/src/components/admin/charges/CreateChargeModal.svelte +++ b/src/components/admin/charges/CreateChargeModal.svelte @@ -16,8 +16,10 @@ initialFormState, initialFiscal, type CreateChargeForm, + type CreateChargeFormFiscal, type DonorType, } from "../../../types/admin-charge"; + import { useFormDraft, restoreFields } from "../../../utils/forms/useFormDraft.svelte"; import Button from "../../library/buttons/Button.svelte"; import Title from "../../library/typography/Title.svelte"; @@ -50,6 +52,98 @@ let submitState = $state<"idle" | "submitting" | "error">("idle"); let submitError = $state(null); + /** + * The fiscal data of the donor, without the tax ids. + * + * They are fiscal data and are left out on purpose: whoever fills the form in types them + * again. + */ + type FiscalDraft = + | { kind: "organization"; legalName: string; repFirstName: string; repLastName: string } + | { kind: "individual"; firstName: string; lastName: string }; + + function fiscalDraft(fiscal: CreateChargeFormFiscal): FiscalDraft { + if (fiscal.kind === "organization") { + return { + kind: "organization", + legalName: fiscal.legalName, + repFirstName: fiscal.repFirstName, + repLastName: fiscal.repLastName, + }; + } + + return { + kind: "individual", + firstName: fiscal.firstName, + lastName: fiscal.lastName, + }; + } + + /** + * Rebuilds the fiscal data of the donor, with the tax ids empty because they are not + * kept. The kind comes with it, so the effect that keeps both in step leaves it alone. + */ + function fiscalFromDraft(draft: FiscalDraft): CreateChargeFormFiscal { + if (draft.kind === "organization") { + return { + kind: "organization", + legalName: draft.legalName, + taxId: "", + repFirstName: draft.repFirstName, + repLastName: draft.repLastName, + repTaxId: "", + }; + } + + return { + kind: "individual", + firstName: draft.firstName, + lastName: draft.lastName, + taxId: "", + }; + } + + /** + * The password of the donor is left out on purpose, it is a credential. + */ + type ChargeDraft = { + currentStep: StepKey; + existingUser: CreateChargeForm["existingUser"]; + user: Pick; + fiscal: FiscalDraft; + charge: CreateChargeForm["charge"]; + }; + + const { restored } = useFormDraft("admin-create-charge", () => ({ + currentStep, + existingUser: form.existingUser, + user: { type: form.user.type, email: form.user.email }, + fiscal: fiscalDraft(form.fiscal), + charge: form.charge, + })); + + /** + * Puts back what was kept before the language switch. + */ + function restoreCharge(draft: Partial) { + currentStep = draft.currentStep ?? "user"; + form.existingUser = draft.existingUser ?? null; + + restoreFields(form.user, draft.user, ["type", "email"]); + + if (draft.charge) { + form.charge = draft.charge; + } + + if (draft.fiscal) { + form.fiscal = fiscalFromDraft(draft.fiscal); + } + } + + if (restored) { + restoreCharge(restored); + } + $effect(() => { submitting = submitState === "submitting"; }); diff --git a/src/components/admin/comm/Newsletter.svelte b/src/components/admin/comm/Newsletter.svelte index 9310d0a7..dd883618 100644 --- a/src/components/admin/comm/Newsletter.svelte +++ b/src/components/admin/comm/Newsletter.svelte @@ -9,6 +9,7 @@ } from "flowbite-svelte"; import { t } from "../../../i18n/store"; + import { useFormDraft } from "../../../utils/forms/useFormDraft.svelte"; import PlusIcon from "../../icons/actions/PlusIcon.svelte"; import FiltersIcon from "../../icons/filters/Filters.svelte"; import Button from "../../library/buttons/Button.svelte"; @@ -88,6 +89,38 @@ let isSubmitting = $state(false); + /** + * The newsletter holds no sensitive data, so the whole form can be kept. + */ + const { restored } = useFormDraft("admin-newsletter", () => ({ + selectedTemplate, + recipientBlocks, + selectedRecipients, + isTest, + onlySpanish, + })); + if (restored) { + if (restored.selectedTemplate !== undefined) { + selectedTemplate = restored.selectedTemplate; + } + + if (restored.recipientBlocks) { + recipientBlocks = restored.recipientBlocks; + } + + if (restored.selectedRecipients) { + selectedRecipients = restored.selectedRecipients; + } + + if (restored.isTest !== undefined) { + isTest = restored.isTest; + } + + if (restored.onlySpanish !== undefined) { + onlySpanish = restored.onlySpanish; + } + } + const recipientOptions = $derived([ { value: "all", label: $t("pages.admin.newsletter.send.recipients.all") }, { value: "promoters", label: $t("pages.admin.newsletter.send.recipients.promoters") }, diff --git a/src/components/admin/comm/blog/BlogForm.svelte b/src/components/admin/comm/blog/BlogForm.svelte index c4bac973..cdd8fd39 100644 --- a/src/components/admin/comm/blog/BlogForm.svelte +++ b/src/components/admin/comm/blog/BlogForm.svelte @@ -5,6 +5,7 @@ import { locale, t } from "../../../../i18n/store"; import { BLOG_SECTIONS } from "../../../../utils/blog"; import { getDefaultLanguage } from "../../../../utils/consts"; + import { useFormDraft, restoreFields } from "../../../../utils/forms/useFormDraft.svelte"; import { getLanguageDisplayName, primaryLanguage as pickPrimaryLanguage, @@ -50,6 +51,8 @@ const contentId = $props.id(); let publishedAt = $state(initial?.publishedAt ?? new Date()); let section = $state(initial?.section ?? "news"); + let author = $state(initial?.author ?? ""); + let videoUrl = $state(initial?.videoUrl ?? ""); // Only URL and type are stored, so rebuild what FileUpload needs to list the current header. let header = $state( @@ -71,25 +74,24 @@ const defaultLanguage = getDefaultLanguage(); // Every language's texts live here, the base one included, and are saved together. - let texts = $state>( - initial - ? Object.fromEntries( - initial.languages.map((code) => { - const stored = - code === initial.language ? initial : initial.translations[code]; + const initialTexts: Record = initial + ? Object.fromEntries( + initial.languages.map((code) => { + const stored = code === initial.language ? initial : initial.translations[code]; - return [ - code, - { - title: stored?.title ?? "", - subtitle: stored?.subtitle ?? "", - content: stored?.content ?? "", - }, - ]; - }), - ) - : { [defaultLanguage]: emptyTexts() }, - ); + return [ + code, + { + title: stored?.title ?? "", + subtitle: stored?.subtitle ?? "", + content: stored?.content ?? "", + }, + ]; + }), + ) + : { [defaultLanguage]: emptyTexts() }; + + let texts = $state>(initialTexts); let languages = $state(initial?.languages ?? [defaultLanguage]); let selectedLanguage = $state(untrack(() => languages[0])); const active = $derived(texts[selectedLanguage]); @@ -103,6 +105,59 @@ fieldErrors = {}; } + /** + * Nothing in this form is sensitive, so all of it can be kept. The header is kept by URL + * and type, the way it is sent to the API. + */ + const { restored } = useFormDraft("admin-comm-blog", () => ({ + texts, + languages, + selectedLanguage, + publishedAt: publishedAt.toISOString(), + section, + author, + videoUrl, + header: header.map(({ url, type }) => ({ url, type })), + })); + + if (restored) { + restoreFields(texts, restored.texts); + + if (restored.languages) { + languages = restored.languages; + } + + if (restored.selectedLanguage) { + selectedLanguage = restored.selectedLanguage; + } + + if (restored.publishedAt) { + publishedAt = new Date(restored.publishedAt); + } + + if (restored.section) { + section = restored.section; + } + + if (restored.author !== undefined) { + author = restored.author; + } + + if (restored.videoUrl !== undefined) { + videoUrl = restored.videoUrl; + } + + if (restored.header) { + header = restored.header.map(({ url, type }) => ({ + id: url, + url, + type, + size: 0, + name: url.split("/").pop() ?? "", + })); + } + } + async function submit(publish: boolean) { fieldErrors = {}; @@ -242,7 +297,7 @@
diff --git a/src/components/admin/customize/ColorsForm.svelte b/src/components/admin/customize/ColorsForm.svelte new file mode 100644 index 00000000..d8861142 --- /dev/null +++ b/src/components/admin/customize/ColorsForm.svelte @@ -0,0 +1,261 @@ + + +
+
+
+ + {$t("pages.admin.customize.colors.title")} + +

+ {$t("pages.admin.customize.colors.description")} +

+
+
+ + {$t("pages.admin.customize.colors.reset.button")} + + + {$t("pages.admin.customize.colors.save")} + +
+
+
+ + {$t("pages.admin.customize.colors.contrast.title")} + +

+ {$t("pages.admin.customize.colors.contrast.description", { + minimum: MINIMUM_CONTRAST_RATIO, + })} +

+
+ + (activeTheme = tab as "generic" | "light" | "dark")} + /> + + {#if activeTheme === "generic"} +
+
+ + {$t("pages.admin.customize.colors.themes.generic")} + +

+ {$t("pages.admin.customize.colors.themes.genericDescription")} +

+
+
+ {#each GENERIC_THEME_COLOR_TOKENS as token} + + {/each} +
+
+ {:else if activeTheme === "light"} +
+
+ + {$t("pages.admin.customize.colors.themes.light")} + +

+ {$t("pages.admin.customize.colors.themes.lightDescription")} +

+
+
+ {#each LIGHT_THEME_COLOR_TOKENS as token} + + {/each} +
+
+ {:else} +
+
+ + {$t("pages.admin.customize.colors.themes.dark")} + +

+ {$t("pages.admin.customize.colors.themes.darkDescription")} +

+
+
+ {#each DARK_THEME_COLOR_TOKENS as token} + + {/each} +
+
+ {/if} +
+ +{errorMessage} +{successMessage} diff --git a/src/components/admin/customize/footer/FooterEditor.svelte b/src/components/admin/customize/footer/FooterEditor.svelte new file mode 100644 index 00000000..a14dca57 --- /dev/null +++ b/src/components/admin/customize/footer/FooterEditor.svelte @@ -0,0 +1,486 @@ + + +{#snippet rowControls(list: unknown[], index: number)} +
+ + + +
+{/snippet} + +{#snippet localizedInput(text: LocalizedText, placeholder: string)} +
+ text[language] ?? "", (value) => (text[language] = String(value))} + placeholder={language === defaultLanguage + ? placeholder + : text[defaultLanguage] || placeholder} + /> +
+{/snippet} + +{#snippet linkList(links: FooterLinkItem[], path: string)} +
    + {#each links as link, index (link)} +
  • + {@render localizedInput( + link.label, + $t("pages.admin.customize.footer.fields.labelPlaceholder"), + )} +
    + +
    + {@render rowControls(links, index)} +
  • + {/each} +
+ +{/snippet} + +{#snippet partnerList(partners: FooterPartner[], path: string)} +
    + {#each partners as partner, index (partner)} +
  • + +
    + +
    +
    + partner.href ?? "", (value) => (partner.href = String(value)) + } + placeholder={$t( + "pages.admin.customize.footer.fields.partnerHrefPlaceholder", + )} + /> +
    + {@render rowControls(partners, index)} +
  • + {/each} +
+ +{/snippet} + + +{#snippet languageTabsNav()} + (language = id as Locale)} + /> +{/snippet} + +{#snippet sectionHeader(section: FooterSection, titleKey: string)} +
+ {$t(titleKey)} + +
+{/snippet} + +{#snippet summaryCard(list: EditableList, title: LocalizedText, count: string, index: number)} +
  • +
    +

    + {localized(title, language) || + $t("pages.admin.customize.footer.fields.titlePlaceholder")} +

    +

    {count}

    +
    + + {@render rowControls(config[list], index)} +
  • +{/snippet} + +
    + + {$t("pages.admin.customize.footer.sections.preview")} + +

    {$t("pages.admin.customize.footer.previewHelp")}

    + + +
    + +
    { + event.preventDefault(); + }} +> +
    + {@render languageTabsNav()} +

    + {$t("pages.admin.customize.footer.languageHelp", { + language: languagesList[defaultLanguage], + })} +

    +
    + +
    +
    + {@render sectionHeader("partners", "pages.admin.customize.footer.sections.partners")} + +
      + {#each config.partnerGroups as group, index (group)} + {@render summaryCard( + "partnerGroups", + group.title, + $t("pages.admin.customize.footer.logoCount", { + count: group.partners.length, + }), + index, + )} + {/each} +
    + + +
    + +
    + {@render sectionHeader( + "navigation", + "pages.admin.customize.footer.sections.navigation", + )} + +
      + {#each config.navColumns as column, index (column)} + {@render summaryCard( + "navColumns", + column.title, + $t("pages.admin.customize.footer.linkCount", { + count: column.links.length, + }), + index, + )} + {/each} +
    + + +
    +
    + + + + {#if editing && config[editing.list][editing.index]} + {@const { list, index } = editing} +
    + + {$t( + list === "navColumns" + ? "pages.admin.customize.footer.editColumn" + : "pages.admin.customize.footer.editGroup", + )} + + {@render languageTabsNav()} +
    + {@render localizedInput( + config[list][index].title, + $t("pages.admin.customize.footer.fields.titlePlaceholder"), + )} +
    + {#if list === "navColumns"} + {@render linkList(config.navColumns[index].links, `navColumns.${index}.links`)} + {:else} + {@render partnerList( + config.partnerGroups[index].partners, + `partnerGroups.${index}.partners`, + )} + {/if} +
    + +
    +
    + {/if} +
    + +
    +
    + {@render sectionHeader("legal", "pages.admin.customize.footer.sections.legal")} + {@render linkList(config.legalLinks, "legalLinks")} +
    + +
    + {@render sectionHeader("social", "pages.admin.customize.footer.sections.social")} +
      + {#each config.social as link, index (link)} +
    • + +
      + +
      + {@render rowControls(config.social, index)} +
    • + {/each} +
    + +
    +
    + + + {$t("common.save")} + +
    + + + +{errorMessage} + + {$t("pages.admin.customize.footer.saved")} + diff --git a/src/components/admin/customize/logo/Logo.svelte b/src/components/admin/customize/logo/Logo.svelte new file mode 100644 index 00000000..23de5bb9 --- /dev/null +++ b/src/components/admin/customize/logo/Logo.svelte @@ -0,0 +1,85 @@ + + +
    + + {$t("pages.admin.customize.logo.title")} + +

    + {$t("pages.admin.customize.logo.description")} +

    +
    + +{errorMessage} + +
    + + {#if currentSubtab === "new"} + + {:else if currentSubtab === "history"} + { + errorMessage = message; + showError = true; + }} + onSaved={refreshLogos} + /> + {/if} +
    diff --git a/src/components/admin/customize/logo/LogoForm.svelte b/src/components/admin/customize/logo/LogoForm.svelte new file mode 100644 index 00000000..8edec3e5 --- /dev/null +++ b/src/components/admin/customize/logo/LogoForm.svelte @@ -0,0 +1,175 @@ + + +
    +
    + + {$t("pages.admin.customize.logo.fields.mediaTitle")} + + +
    +
    +

    + {$t("pages.admin.customize.logo.fields.mediaLabel")} +

    + + {#if media} +

    {media.name}

    + {:else} +

    + {$t("pages.admin.customize.logo.fields.mediaHint")} +

    + {/if} +
    + + {#if media} +
    + {altText +
    + {/if} + + {#if mediaError} +

    {mediaError}

    + {/if} + +
    + + + {#if media} + + {/if} +
    +
    +
    + + + + + {$t("common.save")} + + + +{errorMessage} + + diff --git a/src/components/admin/customize/logo/LogoHistory.svelte b/src/components/admin/customize/logo/LogoHistory.svelte new file mode 100644 index 00000000..eb26b8bf --- /dev/null +++ b/src/components/admin/customize/logo/LogoHistory.svelte @@ -0,0 +1,197 @@ + + +
    + + {$t("pages.admin.customize.logo.history.title")} + +

    {$t("pages.admin.customize.logo.history.description")}

    +
    + + (currentPage = page)} +> + {#snippet children(row)} + + {row.id} + + + {row.altText} + + + {row.altText} + + + {@const status = statusOf(row)} + + + {$t(`pages.admin.customize.logo.history.status.${status}`)} + + + +
    + + +
    +
    + {/snippet} +
    + + + {#if previewRow} +
    + {previewRow.altText} +

    {previewRow.altText}

    +
    + {/if} +
    + + diff --git a/src/components/admin/customize/logo/LogoTabs.svelte b/src/components/admin/customize/logo/LogoTabs.svelte new file mode 100644 index 00000000..f8832849 --- /dev/null +++ b/src/components/admin/customize/logo/LogoTabs.svelte @@ -0,0 +1,39 @@ + + +
    + + +
    diff --git a/src/components/admin/home/FeaturedUsersForm.svelte b/src/components/admin/home/FeaturedUsersForm.svelte index 724e9e7e..870a5347 100644 --- a/src/components/admin/home/FeaturedUsersForm.svelte +++ b/src/components/admin/home/FeaturedUsersForm.svelte @@ -89,4 +89,5 @@ {labels} search={searchUsers} onSave={saveUsers} + draftId="admin-featured-users" /> diff --git a/src/components/admin/home/Highlights.svelte b/src/components/admin/home/Highlights.svelte index 57bcc584..22942ffb 100644 --- a/src/components/admin/home/Highlights.svelte +++ b/src/components/admin/home/Highlights.svelte @@ -1,22 +1,16 @@ + + + {#snippet header()} + {title} + {/snippet} +
    + {#if description} +

    {description}

    + {/if} +
    + {#if projectQuery && searchLabel} + + {searchLabel} + + {/if} + +
    +
    + {#snippet footer()} + + + {/snippet} +
    diff --git a/src/components/admin/home/ProjectSlotCard.svelte b/src/components/admin/home/ProjectSlotCard.svelte new file mode 100644 index 00000000..7a31d51e --- /dev/null +++ b/src/components/admin/home/ProjectSlotCard.svelte @@ -0,0 +1,137 @@ + + + +{#if variant === "add"} +
    +
    + + {$t("pages.admin.slotCard.addTitle")} + +

    + {$t("pages.admin.slotCard.addSubtitle")} +

    +
    + +
    +{:else} +
    + {#if project?.image} + {project.title} + {/if} +
    + {#if project} +
    +

    {project.title}

    + {#if slotNumber !== undefined} +

    + {$t("pages.admin.slotCard.position", { + number: String(slotNumber).padStart(2, "0"), + })} +

    + {/if} +
    +
    + + {#if onRemove} + + {/if} +
    + {:else} +
    + {#if slotNumber !== undefined} +

    + {$t("pages.admin.slotCard.slot", { + number: String(slotNumber).padStart(2, "0"), + })} +

    + {/if} +

    {$t("pages.admin.slotCard.empty")}

    +
    +
    + + {#if onRemoveSlot} + + {/if} +
    + {/if} +
    +
    +{/if} diff --git a/src/components/admin/home/ProposedCampaigns.svelte b/src/components/admin/home/ProposedCampaigns.svelte new file mode 100644 index 00000000..dc05e3c9 --- /dev/null +++ b/src/components/admin/home/ProposedCampaigns.svelte @@ -0,0 +1,179 @@ + + +
    +
    +
    + {$t("pages.admin.home.proposed.title")} +

    + {$t("pages.admin.home.proposed.description")} +

    +
    + + {$t("pages.admin.home.proposed.save")} + +
    + +
    +
    + + {$t("pages.admin.home.proposed.projects.title")} + +

    + {$t("pages.admin.home.proposed.projects.description")} +

    +
    + + + + + {#each activeSlots as slot, index (index)} + openPicker(index)} + onReplace={() => openPicker(index)} + onRemove={() => handleClearProject(index)} + onRemoveSlot={() => handleRemoveSlot(index)} + /> + {/each} + + +
    +
    + +{errorMessage} + + diff --git a/src/components/admin/home/banners/BannersForm.svelte b/src/components/admin/home/banners/BannersForm.svelte index d1b7f00c..fd34c1c2 100644 --- a/src/components/admin/home/banners/BannersForm.svelte +++ b/src/components/admin/home/banners/BannersForm.svelte @@ -5,6 +5,7 @@ import { locale, t } from "../../../../i18n/store"; import { getDefaultLanguage } from "../../../../utils/consts"; import { endOfDay, formatDate, startOfDay } from "../../../../utils/dates"; + import { useFormDraft, restoreFields } from "../../../../utils/forms/useFormDraft.svelte"; import { getLanguageDisplayName, primaryLanguage } from "../../../../utils/lang"; import ActionableButton from "../../../library/buttons/ActionableButton.svelte"; import Toast from "../../../library/feedback/Toast.svelte"; @@ -42,19 +43,19 @@ const defaultLanguage = getDefaultLanguage(); // Every language's texts live here, the base one included, and are saved together. - let texts = $state>( - initial - ? Object.fromEntries( - initial.languages.map((code) => [ - code, - { - ...emptyTexts(), - ...(code === initial.language ? initial : initial.translations[code]), - }, - ]), - ) - : { [defaultLanguage]: emptyTexts() }, - ); + const initialTexts: Record = initial + ? Object.fromEntries( + initial.languages.map((code) => [ + code, + { + ...emptyTexts(), + ...(code === initial.language ? initial : initial.translations[code]), + }, + ]), + ) + : { [defaultLanguage]: emptyTexts() }; + + let texts = $state>(initialTexts); let languages = $state(initial?.languages ?? [defaultLanguage]); let selectedLanguage = $state(untrack(() => languages[0])); const active = $derived(texts[selectedLanguage]); @@ -93,6 +94,37 @@ }; } + /** + * Nothing in this form is sensitive, so all of it can be kept. + */ + const { restored } = useFormDraft("admin-home-banner", () => ({ + texts, + languages, + selectedLanguage, + startsAt: startsAt.toISOString(), + endsAt: endsAt.toISOString(), + })); + + if (restored) { + restoreFields(texts, restored.texts); + + if (restored.languages) { + languages = restored.languages; + } + + if (restored.selectedLanguage) { + selectedLanguage = restored.selectedLanguage; + } + + if (restored.startsAt) { + startsAt = new Date(restored.startsAt); + } + + if (restored.endsAt) { + endsAt = new Date(restored.endsAt); + } + } + async function submit() { fieldErrors = {}; diff --git a/src/components/admin/home/banners/BannersHistory.svelte b/src/components/admin/home/banners/BannersHistory.svelte index 7fbbb7b4..be30e064 100644 --- a/src/components/admin/home/banners/BannersHistory.svelte +++ b/src/components/admin/home/banners/BannersHistory.svelte @@ -1,6 +1,7 @@ {#snippet actions()} - {/snippet} {#snippet footer()} @@ -125,6 +127,7 @@ {$t("pages.admin.projects.table.rows.details.btns.certificates")} --> +
    {/snippet} diff --git a/src/components/admin/projects/ProjectsModalAnnotations.svelte b/src/components/admin/projects/ProjectsModalAnnotations.svelte index 91419318..b742a67a 100644 --- a/src/components/admin/projects/ProjectsModalAnnotations.svelte +++ b/src/components/admin/projects/ProjectsModalAnnotations.svelte @@ -5,15 +5,13 @@ import Button from "../../library/buttons/Button.svelte"; import TextArea from "../../library/inputs/TextArea.svelte"; - let { - open = $bindable(false), - annotationText = $bindable(""), - onsave, - } = $props<{ + interface Props { open: boolean; annotationText: string; onsave?: (text: string) => void; - }>(); + } + + let { open = $bindable(false), annotationText = $bindable(""), onsave }: Props = $props(); + import type { ProjectStatus } from "../../../utils/projectStatus"; import type { DataTableHeader, SortOption } from "../../library/tables/DataTable.svelte"; export type ProjectRow = { @@ -6,10 +7,11 @@ name: string; slug: string; promoter: string; + promoterHandle: string; achieved: string; paid: string; paidMatchfunding: string; - status: string; + status: ProjectStatus; datePublished: string; dateEnd1: string; dateEnd2: string; @@ -46,7 +48,8 @@ { key: "pages.admin.projects.table.headers.name" }, { key: "pages.admin.projects.table.headers.promoter" }, { key: "pages.admin.projects.table.headers.achieved" }, - { key: "pages.admin.projects.table.headers.paid" }, + // Hidden until the API provides the paid amount (also the cell below). + // { key: "pages.admin.projects.table.headers.paid" }, { key: "pages.admin.projects.table.headers.process" }, { key: "", class: "w-12" }, ]; @@ -54,13 +57,14 @@ {project.achieved} + -
    e.stopPropagation()} role="presentation"> - -
    + + {$t(projectStatusLabelKey(project.status))} +
    onOpenAnnotationsModal?.(project, new MouseEvent("click"))} - {onChangeStatus} + {onStatusChange} userEmail={userEmailById.get(project.id)} /> {/snippet} diff --git a/src/components/admin/reviews/AssignAdvisorModal.svelte b/src/components/admin/reviews/AssignAdvisorModal.svelte index ef5ff521..3c9086cc 100644 --- a/src/components/admin/reviews/AssignAdvisorModal.svelte +++ b/src/components/admin/reviews/AssignAdvisorModal.svelte @@ -7,10 +7,9 @@ apiUsersGetCollectionUrl, type User, } from "../../../openapi/client/index.ts"; - import { debounce } from "../../../utils/debounce.ts"; import { toCollectionItems } from "../../../utils/hydra"; import Button from "../../library/buttons/Button.svelte"; - import DropdownMenu from "../../library/dropdown/DropdownMenu.svelte"; + import DropdownSearch from "../../library/dropdown/DropdownSearch.svelte"; import UserResultRow from "../../library/dropdown/UserResultRow.svelte"; import Title from "../../library/typography/Title.svelte"; @@ -34,7 +33,6 @@ onAssign: (iri: string, name: string) => void; } = $props(); - let candidates = $state([]); let searchValue = $state(""); let selected = $state([]); @@ -47,24 +45,14 @@ }; } - const searchUsers = debounce(async (term: string) => { + async function searchUsers(term: string, signal: AbortSignal): Promise { const { data } = await apiUsersGetCollection({ baseUrl: "/api/relay", - query: { q: term.trim(), itemsPerPage: 30 }, + query: { q: term, itemsPerPage: 30 }, + signal, }); - candidates = toCollectionItems(data).map(toOption); - }, 250); - - function handleSearch(value: string): void { - const trimmed = value.trim(); - if (trimmed.length < 2) { - searchUsers.cancel(); - candidates = []; - return; - } - - searchUsers(trimmed); + return toCollectionItems(data).map(toOption); } $effect(() => { @@ -109,17 +97,17 @@ {$t("pages.admin.reviews.projects.table.rows.details.modals.assignAdvisor.description")}

    - @@ -128,7 +116,7 @@ {/if} {/snippet} - + {#snippet footer()}