@ai-matrx/summon 0.1.10 → 0.1.12

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RawOpenPayload, C as CloseOverlaysBoundToPagePayload, P as PruneStaleInstancesPayload, O as OverlayState, I as InstanceKey, S as SummonPorts, a as StateWithOverlays, b as OverlayDefinitionMeta, c as SummonCore } from './gate-CfjdNWP6.js';
2
- export { A as AnyOverlayMeta, d as CloseAllInstancesPayload, e as CloseOverlayPayload, D as DEFAULT_INSTANCE_ID, f as DEFAULT_PORTS, g as DebugPort, E as ErrorSinkPort, h as IdentityPort, i as InstanceMode, K as KeepAlive, L as LinkHydrateContext, M as MobilePresentation, N as NotifyOptions, j as NotifyPort, k as OpenInstanceView, l as OpenOverlayPayload, m as OverlayDataOf, n as OverlayHostDispatch, o as OverlayId, p as OverlayInstance, q as OverlayLinkSpec, r as OverlayPersistencePort, s as OverlayRawData, t as OverlayWindowOptions, u as RouterPort, v as StoredValue, T as ToggleOverlayPayload, U as UnbiddenHomeRoute, w as Unsubscribe, W as WindowPreservation, x as allOverlayMeta, y as anonymousIdentity, z as closeAllInstancesOfOverlay, B as closeOverlay, F as closeOverlaysBoundToPage, G as consoleErrorSink, H as consoleNotify, J as debugOff, Q as defaultWindowIdFor, V as getOverlayMeta, X as getOverlayMetaByLinkKey, Y as instanceKey, Z as isRegisteredOverlay, _ as listOpenInstanceKeys, $ as locationRouter, a0 as openOverlay, a1 as overlayIdsBoundToPage, a2 as parseInstanceKey, a3 as registerOverlayMeta, a4 as resetOverlayRegistry, a5 as resolvePorts, a6 as selectIsOverlayOpen, a7 as selectOpenInstances, a8 as selectOverlay, a9 as selectOverlayData, aa as subscribeToOverlayRegistry, ab as toggleOverlay } from './gate-CfjdNWP6.js';
1
+ import { R as RawOpenPayload, C as CloseOverlaysBoundToPagePayload, P as PruneStaleInstancesPayload, O as OverlayState, I as InstanceKey, S as SummonPorts, W as WindowManagerState, a as StateWithOverlays, b as WindowEntry, c as WindowRect, d as OverlayDefinitionMeta, e as SummonCore } from './gate-O-00kToO.js';
2
+ export { A as AnyOverlayMeta, f as CloseAllInstancesPayload, g as CloseOverlayPayload, D as DEFAULT_INSTANCE_ID, h as DEFAULT_PORTS, i as DebugPort, j as DockWindowPayload, E as ErrorSinkPort, G as GlobalLayoutType, H as HydratedWindowSession, k as IdentityPort, l as InstanceMode, K as KeepAlive, L as LinkHydrateContext, M as MobilePresentation, N as NotifyOptions, m as NotifyPort, n as OpenInstanceView, o as OpenOverlayPayload, p as OverlayDataOf, q as OverlayHostDispatch, r as OverlayId, s as OverlayInstance, t as OverlayLinkSpec, u as OverlayPersistencePort, v as OverlayRawData, w as OverlayWindowOptions, x as PersistedWindowSession, y as PopoutMode, z as RouterPort, B as StoredValue, T as TRAY_CHIP_H, F as TRAY_CHIP_W, J as ToggleOverlayPayload, U as UnbiddenHomeRoute, Q as Unsubscribe, V as WINDOW_SESSION_SCHEMA_VERSION, X as WindowPersistenceRegistration, Y as WindowPersistenceState, Z as WindowPreservation, _ as WindowState, $ as allOverlayMeta, a0 as anonymousIdentity, a1 as arrangeActiveWindows, a2 as buildDockWindowPayload, a3 as clampAllWindowRects, a4 as clampWindowRect, a5 as clearWindowPersistenceState, a6 as closeAllInstancesOfOverlay, a7 as closeOverlay, a8 as closeOverlaysBoundToPage, a9 as computeGlobalArrangement, aa as confirmWindowRestored, ab as consoleErrorSink, ac as consoleNotify, ad as debugOff, ae as defaultWindowIdFor, af as discardPendingWindowSession, ag as dockWindow, ah as focusWindow, ai as getGrid12Rect, aj as getGrid4Rect, ak as getGrid6Rect, al as getGrid8Rect, am as getGrid9Rect, an as getOverlayMeta, ao as getOverlayMetaByLinkKey, ap as getStackedLeft2Rect, aq as getStackedLeft3Rect, ar as getStackedLeft4Rect, as as getStackedLeft5Rect, at as getStackedRight2Rect, au as getStackedRight3Rect, av as getStackedRight4Rect, aw as getStackedRight5Rect, ax as hydrateWindowSessions, ay as instanceKey, az as isRegisteredOverlay, aA as listOpenInstanceKeys, aB as locationRouter, aC as markWindowClosing, aD as maximizeWindow, aE as minimizeAll, aF as minimizeWindow, aG as moveTraySlot, aH as openOverlay, aI as overlayIdsBoundToPage, aJ as parseInstanceKey, aK as popOutWindow, aL as raiseTransientWindow, aM as recomputeTrayPositions, aN as registerOverlayMeta, aO as registerWindow, aP as releaseTransientWindow, aQ as resetOverlayRegistry, aR as resolvePorts, aS as restoreAll, aT as restoreWindow, aU as restoreWindowState, aV as revealWindow, aW as selectActivePipWindowId, aX as selectAllMinimized, aY as selectAllWindows, aZ as selectDockedWindows, a_ as selectIsOverlayOpen, a$ as selectIsPoppedOut, b0 as selectOpenInstances, b1 as selectOverlay, b2 as selectOverlayData, b3 as selectPendingWindowRestores, b4 as selectPopoutCandidateId, b5 as selectPopoutMode, b6 as selectPrePopoutRect, b7 as selectTransientZIndex, b8 as selectTraySlotWidth, b9 as selectTrayWindows, ba as selectWindow, bb as selectWindowPersistence, bc as selectWindowRect, bd as selectWindowState, be as selectWindowTitle, bf as selectWindowZIndex, bg as selectWindowsHidden, bh as setPopoutCandidate, bi as subscribeToOverlayRegistry, bj as toggleOverlay, bk as toggleWindowsHidden, bl as unregisterWindow, bm as updateWindowPersistence, bn as updateWindowRect, bo as updateWindowTitle, bp as windowManagerReducer, bq as windowSessionKey } from './gate-O-00kToO.js';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
4
  import { PayloadAction, Reducer, UnknownAction, Middleware } from '@reduxjs/toolkit';
5
5
  import '@ai-matrx/summon';
@@ -110,434 +110,6 @@ declare const overlaysRawActions: _reduxjs_toolkit.CaseReducerActions<{
110
110
  declare const closeAllOverlays: _reduxjs_toolkit.ActionCreatorWithoutPayload<"overlays/closeAllOverlays">;
111
111
  declare const pruneStaleInstances: _reduxjs_toolkit.ActionCreatorWithPayload<PruneStaleInstancesPayload, "overlays/pruneStaleInstances">;
112
112
 
113
- interface WindowRect {
114
- x: number;
115
- y: number;
116
- width: number;
117
- height: number;
118
- }
119
-
120
- /**
121
- * Calculates a 4-grid quadrant (2x2).
122
- * @param index 0: top-left, 1: top-right, 2: bottom-left, 3: bottom-right
123
- */
124
- declare function getGrid4Rect(index: number, vw: number, vh: number): WindowRect;
125
- /**
126
- * Calculates a 6-grid partition (3 columns x 2 rows).
127
- * @param index 0-5. 0-2 is top row (left-to-right), 3-5 is bottom row.
128
- */
129
- declare function getGrid6Rect(index: number, vw: number, vh: number): WindowRect;
130
- /**
131
- * Calculates an 8-window grid (4 columns, 2 a rows)
132
- */
133
- declare function getGrid8Rect(index: number, vw: number, vh: number): WindowRect;
134
- /**
135
- * Calculates a 9-window grid (3 columns, 3 rows)
136
- */
137
- declare function getGrid9Rect(index: number, vw: number, vh: number): WindowRect;
138
- /**
139
- * Calculates a 12-window grid (4 columns, 3 rows)
140
- */
141
- declare function getGrid12Rect(index: number, vw: number, vh: number): WindowRect;
142
- /**
143
- * Calculates 2 stacked windows on the right edge.
144
- * @param index 0: top right half, 1: bottom right half
145
- */
146
- declare function getStackedRight2Rect(index: number, vw: number, vh: number): WindowRect;
147
- /**
148
- * Calculates 3 stacked windows on the right edge.
149
- * @param index 0, 1, 2 top-to-bottom on the right third of the screen.
150
- */
151
- declare function getStackedRight3Rect(index: number, vw: number, vh: number): WindowRect;
152
- /**
153
- * Calculates 4 stacked windows on the right edge.
154
- * @param index 0,1,2,3 top-to-bottom on the right quarter of the screen.
155
- */
156
- declare function getStackedRight4Rect(index: number, vw: number, vh: number): WindowRect;
157
- /**
158
- * Calculates 5 stacked windows on the right edge.
159
- */
160
- declare function getStackedRight5Rect(index: number, vw: number, vh: number): WindowRect;
161
- /**
162
- * Calculates 2 stacked windows on the left edge.
163
- * @param index 0: top left half, 1: bottom left half
164
- */
165
- declare function getStackedLeft2Rect(index: number, vw: number, vh: number): WindowRect;
166
- /**
167
- * Calculates 3 stacked windows on the left edge.
168
- * @param index 0, 1, 2 top-to-bottom on the left third of the screen.
169
- */
170
- declare function getStackedLeft3Rect(index: number, vw: number, vh: number): WindowRect;
171
- /**
172
- * Calculates 4 stacked windows on the left edge.
173
- * @param index 0,1,2,3 top-to-bottom on the left quarter of the screen.
174
- */
175
- declare function getStackedLeft4Rect(index: number, vw: number, vh: number): WindowRect;
176
- /**
177
- * Calculates 5 stacked windows on the left edge.
178
- */
179
- declare function getStackedLeft5Rect(index: number, vw: number, vh: number): WindowRect;
180
- type GlobalLayoutType = "grid4" | "grid6" | "grid8" | "grid9" | "grid12" | "stackRight2" | "stackRight3" | "stackRight4" | "stackRight5" | "stackLeft2" | "stackLeft3" | "stackLeft4" | "stackLeft5";
181
- /**
182
- * Helper: Applies global arrangement to an array of windows logic.
183
- * Returns an array of updates to batch dispatch.
184
- */
185
- declare function computeGlobalArrangement(layout: GlobalLayoutType, windowIds: string[], vw: number, vh: number, dirX?: "ltr" | "rtl", dirY?: "ttb" | "btt", primary?: "horizontal" | "vertical"): {
186
- id: string;
187
- rect: WindowRect;
188
- }[];
189
-
190
- interface DockWindowPayload {
191
- id: string;
192
- viewportWidth: number;
193
- viewportHeight: number;
194
- }
195
- /** Build a dock action payload from the live parent viewport. Client-only. */
196
- declare function buildDockWindowPayload(windowId: string): DockWindowPayload;
197
-
198
- type WindowState = "windowed" | "maximized" | "minimized";
199
- declare const WINDOW_SESSION_SCHEMA_VERSION: 1;
200
- /** Canonical persistence identity. Runtime window ids and registry slugs are not identities. */
201
- declare function windowSessionKey(overlayId: string, instanceId: string): string;
202
- interface WindowPersistenceRegistration {
203
- overlayId: string;
204
- instanceId: string;
205
- data: Record<string, unknown>;
206
- sidebarOpen: boolean;
207
- sidebarSize: number | null;
208
- }
209
- interface WindowPersistenceState extends WindowPersistenceRegistration {
210
- /** Explicit close suppresses every later snapshot/unmount path. */
211
- closing: boolean;
212
- }
213
- /** Compact, JSON-only record written to the local window workspace cache. */
214
- interface PersistedWindowSession {
215
- schemaVersion: typeof WINDOW_SESSION_SCHEMA_VERSION;
216
- sessionKey: string;
217
- overlayId: string;
218
- instanceId: string;
219
- /** Runtime id is diagnostic/matching metadata, never the canonical identity. */
220
- windowId: string;
221
- title: string;
222
- state: WindowState;
223
- /** Always the full windowed rect, never minimized-card geometry. */
224
- windowedRect: WindowRect;
225
- traySlot: number | null;
226
- zIndex: number;
227
- sidebarOpen: boolean;
228
- sidebarSize: number | null;
229
- data: Record<string, unknown>;
230
- savedAt: number;
231
- }
232
- /** Viewport-normalized session staged for a live WindowPanel registration. */
233
- interface HydratedWindowSession extends PersistedWindowSession {
234
- /** Current-viewport render rect; tray geometry is recomputed, never stored. */
235
- renderRect: WindowRect;
236
- }
237
- /**
238
- * Pop-out mode for windows that have been detached into a separate browser
239
- * window. Orthogonal to `WindowState` — a popped-out window still has a
240
- * "logical" docked state remembered on `prePopoutRect` for the dock-back path.
241
- *
242
- * - `"pip"`: Document Picture-in-Picture (Chromium) — frameless, always-on-top.
243
- * Subject to the single-PiP-per-origin constraint enforced via
244
- * `activePipWindowId`.
245
- * - `"popup"`: `window.open()` fallback for browsers without DPiP support
246
- * (Safari, Firefox). Shows browser chrome.
247
- * - `null`: Window is docked inside the parent viewport (the default).
248
- */
249
- type PopoutMode = "pip" | "popup" | null;
250
- interface WindowEntry {
251
- id: string;
252
- title: string;
253
- state: WindowState;
254
- /** Last windowed size/position — restored when coming back from max/min */
255
- windowed: WindowRect;
256
- /** Saved rect before minimize so restore can return to the original size */
257
- preMinimizedRect: WindowRect | null;
258
- /** z-index order — higher = on top */
259
- zIndex: number;
260
- /** Order in the minimized tray (0-based). */
261
- traySlot: number | null;
262
- /**
263
- * Pop-out mode. `null` while docked. When set, the window is rendered into
264
- * a separate browser window via Document PiP or `window.open()` fallback.
265
- * Never written to the local workspace cache — always reset on hydration
266
- * (see `restoreWindowState`).
267
- */
268
- popoutMode: PopoutMode;
269
- /**
270
- * Saved windowed rect at popout time. Restored to `windowed` on dock-back
271
- * via `dockWindow`. `null` while docked (matches `preMinimizedRect` pattern).
272
- */
273
- prePopoutRect: WindowRect | null;
274
- /** Present only for registry entries explicitly approved for preservation. */
275
- persistence?: WindowPersistenceState;
276
- }
277
- interface WindowManagerState {
278
- windows: Record<string, WindowEntry>;
279
- /** Validated sessions waiting for their WindowPanel registration. */
280
- pendingRestores: Record<string, HydratedWindowSession>;
281
- /** Next z-index to assign when a window is focused */
282
- nextZIndex: number;
283
- /** How many slots are currently occupied in the tray */
284
- trayCount: number;
285
- /** Last viewport used to place tray cards; enables safe reflow on removal. */
286
- trayViewport: {
287
- width: number;
288
- height: number;
289
- } | null;
290
- /** Global show/hide toggle — windows stay mounted but are visually hidden */
291
- windowsHidden: boolean;
292
- /**
293
- * The id of the window currently occupying the single Document PiP slot
294
- * (Chromium allows only one DPiP window per origin at a time). `null` when
295
- * the slot is free. Windows in `"popup"` mode do NOT count toward this slot.
296
- */
297
- activePipWindowId: string | null;
298
- /**
299
- * The id of the window currently being dragged outside the viewport beyond
300
- * the popout threshold. Used purely for visual feedback ("Release to pop
301
- * out" outline + ghost label). Cleared on every `pointerup`.
302
- */
303
- popoutCandidateId: string | null;
304
- /**
305
- * Z-index lane for LITE windows (`MatrxDynamicPanelHost presentation="floating"`).
306
- *
307
- * They are deliberately NOT entries in `windows`: a lite window is a
308
- * transient form/picker host with no tray chip, no minimize and no
309
- * persistence, so joining `windows` would put a half-typed create form into
310
- * "minimize all" and the tray — the lost-work trap the lite window exists to
311
- * avoid. Keeping them in their own map means every tray/minimize/arrange
312
- * selector excludes them BY CONSTRUCTION rather than by a flag somebody must
313
- * remember to filter on.
314
- *
315
- * They still draw from the SAME `nextZIndex` counter, so there is one
316
- * z-order: a lite window opened from a WindowPanel always lands above it,
317
- * and clicking the WindowPanel afterwards raises it above the lite window.
318
- */
319
- transientZ: Record<string, number>;
320
- }
321
- declare const TRAY_CHIP_W = 240;
322
- declare const TRAY_CHIP_H = 160;
323
- declare const raiseTransientWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/raiseTransientWindow">;
324
- declare const releaseTransientWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/releaseTransientWindow">;
325
- declare const registerWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
326
- id: string;
327
- title?: string;
328
- initial: WindowRect;
329
- initialState?: "windowed" | "minimized";
330
- persistence?: WindowPersistenceRegistration;
331
- viewport?: {
332
- width: number;
333
- height: number;
334
- };
335
- }, "windowManager/registerWindow">;
336
- declare const unregisterWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/unregisterWindow">;
337
- declare const focusWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/focusWindow">;
338
- declare const restoreWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/restoreWindow">;
339
- declare const revealWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
340
- id: string;
341
- viewportWidth: number;
342
- viewportHeight: number;
343
- }, "windowManager/revealWindow">;
344
- declare const maximizeWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/maximizeWindow">;
345
- declare const minimizeWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
346
- id: string;
347
- viewportWidth: number;
348
- viewportHeight: number;
349
- }, "windowManager/minimizeWindow">;
350
- declare const minimizeAll: _reduxjs_toolkit.ActionCreatorWithPayload<{
351
- viewportWidth: number;
352
- viewportHeight: number;
353
- }, "windowManager/minimizeAll">;
354
- declare const restoreAll: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/restoreAll">;
355
- declare const recomputeTrayPositions: _reduxjs_toolkit.ActionCreatorWithPayload<{
356
- viewportWidth: number;
357
- viewportHeight: number;
358
- }, "windowManager/recomputeTrayPositions">;
359
- declare const updateWindowRect: _reduxjs_toolkit.ActionCreatorWithPayload<{
360
- id: string;
361
- rect: Partial<WindowRect>;
362
- }, "windowManager/updateWindowRect">;
363
- declare const updateWindowTitle: _reduxjs_toolkit.ActionCreatorWithPayload<{
364
- id: string;
365
- title: string;
366
- }, "windowManager/updateWindowTitle">;
367
- declare const toggleWindowsHidden: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/toggleWindowsHidden">;
368
- declare const moveTraySlot: _reduxjs_toolkit.ActionCreatorWithPayload<{
369
- id: string;
370
- toSlot: number;
371
- }, "windowManager/moveTraySlot">;
372
- declare const arrangeActiveWindows: _reduxjs_toolkit.ActionCreatorWithPayload<{
373
- layout: GlobalLayoutType;
374
- viewportWidth: number;
375
- viewportHeight: number;
376
- dirX?: "ltr" | "rtl";
377
- dirY?: "ttb" | "btt";
378
- primary?: "horizontal" | "vertical";
379
- }, "windowManager/arrangeActiveWindows">;
380
- declare const popOutWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
381
- id: string;
382
- mode: "pip" | "popup";
383
- }, "windowManager/popOutWindow">;
384
- declare const dockWindow: _reduxjs_toolkit.ActionCreatorWithPayload<DockWindowPayload, "windowManager/dockWindow">;
385
- declare const setPopoutCandidate: _reduxjs_toolkit.ActionCreatorWithPayload<{
386
- id: string | null;
387
- }, "windowManager/setPopoutCandidate">;
388
- declare const clampWindowRect: _reduxjs_toolkit.ActionCreatorWithPayload<{
389
- id: string;
390
- viewportWidth: number;
391
- viewportHeight: number;
392
- }, "windowManager/clampWindowRect">;
393
- declare const clampAllWindowRects: _reduxjs_toolkit.ActionCreatorWithPayload<{
394
- viewportWidth: number;
395
- viewportHeight: number;
396
- }, "windowManager/clampAllWindowRects">;
397
- declare const restoreWindowState: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, WindowEntry>, "windowManager/restoreWindowState">;
398
- declare const hydrateWindowSessions: _reduxjs_toolkit.ActionCreatorWithPayload<{
399
- sessions: HydratedWindowSession[];
400
- viewportWidth: number;
401
- viewportHeight: number;
402
- }, "windowManager/hydrateWindowSessions">;
403
- declare const confirmWindowRestored: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/confirmWindowRestored">;
404
- declare const discardPendingWindowSession: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/discardPendingWindowSession">;
405
- declare const updateWindowPersistence: _reduxjs_toolkit.ActionCreatorWithPayload<{
406
- id: string;
407
- data?: Record<string, unknown>;
408
- sidebarOpen?: boolean;
409
- sidebarSize?: number | null;
410
- }, "windowManager/updateWindowPersistence">;
411
- declare const markWindowClosing: _reduxjs_toolkit.ActionCreatorWithPayload<{
412
- overlayId: string;
413
- instanceId: string;
414
- }, "windowManager/markWindowClosing">;
415
- declare const clearWindowPersistenceState: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/clearWindowPersistenceState">;
416
- type StateWithWM = {
417
- windowManager: WindowManagerState;
418
- };
419
- declare const selectPendingWindowRestores: (state: StateWithWM) => Record<string, HydratedWindowSession>;
420
- declare const selectWindowPersistence: (id: string) => (state: StateWithWM) => WindowPersistenceState | undefined;
421
- declare const selectWindow: (id: string) => (state: StateWithWM) => WindowEntry | undefined;
422
- declare const selectWindowState: (id: string) => (state: StateWithWM) => WindowState | undefined;
423
- declare const selectWindowRect: (id: string) => (state: StateWithWM) => WindowRect | undefined;
424
- declare const selectWindowZIndex: (id: string) => (state: StateWithWM) => number;
425
- /** z-index for a transient (lite) window; BASE_Z until it has been raised. */
426
- declare const selectTransientZIndex: (id: string) => (state: StateWithWM) => number;
427
- declare const selectWindowTitle: (id: string) => (state: StateWithWM) => string;
428
- declare const selectTraySlotWidth: () => number;
429
- declare const selectWindowsHidden: (state: StateWithWM) => boolean;
430
- /**
431
- * Minimized windows sorted by tray slot ascending.
432
- * Memoized — only recalculates when the windows map reference changes.
433
- */
434
- declare const selectTrayWindows: ((state: StateWithWM) => WindowEntry[]) & {
435
- clearCache: () => void;
436
- resultsCount: () => number;
437
- resetResultsCount: () => void;
438
- } & {
439
- resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
440
- memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
441
- clearCache: () => void;
442
- resultsCount: () => number;
443
- resetResultsCount: () => void;
444
- };
445
- lastResult: () => WindowEntry[];
446
- dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
447
- recomputations: () => number;
448
- resetRecomputations: () => void;
449
- dependencyRecomputations: () => number;
450
- resetDependencyRecomputations: () => void;
451
- } & {
452
- memoize: typeof _reduxjs_toolkit.weakMapMemoize;
453
- argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
454
- };
455
- /** All registered windows sorted by zIndex descending (most-recently-focused first). */
456
- declare const selectAllWindows: ((state: StateWithWM) => WindowEntry[]) & {
457
- clearCache: () => void;
458
- resultsCount: () => number;
459
- resetResultsCount: () => void;
460
- } & {
461
- resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
462
- memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
463
- clearCache: () => void;
464
- resultsCount: () => number;
465
- resetResultsCount: () => void;
466
- };
467
- lastResult: () => WindowEntry[];
468
- dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
469
- recomputations: () => number;
470
- resetRecomputations: () => void;
471
- dependencyRecomputations: () => number;
472
- resetDependencyRecomputations: () => void;
473
- } & {
474
- memoize: typeof _reduxjs_toolkit.weakMapMemoize;
475
- argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
476
- };
477
- /** True when every registered window is minimized (or there are none). */
478
- declare const selectAllMinimized: ((state: StateWithWM) => boolean) & {
479
- clearCache: () => void;
480
- resultsCount: () => number;
481
- resetResultsCount: () => void;
482
- } & {
483
- resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => boolean;
484
- memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => boolean) & {
485
- clearCache: () => void;
486
- resultsCount: () => number;
487
- resetResultsCount: () => void;
488
- };
489
- lastResult: () => boolean;
490
- dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
491
- recomputations: () => number;
492
- resetRecomputations: () => void;
493
- dependencyRecomputations: () => number;
494
- resetDependencyRecomputations: () => void;
495
- } & {
496
- memoize: typeof _reduxjs_toolkit.weakMapMemoize;
497
- argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
498
- };
499
- /** Current popout mode for a window. Returns `null` if docked or unknown id. */
500
- declare const selectPopoutMode: (id: string) => (state: StateWithWM) => "pip" | "popup" | null;
501
- /** True if the window is currently popped out (either pip or popup mode). */
502
- declare const selectIsPoppedOut: (id: string) => (state: StateWithWM) => boolean;
503
- /** The id of the window holding the single Document PiP slot, or `null`. */
504
- declare const selectActivePipWindowId: (state: StateWithWM) => string | null;
505
- /**
506
- * The id of the window currently being dragged outside the viewport beyond
507
- * the popout threshold. Used by WindowPanel to render the "Release to pop
508
- * out" outline.
509
- */
510
- declare const selectPopoutCandidateId: (state: StateWithWM) => string | null;
511
- /** Saved rect to dock back to. `null` while docked or after dock-back. */
512
- declare const selectPrePopoutRect: (id: string) => (state: StateWithWM) => WindowRect | null;
513
- /**
514
- * All windows currently docked (popoutMode === null), sorted by zIndex
515
- * descending. Used by arrange/tray logic so popped-out windows don't get
516
- * assigned slots in parent-viewport layouts.
517
- */
518
- declare const selectDockedWindows: ((state: StateWithWM) => WindowEntry[]) & {
519
- clearCache: () => void;
520
- resultsCount: () => number;
521
- resetResultsCount: () => void;
522
- } & {
523
- resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
524
- memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
525
- clearCache: () => void;
526
- resultsCount: () => number;
527
- resetResultsCount: () => void;
528
- };
529
- lastResult: () => WindowEntry[];
530
- dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
531
- recomputations: () => number;
532
- resetRecomputations: () => void;
533
- dependencyRecomputations: () => number;
534
- resetDependencyRecomputations: () => void;
535
- } & {
536
- memoize: typeof _reduxjs_toolkit.weakMapMemoize;
537
- argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
538
- };
539
- declare const windowManagerReducer: _reduxjs_toolkit.Reducer<WindowManagerState>;
540
-
541
113
  interface UrlSyncEntry {
542
114
  typeKey: string;
543
115
  instanceId: string;
@@ -924,4 +496,4 @@ declare function traySlotRect(slot: number, viewportWidth: number, viewportHeigh
924
496
 
925
497
  declare const summonCore: SummonCore;
926
498
 
927
- export { type CloseEvent, type CloseFlusher, CloseOverlaysBoundToPagePayload, type CreateOverlaysStoreOptions, type DockWindowPayload, type GlobalLayoutType, type HydrateOverlayStatePayload, type HydratedWindowSession, InstanceKey, LAZY_WINDOW_MOUNT_DEADLINE_MS, OverlayDefinitionMeta, type OverlayHostTypes, type OverlayRegistry, OverlayState, type OverlayStateEntry, type OverlayStateState, type PersistedWindowSession, type PopoutMode, PruneStaleInstancesPayload, RENDER_WATCHDOG_SLOT, type RenderDiagnosis, type RenderFailureReason, type ReplaceOverlayStatePayload, type SetOverlayStateValuePayload, type StateWithOverlayState, StateWithOverlays, type StateWithUrlSync, type SummonDispatch, SummonPorts, type SummonRootState, type SummonStore, TRAY_CHIP_H, TRAY_CHIP_H_DESKTOP, TRAY_CHIP_H_MOBILE, TRAY_CHIP_W, TRAY_CHIP_W_DESKTOP, TRAY_CHIP_W_MOBILE_MAX, TRAY_COMPACT_GAP, TRAY_COMPACT_H, TRAY_GAP_X, TRAY_GAP_Y, TRAY_MARGIN_B, TRAY_MARGIN_L, TRAY_MARGIN_R, TRAY_MOBILE_BREAKPOINT, type UrlSyncEntry, type UrlSyncState, type ViewportDims, WINDOW_SESSION_SCHEMA_VERSION, type WindowCloseIntent, type WindowEntry, type WindowManagerState, type WindowPersistenceRegistration, type WindowPersistenceState, type WindowRect, type WindowRectLike, type WindowState, ackOverlayRender, ackOverlaySurfaceRender, arrangeActiveWindows, buildDockWindowPayload, centerRectInViewport, clampAllWindowRects, clampRectToCurrentViewport, clampRectToViewport, clampWindowRect, clearOverlayRender, clearOverlayState, clearOverlaySurfaceRender, clearWindowPersistenceState, closeAllOverlays, closeLifecycleMiddleware, computeGlobalArrangement, computeTrayChipHeight, computeTrayChipWidth, confirmWindowRestored, createOverlayRenderWatchdogMiddleware, createSummonMiddleware, createSummonStore, diagnoseOverlayRender, discardPendingWindowSession, dockWindow, focusWindow, getGrid12Rect, getGrid4Rect, getGrid6Rect, getGrid8Rect, getGrid9Rect, getStackedLeft2Rect, getStackedLeft3Rect, getStackedLeft4Rect, getStackedLeft5Rect, getStackedRight2Rect, getStackedRight3Rect, getStackedRight4Rect, getStackedRight5Rect, hydrateOverlayState, hydrateWindowSessions, linksReducer, markWindowClosing, maximizeWindow, minimizeAll, minimizeWindow, moveTraySlot, overlayStateReducer, overlaysRawActions, overlaysReducer, popOutWindow, pruneStaleInstances, raiseTransientWindow, recomputeTrayPositions, rectOnScreen, rectsEqual, registerCloseFlusher, registerSyncEntry, registerWindow, releaseOverlayInstance, releaseTransientWindow, replaceOverlayState, resetOverlayRenderWatchdog, restoreAll, restoreWindow, restoreWindowState, revealWindow, safeViewportDims, selectActivePipWindowId, selectAllMinimized, selectAllWindows, selectDockedWindows, selectIsPoppedOut, selectIsUrlHydrated, selectOverlayStateFor, selectOverlayStateValue, selectPendingWindowRestores, selectPopoutCandidateId, selectPopoutMode, selectPrePopoutRect, selectTransientZIndex, selectTraySlotWidth, selectTrayWindows, selectUrlSyncEntries, selectWindow, selectWindowPersistence, selectWindowRect, selectWindowState, selectWindowTitle, selectWindowZIndex, selectWindowsHidden, setHydrated, setOverlayStateValue, setPopoutCandidate, summonCore, summonReducers, toggleWindowsHidden, trayChipsPerRow, traySlotRect, unregisterSyncEntry, unregisterWindow, updateWindowPersistence, updateWindowRect, updateWindowTitle, watchdogTracksOpen, windowManagerReducer, windowSessionKey };
499
+ export { type CloseEvent, type CloseFlusher, CloseOverlaysBoundToPagePayload, type CreateOverlaysStoreOptions, type HydrateOverlayStatePayload, InstanceKey, LAZY_WINDOW_MOUNT_DEADLINE_MS, OverlayDefinitionMeta, type OverlayHostTypes, type OverlayRegistry, OverlayState, type OverlayStateEntry, type OverlayStateState, PruneStaleInstancesPayload, RENDER_WATCHDOG_SLOT, type RenderDiagnosis, type RenderFailureReason, type ReplaceOverlayStatePayload, type SetOverlayStateValuePayload, type StateWithOverlayState, StateWithOverlays, type StateWithUrlSync, type SummonDispatch, SummonPorts, type SummonRootState, type SummonStore, TRAY_CHIP_H_DESKTOP, TRAY_CHIP_H_MOBILE, TRAY_CHIP_W_DESKTOP, TRAY_CHIP_W_MOBILE_MAX, TRAY_COMPACT_GAP, TRAY_COMPACT_H, TRAY_GAP_X, TRAY_GAP_Y, TRAY_MARGIN_B, TRAY_MARGIN_L, TRAY_MARGIN_R, TRAY_MOBILE_BREAKPOINT, type UrlSyncEntry, type UrlSyncState, type ViewportDims, type WindowCloseIntent, WindowEntry, WindowManagerState, WindowRect, type WindowRectLike, ackOverlayRender, ackOverlaySurfaceRender, centerRectInViewport, clampRectToCurrentViewport, clampRectToViewport, clearOverlayRender, clearOverlayState, clearOverlaySurfaceRender, closeAllOverlays, closeLifecycleMiddleware, computeTrayChipHeight, computeTrayChipWidth, createOverlayRenderWatchdogMiddleware, createSummonMiddleware, createSummonStore, diagnoseOverlayRender, hydrateOverlayState, linksReducer, overlayStateReducer, overlaysRawActions, overlaysReducer, pruneStaleInstances, rectOnScreen, rectsEqual, registerCloseFlusher, registerSyncEntry, releaseOverlayInstance, replaceOverlayState, resetOverlayRenderWatchdog, safeViewportDims, selectIsUrlHydrated, selectOverlayStateFor, selectOverlayStateValue, selectUrlSyncEntries, setHydrated, setOverlayStateValue, summonCore, summonReducers, trayChipsPerRow, traySlotRect, unregisterSyncEntry, watchdogTracksOpen };
package/dist/index.js CHANGED
@@ -141,10 +141,9 @@ var closeOverlay = creator(
141
141
  (payload) => payload.instanceId === void 0 ? { overlayId: payload.overlayId } : { overlayId: payload.overlayId, instanceId: payload.instanceId }
142
142
  );
143
143
  var toggleOverlay = creator(O + "toggleOverlay", (payload) => rawOpen(payload));
144
- var closeAllInstancesOfOverlay = creator(
145
- O + "closeAllInstancesOfOverlay",
146
- (payload) => ({ overlayId: payload.overlayId })
147
- );
144
+ var closeAllInstancesOfOverlay = creator(O + "closeAllInstancesOfOverlay", (payload) => ({
145
+ overlayId: payload.overlayId
146
+ }));
148
147
  function overlayIdsBoundToPage() {
149
148
  return allOverlayMeta().filter((meta) => meta.closesOnNavigation === true).map((meta) => meta.id);
150
149
  }
@@ -163,17 +162,21 @@ var restoreWindow = creator(W + "restoreWindow", pass());
163
162
  var toggleWindowsHidden = creator(W + "toggleWindowsHidden", () => void 0);
164
163
  var restoreAll = creator(W + "restoreAll", () => void 0);
165
164
  var minimizeAll = creator(W + "minimizeAll", pass());
165
+ var arrangeActiveWindows = creator(W + "arrangeActiveWindows", pass());
166
+ var registerSyncEntry = creator("urlSync/registerSyncEntry", pass());
167
+ var unregisterSyncEntry = creator("urlSync/unregisterSyncEntry", pass());
166
168
 
167
169
  // src/open/selectors.ts
168
170
  import { globalSlot as globalSlot2 } from "@ai-matrx/kit/global-slot";
171
+ var overlaysOf = (state2) => state2.overlays;
169
172
  var CLOSED = Object.freeze({ isOpen: false, data: null });
170
173
  var EMPTY = Object.freeze([]);
171
- var selectOverlay = (state2, overlayId, instanceId = DEFAULT_INSTANCE_ID) => state2.overlays?.overlays[overlayId]?.[instanceId] ?? CLOSED;
174
+ var selectOverlay = (state2, overlayId, instanceId = DEFAULT_INSTANCE_ID) => overlaysOf(state2)?.overlays[overlayId]?.[instanceId] ?? CLOSED;
172
175
  var selectIsOverlayOpen = (state2, overlayId, instanceId = DEFAULT_INSTANCE_ID) => selectOverlay(state2, overlayId, instanceId).isOpen;
173
176
  var selectOverlayData = (state2, overlayId, instanceId = DEFAULT_INSTANCE_ID) => selectOverlay(state2, overlayId, instanceId).data;
174
177
  var openCache = () => globalSlot2("ai-matrx.summon.openInstances", () => /* @__PURE__ */ new Map());
175
178
  var selectOpenInstances = (state2, overlayId) => {
176
- const bucket = state2.overlays?.overlays[overlayId];
179
+ const bucket = overlaysOf(state2)?.overlays[overlayId];
177
180
  const cache = openCache();
178
181
  const hit = cache.get(overlayId);
179
182
  if (hit && hit.bucket === bucket) return hit.result;
@@ -188,11 +191,12 @@ var selectOpenInstances = (state2, overlayId) => {
188
191
  };
189
192
  function listOpenInstanceKeys(state2) {
190
193
  const keys = [];
191
- for (const [overlayId, bucket] of Object.entries(state2.overlays?.overlays ?? {})) {
194
+ for (const [overlayId, bucket] of Object.entries(overlaysOf(state2)?.overlays ?? {})) {
192
195
  for (const [instanceId, inst] of Object.entries(bucket)) if (inst.isOpen) keys.push(`${overlayId}:${instanceId}`);
193
196
  }
194
197
  return keys;
195
198
  }
199
+ var EMPTY_WINDOWS = Object.freeze([]);
196
200
 
197
201
  // src/core/overlaysSlice.ts
198
202
  var initialState = { overlays: {} };
@@ -1450,7 +1454,7 @@ var {
1450
1454
  updateWindowTitle,
1451
1455
  toggleWindowsHidden: toggleWindowsHidden2,
1452
1456
  moveTraySlot,
1453
- arrangeActiveWindows,
1457
+ arrangeActiveWindows: arrangeActiveWindows2,
1454
1458
  popOutWindow,
1455
1459
  dockWindow,
1456
1460
  setPopoutCandidate,
@@ -1525,7 +1529,7 @@ var urlSyncSlice = createSlice3({
1525
1529
  }
1526
1530
  });
1527
1531
  var linksReducer = urlSyncSlice.reducer;
1528
- var { setHydrated, registerSyncEntry, unregisterSyncEntry } = urlSyncSlice.actions;
1532
+ var { setHydrated, registerSyncEntry: registerSyncEntry2, unregisterSyncEntry: unregisterSyncEntry2 } = urlSyncSlice.actions;
1529
1533
  var selectUrlSyncEntries = (state2) => state2.urlSync.entries;
1530
1534
  var selectIsUrlHydrated = (state2) => state2.urlSync.isHydrated;
1531
1535
 
@@ -2267,7 +2271,7 @@ export {
2267
2271
  ackOverlaySurfaceRender,
2268
2272
  allOverlayMeta,
2269
2273
  anonymousIdentity,
2270
- arrangeActiveWindows,
2274
+ arrangeActiveWindows2 as arrangeActiveWindows,
2271
2275
  buildDockWindowPayload,
2272
2276
  centerRectInViewport,
2273
2277
  clampAllWindowRects,
@@ -2339,7 +2343,7 @@ export {
2339
2343
  rectsEqual,
2340
2344
  registerCloseFlusher,
2341
2345
  registerOverlayMeta,
2342
- registerSyncEntry,
2346
+ registerSyncEntry2 as registerSyncEntry,
2343
2347
  registerWindow,
2344
2348
  releaseOverlayInstance,
2345
2349
  releaseTransientWindow,
@@ -2389,7 +2393,7 @@ export {
2389
2393
  toggleWindowsHidden2 as toggleWindowsHidden,
2390
2394
  trayChipsPerRow,
2391
2395
  traySlotRect,
2392
- unregisterSyncEntry,
2396
+ unregisterSyncEntry2 as unregisterSyncEntry,
2393
2397
  unregisterWindow,
2394
2398
  updateWindowPersistence,
2395
2399
  updateWindowRect,