mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-07 10:32:49 +00:00
update dependencies
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<!--{@html webManifestLink}-->
|
||||
{@html webManifestLink}
|
||||
<title>{$LL.TITLE()}</title>
|
||||
<meta name="description" content={$LL.DESCRIPTION()} />
|
||||
<meta name="theme-color" content={data.themeColor} />
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { browser } from "$app/environment";
|
||||
import { page } from "$app/stores";
|
||||
import { userPreferences } from "$lib/preferences";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
onMount(async () => {
|
||||
if (browser && !$userPreferences.autoConnect) {
|
||||
connectButton.click();
|
||||
}
|
||||
});
|
||||
|
||||
const routes = [
|
||||
[
|
||||
@@ -114,6 +105,7 @@
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
|
||||
transition: all 250ms ease;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { fly } from "svelte/transition";
|
||||
import { afterNavigate, beforeNavigate } from "$app/navigation";
|
||||
import { expoIn, expoOut } from "svelte/easing";
|
||||
import type { Snippet } from "svelte";
|
||||
import { type Snippet } from "svelte";
|
||||
|
||||
let { children }: { children: Snippet } = $props();
|
||||
|
||||
let inDirection = $state(0);
|
||||
let outDirection = $state(0);
|
||||
let outroEnd: undefined | (() => void) = $state(undefined);
|
||||
let done: undefined | (() => void) = $state(undefined);
|
||||
let animationDone: Promise<void>;
|
||||
|
||||
let isNavigating = $state(false);
|
||||
@@ -19,6 +19,10 @@
|
||||
"/config/layout/",
|
||||
];
|
||||
|
||||
function outroEnd() {
|
||||
done?.();
|
||||
}
|
||||
|
||||
beforeNavigate((navigation) => {
|
||||
const from = navigation.from?.url.pathname;
|
||||
const to = navigation.to?.url.pathname;
|
||||
@@ -37,7 +41,7 @@
|
||||
}
|
||||
|
||||
animationDone = new Promise((resolve) => {
|
||||
outroEnd = resolve;
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,7 +53,12 @@
|
||||
|
||||
{#if !isNavigating}
|
||||
<main
|
||||
in:fly={{ y: inDirection * 24, duration: 150, easing: expoOut }}
|
||||
in:fly={{
|
||||
y: inDirection * 24,
|
||||
duration: 150,
|
||||
delay: 1, // flicker for some reason without this
|
||||
easing: expoOut,
|
||||
}}
|
||||
out:fly={{ y: outDirection * 24, duration: 150, easing: expoIn }}
|
||||
onoutroend={outroEnd}
|
||||
>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
id.splice(id.indexOf(0), 1);
|
||||
id.push(0);
|
||||
while ($chords.some((it) => JSON.stringify(it.id) === JSON.stringify(id))) {
|
||||
id[id.length - 1]!++;
|
||||
id[id.length - 1] = id[id.length - 1]! + 1;
|
||||
}
|
||||
|
||||
changes.update((changes) => {
|
||||
|
||||
@@ -155,30 +155,31 @@
|
||||
doc: examplePlugin,
|
||||
});
|
||||
});
|
||||
let channels = $derived(
|
||||
$serialPort
|
||||
? ({
|
||||
getVersion: async (..._args: unknown[]) => $serialPort.version,
|
||||
getDevice: async (..._args: unknown[]) => $serialPort.device,
|
||||
commit: async (..._args: unknown[]) => {
|
||||
if (
|
||||
confirm(
|
||||
"Perform a commit? Settings are already applied until the next reboot.\n\n" +
|
||||
"Excessive commits can lead to premature breakdowns, as the settings storage is only rated for 10,000-25,000 commits.\n\n" +
|
||||
"Click OK to perform the commit anyways.",
|
||||
)
|
||||
) {
|
||||
return $serialPort.commit();
|
||||
}
|
||||
},
|
||||
...Object.fromEntries(
|
||||
charaMethods.map(
|
||||
(it) => [it, $serialPort[it].bind($serialPort)] as const,
|
||||
),
|
||||
),
|
||||
} satisfies Record<string, Function>)
|
||||
: ({} as any),
|
||||
);
|
||||
|
||||
let channels = $derived.by(() => {
|
||||
if (!$serialPort) return {} as any;
|
||||
return {
|
||||
getVersion: (..._args: unknown[]) => Promise.resolve($serialPort.version),
|
||||
getDevice: (..._args: unknown[]) => Promise.resolve($serialPort.device),
|
||||
commit: (..._args: unknown[]) => {
|
||||
if (
|
||||
confirm(
|
||||
"Perform a commit? Settings are already applied until the next reboot.\n\n" +
|
||||
"Excessive commits can lead to premature breakdowns, as the settings storage is only rated for 10,000-25,000 commits.\n\n" +
|
||||
"Click OK to perform the commit anyways.",
|
||||
)
|
||||
) {
|
||||
return Promise.resolve($serialPort.commit());
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
...Object.fromEntries(
|
||||
charaMethods.map(
|
||||
(it) => [it, $serialPort[it].bind($serialPort)] as const,
|
||||
),
|
||||
),
|
||||
} satisfies Record<string, Function>;
|
||||
});
|
||||
|
||||
async function onMessage(event: MessageEvent) {
|
||||
if (event.origin !== "null" || event.source !== frame.contentWindow) return;
|
||||
|
||||
Reference in New Issue
Block a user