@immich/ui 0.52.0 → 0.53.1
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.
|
@@ -51,12 +51,11 @@
|
|
|
51
51
|
color="muted">{item.description}</Text
|
|
52
52
|
>
|
|
53
53
|
{/if}
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</div>
|
|
54
|
+
{#if item.type}
|
|
55
|
+
<div class="mt-2">
|
|
56
|
+
<Badge color="primary" size="small" shape="round">{item.type}</Badge>
|
|
57
|
+
</div>
|
|
58
|
+
{/if}
|
|
60
59
|
</div>
|
|
61
60
|
{#if renderedShortcuts.length > 0}
|
|
62
61
|
<div class="flex shrink-0 flex-col justify-end gap-1">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { matchesShortcut, shortcuts } from '../actions/shortcut.js';
|
|
2
2
|
import CommandPaletteModal from '../internal/CommandPaletteModal.svelte';
|
|
3
3
|
import { modalManager } from './modal-manager.svelte.js';
|
|
4
|
-
import { asArray, generateId, getSearchString } from '../utilities/internal.js';
|
|
4
|
+
import { asArray, generateId, getSearchString, isEnabled } from '../utilities/internal.js';
|
|
5
5
|
export const defaultProvider = ({ name, actions }) => ({
|
|
6
6
|
name,
|
|
7
7
|
onSearch: (query) => query ? actions.filter((action) => getSearchString(action).includes(query.toLowerCase())) : actions,
|
|
@@ -37,7 +37,10 @@ class CommandPaletteManager {
|
|
|
37
37
|
}
|
|
38
38
|
async #onSearch(query) {
|
|
39
39
|
const newItems = await Promise.all(this.#providers.map((provider) => Promise.resolve(provider.onSearch(query))));
|
|
40
|
-
this.#items = newItems
|
|
40
|
+
this.#items = newItems
|
|
41
|
+
.flat()
|
|
42
|
+
.filter((item) => isEnabled(item))
|
|
43
|
+
.map((item) => ({ ...item, id: generateId() }));
|
|
41
44
|
}
|
|
42
45
|
queryUpdate(query) {
|
|
43
46
|
if (!query) {
|
|
@@ -50,7 +53,7 @@ class CommandPaletteManager {
|
|
|
50
53
|
const actions = await Promise.all(this.#providers.map((provider) => Promise.resolve(provider.onSearch())));
|
|
51
54
|
for (const action of actions.flat()) {
|
|
52
55
|
const shortcuts = asArray(action.shortcuts);
|
|
53
|
-
if (shortcuts.some((shortcut) => matchesShortcut(event, shortcut))) {
|
|
56
|
+
if (shortcuts.some((shortcut) => matchesShortcut(event, shortcut)) && isEnabled(action)) {
|
|
54
57
|
action?.onAction(action);
|
|
55
58
|
}
|
|
56
59
|
}
|
package/dist/types.d.ts
CHANGED