diff --git a/icons.config.js b/icons.config.js index b4d2411c..14b62b14 100644 --- a/icons.config.js +++ b/icons.config.js @@ -4,6 +4,7 @@ const config = { "node_modules/@fontsource-variable/material-symbols-rounded/files/material-symbols-rounded-latin-full-normal.woff2", outputPath: "src/lib/assets/icons.min.woff2", icons: [ + "deployed_code_update", "adjust", "add", "piano", diff --git a/package.json b/package.json index a202caaa..9cfc44fc 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@types/flexsearch": "^0.7.6", "@types/w3c-web-serial": "^1.0.6", "@types/w3c-web-usb": "^1.0.10", + "@types/wicg-file-system-access": "^2023.10.5", "@vite-pwa/sveltekit": "^0.6.0", "autoprefixer": "^10.4.19", "codemirror": "^6.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e75c44c6..e1cbbec3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,9 @@ importers: '@types/w3c-web-usb': specifier: ^1.0.10 version: 1.0.10 + '@types/wicg-file-system-access': + specifier: ^2023.10.5 + version: 2023.10.5 '@vite-pwa/sveltekit': specifier: ^0.6.0 version: 0.6.0(@sveltejs/kit@2.5.18(@sveltejs/vite-plugin-svelte@3.1.1(svelte@5.0.0-next.221)(vite@5.3.5(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1)))(svelte@5.0.0-next.221)(vite@5.3.5(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1)))(vite-plugin-pwa@0.20.1(vite@5.3.5(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(workbox-build@7.1.1)(workbox-window@7.1.0)) @@ -1408,6 +1411,9 @@ packages: '@types/w3c-web-usb@1.0.10': resolution: {integrity: sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==} + '@types/wicg-file-system-access@2023.10.5': + resolution: {integrity: sha512-e9kZO9kCdLqT2h9Tw38oGv9UNzBBWaR1MzuAavxPcsV/7FJ3tWbU6RI3uB+yKIDPGLkGVbplS52ub0AcRLvrhA==} + '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} @@ -5537,6 +5543,8 @@ snapshots: '@types/w3c-web-usb@1.0.10': {} + '@types/wicg-file-system-access@2023.10.5': {} + '@types/yauzl@2.10.3': dependencies: '@types/node': 20.14.10 diff --git a/src/lib/PageTransition.svelte b/src/lib/PageTransition.svelte new file mode 100644 index 00000000..c3ad7a01 --- /dev/null +++ b/src/lib/PageTransition.svelte @@ -0,0 +1,55 @@ + + +{#if !isNavigating} +
+ {@render children()} +
+{/if} + + diff --git a/src/lib/serial/connection.ts b/src/lib/serial/connection.ts index 2e6cd1a7..f16cc428 100644 --- a/src/lib/serial/connection.ts +++ b/src/lib/serial/connection.ts @@ -53,11 +53,13 @@ export interface ProgressInfo { } export const syncProgress = writable(undefined); -export async function initSerial(manual = false) { +export async function initSerial(manual = false, withSync = true) { const device = get(serialPort) ?? new CharaDevice(); await device.init(manual); serialPort.set(device); - await sync(); + if (withSync) { + await sync(); + } } export async function sync() { diff --git a/src/routes/(app)/PageTransition.svelte b/src/routes/(app)/PageTransition.svelte index 70bc372d..840a94d6 100644 --- a/src/routes/(app)/PageTransition.svelte +++ b/src/routes/(app)/PageTransition.svelte @@ -14,27 +14,26 @@ let isNavigating = $state(false); const routeOrder = [ - "/config/chords/", - "/config/layout/", - "/config/settings/", + "/config", + "/learn", + "/docs", + "/editor", + "/chat", + "/plugin", ]; + function routeIndex(route: string | undefined): number { + return routeOrder.findIndex((it) => route?.startsWith(it)); + } + beforeNavigate((navigation) => { - const from = navigation.from?.url.pathname; - const to = navigation.to?.url.pathname; - if (from === to) return; + const from = routeIndex(navigation.from?.url.pathname); + const to = routeIndex(navigation.to?.url.pathname); + if (from === -1 || to === -1 || from === to) return; isNavigating = true; - if (!(from && to && routeOrder.includes(from) && routeOrder.includes(to))) { - inDirection = 0; - outDirection = 0; - } else { - const fromIndex = routeOrder.indexOf(from); - const toIndex = routeOrder.indexOf(to); - - inDirection = fromIndex > toIndex ? -1 : 1; - outDirection = fromIndex > toIndex ? 1 : -1; - } + inDirection = from > to ? -1 : 1; + outDirection = from > to ? 1 : -1; animationDone = new Promise((resolve) => { outroEnd = resolve; @@ -49,8 +48,8 @@ {#if !isNavigating}
{@render children()} diff --git a/src/routes/(app)/config/+layout.svelte b/src/routes/(app)/config/+layout.svelte index 3a999c29..c4059d8d 100644 --- a/src/routes/(app)/config/+layout.svelte +++ b/src/routes/(app)/config/+layout.svelte @@ -1,5 +1,6 @@ + +{#if !isNavigating} +
+ {@render children()} +
+{/if} + + diff --git a/src/routes/(app)/config/settings/+page.svelte b/src/routes/(app)/config/settings/+page.svelte index 5c47bb08..28e1fc4e 100644 --- a/src/routes/(app)/config/settings/+page.svelte +++ b/src/routes/(app)/config/settings/+page.svelte @@ -315,7 +315,7 @@ } input[type="checkbox"] { - font-size: 12px; + font-size: 12px !important; } fieldset { diff --git a/src/routes/(app)/ota-update/+page.svelte b/src/routes/(app)/ota-update/+page.svelte index 92c7ee36..86aa8c9f 100644 --- a/src/routes/(app)/ota-update/+page.svelte +++ b/src/routes/(app)/ota-update/+page.svelte @@ -4,15 +4,6 @@ let { data } = $props(); - let files: FileList | null = $state(null); - - $effect(() => { - const file = files?.[0]; - if (file && $serialPort) { - $serialPort.updateFirmware(file); - } - }); - let currentDevice = $derived( $serialPort ? `${$serialPort.device.toLowerCase()}_${$serialPort.chipset.toLowerCase()}` @@ -34,8 +25,6 @@ {/if} - -