@immich/ui 0.42.0 → 0.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CommandPalette/CommandPaletteContext.svelte +8 -2
- package/dist/components/CommandPalette/CommandPaletteItem.svelte +8 -12
- package/dist/components/Kbd/Kbd.svelte +2 -3
- package/dist/components/Kbd/Kbd.svelte.d.ts +1 -2
- package/dist/internal/CommandPaletteModal.svelte +1 -1
- package/dist/services/command-palette-manager.svelte.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { commandPaletteManager, type CommandItem } from '../../services/command-palette-manager.svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { untrack } from 'svelte';
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
commands?: CommandItem[];
|
|
@@ -9,5 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
const { commands = [], global }: Props = $props();
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
$effect(() => {
|
|
13
|
+
// prevent reactivity loop
|
|
14
|
+
const addCommands = (commands: CommandItem[], global?: boolean) =>
|
|
15
|
+
untrack(() => commandPaletteManager.addCommands(commands, { global }));
|
|
16
|
+
|
|
17
|
+
return addCommands(commands, global);
|
|
18
|
+
});
|
|
13
19
|
</script>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
{/if}
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
62
|
-
<div class="flex flex-col items-end">
|
|
62
|
+
<div class="flex flex-col items-end gap-1">
|
|
63
63
|
{#if onRemove}
|
|
64
64
|
<IconButton
|
|
65
65
|
size="small"
|
|
@@ -73,17 +73,13 @@
|
|
|
73
73
|
{:else}
|
|
74
74
|
<span class="shrink-0">[{item.type}]</span>
|
|
75
75
|
{/if}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{/each}
|
|
84
|
-
</div>
|
|
85
|
-
{/if}
|
|
86
|
-
</div>
|
|
76
|
+
{#if renderedShortcuts.length > 0}
|
|
77
|
+
<div class="flex justify-end gap-1">
|
|
78
|
+
{#each renderedShortcuts[0] as key (key)}
|
|
79
|
+
<Kbd size="small">{key}</Kbd>
|
|
80
|
+
{/each}
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
87
83
|
</div>
|
|
88
84
|
</div>
|
|
89
85
|
</Button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Size } from '../../types.js';
|
|
3
3
|
import { cleanClass } from '../../utilities/internal.js';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
size?: Size;
|
|
10
|
-
color?: Color;
|
|
11
10
|
class?: string;
|
|
12
11
|
children?: Snippet;
|
|
13
12
|
} & HTMLAttributes<HTMLElement>;
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
const { class: className, size = 'small', children, ...restProps }: Props = $props();
|
|
16
15
|
|
|
17
16
|
const styles = tv({
|
|
18
|
-
base: 'bg-subtle
|
|
17
|
+
base: 'bg-subtle rounded-md border border-b-2 px-1 py-0.5 font-mono shadow',
|
|
19
18
|
variants: {
|
|
20
19
|
size: {
|
|
21
20
|
tiny: 'text-xs',
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Size } from '../../types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
type Props = {
|
|
5
5
|
size?: Size;
|
|
6
|
-
color?: Color;
|
|
7
6
|
class?: string;
|
|
8
7
|
children?: Snippet;
|
|
9
8
|
} & HTMLAttributes<HTMLElement>;
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
|
|
90
90
|
{#if commandPaletteManager.results.length > 0}
|
|
91
91
|
<div class="flex flex-col">
|
|
92
|
-
{#each commandPaletteManager.results as item, i (
|
|
92
|
+
{#each commandPaletteManager.results as item, i (item.id)}
|
|
93
93
|
<CommandPaletteItem
|
|
94
94
|
{item}
|
|
95
95
|
selected={commandPaletteManager.selectedIndex === i}
|
|
@@ -2,7 +2,7 @@ import { type Shortcut } from '../actions/shortcut.js';
|
|
|
2
2
|
import type { MaybeArray, TranslationProps } from '../types.js';
|
|
3
3
|
export type CommandItem = {
|
|
4
4
|
icon: string;
|
|
5
|
-
iconClass
|
|
5
|
+
iconClass?: string;
|
|
6
6
|
type: string;
|
|
7
7
|
title: string;
|
|
8
8
|
description?: string;
|