@surdeddd/wmkit 0.1.0 → 0.2.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.
Files changed (54) hide show
  1. package/README.md +14 -2
  2. package/README.ru.md +8 -2
  3. package/dist/{controller-D5zIriLg.d.ts → binder-BY-saDUB.d.cts} +9 -3
  4. package/dist/{controller-B0bogK9N.d.cts → binder-D9UEE1SM.d.ts} +9 -3
  5. package/dist/{chunk-7HHDQEBI.js → chunk-2TVOEDRG.js} +368 -247
  6. package/dist/chunk-2TVOEDRG.js.map +1 -0
  7. package/dist/{chunk-KWLI7JIY.cjs → chunk-KQCVZ2W7.cjs} +368 -247
  8. package/dist/chunk-KQCVZ2W7.cjs.map +1 -0
  9. package/dist/index.cjs +15 -15
  10. package/dist/index.d.cts +7 -4
  11. package/dist/index.d.ts +7 -4
  12. package/dist/index.js +1 -1
  13. package/dist/persist.cjs +1 -1
  14. package/dist/persist.cjs.map +1 -1
  15. package/dist/persist.d.cts +1 -1
  16. package/dist/persist.d.ts +1 -1
  17. package/dist/persist.js +1 -1
  18. package/dist/persist.js.map +1 -1
  19. package/dist/popout.cjs +1 -1
  20. package/dist/popout.cjs.map +1 -1
  21. package/dist/popout.d.cts +1 -1
  22. package/dist/popout.d.ts +1 -1
  23. package/dist/popout.js +1 -1
  24. package/dist/popout.js.map +1 -1
  25. package/dist/react.cjs +3 -3
  26. package/dist/react.cjs.map +1 -1
  27. package/dist/react.d.cts +2 -2
  28. package/dist/react.d.ts +2 -2
  29. package/dist/react.js +1 -1
  30. package/dist/react.js.map +1 -1
  31. package/dist/solid.cjs +3 -3
  32. package/dist/solid.cjs.map +1 -1
  33. package/dist/solid.d.cts +2 -2
  34. package/dist/solid.d.ts +2 -2
  35. package/dist/solid.js +1 -1
  36. package/dist/solid.js.map +1 -1
  37. package/dist/svelte.cjs +4 -4
  38. package/dist/svelte.cjs.map +1 -1
  39. package/dist/svelte.d.cts +2 -2
  40. package/dist/svelte.d.ts +2 -2
  41. package/dist/svelte.js +2 -2
  42. package/dist/svelte.js.map +1 -1
  43. package/dist/themes/glass.css +0 -1
  44. package/dist/{types-CtFzL_oA.d.cts → types-Bkrq2djr.d.cts} +9 -2
  45. package/dist/{types-CtFzL_oA.d.ts → types-Bkrq2djr.d.ts} +9 -2
  46. package/dist/vue.cjs +3 -3
  47. package/dist/vue.cjs.map +1 -1
  48. package/dist/vue.d.cts +2 -2
  49. package/dist/vue.d.ts +2 -2
  50. package/dist/vue.js +1 -1
  51. package/dist/vue.js.map +1 -1
  52. package/package.json +5 -5
  53. package/dist/chunk-7HHDQEBI.js.map +0 -1
  54. package/dist/chunk-KWLI7JIY.cjs.map +0 -1
package/dist/react.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkKWLI7JIY_cjs = require('./chunk-KWLI7JIY.cjs');
3
+ var chunkKQCVZ2W7_cjs = require('./chunk-KQCVZ2W7.cjs');
4
4
  var react = require('react');
5
5
 
6
6
  function useWindowManager(options) {
7
- const [wm] = react.useState(() => chunkKWLI7JIY_cjs.createWindowManager(options));
7
+ const [wm] = react.useState(() => chunkKQCVZ2W7_cjs.createWindowManager(options));
8
8
  react.useEffect(() => () => wm.destroy(), [wm]);
9
9
  return wm;
10
10
  }
@@ -17,7 +17,7 @@ function useWmWindow(wm, id) {
17
17
  }
18
18
  function useDesktop(wm, options) {
19
19
  const optionsRef = react.useRef(options);
20
- const binder = react.useMemo(() => chunkKWLI7JIY_cjs.createDesktopBinder(wm, optionsRef.current), [wm]);
20
+ const binder = react.useMemo(() => chunkKQCVZ2W7_cjs.createDesktopBinder(wm, optionsRef.current), [wm]);
21
21
  const cleanupRef = react.useRef(null);
22
22
  const ref = react.useCallback(
23
23
  (node) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react.ts"],"names":["useState","createWindowManager","useEffect","useSyncExternalStore","useCallback","useRef","useMemo","createDesktopBinder"],"mappings":";;;;;AAaO,SAAS,iB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,OAAO,EAAE,GAAA,EAAK,MAAA,EAAQ,UAAA,EAAY,OAAO,UAAA,EAAW;AACtD;AAEO,SAAS,cAAA,CACd,MAAA,EACA,EAAA,EACA,OAAA,EACY;AACZ,EAAA,MAAM,UAAA,GAAaC,aAAO,OAAO,CAAA;AACjC,EAAA,MAAM,UAAA,GAAaA,aAA4B,IAAI,CAAA;AACnD,EAAA,OAAOD,iBAAA;AAAA,IACL,CAAC,IAAA,KAAS;AACR,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,IAAA,EAAM,WAAW,OAAO,CAAA;AAAA,MACrE,CAAA,MAAO;AACL,QAAA,UAAA,CAAW,OAAA,IAAU;AACrB,QAAA,UAAA,CAAW,OAAA,GAAU,IAAA;AAAA,MACvB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,QAAQ,EAAE;AAAA,GACb;AACF","file":"react.cjs","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopController,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nexport type ElementRef = (node: HTMLElement | null) => void\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const [wm] = useState(() => createWindowManager(options))\n useEffect(() => () => wm.destroy(), [wm])\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ManagerState {\n return useSyncExternalStore(wm.subscribe, wm.getState, wm.getState)\n}\n\nexport function useWmWindow(wm: WindowManager, id: string): WindowState | undefined {\n const getSnapshot = useCallback(() => wm.get(id), [wm, id])\n return useSyncExternalStore(wm.subscribe, getSnapshot, getSnapshot)\n}\n\nexport interface UseDesktopResult {\n ref: ElementRef\n binder: DesktopBinder\n controller(): DesktopController | null\n}\n\nexport function useDesktop(wm: WindowManager, options?: DesktopOptions): UseDesktopResult {\n const optionsRef = useRef(options)\n const binder = useMemo(() => createDesktopBinder(wm, optionsRef.current), [wm])\n const cleanupRef = useRef<(() => void) | null>(null)\n const ref = useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindDesktop(node)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder],\n )\n return { ref, binder, controller: binder.controller }\n}\n\nexport function useWmWindowRef(\n binder: DesktopBinder,\n id: string,\n options?: WindowAttachOptions,\n): ElementRef {\n const optionsRef = useRef(options)\n const cleanupRef = useRef<(() => void) | null>(null)\n return useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindWindow(id, node, optionsRef.current)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder, id],\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/react.ts"],"names":["useState","createWindowManager","useEffect","useSyncExternalStore","useCallback","useRef","useMemo","createDesktopBinder"],"mappings":";;;;;AAQO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,CAAC,EAAE,CAAA,GAAIA,eAAS,MAAMC,qCAAA,CAAoB,OAAO,CAAC,CAAA;AACxD,EAAAC,eAAA,CAAU,MAAM,MAAM,EAAA,CAAG,SAAQ,EAAG,CAAC,EAAE,CAAC,CAAA;AACxC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAAiC;AAC1D,EAAA,OAAOC,2BAAqB,EAAA,CAAG,SAAA,EAAW,EAAA,CAAG,QAAA,EAAU,GAAG,QAAQ,CAAA;AACpE;AAEO,SAAS,WAAA,CAAY,IAAmB,EAAA,EAAqC;AAClF,EAAA,MAAM,WAAA,GAAcC,iBAAA,CAAY,MAAM,EAAA,CAAG,GAAA,CAAI,EAAE,CAAA,EAAG,CAAC,EAAA,EAAI,EAAE,CAAC,CAAA;AAC1D,EAAA,OAAOD,0BAAA,CAAqB,EAAA,CAAG,SAAA,E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file":"react.cjs","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopController, DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nexport type ElementRef = (node: HTMLElement | null) => void\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const [wm] = useState(() => createWindowManager(options))\n useEffect(() => () => wm.destroy(), [wm])\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ManagerState {\n return useSyncExternalStore(wm.subscribe, wm.getState, wm.getState)\n}\n\nexport function useWmWindow(wm: WindowManager, id: string): WindowState | undefined {\n const getSnapshot = useCallback(() => wm.get(id), [wm, id])\n return useSyncExternalStore(wm.subscribe, getSnapshot, getSnapshot)\n}\n\nexport interface UseDesktopResult {\n ref: ElementRef\n binder: DesktopBinder\n controller(): DesktopController | null\n}\n\nexport function useDesktop(wm: WindowManager, options?: DesktopOptions): UseDesktopResult {\n const optionsRef = useRef(options)\n const binder = useMemo(() => createDesktopBinder(wm, optionsRef.current), [wm])\n const cleanupRef = useRef<(() => void) | null>(null)\n const ref = useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindDesktop(node)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder],\n )\n return { ref, binder, controller: binder.controller }\n}\n\nexport function useWmWindowRef(\n binder: DesktopBinder,\n id: string,\n options?: WindowAttachOptions,\n): ElementRef {\n const optionsRef = useRef(options)\n const cleanupRef = useRef<(() => void) | null>(null)\n return useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindWindow(id, node, optionsRef.current)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder, id],\n )\n}\n"]}
package/dist/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.cjs';
2
- import { D as DesktopBinder, b as DesktopController, d as DesktopOptions, W as WindowAttachOptions } from './controller-B0bogK9N.cjs';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.cjs';
2
+ import { D as DesktopBinder, a as DesktopController, b as DesktopOptions, W as WindowAttachOptions } from './binder-BY-saDUB.cjs';
3
3
 
4
4
  type ElementRef = (node: HTMLElement | null) => void;
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.js';
2
- import { D as DesktopBinder, b as DesktopController, d as DesktopOptions, W as WindowAttachOptions } from './controller-D5zIriLg.js';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.js';
2
+ import { D as DesktopBinder, a as DesktopController, b as DesktopOptions, W as WindowAttachOptions } from './binder-D9UEE1SM.js';
3
3
 
4
4
  type ElementRef = (node: HTMLElement | null) => void;
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createWindowManager, createDesktopBinder } from './chunk-7HHDQEBI.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-2TVOEDRG.js';
2
2
  import { useState, useEffect, useSyncExternalStore, useCallback, useRef, useMemo } from 'react';
3
3
 
4
4
  function useWindowManager(options) {
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react.ts"],"names":[],"mappings":";;;AAaO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,CAAC,EAAE,CAAA,GAAI,SAAS,MAAM,mBAAA,CAAoB,OAAO,CAAC,CAAA;AACxD,EAAA,SAAA,CAAU,MAAM,MAAM,EAAA,CAAG,SAAQ,EAAG,CAAC,EAA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AAM,UAAA,GAAa,OAA4B,IAAI,CAAA;AACnD,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,IAAA,KAAS;AACR,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,IAAA,EAAM,WAAW,OAAO,CAAA;AAAA,MACrE,CAAA,MAAO;AACL,QAAA,UAAA,CAAW,OAAA,IAAU;AACrB,QAAA,UAAA,CAAW,OAAA,GAAU,IAAA;AAAA,MACvB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,QAAQ,EAAE;AAAA,GACb;AACF","file":"react.js","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopController,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nexport type ElementRef = (node: HTMLElement | null) => void\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const [wm] = useState(() => createWindowManager(options))\n useEffect(() => () => wm.destroy(), [wm])\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ManagerState {\n return useSyncExternalStore(wm.subscribe, wm.getState, wm.getState)\n}\n\nexport function useWmWindow(wm: WindowManager, id: string): WindowState | undefined {\n const getSnapshot = useCallback(() => wm.get(id), [wm, id])\n return useSyncExternalStore(wm.subscribe, getSnapshot, getSnapshot)\n}\n\nexport interface UseDesktopResult {\n ref: ElementRef\n binder: DesktopBinder\n controller(): DesktopController | null\n}\n\nexport function useDesktop(wm: WindowManager, options?: DesktopOptions): UseDesktopResult {\n const optionsRef = useRef(options)\n const binder = useMemo(() => createDesktopBinder(wm, optionsRef.current), [wm])\n const cleanupRef = useRef<(() => void) | null>(null)\n const ref = useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindDesktop(node)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder],\n )\n return { ref, binder, controller: binder.controller }\n}\n\nexport function useWmWindowRef(\n binder: DesktopBinder,\n id: string,\n options?: WindowAttachOptions,\n): ElementRef {\n const optionsRef = useRef(options)\n const cleanupRef = useRef<(() => void) | null>(null)\n return useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindWindow(id, node, optionsRef.current)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder, id],\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/react.ts"],"names":[],"mappings":";;;AAQO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,CAAC,EAAE,CAAA,GAAI,SAAS,MAAM,mBAAA,CAAoB,OAAO,CAAC,CAAA;AACxD,EAAA,SAAA,CAAU,MAAM,MAAM,EAAA,CAAG,SAAQ,EAAG,CAAC,EAAE,CAAC,CAAA;AACxC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAAiC;AAC1D,EAAA,OAAO,qBAAqB,EAAA,CAAG,SAAA,EAAW,EAAA,CAAG,QAAA,EAAU,GAAG,QAAQ,CAAA;AACpE;AAEO,SAAS,WAAA,CAAY,IAAmB,EAAA,EAAqC;AAClF,EAAA,MAAM,WAAA,GAAc,WAAA,CAAY,MAAM,EAAA,CAAG,GAAA,CAAI,EAAE,CAAA,EAAG,CAAC,EAAA,EAAI,EAAE,CAAC,CAAA;AAC1D,EAAA,OAAO,oBAAA,CAAqB,EAAA,CAAG,SAAA,EAAW,WAAA,EAAa,WAAW,CAAA;AACpE;AAQO,SAAS,UAAA,CAAW,IAAmB,OAAA,EAA4C;AACxF,EAAA,MAAM,UAAA,GAAa,OAAO,OAAO,CAAA;AACjC,EAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAM,mBAAA,CAAoB,EAAA,EAAI,WAAW,OAAO,CAAA,EAAG,CAAC,EAAE,CAAC,CAAA;AAC9E,EAAA,MAAM,UAAA,GAAa,OAA4B,IAAI,CAAA;AACnD,EAAA,MAAM,GAAA,GAAM,WAAA;AAAA,IACV,CAAC,IAAA,KAAS;AACR,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,OAAA,GAAU,MAAA,CAAO,WAAA,CAAY,IAAI,CAAA;AAAA,MAC9C,CAAA,MAAO;AACL,QAAA,UAAA,CAAW,OAAA,IAAU;AACrB,QAAA,UAAA,CAAW,OAAA,GAAU,IAAA;AAAA,MACvB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACA,EAAA,OAAO,EAAE,GAAA,EAAK,MAAA,EAAQ,UAAA,EAAY,OAAO,UAAA,EAAW;AACtD;AAEO,SAAS,cAAA,CACd,MAAA,EACA,EAAA,EACA,OAAA,EACY;AACZ,EAAA,MAAM,UAAA,GAAa,OAAO,OAAO,CAAA;AACjC,EAAA,MAAM,UAAA,GAAa,OAA4B,IAAI,CAAA;AACnD,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,IAAA,KAAS;AACR,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,IAAA,EAAM,WAAW,OAAO,CAAA;AAAA,MACrE,CAAA,MAAO;AACL,QAAA,UAAA,CAAW,OAAA,IAAU;AACrB,QAAA,UAAA,CAAW,OAAA,GAAU,IAAA;AAAA,MACvB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,QAAQ,EAAE;AAAA,GACb;AACF","file":"react.js","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopController, DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nexport type ElementRef = (node: HTMLElement | null) => void\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const [wm] = useState(() => createWindowManager(options))\n useEffect(() => () => wm.destroy(), [wm])\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ManagerState {\n return useSyncExternalStore(wm.subscribe, wm.getState, wm.getState)\n}\n\nexport function useWmWindow(wm: WindowManager, id: string): WindowState | undefined {\n const getSnapshot = useCallback(() => wm.get(id), [wm, id])\n return useSyncExternalStore(wm.subscribe, getSnapshot, getSnapshot)\n}\n\nexport interface UseDesktopResult {\n ref: ElementRef\n binder: DesktopBinder\n controller(): DesktopController | null\n}\n\nexport function useDesktop(wm: WindowManager, options?: DesktopOptions): UseDesktopResult {\n const optionsRef = useRef(options)\n const binder = useMemo(() => createDesktopBinder(wm, optionsRef.current), [wm])\n const cleanupRef = useRef<(() => void) | null>(null)\n const ref = useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindDesktop(node)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder],\n )\n return { ref, binder, controller: binder.controller }\n}\n\nexport function useWmWindowRef(\n binder: DesktopBinder,\n id: string,\n options?: WindowAttachOptions,\n): ElementRef {\n const optionsRef = useRef(options)\n const cleanupRef = useRef<(() => void) | null>(null)\n return useCallback<ElementRef>(\n (node) => {\n if (node) {\n cleanupRef.current = binder.bindWindow(id, node, optionsRef.current)\n } else {\n cleanupRef.current?.()\n cleanupRef.current = null\n }\n },\n [binder, id],\n )\n}\n"]}
package/dist/solid.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkKWLI7JIY_cjs = require('./chunk-KWLI7JIY.cjs');
3
+ var chunkKQCVZ2W7_cjs = require('./chunk-KQCVZ2W7.cjs');
4
4
  var solidJs = require('solid-js');
5
5
 
6
6
  function disposeWithOwner(dispose) {
7
7
  if (solidJs.getOwner()) solidJs.onCleanup(dispose);
8
8
  }
9
9
  function useWindowManager(options) {
10
- const wm = chunkKWLI7JIY_cjs.createWindowManager(options);
10
+ const wm = chunkKQCVZ2W7_cjs.createWindowManager(options);
11
11
  disposeWithOwner(() => wm.destroy());
12
12
  return wm;
13
13
  }
@@ -21,7 +21,7 @@ function useWmWindow(wm, id) {
21
21
  return () => state().windows[typeof id === "function" ? id() : id];
22
22
  }
23
23
  function createDesktop(wm, options) {
24
- const binder = chunkKWLI7JIY_cjs.createDesktopBinder(wm, options);
24
+ const binder = chunkKQCVZ2W7_cjs.createDesktopBinder(wm, options);
25
25
  return {
26
26
  binder,
27
27
  desktop(element) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/solid.ts"],"names":["getOwner","onCleanup","createWindowManager","createSignal","createDesktopBinder","options"],"mappings":";;;;;AAUA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAIA,gBAAA,EAAS,EAAGC,iBAAA,CAAU,OAAO,CAAA;AACnC;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAKC,sCAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA2C;AACpE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,IAAIC,oBAAA,CAAa,EAAA,CAAG,UAAU,CAAA;AACpD,EAAA,gBAAA,CAAiB,GAAG,SAAA,CAAU,CAAC,SAAS,QAAA,CAAS,IAAI,CAAC,CAAC,CAAA;AACvD,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACmC;AACnC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,MAAM,OAAM,CAAE,OAAA,CAAQ,OAAO,EAAA,KAAO,UAAA,GAAa,EAAA,EAAG,GAAI,EAAE,CAAA;AACnE;AAQO,SAAS,aAAA,CAAc,IAAmB,OAAA,EAAwC;AACvF,EAAA,MAAM,MAAA,GAASC,qCAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,QAAQ,OAAA,EAAS;AACf,MAAA,MAAM,MAAA,GAAS,MAAA,CAAO,WAAA,CAAY,OAAO,CAAA;AACzC,MAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,MAAA,CAAO,IAAIC,QAAAA,EAAS;AAClB,MAAA,OAAO,CAAC,OAAA,KAAY;AAClB,QAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,SAASA,QAAO,CAAA;AACrD,QAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,MACzB,CAAA;AAAA,IACF;AAAA,GACF;AACF","file":"solid.cjs","sourcesContent":["import { type Accessor, createSignal, getOwner, onCleanup } from 'solid-js'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nfunction disposeWithOwner(dispose: () => void): void {\n if (getOwner()) onCleanup(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithOwner(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): Accessor<ManagerState> {\n const [state, setState] = createSignal(wm.getState())\n disposeWithOwner(wm.subscribe((next) => setState(next)))\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: string | Accessor<string>,\n): Accessor<WindowState | undefined> {\n const state = useWmState(wm)\n return () => state().windows[typeof id === 'function' ? id() : id]\n}\n\nexport interface SolidDesktop {\n binder: DesktopBinder\n desktop(element: HTMLElement): void\n window(id: string, options?: WindowAttachOptions): (element: HTMLElement) => void\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SolidDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(element) {\n const unbind = binder.bindDesktop(element)\n disposeWithOwner(unbind)\n },\n window(id, options) {\n return (element) => {\n const unbind = binder.bindWindow(id, element, options)\n disposeWithOwner(unbind)\n }\n },\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/solid.ts"],"names":["getOwner","onCleanup","createWindowManager","createSignal","createDesktopBinder","options"],"mappings":";;;;;AAMA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAIA,gBAAA,EAAS,EAAGC,iBAAA,CAAU,OAAO,CAAA;AACnC;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAKC,sCAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA2C;AACpE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,IAAIC,oBAAA,CAAa,EAAA,CAAG,UAAU,CAAA;AACpD,EAAA,gBAAA,CAAiB,GAAG,SAAA,CAAU,CAAC,SAAS,QAAA,CAAS,IAAI,CAAC,CAAC,CAAA;AACvD,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACmC;AACnC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,MAAM,OAAM,CAAE,OAAA,CAAQ,OAAO,EAAA,KAAO,UAAA,GAAa,EAAA,EAAG,GAAI,EAAE,CAAA;AACnE;AAQO,SAAS,aAAA,CAAc,IAAmB,OAAA,EAAwC;AACvF,EAAA,MAAM,MAAA,GAASC,qCAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,QAAQ,OAAA,EAAS;AACf,MAAA,MAAM,MAAA,GAAS,MAAA,CAAO,WAAA,CAAY,OAAO,CAAA;AACzC,MAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,MAAA,CAAO,IAAIC,QAAAA,EAAS;AAClB,MAAA,OAAO,CAAC,OAAA,KAAY;AAClB,QAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,SAASA,QAAO,CAAA;AACrD,QAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,MACzB,CAAA;AAAA,IACF;AAAA,GACF;AACF","file":"solid.cjs","sourcesContent":["import { type Accessor, createSignal, getOwner, onCleanup } from 'solid-js'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nfunction disposeWithOwner(dispose: () => void): void {\n if (getOwner()) onCleanup(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithOwner(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): Accessor<ManagerState> {\n const [state, setState] = createSignal(wm.getState())\n disposeWithOwner(wm.subscribe((next) => setState(next)))\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: string | Accessor<string>,\n): Accessor<WindowState | undefined> {\n const state = useWmState(wm)\n return () => state().windows[typeof id === 'function' ? id() : id]\n}\n\nexport interface SolidDesktop {\n binder: DesktopBinder\n desktop(element: HTMLElement): void\n window(id: string, options?: WindowAttachOptions): (element: HTMLElement) => void\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SolidDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(element) {\n const unbind = binder.bindDesktop(element)\n disposeWithOwner(unbind)\n },\n window(id, options) {\n return (element) => {\n const unbind = binder.bindWindow(id, element, options)\n disposeWithOwner(unbind)\n }\n },\n }\n}\n"]}
package/dist/solid.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.cjs';
3
- import { D as DesktopBinder, W as WindowAttachOptions, d as DesktopOptions } from './controller-B0bogK9N.cjs';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.cjs';
3
+ import { D as DesktopBinder, W as WindowAttachOptions, b as DesktopOptions } from './binder-BY-saDUB.cjs';
4
4
 
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
6
6
  declare function useWmState(wm: WindowManager): Accessor<ManagerState>;
package/dist/solid.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.js';
3
- import { D as DesktopBinder, W as WindowAttachOptions, d as DesktopOptions } from './controller-D5zIriLg.js';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.js';
3
+ import { D as DesktopBinder, W as WindowAttachOptions, b as DesktopOptions } from './binder-D9UEE1SM.js';
4
4
 
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
6
6
  declare function useWmState(wm: WindowManager): Accessor<ManagerState>;
package/dist/solid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createWindowManager, createDesktopBinder } from './chunk-7HHDQEBI.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-2TVOEDRG.js';
2
2
  import { createSignal, getOwner, onCleanup } from 'solid-js';
3
3
 
4
4
  function disposeWithOwner(dispose) {
package/dist/solid.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/solid.ts"],"names":["options"],"mappings":";;;AAUA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAI,QAAA,EAAS,EAAG,SAAA,CAAU,OAAO,CAAA;AACnC;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAK,oBAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA2C;AACpE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,IAAI,YAAA,CAAa,EAAA,CAAG,UAAU,CAAA;AACpD,EAAA,gBAAA,CAAiB,GAAG,SAAA,CAAU,CAAC,SAAS,QAAA,CAAS,IAAI,CAAC,CAAC,CAAA;AACvD,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACmC;AACnC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,MAAM,OAAM,CAAE,OAAA,CAAQ,OAAO,EAAA,KAAO,UAAA,GAAa,EAAA,EAAG,GAAI,EAAE,CAAA;AACnE;AAQO,SAAS,aAAA,CAAc,IAAmB,OAAA,EAAwC;AACvF,EAAA,MAAM,MAAA,GAAS,mBAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,QAAQ,OAAA,EAAS;AACf,MAAA,MAAM,MAAA,GAAS,MAAA,CAAO,WAAA,CAAY,OAAO,CAAA;AACzC,MAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,MAAA,CAAO,IAAIA,QAAAA,EAAS;AAClB,MAAA,OAAO,CAAC,OAAA,KAAY;AAClB,QAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,SAASA,QAAO,CAAA;AACrD,QAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,MACzB,CAAA;AAAA,IACF;AAAA,GACF;AACF","file":"solid.js","sourcesContent":["import { type Accessor, createSignal, getOwner, onCleanup } from 'solid-js'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nfunction disposeWithOwner(dispose: () => void): void {\n if (getOwner()) onCleanup(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithOwner(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): Accessor<ManagerState> {\n const [state, setState] = createSignal(wm.getState())\n disposeWithOwner(wm.subscribe((next) => setState(next)))\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: string | Accessor<string>,\n): Accessor<WindowState | undefined> {\n const state = useWmState(wm)\n return () => state().windows[typeof id === 'function' ? id() : id]\n}\n\nexport interface SolidDesktop {\n binder: DesktopBinder\n desktop(element: HTMLElement): void\n window(id: string, options?: WindowAttachOptions): (element: HTMLElement) => void\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SolidDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(element) {\n const unbind = binder.bindDesktop(element)\n disposeWithOwner(unbind)\n },\n window(id, options) {\n return (element) => {\n const unbind = binder.bindWindow(id, element, options)\n disposeWithOwner(unbind)\n }\n },\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/solid.ts"],"names":["options"],"mappings":";;;AAMA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAI,QAAA,EAAS,EAAG,SAAA,CAAU,OAAO,CAAA;AACnC;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAK,oBAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA2C;AACpE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,IAAI,YAAA,CAAa,EAAA,CAAG,UAAU,CAAA;AACpD,EAAA,gBAAA,CAAiB,GAAG,SAAA,CAAU,CAAC,SAAS,QAAA,CAAS,IAAI,CAAC,CAAC,CAAA;AACvD,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACmC;AACnC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,MAAM,OAAM,CAAE,OAAA,CAAQ,OAAO,EAAA,KAAO,UAAA,GAAa,EAAA,EAAG,GAAI,EAAE,CAAA;AACnE;AAQO,SAAS,aAAA,CAAc,IAAmB,OAAA,EAAwC;AACvF,EAAA,MAAM,MAAA,GAAS,mBAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,QAAQ,OAAA,EAAS;AACf,MAAA,MAAM,MAAA,GAAS,MAAA,CAAO,WAAA,CAAY,OAAO,CAAA;AACzC,MAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,IACzB,CAAA;AAAA,IACA,MAAA,CAAO,IAAIA,QAAAA,EAAS;AAClB,MAAA,OAAO,CAAC,OAAA,KAAY;AAClB,QAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,EAAA,EAAI,SAASA,QAAO,CAAA;AACrD,QAAA,gBAAA,CAAiB,MAAM,CAAA;AAAA,MACzB,CAAA;AAAA,IACF;AAAA,GACF;AACF","file":"solid.js","sourcesContent":["import { type Accessor, createSignal, getOwner, onCleanup } from 'solid-js'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nfunction disposeWithOwner(dispose: () => void): void {\n if (getOwner()) onCleanup(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithOwner(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): Accessor<ManagerState> {\n const [state, setState] = createSignal(wm.getState())\n disposeWithOwner(wm.subscribe((next) => setState(next)))\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: string | Accessor<string>,\n): Accessor<WindowState | undefined> {\n const state = useWmState(wm)\n return () => state().windows[typeof id === 'function' ? id() : id]\n}\n\nexport interface SolidDesktop {\n binder: DesktopBinder\n desktop(element: HTMLElement): void\n window(id: string, options?: WindowAttachOptions): (element: HTMLElement) => void\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SolidDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(element) {\n const unbind = binder.bindDesktop(element)\n disposeWithOwner(unbind)\n },\n window(id, options) {\n return (element) => {\n const unbind = binder.bindWindow(id, element, options)\n disposeWithOwner(unbind)\n }\n },\n }\n}\n"]}
package/dist/svelte.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkKWLI7JIY_cjs = require('./chunk-KWLI7JIY.cjs');
3
+ var chunkKQCVZ2W7_cjs = require('./chunk-KQCVZ2W7.cjs');
4
4
 
5
- // src/svelte.ts
5
+ // src/adapters/svelte.ts
6
6
  function createManager(options) {
7
- return chunkKWLI7JIY_cjs.createWindowManager(options);
7
+ return chunkKQCVZ2W7_cjs.createWindowManager(options);
8
8
  }
9
9
  function wmStore(wm) {
10
10
  return {
@@ -30,7 +30,7 @@ function wmWindowStore(wm, id) {
30
30
  };
31
31
  }
32
32
  function createDesktop(wm, options) {
33
- const binder = chunkKWLI7JIY_cjs.createDesktopBinder(wm, options);
33
+ const binder = chunkKQCVZ2W7_cjs.createDesktopBinder(wm, options);
34
34
  return {
35
35
  binder,
36
36
  desktop(node) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/svelte.ts"],"names":["createWindowManager","createDesktopBinder"],"mappings":";;;;;AAsBO,SAAS,cAAc,OAAA,EAAyC;AACrE,EAAA,OAAOA,sCAAoB,OAAO,CAAA;AACpC;AAEO,SA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AW,IAAA,CAAK,EAAA,EAAI,MAAM,IAAI,CAAA;AAAA,QAChD,CAAA;AAAA,QACA,OAAA,GAAU;AACR,UAAA,MAAA,EAAO;AAAA,QACT;AAAA,OACF;AAAA,IACF;AAAA,GACF;AACF","file":"svelte.cjs","sourcesContent":["import { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nexport interface ReadableStore<T> {\n subscribe(run: (value: T) => void): () => void\n}\n\nexport interface ActionResult {\n update?(params: WindowActionParams): void\n destroy(): void\n}\n\nexport interface WindowActionParams extends WindowAttachOptions {\n id: string\n}\n\nexport function createManager(options?: ManagerOptions): WindowManager {\n return createWindowManager(options)\n}\n\nexport function wmStore(wm: WindowManager): ReadableStore<ManagerState> {\n return {\n subscribe(run) {\n run(wm.getState())\n return wm.subscribe(run)\n },\n }\n}\n\nexport function wmWindowStore(\n wm: WindowManager,\n id: string,\n): ReadableStore<WindowState | undefined> {\n return {\n subscribe(run) {\n run(wm.get(id))\n let last = wm.get(id)\n return wm.subscribe(() => {\n const next = wm.get(id)\n if (next !== last) {\n last = next\n run(next)\n }\n })\n },\n }\n}\n\nexport interface SvelteDesktop {\n binder: DesktopBinder\n desktop(node: HTMLElement): ActionResult\n window(node: HTMLElement, params: WindowActionParams): ActionResult\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SvelteDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(node) {\n const unbind = binder.bindDesktop(node)\n return { destroy: unbind }\n },\n window(node, params) {\n let unbind = binder.bindWindow(params.id, node, params)\n return {\n update(next) {\n unbind()\n unbind = binder.bindWindow(next.id, node, next)\n },\n destroy() {\n unbind()\n },\n }\n },\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/svelte.ts"],"names":["createWindowManager","createDesktopBinder"],"mappings":";;;;;AA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OAAO,IAAA,EAAM;AACX,UAAA,MAAA,EAAO;AACP,UAAA,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,IAAA,CAAK,EAAA,EAAI,MAAM,IAAI,CAAA;AAAA,QAChD,CAAA;AAAA,QACA,OAAA,GAAU;AACR,UAAA,MAAA,EAAO;AAAA,QACT;AAAA,OACF;AAAA,IACF;AAAA,GACF;AACF","file":"svelte.cjs","sourcesContent":["import { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nexport interface ReadableStore<T> {\n subscribe(run: (value: T) => void): () => void\n}\n\nexport interface ActionResult {\n update?(params: WindowActionParams): void\n destroy(): void\n}\n\nexport interface WindowActionParams extends WindowAttachOptions {\n id: string\n}\n\nexport function createManager(options?: ManagerOptions): WindowManager {\n return createWindowManager(options)\n}\n\nexport function wmStore(wm: WindowManager): ReadableStore<ManagerState> {\n return {\n subscribe(run) {\n run(wm.getState())\n return wm.subscribe(run)\n },\n }\n}\n\nexport function wmWindowStore(\n wm: WindowManager,\n id: string,\n): ReadableStore<WindowState | undefined> {\n return {\n subscribe(run) {\n run(wm.get(id))\n let last = wm.get(id)\n return wm.subscribe(() => {\n const next = wm.get(id)\n if (next !== last) {\n last = next\n run(next)\n }\n })\n },\n }\n}\n\nexport interface SvelteDesktop {\n binder: DesktopBinder\n desktop(node: HTMLElement): ActionResult\n window(node: HTMLElement, params: WindowActionParams): ActionResult\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SvelteDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(node) {\n const unbind = binder.bindDesktop(node)\n return { destroy: unbind }\n },\n window(node, params) {\n let unbind = binder.bindWindow(params.id, node, params)\n return {\n update(next) {\n unbind()\n unbind = binder.bindWindow(next.id, node, next)\n },\n destroy() {\n unbind()\n },\n }\n },\n }\n}\n"]}
package/dist/svelte.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.cjs';
2
- import { W as WindowAttachOptions, D as DesktopBinder, d as DesktopOptions } from './controller-B0bogK9N.cjs';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.cjs';
2
+ import { W as WindowAttachOptions, D as DesktopBinder, b as DesktopOptions } from './binder-BY-saDUB.cjs';
3
3
 
4
4
  interface ReadableStore<T> {
5
5
  subscribe(run: (value: T) => void): () => void;
package/dist/svelte.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.js';
2
- import { W as WindowAttachOptions, D as DesktopBinder, d as DesktopOptions } from './controller-D5zIriLg.js';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.js';
2
+ import { W as WindowAttachOptions, D as DesktopBinder, b as DesktopOptions } from './binder-D9UEE1SM.js';
3
3
 
4
4
  interface ReadableStore<T> {
5
5
  subscribe(run: (value: T) => void): () => void;
package/dist/svelte.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createWindowManager, createDesktopBinder } from './chunk-7HHDQEBI.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-2TVOEDRG.js';
2
2
 
3
- // src/svelte.ts
3
+ // src/adapters/svelte.ts
4
4
  function createManager(options) {
5
5
  return createWindowManager(options);
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/svelte.ts"],"names":[],"mappings":";;;AAsBO,SAAS,cAAc,OAAA,EAAyC;AACrE,EAAA,OAAO,oBAAoB,OAAO,CAAA;AACpC;AAEO,SAAS,QAAQ,EAAA,EAAgD;AACtE,EAAA,OAAO;AAAA,IACL,UAAU,GAAA,EAAK;AACb,MAAA,GAAA,CAAI,EAAA,CAAG,UAAU,CAAA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ACT;AAAA,OACF;AAAA,IACF;AAAA,GACF;AACF","file":"svelte.js","sourcesContent":["import { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nexport interface ReadableStore<T> {\n subscribe(run: (value: T) => void): () => void\n}\n\nexport interface ActionResult {\n update?(params: WindowActionParams): void\n destroy(): void\n}\n\nexport interface WindowActionParams extends WindowAttachOptions {\n id: string\n}\n\nexport function createManager(options?: ManagerOptions): WindowManager {\n return createWindowManager(options)\n}\n\nexport function wmStore(wm: WindowManager): ReadableStore<ManagerState> {\n return {\n subscribe(run) {\n run(wm.getState())\n return wm.subscribe(run)\n },\n }\n}\n\nexport function wmWindowStore(\n wm: WindowManager,\n id: string,\n): ReadableStore<WindowState | undefined> {\n return {\n subscribe(run) {\n run(wm.get(id))\n let last = wm.get(id)\n return wm.subscribe(() => {\n const next = wm.get(id)\n if (next !== last) {\n last = next\n run(next)\n }\n })\n },\n }\n}\n\nexport interface SvelteDesktop {\n binder: DesktopBinder\n desktop(node: HTMLElement): ActionResult\n window(node: HTMLElement, params: WindowActionParams): ActionResult\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SvelteDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(node) {\n const unbind = binder.bindDesktop(node)\n return { destroy: unbind }\n },\n window(node, params) {\n let unbind = binder.bindWindow(params.id, node, params)\n return {\n update(next) {\n unbind()\n unbind = binder.bindWindow(next.id, node, next)\n },\n destroy() {\n unbind()\n },\n }\n },\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/svelte.ts"],"names":[],"mappings":";;;AAkBO,SAAS,cAAc,OAAA,EAAyC;AACrE,EAAA,OAAO,oBAAoB,OAAO,CAAA;AACpC;AAEO,SAAS,QAAQ,EAAA,EAAgD;AACtE,EAAA,OAAO;AAAA,IACL,UAAU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CAAA;AAAA,QACA,OAAA,GAAU;AACR,UAAA,MAAA,EAAO;AAAA,QACT;AAAA,OACF;AAAA,IACF;AAAA,GACF;AACF","file":"svelte.js","sourcesContent":["import { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nexport interface ReadableStore<T> {\n subscribe(run: (value: T) => void): () => void\n}\n\nexport interface ActionResult {\n update?(params: WindowActionParams): void\n destroy(): void\n}\n\nexport interface WindowActionParams extends WindowAttachOptions {\n id: string\n}\n\nexport function createManager(options?: ManagerOptions): WindowManager {\n return createWindowManager(options)\n}\n\nexport function wmStore(wm: WindowManager): ReadableStore<ManagerState> {\n return {\n subscribe(run) {\n run(wm.getState())\n return wm.subscribe(run)\n },\n }\n}\n\nexport function wmWindowStore(\n wm: WindowManager,\n id: string,\n): ReadableStore<WindowState | undefined> {\n return {\n subscribe(run) {\n run(wm.get(id))\n let last = wm.get(id)\n return wm.subscribe(() => {\n const next = wm.get(id)\n if (next !== last) {\n last = next\n run(next)\n }\n })\n },\n }\n}\n\nexport interface SvelteDesktop {\n binder: DesktopBinder\n desktop(node: HTMLElement): ActionResult\n window(node: HTMLElement, params: WindowActionParams): ActionResult\n}\n\nexport function createDesktop(wm: WindowManager, options?: DesktopOptions): SvelteDesktop {\n const binder = createDesktopBinder(wm, options)\n return {\n binder,\n desktop(node) {\n const unbind = binder.bindDesktop(node)\n return { destroy: unbind }\n },\n window(node, params) {\n let unbind = binder.bindWindow(params.id, node, params)\n return {\n update(next) {\n unbind()\n unbind = binder.bindWindow(next.id, node, next)\n },\n destroy() {\n unbind()\n },\n }\n },\n }\n}\n"]}
@@ -29,7 +29,6 @@
29
29
  box-shadow: var(--wm-shadow);
30
30
  outline: none;
31
31
  contain: layout style;
32
- will-change: transform;
33
32
  transition:
34
33
  transform var(--wm-transition),
35
34
  width var(--wm-transition),
@@ -54,9 +54,16 @@ interface ManagerState {
54
54
  focusedId: string | null;
55
55
  viewport: Size;
56
56
  }
57
+ interface SerializedMaxSize {
58
+ width: number | null;
59
+ height: number | null;
60
+ }
61
+ interface SerializedWindowState extends Omit<WindowState, 'maxSize'> {
62
+ maxSize: SerializedMaxSize | null;
63
+ }
57
64
  interface SerializedState {
58
65
  version: 1;
59
- windows: WindowState[];
66
+ windows: SerializedWindowState[];
60
67
  order: string[];
61
68
  focusedId: string | null;
62
69
  }
@@ -148,4 +155,4 @@ interface WindowManager {
148
155
  destroy(): void;
149
156
  }
150
157
 
151
- export type { Bounds as B, ManagerOptions as M, SerializedState as S, WindowManager as W, ManagerEvents as a, ManagerState as b, Size as c, SnapZone as d, WindowFlags as e, WindowInit as f, WindowLayer as g, WindowStage as h, WindowState as i, WindowUpdate as j };
158
+ export type { Bounds as B, ManagerOptions as M, SerializedMaxSize as S, WindowManager as W, ManagerState as a, WindowState as b, ManagerEvents as c, SerializedState as d, SerializedWindowState as e, Size as f, SnapZone as g, WindowFlags as h, WindowInit as i, WindowLayer as j, WindowStage as k, WindowUpdate as l };
@@ -54,9 +54,16 @@ interface ManagerState {
54
54
  focusedId: string | null;
55
55
  viewport: Size;
56
56
  }
57
+ interface SerializedMaxSize {
58
+ width: number | null;
59
+ height: number | null;
60
+ }
61
+ interface SerializedWindowState extends Omit<WindowState, 'maxSize'> {
62
+ maxSize: SerializedMaxSize | null;
63
+ }
57
64
  interface SerializedState {
58
65
  version: 1;
59
- windows: WindowState[];
66
+ windows: SerializedWindowState[];
60
67
  order: string[];
61
68
  focusedId: string | null;
62
69
  }
@@ -148,4 +155,4 @@ interface WindowManager {
148
155
  destroy(): void;
149
156
  }
150
157
 
151
- export type { Bounds as B, ManagerOptions as M, SerializedState as S, WindowManager as W, ManagerEvents as a, ManagerState as b, Size as c, SnapZone as d, WindowFlags as e, WindowInit as f, WindowLayer as g, WindowStage as h, WindowState as i, WindowUpdate as j };
158
+ export type { Bounds as B, ManagerOptions as M, SerializedMaxSize as S, WindowManager as W, ManagerState as a, WindowState as b, ManagerEvents as c, SerializedState as d, SerializedWindowState as e, Size as f, SnapZone as g, WindowFlags as h, WindowInit as i, WindowLayer as j, WindowStage as k, WindowUpdate as l };
package/dist/vue.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkKWLI7JIY_cjs = require('./chunk-KWLI7JIY.cjs');
3
+ var chunkKQCVZ2W7_cjs = require('./chunk-KQCVZ2W7.cjs');
4
4
  var vue = require('vue');
5
5
 
6
6
  function disposeWithScope(dispose) {
7
7
  if (vue.getCurrentScope()) vue.onScopeDispose(dispose);
8
8
  }
9
9
  function useWindowManager(options) {
10
- const wm = chunkKWLI7JIY_cjs.createWindowManager(options);
10
+ const wm = chunkKQCVZ2W7_cjs.createWindowManager(options);
11
11
  disposeWithScope(() => wm.destroy());
12
12
  return wm;
13
13
  }
@@ -25,7 +25,7 @@ function useWmWindow(wm, id) {
25
25
  return vue.computed(() => state.value.windows[vue.toValue(id)]);
26
26
  }
27
27
  function useDesktop(wm, target, options) {
28
- const binder = chunkKWLI7JIY_cjs.createDesktopBinder(wm, options);
28
+ const binder = chunkKQCVZ2W7_cjs.createDesktopBinder(wm, options);
29
29
  vue.watch(
30
30
  target,
31
31
  (element, _previous, onCleanup) => {
package/dist/vue.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vue.ts"],"names":["getCurrentScope","onScopeDispose","createWindowManager","shallowRef","computed","toValue","createDesktopBinder","watch"],"mappings":";;;;;AAqBA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAIA,mBAAA,EAAgB,EAAGC,kBAAA,CAAe,OAAO,CAAA;AAC/C;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAKC,sCAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC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AS,OAAO,CAAC,CAAA;AAAA,IAClF,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACF","file":"vue.cjs","sourcesContent":["import {\n type ComputedRef,\n computed,\n getCurrentScope,\n type MaybeRefOrGetter,\n onScopeDispose,\n type Ref,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from 'vue'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nfunction disposeWithScope(dispose: () => void): void {\n if (getCurrentScope()) onScopeDispose(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithScope(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ShallowRef<ManagerState> {\n const state = shallowRef(wm.getState())\n disposeWithScope(\n wm.subscribe((next) => {\n state.value = next\n }),\n )\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: MaybeRefOrGetter<string>,\n): ComputedRef<WindowState | undefined> {\n const state = useWmState(wm)\n return computed(() => state.value.windows[toValue(id)])\n}\n\nexport function useDesktop(\n wm: WindowManager,\n target: Ref<HTMLElement | null | undefined>,\n options?: DesktopOptions,\n): DesktopBinder {\n const binder = createDesktopBinder(wm, options)\n watch(\n target,\n (element, _previous, onCleanup) => {\n if (element) onCleanup(binder.bindDesktop(element))\n },\n { immediate: true, flush: 'post' },\n )\n return binder\n}\n\nexport function useWmWindowEl(\n binder: DesktopBinder,\n id: MaybeRefOrGetter<string>,\n target: Ref<HTMLElement | null | undefined>,\n options?: WindowAttachOptions,\n): void {\n watch(\n [target, () => toValue(id)],\n ([element, windowId], _previous, onCleanup) => {\n if (element && windowId) onCleanup(binder.bindWindow(windowId, element, options))\n },\n { immediate: true, flush: 'post' },\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/vue.ts"],"names":["getCurrentScope","onScopeDispose","createWindowManager","shallowRef","computed","toValue","createDesktopBinder","watch"],"mappings":";;;;;AAiBA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAIA,mBAAA,EAAgB,EAAGC,kBAAA,CAAe,OAAO,CAAA;AAC/C;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAKC,sCAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA6C;AACtE,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAW,EAAA,CAAG,QAAA,EAAU,CAAA;AACtC,EAAA,gBAAA;AAAA,IACE,EAAA,CAAG,SAAA,CAAU,CAAC,IAAA,KAAS;AACrB,MAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,IAChB,CAAC;AAAA,GACH;AACA,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACsC;AACtC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAOC,YAAA,CAAS,MAAM,KAAA,CAAM,KAAA,CAAM,QAAQC,WAAA,CAAQ,EAAE,CAAC,CAAC,CAAA;AACxD;AAEO,SAAS,UAAA,CACd,EAAA,EACA,MAAA,EACA,OAAA,EACe;AACf,EAAA,MAAM,MAAA,GAASC,qCAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAAC,SAAA;AAAA,IACE,MAAA;AAAA,IACA,CAAC,OAAA,EAAS,SAAA,EAAW,SAAA,KAAc;AACjC,MAAA,IAAI,OAAA,EAAS,SAAA,CAAU,MAAA,CAAO,WAAA,CAAY,OAAO,CAAC,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACA,EAAA,OAAO,MAAA;AACT;AAEO,SAAS,aAAA,CACd,MAAA,EACA,EAAA,EACA,MAAA,EACA,OAAA,EACM;AACN,EAAAA,SAAA;AAAA,IACE,CAAC,MAAA,EAAQ,MAAMF,WAAA,CAAQ,EAAE,CAAC,CAAA;AAAA,IAC1B,CAAC,CAAC,OAAA,EAAS,QAAQ,CAAA,EAAG,WAAW,SAAA,KAAc;AAC7C,MAAA,IAAI,OAAA,IAAW,UAAU,SAAA,CAAU,MAAA,CAAO,WAAW,QAAA,EAAU,OAAA,EAAS,OAAO,CAAC,CAAA;AAAA,IAClF,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACF","file":"vue.cjs","sourcesContent":["import {\n type ComputedRef,\n computed,\n getCurrentScope,\n type MaybeRefOrGetter,\n onScopeDispose,\n type Ref,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from 'vue'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nfunction disposeWithScope(dispose: () => void): void {\n if (getCurrentScope()) onScopeDispose(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithScope(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ShallowRef<ManagerState> {\n const state = shallowRef(wm.getState())\n disposeWithScope(\n wm.subscribe((next) => {\n state.value = next\n }),\n )\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: MaybeRefOrGetter<string>,\n): ComputedRef<WindowState | undefined> {\n const state = useWmState(wm)\n return computed(() => state.value.windows[toValue(id)])\n}\n\nexport function useDesktop(\n wm: WindowManager,\n target: Ref<HTMLElement | null | undefined>,\n options?: DesktopOptions,\n): DesktopBinder {\n const binder = createDesktopBinder(wm, options)\n watch(\n target,\n (element, _previous, onCleanup) => {\n if (element) onCleanup(binder.bindDesktop(element))\n },\n { immediate: true, flush: 'post' },\n )\n return binder\n}\n\nexport function useWmWindowEl(\n binder: DesktopBinder,\n id: MaybeRefOrGetter<string>,\n target: Ref<HTMLElement | null | undefined>,\n options?: WindowAttachOptions,\n): void {\n watch(\n [target, () => toValue(id)],\n ([element, windowId], _previous, onCleanup) => {\n if (element && windowId) onCleanup(binder.bindWindow(windowId, element, options))\n },\n { immediate: true, flush: 'post' },\n )\n}\n"]}
package/dist/vue.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Ref, ShallowRef, MaybeRefOrGetter, ComputedRef } from 'vue';
2
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.cjs';
3
- import { d as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './controller-B0bogK9N.cjs';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.cjs';
3
+ import { b as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-BY-saDUB.cjs';
4
4
 
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
6
6
  declare function useWmState(wm: WindowManager): ShallowRef<ManagerState>;
package/dist/vue.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Ref, ShallowRef, MaybeRefOrGetter, ComputedRef } from 'vue';
2
- import { W as WindowManager, M as ManagerOptions, b as ManagerState, i as WindowState } from './types-CtFzL_oA.js';
3
- import { d as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './controller-D5zIriLg.js';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-Bkrq2djr.js';
3
+ import { b as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-D9UEE1SM.js';
4
4
 
5
5
  declare function useWindowManager(options?: ManagerOptions): WindowManager;
6
6
  declare function useWmState(wm: WindowManager): ShallowRef<ManagerState>;
package/dist/vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createWindowManager, createDesktopBinder } from './chunk-7HHDQEBI.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-2TVOEDRG.js';
2
2
  import { shallowRef, computed, toValue, watch, getCurrentScope, onScopeDispose } from 'vue';
3
3
 
4
4
  function disposeWithScope(dispose) {
package/dist/vue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vue.ts"],"names":[],"mappings":";;;AAqBA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAI,eAAA,EAAgB,EAAG,cAAA,CAAe,OAAO,CAAA;AAC/C;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAK,oBAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA6C;AACtE,EAAA,MAAM,KAAA,GAAQ,UAAA,CAAW,EAAA,CAAG,QAAA,EAAU,CAAA;AACtC,EAAA,gBAAA;AAAA,IACE,EAAA,CAAG,SAAA,CAAU,CAAC,IAAA,KAAS;AACrB,MAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,IAChB,CAAC;AAAA,GACH;AACA,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACsC;AACtC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,QAAA,CAAS,MAAM,KAAA,CAAM,KAAA,CAAM,QAAQ,OAAA,CAAQ,EAAE,CAAC,CAAC,CAAA;AACxD;AAEO,SAAS,UAAA,CACd,EAAA,EACA,MAAA,EACA,OAAA,EACe;AACf,EAAA,MAAM,MAAA,GAAS,mBAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,KAAA;AAAA,IACE,MAAA;AAAA,IACA,CAAC,OAAA,EAAS,SAAA,EAAW,SAAA,KAAc;AACjC,MAAA,IAAI,OAAA,EAAS,SAAA,CAAU,MAAA,CAAO,WAAA,CAAY,OAAO,CAAC,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACA,EAAA,OAAO,MAAA;AACT;AAEO,SAAS,aAAA,CACd,MAAA,EACA,EAAA,EACA,MAAA,EACA,OAAA,EACM;AACN,EAAA,KAAA;AAAA,IACE,CAAC,MAAA,EAAQ,MAAM,OAAA,CAAQ,EAAE,CAAC,CAAA;AAAA,IAC1B,CAAC,CAAC,OAAA,EAAS,QAAQ,CAAA,EAAG,WAAW,SAAA,KAAc;AAC7C,MAAA,IAAI,OAAA,IAAW,UAAU,SAAA,CAAU,MAAA,CAAO,WAAW,QAAA,EAAU,OAAA,EAAS,OAAO,CAAC,CAAA;AAAA,IAClF,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACF","file":"vue.js","sourcesContent":["import {\n type ComputedRef,\n computed,\n getCurrentScope,\n type MaybeRefOrGetter,\n onScopeDispose,\n type Ref,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from 'vue'\nimport { createWindowManager } from './core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from './core/types'\nimport {\n createDesktopBinder,\n type DesktopBinder,\n type DesktopOptions,\n type WindowAttachOptions,\n} from './dom/controller'\n\nfunction disposeWithScope(dispose: () => void): void {\n if (getCurrentScope()) onScopeDispose(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithScope(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ShallowRef<ManagerState> {\n const state = shallowRef(wm.getState())\n disposeWithScope(\n wm.subscribe((next) => {\n state.value = next\n }),\n )\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: MaybeRefOrGetter<string>,\n): ComputedRef<WindowState | undefined> {\n const state = useWmState(wm)\n return computed(() => state.value.windows[toValue(id)])\n}\n\nexport function useDesktop(\n wm: WindowManager,\n target: Ref<HTMLElement | null | undefined>,\n options?: DesktopOptions,\n): DesktopBinder {\n const binder = createDesktopBinder(wm, options)\n watch(\n target,\n (element, _previous, onCleanup) => {\n if (element) onCleanup(binder.bindDesktop(element))\n },\n { immediate: true, flush: 'post' },\n )\n return binder\n}\n\nexport function useWmWindowEl(\n binder: DesktopBinder,\n id: MaybeRefOrGetter<string>,\n target: Ref<HTMLElement | null | undefined>,\n options?: WindowAttachOptions,\n): void {\n watch(\n [target, () => toValue(id)],\n ([element, windowId], _previous, onCleanup) => {\n if (element && windowId) onCleanup(binder.bindWindow(windowId, element, options))\n },\n { immediate: true, flush: 'post' },\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/vue.ts"],"names":[],"mappings":";;;AAiBA,SAAS,iBAAiB,OAAA,EAA2B;AACnD,EAAA,IAAI,eAAA,EAAgB,EAAG,cAAA,CAAe,OAAO,CAAA;AAC/C;AAEO,SAAS,iBAAiB,OAAA,EAAyC;AACxE,EAAA,MAAM,EAAA,GAAK,oBAAoB,OAAO,CAAA;AACtC,EAAA,gBAAA,CAAiB,MAAM,EAAA,CAAG,OAAA,EAAS,CAAA;AACnC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,WAAW,EAAA,EAA6C;AACtE,EAAA,MAAM,KAAA,GAAQ,UAAA,CAAW,EAAA,CAAG,QAAA,EAAU,CAAA;AACtC,EAAA,gBAAA;AAAA,IACE,EAAA,CAAG,SAAA,CAAU,CAAC,IAAA,KAAS;AACrB,MAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,IAChB,CAAC;AAAA,GACH;AACA,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,WAAA,CACd,IACA,EAAA,EACsC;AACtC,EAAA,MAAM,KAAA,GAAQ,WAAW,EAAE,CAAA;AAC3B,EAAA,OAAO,QAAA,CAAS,MAAM,KAAA,CAAM,KAAA,CAAM,QAAQ,OAAA,CAAQ,EAAE,CAAC,CAAC,CAAA;AACxD;AAEO,SAAS,UAAA,CACd,EAAA,EACA,MAAA,EACA,OAAA,EACe;AACf,EAAA,MAAM,MAAA,GAAS,mBAAA,CAAoB,EAAA,EAAI,OAAO,CAAA;AAC9C,EAAA,KAAA;AAAA,IACE,MAAA;AAAA,IACA,CAAC,OAAA,EAAS,SAAA,EAAW,SAAA,KAAc;AACjC,MAAA,IAAI,OAAA,EAAS,SAAA,CAAU,MAAA,CAAO,WAAA,CAAY,OAAO,CAAC,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACA,EAAA,OAAO,MAAA;AACT;AAEO,SAAS,aAAA,CACd,MAAA,EACA,EAAA,EACA,MAAA,EACA,OAAA,EACM;AACN,EAAA,KAAA;AAAA,IACE,CAAC,MAAA,EAAQ,MAAM,OAAA,CAAQ,EAAE,CAAC,CAAA;AAAA,IAC1B,CAAC,CAAC,OAAA,EAAS,QAAQ,CAAA,EAAG,WAAW,SAAA,KAAc;AAC7C,MAAA,IAAI,OAAA,IAAW,UAAU,SAAA,CAAU,MAAA,CAAO,WAAW,QAAA,EAAU,OAAA,EAAS,OAAO,CAAC,CAAA;AAAA,IAClF,CAAA;AAAA,IACA,EAAE,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,MAAA;AAAO,GACnC;AACF","file":"vue.js","sourcesContent":["import {\n type ComputedRef,\n computed,\n getCurrentScope,\n type MaybeRefOrGetter,\n onScopeDispose,\n type Ref,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from 'vue'\nimport { createWindowManager } from '../core/manager'\nimport type { ManagerOptions, ManagerState, WindowManager, WindowState } from '../core/types'\nimport { createDesktopBinder, type DesktopBinder } from '../dom/binder'\nimport type { DesktopOptions, WindowAttachOptions } from '../dom/shared'\n\nfunction disposeWithScope(dispose: () => void): void {\n if (getCurrentScope()) onScopeDispose(dispose)\n}\n\nexport function useWindowManager(options?: ManagerOptions): WindowManager {\n const wm = createWindowManager(options)\n disposeWithScope(() => wm.destroy())\n return wm\n}\n\nexport function useWmState(wm: WindowManager): ShallowRef<ManagerState> {\n const state = shallowRef(wm.getState())\n disposeWithScope(\n wm.subscribe((next) => {\n state.value = next\n }),\n )\n return state\n}\n\nexport function useWmWindow(\n wm: WindowManager,\n id: MaybeRefOrGetter<string>,\n): ComputedRef<WindowState | undefined> {\n const state = useWmState(wm)\n return computed(() => state.value.windows[toValue(id)])\n}\n\nexport function useDesktop(\n wm: WindowManager,\n target: Ref<HTMLElement | null | undefined>,\n options?: DesktopOptions,\n): DesktopBinder {\n const binder = createDesktopBinder(wm, options)\n watch(\n target,\n (element, _previous, onCleanup) => {\n if (element) onCleanup(binder.bindDesktop(element))\n },\n { immediate: true, flush: 'post' },\n )\n return binder\n}\n\nexport function useWmWindowEl(\n binder: DesktopBinder,\n id: MaybeRefOrGetter<string>,\n target: Ref<HTMLElement | null | undefined>,\n options?: WindowAttachOptions,\n): void {\n watch(\n [target, () => toValue(id)],\n ([element, windowId], _previous, onCleanup) => {\n if (element && windowId) onCleanup(binder.bindWindow(windowId, element, options))\n },\n { immediate: true, flush: 'post' },\n )\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surdeddd/wmkit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Headless, framework-agnostic window manager for the web — draggable, resizable, snappable windows with first-class accessibility and 60fps performance",
5
5
  "keywords": [
6
6
  "window-manager",
@@ -134,9 +134,7 @@
134
134
  "publint": "publint",
135
135
  "prepublishOnly": "pnpm build",
136
136
  "verify": "pnpm lint && pnpm typecheck && pnpm test:coverage && pnpm build && pnpm size && pnpm publint && pnpm attw && pnpm test:e2e",
137
- "changeset": "changeset",
138
- "release:version": "changeset version",
139
- "release:tag": "changeset tag"
137
+ "release": "semantic-release"
140
138
  },
141
139
  "peerDependencies": {
142
140
  "react": ">=18",
@@ -162,8 +160,9 @@
162
160
  "@arethetypeswrong/cli": "^0.18.2",
163
161
  "@axe-core/playwright": "^4.10.2",
164
162
  "@biomejs/biome": "^2.0.0",
165
- "@changesets/cli": "^2.29.5",
166
163
  "@playwright/test": "^1.53.2",
164
+ "@semantic-release/changelog": "^6.0.3",
165
+ "@semantic-release/git": "^10.0.1",
167
166
  "@size-limit/preset-small-lib": "^11.2.0",
168
167
  "@testing-library/react": "^16.3.0",
169
168
  "@types/node": "^24.0.0",
@@ -174,6 +173,7 @@
174
173
  "publint": "^0.3.12",
175
174
  "react": "^19.1.0",
176
175
  "react-dom": "^19.1.0",
176
+ "semantic-release": "^25.0.6",
177
177
  "size-limit": "^11.2.0",
178
178
  "solid-js": "^1.9.7",
179
179
  "svelte": "^5.35.2",