@surdeddd/wmkit 0.4.2 → 0.5.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 (41) hide show
  1. package/README.md +1 -0
  2. package/README.ru.md +1 -0
  3. package/dist/angular.cjs +3 -3
  4. package/dist/angular.d.cts +2 -2
  5. package/dist/angular.d.ts +2 -2
  6. package/dist/angular.js +1 -1
  7. package/dist/{binder-B2A2IZGh.d.ts → binder-Ca3GOfZX.d.ts} +5 -1
  8. package/dist/{binder-Dl07SXIM.d.cts → binder-EBroZTRw.d.cts} +5 -1
  9. package/dist/{chunk-GGDF2EWV.js → chunk-L43XBN44.js} +235 -14
  10. package/dist/chunk-L43XBN44.js.map +1 -0
  11. package/dist/{chunk-GLBVT4AQ.cjs → chunk-RXAMUBUJ.cjs} +235 -14
  12. package/dist/chunk-RXAMUBUJ.cjs.map +1 -0
  13. package/dist/index.cjs +18 -18
  14. package/dist/index.d.cts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +1 -1
  17. package/dist/persist.d.cts +1 -1
  18. package/dist/persist.d.ts +1 -1
  19. package/dist/popout.d.cts +1 -1
  20. package/dist/popout.d.ts +1 -1
  21. package/dist/react.cjs +3 -3
  22. package/dist/react.d.cts +2 -2
  23. package/dist/react.d.ts +2 -2
  24. package/dist/react.js +1 -1
  25. package/dist/solid.cjs +3 -3
  26. package/dist/solid.d.cts +2 -2
  27. package/dist/solid.d.ts +2 -2
  28. package/dist/solid.js +1 -1
  29. package/dist/svelte.cjs +3 -3
  30. package/dist/svelte.d.cts +2 -2
  31. package/dist/svelte.d.ts +2 -2
  32. package/dist/svelte.js +1 -1
  33. package/dist/{types-t6pyVYKN.d.cts → types-LP7Inhxx.d.cts} +18 -0
  34. package/dist/{types-t6pyVYKN.d.ts → types-LP7Inhxx.d.ts} +18 -0
  35. package/dist/vue.cjs +3 -3
  36. package/dist/vue.d.cts +2 -2
  37. package/dist/vue.d.ts +2 -2
  38. package/dist/vue.js +1 -1
  39. package/package.json +7 -7
  40. package/dist/chunk-GGDF2EWV.js.map +0 -1
  41. package/dist/chunk-GLBVT4AQ.cjs.map +0 -1
package/dist/popout.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { W as WindowManager } from './types-t6pyVYKN.cjs';
1
+ import { W as WindowManager } from './types-LP7Inhxx.cjs';
2
2
 
3
3
  interface DocumentPictureInPictureApi {
4
4
  requestWindow(options?: {
package/dist/popout.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { W as WindowManager } from './types-t6pyVYKN.js';
1
+ import { W as WindowManager } from './types-LP7Inhxx.js';
2
2
 
3
3
  interface DocumentPictureInPictureApi {
4
4
  requestWindow(options?: {
package/dist/react.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkGLBVT4AQ_cjs = require('./chunk-GLBVT4AQ.cjs');
3
+ var chunkRXAMUBUJ_cjs = require('./chunk-RXAMUBUJ.cjs');
4
4
  var react = require('react');
5
5
 
6
6
  function useWindowManager(options) {
7
- const [wm] = react.useState(() => chunkGLBVT4AQ_cjs.createWindowManager(options));
7
+ const [wm] = react.useState(() => chunkRXAMUBUJ_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(() => chunkGLBVT4AQ_cjs.createDesktopBinder(wm, optionsRef.current), [wm]);
20
+ const binder = react.useMemo(() => chunkRXAMUBUJ_cjs.createDesktopBinder(wm, optionsRef.current), [wm]);
21
21
  react.useEffect(() => () => binder.destroy(), [binder]);
22
22
  const cleanupRef = react.useRef(null);
23
23
  const ref = react.useCallback(
package/dist/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-t6pyVYKN.cjs';
2
- import { D as DesktopBinder, b as DesktopController, a as DesktopOptions, W as WindowAttachOptions } from './binder-Dl07SXIM.cjs';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.cjs';
2
+ import { D as DesktopBinder, b as DesktopController, a as DesktopOptions, W as WindowAttachOptions } from './binder-EBroZTRw.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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.js';
2
- import { D as DesktopBinder, b as DesktopController, a as DesktopOptions, W as WindowAttachOptions } from './binder-B2A2IZGh.js';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.js';
2
+ import { D as DesktopBinder, b as DesktopController, a as DesktopOptions, W as WindowAttachOptions } from './binder-Ca3GOfZX.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-GGDF2EWV.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-L43XBN44.js';
2
2
  import { useState, useEffect, useSyncExternalStore, useCallback, useRef, useMemo } from 'react';
3
3
 
4
4
  function useWindowManager(options) {
package/dist/solid.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkGLBVT4AQ_cjs = require('./chunk-GLBVT4AQ.cjs');
3
+ var chunkRXAMUBUJ_cjs = require('./chunk-RXAMUBUJ.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 = chunkGLBVT4AQ_cjs.createWindowManager(options);
10
+ const wm = chunkRXAMUBUJ_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 = chunkGLBVT4AQ_cjs.createDesktopBinder(wm, options);
24
+ const binder = chunkRXAMUBUJ_cjs.createDesktopBinder(wm, options);
25
25
  disposeWithOwner(() => binder.destroy());
26
26
  return {
27
27
  binder,
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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.cjs';
3
- import { D as DesktopBinder, W as WindowAttachOptions, a as DesktopOptions } from './binder-Dl07SXIM.cjs';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.cjs';
3
+ import { D as DesktopBinder, W as WindowAttachOptions, a as DesktopOptions } from './binder-EBroZTRw.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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.js';
3
- import { D as DesktopBinder, W as WindowAttachOptions, a as DesktopOptions } from './binder-B2A2IZGh.js';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.js';
3
+ import { D as DesktopBinder, W as WindowAttachOptions, a as DesktopOptions } from './binder-Ca3GOfZX.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-GGDF2EWV.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-L43XBN44.js';
2
2
  import { createSignal, getOwner, onCleanup } from 'solid-js';
3
3
 
4
4
  function disposeWithOwner(dispose) {
package/dist/svelte.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkGLBVT4AQ_cjs = require('./chunk-GLBVT4AQ.cjs');
3
+ var chunkRXAMUBUJ_cjs = require('./chunk-RXAMUBUJ.cjs');
4
4
 
5
5
  // src/adapters/svelte.ts
6
6
  function createManager(options) {
7
- return chunkGLBVT4AQ_cjs.createWindowManager(options);
7
+ return chunkRXAMUBUJ_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 = chunkGLBVT4AQ_cjs.createDesktopBinder(wm, options);
33
+ const binder = chunkRXAMUBUJ_cjs.createDesktopBinder(wm, options);
34
34
  return {
35
35
  binder,
36
36
  desktop(node) {
package/dist/svelte.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-t6pyVYKN.cjs';
2
- import { W as WindowAttachOptions, D as DesktopBinder, a as DesktopOptions } from './binder-Dl07SXIM.cjs';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.cjs';
2
+ import { W as WindowAttachOptions, D as DesktopBinder, a as DesktopOptions } from './binder-EBroZTRw.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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.js';
2
- import { W as WindowAttachOptions, D as DesktopBinder, a as DesktopOptions } from './binder-B2A2IZGh.js';
1
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.js';
2
+ import { W as WindowAttachOptions, D as DesktopBinder, a as DesktopOptions } from './binder-Ca3GOfZX.js';
3
3
 
4
4
  interface ReadableStore<T> {
5
5
  subscribe(run: (value: T) => void): () => void;
package/dist/svelte.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createWindowManager, createDesktopBinder } from './chunk-GGDF2EWV.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-L43XBN44.js';
2
2
 
3
3
  // src/adapters/svelte.ts
4
4
  function createManager(options) {
@@ -30,6 +30,7 @@ interface WindowState extends WindowFlags {
30
30
  snapZone: SnapZone | null;
31
31
  layer: WindowLayer;
32
32
  workspace: number;
33
+ groupId: string | null;
33
34
  minSize: Size;
34
35
  maxSize: Size | null;
35
36
  aspectRatio: number | null;
@@ -53,12 +54,18 @@ interface WindowInit extends Partial<WindowFlags> {
53
54
  workspace?: number;
54
55
  meta?: Record<string, unknown>;
55
56
  }
57
+ interface WindowGroup {
58
+ id: string;
59
+ activeId: string;
60
+ members: readonly string[];
61
+ }
56
62
  interface ManagerState {
57
63
  windows: Readonly<Record<string, WindowState>>;
58
64
  order: readonly string[];
59
65
  focusedId: string | null;
60
66
  viewport: Size;
61
67
  workspace: number;
68
+ groups: Readonly<Record<string, WindowGroup>>;
62
69
  }
63
70
  interface SerializedMaxSize {
64
71
  width: number | null;
@@ -73,6 +80,7 @@ interface SerializedState {
73
80
  order: string[];
74
81
  focusedId: string | null;
75
82
  workspace: number;
83
+ activeTabs: Record<string, string>;
76
84
  }
77
85
  interface ManagerEvents {
78
86
  open: {
@@ -105,6 +113,12 @@ interface ManagerEvents {
105
113
  workspace: number;
106
114
  previous: number;
107
115
  };
116
+ group: {
117
+ groupId: string;
118
+ members: readonly string[];
119
+ activeId: string;
120
+ previous: string | null;
121
+ };
108
122
  modalblocked: {
109
123
  window: WindowState;
110
124
  };
@@ -166,6 +180,10 @@ interface WindowManager {
166
180
  workspace(): number;
167
181
  setWorkspace(workspace: number): boolean;
168
182
  moveToWorkspace(id: string, workspace: number): boolean;
183
+ group(ids: readonly string[]): string | null;
184
+ ungroup(id: string): boolean;
185
+ activateTab(id: string): boolean;
186
+ groupMembers(groupId: string): readonly WindowState[];
169
187
  batch(run: () => void): void;
170
188
  serialize(): SerializedState;
171
189
  hydrate(data: SerializedState): boolean;
@@ -30,6 +30,7 @@ interface WindowState extends WindowFlags {
30
30
  snapZone: SnapZone | null;
31
31
  layer: WindowLayer;
32
32
  workspace: number;
33
+ groupId: string | null;
33
34
  minSize: Size;
34
35
  maxSize: Size | null;
35
36
  aspectRatio: number | null;
@@ -53,12 +54,18 @@ interface WindowInit extends Partial<WindowFlags> {
53
54
  workspace?: number;
54
55
  meta?: Record<string, unknown>;
55
56
  }
57
+ interface WindowGroup {
58
+ id: string;
59
+ activeId: string;
60
+ members: readonly string[];
61
+ }
56
62
  interface ManagerState {
57
63
  windows: Readonly<Record<string, WindowState>>;
58
64
  order: readonly string[];
59
65
  focusedId: string | null;
60
66
  viewport: Size;
61
67
  workspace: number;
68
+ groups: Readonly<Record<string, WindowGroup>>;
62
69
  }
63
70
  interface SerializedMaxSize {
64
71
  width: number | null;
@@ -73,6 +80,7 @@ interface SerializedState {
73
80
  order: string[];
74
81
  focusedId: string | null;
75
82
  workspace: number;
83
+ activeTabs: Record<string, string>;
76
84
  }
77
85
  interface ManagerEvents {
78
86
  open: {
@@ -105,6 +113,12 @@ interface ManagerEvents {
105
113
  workspace: number;
106
114
  previous: number;
107
115
  };
116
+ group: {
117
+ groupId: string;
118
+ members: readonly string[];
119
+ activeId: string;
120
+ previous: string | null;
121
+ };
108
122
  modalblocked: {
109
123
  window: WindowState;
110
124
  };
@@ -166,6 +180,10 @@ interface WindowManager {
166
180
  workspace(): number;
167
181
  setWorkspace(workspace: number): boolean;
168
182
  moveToWorkspace(id: string, workspace: number): boolean;
183
+ group(ids: readonly string[]): string | null;
184
+ ungroup(id: string): boolean;
185
+ activateTab(id: string): boolean;
186
+ groupMembers(groupId: string): readonly WindowState[];
169
187
  batch(run: () => void): void;
170
188
  serialize(): SerializedState;
171
189
  hydrate(data: SerializedState): boolean;
package/dist/vue.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkGLBVT4AQ_cjs = require('./chunk-GLBVT4AQ.cjs');
3
+ var chunkRXAMUBUJ_cjs = require('./chunk-RXAMUBUJ.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 = chunkGLBVT4AQ_cjs.createWindowManager(options);
10
+ const wm = chunkRXAMUBUJ_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 = chunkGLBVT4AQ_cjs.createDesktopBinder(wm, options);
28
+ const binder = chunkRXAMUBUJ_cjs.createDesktopBinder(wm, options);
29
29
  disposeWithScope(() => binder.destroy());
30
30
  vue.watch(
31
31
  target,
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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.cjs';
3
- import { a as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-Dl07SXIM.cjs';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.cjs';
3
+ import { a as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-EBroZTRw.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, a as ManagerState, b as WindowState } from './types-t6pyVYKN.js';
3
- import { a as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-B2A2IZGh.js';
2
+ import { W as WindowManager, M as ManagerOptions, a as ManagerState, b as WindowState } from './types-LP7Inhxx.js';
3
+ import { a as DesktopOptions, D as DesktopBinder, W as WindowAttachOptions } from './binder-Ca3GOfZX.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-GGDF2EWV.js';
1
+ import { createWindowManager, createDesktopBinder } from './chunk-L43XBN44.js';
2
2
  import { shallowRef, computed, toValue, watch, getCurrentScope, onScopeDispose } from 'vue';
3
3
 
4
4
  function disposeWithScope(dispose) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surdeddd/wmkit",
3
- "version": "0.4.2",
3
+ "version": "0.5.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",
@@ -203,12 +203,12 @@
203
203
  {
204
204
  "name": "core",
205
205
  "path": "dist/index.js",
206
- "limit": "12 kB"
206
+ "limit": "13 kB"
207
207
  },
208
208
  {
209
209
  "name": "react adapter",
210
210
  "path": "dist/react.js",
211
- "limit": "12 kB",
211
+ "limit": "13 kB",
212
212
  "ignore": [
213
213
  "react"
214
214
  ]
@@ -216,7 +216,7 @@
216
216
  {
217
217
  "name": "vue adapter",
218
218
  "path": "dist/vue.js",
219
- "limit": "12 kB",
219
+ "limit": "13 kB",
220
220
  "ignore": [
221
221
  "vue"
222
222
  ]
@@ -224,7 +224,7 @@
224
224
  {
225
225
  "name": "svelte adapter",
226
226
  "path": "dist/svelte.js",
227
- "limit": "12 kB",
227
+ "limit": "13 kB",
228
228
  "ignore": [
229
229
  "svelte"
230
230
  ]
@@ -232,7 +232,7 @@
232
232
  {
233
233
  "name": "solid adapter",
234
234
  "path": "dist/solid.js",
235
- "limit": "12 kB",
235
+ "limit": "13 kB",
236
236
  "ignore": [
237
237
  "solid-js"
238
238
  ]
@@ -240,7 +240,7 @@
240
240
  {
241
241
  "name": "angular adapter",
242
242
  "path": "dist/angular.js",
243
- "limit": "12 kB",
243
+ "limit": "13 kB",
244
244
  "ignore": [
245
245
  "@angular/core"
246
246
  ]