diff --git a/package.json b/package.json index 1db661d5d..a25c84134 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@tailwindcss/postcss": "^4.1.2", "@types/compression": "^1.7.5", "@types/glob": "^8.1.0", + "@types/jsdom": "^21.1.7", "@types/markdown-it": "^13.0.9", "@types/morgan": "^1.9.9", "analytics": "^0.8.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ce26ff2a..21e1bf72c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,6 +78,9 @@ importers: '@types/glob': specifier: ^8.1.0 version: 8.1.0 + '@types/jsdom': + specifier: ^21.1.7 + version: 21.1.7 '@types/markdown-it': specifier: ^13.0.9 version: 13.0.9 @@ -1488,6 +1491,9 @@ packages: '@types/http-errors@2.0.4': resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + '@types/jsdom@21.1.7': + resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -1542,6 +1548,9 @@ packages: '@types/serve-static@1.15.7': resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} + '@types/tough-cookie@4.0.5': + resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@typescript-eslint/eslint-plugin@8.26.1': resolution: {integrity: sha512-2X3mwqsj9Bd3Ciz508ZUtoQQYpOhU/kWoUqIf49H8Z0+Vbh6UF/y0OEYp0Q0axOGzaBGs7QxRwq0knSQ8khQNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5230,6 +5239,12 @@ snapshots: '@types/http-errors@2.0.4': {} + '@types/jsdom@21.1.7': + dependencies: + '@types/node': 22.13.10 + '@types/tough-cookie': 4.0.5 + parse5: 7.2.1 + '@types/json-schema@7.0.15': {} '@types/linkify-it@3.0.5': {} @@ -5286,6 +5301,8 @@ snapshots: '@types/node': 22.13.10 '@types/send': 0.17.4 + '@types/tough-cookie@4.0.5': {} + '@typescript-eslint/eslint-plugin@8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)': dependencies: '@eslint-community/regexpp': 4.12.1 diff --git a/src/icons/optimized/customize.svg b/src/icons/optimized/customize.svg new file mode 100644 index 000000000..e88a59fe9 --- /dev/null +++ b/src/icons/optimized/customize.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/customize.svg b/src/icons/svg/customize.svg new file mode 100644 index 000000000..5f6178510 --- /dev/null +++ b/src/icons/svg/customize.svg @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/src/lib/components/ui/icon/icon.svelte b/src/lib/components/ui/icon/icon.svelte index 0c1c5455b..47bdaa899 100644 --- a/src/lib/components/ui/icon/icon.svelte +++ b/src/lib/components/ui/icon/icon.svelte @@ -5,7 +5,7 @@ type Props = SvelteHTMLElements['svg'] & { class?: string; - name?: IconType; + name: IconType; }; const { @@ -14,7 +14,7 @@ height = 20, width = 20, class: className = '', - name = 'arrow-right', + name, ...rest }: Props = $props(); diff --git a/src/lib/components/ui/icon/sprite/sprite.svelte b/src/lib/components/ui/icon/sprite/sprite.svelte index 99a8e4c27..3a44d65d7 100644 --- a/src/lib/components/ui/icon/sprite/sprite.svelte +++ b/src/lib/components/ui/icon/sprite/sprite.svelte @@ -139,6 +139,14 @@ fill-rule="evenodd" > + + + import Spinner from '$lib/components/shared/spinner.svelte'; import VideoDialog from '$lib/components/shared/video-dialog.svelte'; + import { Button, Icon } from '$lib/components/ui'; import { classNames } from '$lib/utils/classnames'; import { loginGithub } from '../(utils)/github'; import { initDates } from '../+page.svelte'; @@ -38,52 +39,26 @@ diff --git a/src/routes/(init)/init/(components)/window.svelte b/src/routes/(init)/init/(components)/window.svelte index 582885450..8ab16963f 100644 --- a/src/routes/(init)/init/(components)/window.svelte +++ b/src/routes/(init)/init/(components)/window.svelte @@ -21,7 +21,8 @@ >
{#if link} - {@render link()} {:else} diff --git a/src/routes/(init)/init/tickets/customize/+page.server.ts b/src/routes/(init)/init/tickets/customize/+page.server.ts index fa944ad2b..ca6d366c5 100644 --- a/src/routes/(init)/init/tickets/customize/+page.server.ts +++ b/src/routes/(init)/init/tickets/customize/+page.server.ts @@ -31,7 +31,7 @@ export const load = async () => { const updateSchema = zfd.formData({ name: zfd.text(), title: zfd.text(), - sticker: zfd.text() + sticker: zfd.text().nullish() }); export const actions = { diff --git a/src/routes/(init)/init/tickets/customize/+page.svelte b/src/routes/(init)/init/tickets/customize/+page.svelte index 23c42f7c6..32cd71f51 100644 --- a/src/routes/(init)/init/tickets/customize/+page.svelte +++ b/src/routes/(init)/init/tickets/customize/+page.svelte @@ -3,7 +3,7 @@ @@ -52,7 +62,7 @@ {#snippet link()} - + Back @@ -73,19 +83,13 @@ method="POST" class="mt-4 flex flex-1 flex-col gap-4" use:enhance={async () => { - saving = true; + formState.saving = true; return async ({ result, update }) => { if (result.type === 'success') { - originalName = name; - originalTitle = derivedTitle; - originalSticker = sticker; - saved = true; - saving = false; - - const timeout = setTimeout(() => { - saved = false; - }, 3000); + originalTicketData = updatedTicketData; + formState.saved = true; + formState.saving = false; } update({ reset: false }); }; @@ -98,9 +102,9 @@ >First name (editing = true)} - onblur={() => (editing = false)} + bind:value={originalTicketData.name} + onfocus={() => (formState.editing = true)} + onblur={() => (formState.editing = false)} type="text" name="name" class="bg-smooth border-offset w-full appearance-none rounded-lg border p-2" @@ -113,7 +117,7 @@ >Title (sticker = null)} + onclick={() => (originalTicketData.sticker = null)} />
(sticker = i)} + onclick={() => (originalTicketData.sticker = i)} />
- +
- + Front
- + Back