feat: upgrade app to svelte-5

This commit is contained in:
2024-11-02 17:21:04 +01:00
parent a87add30ff
commit fa659ab74e
12 changed files with 1754 additions and 7340 deletions

View File

@ -38,9 +38,9 @@
updateSettings($settings);
}
manager.on("settings", (settings) => {
settingTypes = settings.types;
$settings = settings.values;
manager.on("settings", (_settings) => {
settingTypes = _settings.types;
settings.set(_settings.values);
});
manager.on("result", (result) => {

View File

@ -24,6 +24,7 @@
<div class="wrapper">
<table>
<tbody>
<tr on:click={() => ($open.runtime = !$open.runtime)}>
<td>{$open.runtime ? "-" : "+"} runtime </td>
<td>{humanizeDuration(runtime || 1000)}</td>
@ -61,6 +62,7 @@
<td>faces </td>
<td>{humanizeNumber(faces || 0)}</td>
</tr>
</tbody>
</table>
</div>

View File

@ -6,10 +6,10 @@
type Button = { type: "button"; label?: string; callback: () => void };
type Input = NodeInput | Button;
type InputType = NodeInput | Button;
interface Nested {
[key: string]: (Nested & { __title?: string }) | Input;
[key: string]: (Nested & { __title?: string }) | InputType;
}
export let id: string;
@ -24,7 +24,7 @@
export let depth = 0;
const keys = Object.keys(settings).filter((key) => key !== "__title");
function isNodeInput(v: Input | Nested): v is Input {
function isNodeInput(v: InputType | Nested): v is InputType {
return v && "type" in v;
}
</script>