@immich/ui 0.34.1 → 0.35.0

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.
@@ -9,6 +9,8 @@ type ExtendsEmptyObject<T> = keyof T extends never ? never : T;
9
9
  type StripValueIfOptional<T> = T extends undefined ? undefined : T;
10
10
  type OptionalParamIfEmpty<T> = ExtendsEmptyObject<T> extends never ? [] | [Record<string, never> | undefined] : [T];
11
11
  declare class ModalManager {
12
+ #private;
13
+ get openCount(): number;
12
14
  show<T extends object>(Component: Component<T>, ...props: OptionalParamIfEmpty<Omit<T, 'onClose'>>): Promise<StripValueIfOptional<OnCloseData<T>>>;
13
15
  open<T extends object, K = OnCloseData<T>>(Component: Component<T>, ...props: OptionalParamIfEmpty<Omit<T, 'onClose'>>): {
14
16
  onClose: Promise<StripValueIfOptional<K>>;
@@ -1,6 +1,10 @@
1
1
  import { mount, unmount } from 'svelte';
2
2
  import ConfirmModal from '../components/ConfirmModal/ConfirmModal.svelte';
3
3
  class ModalManager {
4
+ #openCount = $state(0);
5
+ get openCount() {
6
+ return this.#openCount;
7
+ }
4
8
  show(Component, ...props) {
5
9
  return this.open(Component, ...props).onClose;
6
10
  }
@@ -10,6 +14,7 @@ class ModalManager {
10
14
  const deferred = new Promise((resolve) => {
11
15
  onClose = async (...args) => {
12
16
  await unmount(modal);
17
+ this.#openCount--;
13
18
  // make sure bits-ui clean up finishes before resolving
14
19
  setTimeout(() => resolve(args?.[0]), 10);
15
20
  };
@@ -20,6 +25,7 @@ class ModalManager {
20
25
  onClose,
21
26
  },
22
27
  });
28
+ this.#openCount++;
23
29
  });
24
30
  return {
25
31
  onClose: deferred,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.34.1",
3
+ "version": "0.35.0",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "scripts": {
6
6
  "create": "node scripts/create.js",
@@ -60,7 +60,6 @@
60
60
  "publint": "^0.3.0",
61
61
  "svelte": "^5.37.0",
62
62
  "svelte-check": "^4.0.0",
63
- "svelte-highlight": "^7.8.4",
64
63
  "tailwindcss": "^4.1.7",
65
64
  "typescript": "^5.0.0",
66
65
  "typescript-eslint": "^8.34.1",
@@ -68,6 +67,7 @@
68
67
  "vitest": "^3.0.0"
69
68
  },
70
69
  "dependencies": {
70
+ "svelte-highlight": "^7.8.4",
71
71
  "@mdi/js": "^7.4.47",
72
72
  "bits-ui": "^2.9.8",
73
73
  "luxon": "^3.7.2",