@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
- <div class="mt-2">
55
- <Badge color="primary" size="small" shape="round">{item.type}</Badge>
56
- {#if item.isGlobal}
57
- <Badge color="warning" size="small" shape="round">Global</Badge>
58
- {/if}
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">
@@ -28,7 +28,6 @@ declare class CommandPaletteManager {
28
28
  ignoreInputFields?: boolean;
29
29
  preventDefault?: boolean;
30
30
  };
31
- isGlobal?: boolean;
32
31
  } & import("../types.js").IfLike & {
33
32
  id: string;
34
33
  })[];
@@ -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.flat().map((item) => ({ ...item, id: generateId() }));
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
@@ -259,7 +259,6 @@ export type ActionItem = {
259
259
  ignoreInputFields?: boolean;
260
260
  preventDefault?: boolean;
261
261
  };
262
- isGlobal?: boolean;
263
262
  } & IfLike;
264
263
  export type BreadcrumbsProps = {
265
264
  separator?: IconLike | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.52.0",
3
+ "version": "0.53.1",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",