@ai-matrx/summon 0.1.11 → 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/CHANGELOG.md +21 -2
- package/dist/gate-O-00kToO.d.cts +851 -0
- package/dist/gate-O-00kToO.d.ts +851 -0
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -431
- package/dist/index.d.ts +3 -431
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/open.cjs +17 -8
- package/dist/open.cjs.map +1 -1
- package/dist/open.d.cts +1 -1
- package/dist/open.d.ts +1 -1
- package/dist/open.js +17 -8
- package/dist/open.js.map +1 -1
- package/package.json +4 -4
- package/dist/gate-2V3LrLFh.d.cts +0 -419
- package/dist/gate-2V3LrLFh.d.ts +0 -419
|
@@ -0,0 +1,851 @@
|
|
|
1
|
+
import { OverlayHostTypes, OverlayRegistry } from '@ai-matrx/summon';
|
|
2
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
3
|
+
import { Reducer, Middleware } from '@reduxjs/toolkit';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The shared vocabulary of @ai-matrx/summon. Framework-free: no React, no Redux imports.
|
|
7
|
+
*
|
|
8
|
+
* An OVERLAY is any component rendered on top of the app by dispatch — a window, dialog, sheet,
|
|
9
|
+
* light floating window, toast-like card, anything. It is identified by an `OverlayId` and opened
|
|
10
|
+
* as one or more INSTANCES (`instanceId`, "default" for single-instance overlays).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The host's overlay registry: overlay id → the data its opener accepts. Hosts extend it by
|
|
14
|
+
* module augmentation so every open call is type-checked:
|
|
15
|
+
*
|
|
16
|
+
* declare module "@ai-matrx/summon" {
|
|
17
|
+
* interface OverlayRegistry { notesWindow: { noteId?: string } }
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* `defineOverlay` emits nothing at runtime for this; the augmentation is the host's one-line
|
|
21
|
+
* declaration per overlay (the converter writes it next to each definition).
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** Every registered overlay id; plain `string` until the host augments the registry. */
|
|
25
|
+
type OverlayId = [keyof OverlayRegistry] extends [never] ? string : Extract<keyof OverlayRegistry, string>;
|
|
26
|
+
/** The open-data type declared for an overlay id. */
|
|
27
|
+
type OverlayDataOf<Id extends string> = Id extends keyof OverlayRegistry ? OverlayRegistry[Id] : Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Data as it arrives at render time. It crossed Redux, a URL or storage, so it is NOT trusted to
|
|
30
|
+
* match the opener's type: render code narrows it (or the definition supplies `parse`).
|
|
31
|
+
*/
|
|
32
|
+
type OverlayRawData = Readonly<Record<string, unknown>> | null;
|
|
33
|
+
declare const DEFAULT_INSTANCE_ID = "default";
|
|
34
|
+
/** `single`: one instance ("default"). `multi`: any number, each with its own instanceId. */
|
|
35
|
+
type InstanceMode = "single" | "multi";
|
|
36
|
+
/**
|
|
37
|
+
* What closing does to a mounted overlay (Arman, 2026-10-16, C38 R3):
|
|
38
|
+
* none — unmount (default).
|
|
39
|
+
* hidden — stay mounted but hidden; reopening shows the same live component (LRU-capped).
|
|
40
|
+
* restore — unmount, but values saved with `useOverlayState` come back on reopen.
|
|
41
|
+
* Minimizing a window always keeps its component mounted, whatever this says.
|
|
42
|
+
*/
|
|
43
|
+
type KeepAlive = "none" | "hidden" | "restore";
|
|
44
|
+
/** `overlayId:instanceId` — the one key every subsystem uses for an open instance. */
|
|
45
|
+
type InstanceKey = `${string}:${string}`;
|
|
46
|
+
declare function instanceKey(overlayId: string, instanceId?: string): InstanceKey;
|
|
47
|
+
declare function parseInstanceKey(key: string): {
|
|
48
|
+
overlayId: string;
|
|
49
|
+
instanceId: string;
|
|
50
|
+
} | null;
|
|
51
|
+
type MobilePresentation = "fullscreen" | "drawer" | "card" | "hidden";
|
|
52
|
+
/**
|
|
53
|
+
* Default-deny allowlist of the open data a window may save and restore. A window with no
|
|
54
|
+
* preservation entry restores geometry only.
|
|
55
|
+
*/
|
|
56
|
+
interface WindowPreservation {
|
|
57
|
+
readonly dataKeys: readonly string[];
|
|
58
|
+
readonly requiredDataKeys?: readonly string[];
|
|
59
|
+
readonly allowedDataValues?: Readonly<Record<string, readonly (string | number | boolean | null)[]>>;
|
|
60
|
+
/** Default 32 KiB. */
|
|
61
|
+
readonly maxDataBytes?: number;
|
|
62
|
+
}
|
|
63
|
+
/** One declared home for an unbidden (system-raised) window: a route prefix, or one exact page. */
|
|
64
|
+
type UnbiddenHomeRoute = string | {
|
|
65
|
+
readonly route: string;
|
|
66
|
+
readonly exact: true;
|
|
67
|
+
};
|
|
68
|
+
interface OverlayWindowOptions {
|
|
69
|
+
readonly mobile?: MobilePresentation;
|
|
70
|
+
readonly mobileSidebarAs?: "drawer" | "inline";
|
|
71
|
+
/** Never saved or restored (debug panels, one-shot tools, callback-bound editors). */
|
|
72
|
+
readonly ephemeral?: boolean;
|
|
73
|
+
readonly preservation?: WindowPreservation;
|
|
74
|
+
/**
|
|
75
|
+
* Values merged under saved data when a window is RESTORED (reload, another device). Unlike the
|
|
76
|
+
* definition's `defaults`, never applied to a normal open.
|
|
77
|
+
*/
|
|
78
|
+
readonly restoreDefaults?: Readonly<Record<string, unknown>>;
|
|
79
|
+
/**
|
|
80
|
+
* The window-manager id the WindowPanel registers under for the default instance. Default: the
|
|
81
|
+
* overlay id. The render watchdog reveals and inspects this id until the panel acks its own.
|
|
82
|
+
*/
|
|
83
|
+
readonly windowId?: string;
|
|
84
|
+
readonly deprecated?: {
|
|
85
|
+
readonly replacement?: string;
|
|
86
|
+
readonly reason?: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Where a window nobody opened (system-raised) may raise itself. Default deny: no home → it may
|
|
90
|
+
* not raise itself anywhere (`mayRaiseUnbidden` in the window section).
|
|
91
|
+
*/
|
|
92
|
+
readonly unbiddenHome?: readonly UnbiddenHomeRoute[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Host-specific types the package passes through untouched. A Redux host augments `dispatch`
|
|
96
|
+
* with its thunk-aware dispatch so link hydrators can dispatch its thunks without casts:
|
|
97
|
+
*
|
|
98
|
+
* declare module "@ai-matrx/summon" { interface OverlayHostTypes { dispatch: AppDispatch } }
|
|
99
|
+
*/
|
|
100
|
+
type OverlayHostDispatch = OverlayHostTypes extends {
|
|
101
|
+
dispatch: infer D;
|
|
102
|
+
} ? D : (action: unknown) => unknown;
|
|
103
|
+
interface LinkHydrateContext<Data> {
|
|
104
|
+
/** The id segment of the link token (`notes:<id>`). */
|
|
105
|
+
readonly id: string;
|
|
106
|
+
/** Decoded `k-v` arguments of the token. */
|
|
107
|
+
readonly args: Readonly<Record<string, string>>;
|
|
108
|
+
/** Open this overlay. */
|
|
109
|
+
open(options?: {
|
|
110
|
+
readonly instanceId?: string;
|
|
111
|
+
readonly data?: Data;
|
|
112
|
+
}): void;
|
|
113
|
+
/** The host store's dispatch, for thunks a hydrator needs (loading a record first). Typed by
|
|
114
|
+
* augmenting `OverlayHostTypes` with the host's dispatch type. */
|
|
115
|
+
readonly dispatch: OverlayHostDispatch;
|
|
116
|
+
}
|
|
117
|
+
interface OverlayLinkSpec<Data> {
|
|
118
|
+
/** The token type key in `?panels=key:id`. Unique across the host. */
|
|
119
|
+
readonly key: string;
|
|
120
|
+
/** Older keys that still resolve to this overlay. */
|
|
121
|
+
readonly aliases?: readonly string[];
|
|
122
|
+
/** Turn a link token into an open overlay (and its data). `"refused"` keeps the token and says why. */
|
|
123
|
+
hydrate(context: LinkHydrateContext<Data>): void | "refused" | Promise<void | "refused">;
|
|
124
|
+
}
|
|
125
|
+
interface OverlayDefinitionMeta<Id extends string = string, Data = Record<string, unknown>> {
|
|
126
|
+
readonly id: Id;
|
|
127
|
+
/** Human label: tray, menus, diagnostics. */
|
|
128
|
+
readonly label: string;
|
|
129
|
+
readonly instance?: InstanceMode;
|
|
130
|
+
readonly keepAlive?: KeepAlive;
|
|
131
|
+
/** Close when the route changes — the overlay shows a piece of the page that opened it. */
|
|
132
|
+
readonly closesOnNavigation?: boolean;
|
|
133
|
+
/** Present only for overlays that render a WindowPanel. */
|
|
134
|
+
readonly window?: OverlayWindowOptions;
|
|
135
|
+
readonly link?: OverlayLinkSpec<Data>;
|
|
136
|
+
/** Defaults merged under open data (replaces the old per-overlay schema registry). */
|
|
137
|
+
readonly defaults?: Partial<Data>;
|
|
138
|
+
}
|
|
139
|
+
/** The window-manager id a singleton window overlay registers under (`window.windowId ?? id`). */
|
|
140
|
+
declare function defaultWindowIdFor(meta: Pick<OverlayDefinitionMeta, "id" | "window">): string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Everything the overlays system needs from its host, as ports. Every port ships a working
|
|
144
|
+
* default, so a bare host gets a working system with zero wiring (package standard rule 8); a
|
|
145
|
+
* host overrides only what it has: identity, navigation, notifications, error sink, debug flag,
|
|
146
|
+
* persistence. Framework-free.
|
|
147
|
+
*/
|
|
148
|
+
type Unsubscribe = () => void;
|
|
149
|
+
/** Who the person is, for isolating saved state. `key` changes → everything saved is swapped. */
|
|
150
|
+
interface IdentityPort {
|
|
151
|
+
current(): {
|
|
152
|
+
readonly key: string;
|
|
153
|
+
readonly ready: boolean;
|
|
154
|
+
};
|
|
155
|
+
subscribe(listener: () => void): Unsubscribe;
|
|
156
|
+
}
|
|
157
|
+
/** The address bar: route changes (close-on-navigation) and the `?panels=` link channel. */
|
|
158
|
+
interface RouterPort {
|
|
159
|
+
pathname(): string;
|
|
160
|
+
search(): string;
|
|
161
|
+
/** Replace the query string without navigating or remounting the page. */
|
|
162
|
+
replaceSearch(nextSearch: string): void;
|
|
163
|
+
subscribe(listener: () => void): Unsubscribe;
|
|
164
|
+
}
|
|
165
|
+
interface NotifyOptions {
|
|
166
|
+
readonly id?: string;
|
|
167
|
+
readonly description?: string;
|
|
168
|
+
/** How long the notice stays up (ms). Hosts without timed notices ignore it. */
|
|
169
|
+
readonly duration?: number;
|
|
170
|
+
/** One action button (e.g. the render watchdog's "Show it"). Hosts without actions ignore it. */
|
|
171
|
+
readonly action?: {
|
|
172
|
+
readonly label: string;
|
|
173
|
+
readonly onClick: () => void;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
interface NotifyPort {
|
|
177
|
+
info(message: string, options?: NotifyOptions): void;
|
|
178
|
+
warn(message: string, options?: NotifyOptions): void;
|
|
179
|
+
error(message: string, options?: NotifyOptions): void;
|
|
180
|
+
/** Withdraw a notice by id (optional). */
|
|
181
|
+
dismiss?(id: string): void;
|
|
182
|
+
}
|
|
183
|
+
interface ErrorSinkPort {
|
|
184
|
+
capture(error: unknown, context: Readonly<Record<string, unknown>>): void;
|
|
185
|
+
}
|
|
186
|
+
interface DebugPort {
|
|
187
|
+
enabled(): boolean;
|
|
188
|
+
subscribe?(listener: () => void): Unsubscribe;
|
|
189
|
+
}
|
|
190
|
+
/** A stored value with its optimistic-concurrency version (0 when the store has none). */
|
|
191
|
+
interface StoredValue<T = unknown> {
|
|
192
|
+
readonly value: T;
|
|
193
|
+
readonly version: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Where saved overlay state lives when persistence is on. Keys are already scoped to the
|
|
197
|
+
* identity by the caller (`<identityKey>/<key>`) for stores that are not per-person themselves.
|
|
198
|
+
* Implementations: the browser-local store (`./persistence`), `@ai-matrx/data` over
|
|
199
|
+
* `users.user_surface_state` (`./persistence/data`), or any host database.
|
|
200
|
+
*/
|
|
201
|
+
interface OverlayPersistencePort {
|
|
202
|
+
/**
|
|
203
|
+
* True when the store is per-person itself (rows scoped to the signed-in person, e.g. the
|
|
204
|
+
* `@ai-matrx/data` adapter): the persistence section then passes plain keys (`workspace`,
|
|
205
|
+
* `state:<instanceKey>`) instead of `<identityKey>/<key>`, and defaults to `scope: "person"`.
|
|
206
|
+
*/
|
|
207
|
+
readonly perPerson?: boolean;
|
|
208
|
+
load<T = unknown>(key: string): Promise<StoredValue<T> | null>;
|
|
209
|
+
save<T = unknown>(key: string, value: T, options?: {
|
|
210
|
+
readonly expectedVersion?: number;
|
|
211
|
+
}): Promise<{
|
|
212
|
+
readonly version: number;
|
|
213
|
+
}>;
|
|
214
|
+
remove(key: string): Promise<void>;
|
|
215
|
+
list?(prefix: string): Promise<readonly string[]>;
|
|
216
|
+
/**
|
|
217
|
+
* Every saved value at once (key → value), for stores where one read is cheaper than several.
|
|
218
|
+
* When present, restoring an identity costs exactly this one call: the workspace and every
|
|
219
|
+
* saved component state come out of it, and `load`/`list` are not called on boot.
|
|
220
|
+
*/
|
|
221
|
+
loadAll?(): Promise<ReadonlyMap<string, StoredValue>>;
|
|
222
|
+
}
|
|
223
|
+
interface SummonPorts {
|
|
224
|
+
readonly identity: IdentityPort;
|
|
225
|
+
readonly router: RouterPort;
|
|
226
|
+
readonly notify: NotifyPort;
|
|
227
|
+
readonly errors: ErrorSinkPort;
|
|
228
|
+
readonly debug: DebugPort;
|
|
229
|
+
/** `null` = persistence off (R6). */
|
|
230
|
+
readonly persistence: OverlayPersistencePort | null;
|
|
231
|
+
}
|
|
232
|
+
declare const anonymousIdentity: IdentityPort;
|
|
233
|
+
/** `window.location` + `history.replaceState`; inert on the server. */
|
|
234
|
+
declare const locationRouter: RouterPort;
|
|
235
|
+
declare const consoleNotify: NotifyPort;
|
|
236
|
+
declare const consoleErrorSink: ErrorSinkPort;
|
|
237
|
+
declare const debugOff: DebugPort;
|
|
238
|
+
declare const DEFAULT_PORTS: SummonPorts;
|
|
239
|
+
declare function resolvePorts(overrides: Partial<SummonPorts> | undefined): SummonPorts;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* A definition's meta with its data type erased, so definitions of every data shape share one
|
|
243
|
+
* registry without casts. (`never` erasure made `defaults` unassignable.)
|
|
244
|
+
*/
|
|
245
|
+
interface AnyOverlayMeta extends Omit<OverlayDefinitionMeta<string, unknown>, "defaults"> {
|
|
246
|
+
readonly defaults?: object | undefined;
|
|
247
|
+
}
|
|
248
|
+
type AnyMeta = AnyOverlayMeta;
|
|
249
|
+
/**
|
|
250
|
+
* Register (or re-register) definitions. Re-registering an id replaces it (hot reload). A link
|
|
251
|
+
* key claimed by two different ids is a host bug and throws, naming both.
|
|
252
|
+
*/
|
|
253
|
+
declare function registerOverlayMeta(definitions: readonly AnyOverlayMeta[]): void;
|
|
254
|
+
declare function getOverlayMeta(overlayId: string): AnyMeta | undefined;
|
|
255
|
+
declare function getOverlayMetaByLinkKey(linkKey: string): AnyMeta | undefined;
|
|
256
|
+
declare function allOverlayMeta(): readonly AnyMeta[];
|
|
257
|
+
declare function isRegisteredOverlay(overlayId: string): boolean;
|
|
258
|
+
declare function subscribeToOverlayRegistry(listener: () => void): () => void;
|
|
259
|
+
/** Test-only. */
|
|
260
|
+
declare function resetOverlayRegistry(): void;
|
|
261
|
+
|
|
262
|
+
interface WindowRect {
|
|
263
|
+
x: number;
|
|
264
|
+
y: number;
|
|
265
|
+
width: number;
|
|
266
|
+
height: number;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Calculates a 4-grid quadrant (2x2).
|
|
271
|
+
* @param index 0: top-left, 1: top-right, 2: bottom-left, 3: bottom-right
|
|
272
|
+
*/
|
|
273
|
+
declare function getGrid4Rect(index: number, vw: number, vh: number): WindowRect;
|
|
274
|
+
/**
|
|
275
|
+
* Calculates a 6-grid partition (3 columns x 2 rows).
|
|
276
|
+
* @param index 0-5. 0-2 is top row (left-to-right), 3-5 is bottom row.
|
|
277
|
+
*/
|
|
278
|
+
declare function getGrid6Rect(index: number, vw: number, vh: number): WindowRect;
|
|
279
|
+
/**
|
|
280
|
+
* Calculates an 8-window grid (4 columns, 2 a rows)
|
|
281
|
+
*/
|
|
282
|
+
declare function getGrid8Rect(index: number, vw: number, vh: number): WindowRect;
|
|
283
|
+
/**
|
|
284
|
+
* Calculates a 9-window grid (3 columns, 3 rows)
|
|
285
|
+
*/
|
|
286
|
+
declare function getGrid9Rect(index: number, vw: number, vh: number): WindowRect;
|
|
287
|
+
/**
|
|
288
|
+
* Calculates a 12-window grid (4 columns, 3 rows)
|
|
289
|
+
*/
|
|
290
|
+
declare function getGrid12Rect(index: number, vw: number, vh: number): WindowRect;
|
|
291
|
+
/**
|
|
292
|
+
* Calculates 2 stacked windows on the right edge.
|
|
293
|
+
* @param index 0: top right half, 1: bottom right half
|
|
294
|
+
*/
|
|
295
|
+
declare function getStackedRight2Rect(index: number, vw: number, vh: number): WindowRect;
|
|
296
|
+
/**
|
|
297
|
+
* Calculates 3 stacked windows on the right edge.
|
|
298
|
+
* @param index 0, 1, 2 top-to-bottom on the right third of the screen.
|
|
299
|
+
*/
|
|
300
|
+
declare function getStackedRight3Rect(index: number, vw: number, vh: number): WindowRect;
|
|
301
|
+
/**
|
|
302
|
+
* Calculates 4 stacked windows on the right edge.
|
|
303
|
+
* @param index 0,1,2,3 top-to-bottom on the right quarter of the screen.
|
|
304
|
+
*/
|
|
305
|
+
declare function getStackedRight4Rect(index: number, vw: number, vh: number): WindowRect;
|
|
306
|
+
/**
|
|
307
|
+
* Calculates 5 stacked windows on the right edge.
|
|
308
|
+
*/
|
|
309
|
+
declare function getStackedRight5Rect(index: number, vw: number, vh: number): WindowRect;
|
|
310
|
+
/**
|
|
311
|
+
* Calculates 2 stacked windows on the left edge.
|
|
312
|
+
* @param index 0: top left half, 1: bottom left half
|
|
313
|
+
*/
|
|
314
|
+
declare function getStackedLeft2Rect(index: number, vw: number, vh: number): WindowRect;
|
|
315
|
+
/**
|
|
316
|
+
* Calculates 3 stacked windows on the left edge.
|
|
317
|
+
* @param index 0, 1, 2 top-to-bottom on the left third of the screen.
|
|
318
|
+
*/
|
|
319
|
+
declare function getStackedLeft3Rect(index: number, vw: number, vh: number): WindowRect;
|
|
320
|
+
/**
|
|
321
|
+
* Calculates 4 stacked windows on the left edge.
|
|
322
|
+
* @param index 0,1,2,3 top-to-bottom on the left quarter of the screen.
|
|
323
|
+
*/
|
|
324
|
+
declare function getStackedLeft4Rect(index: number, vw: number, vh: number): WindowRect;
|
|
325
|
+
/**
|
|
326
|
+
* Calculates 5 stacked windows on the left edge.
|
|
327
|
+
*/
|
|
328
|
+
declare function getStackedLeft5Rect(index: number, vw: number, vh: number): WindowRect;
|
|
329
|
+
type GlobalLayoutType = "grid4" | "grid6" | "grid8" | "grid9" | "grid12" | "stackRight2" | "stackRight3" | "stackRight4" | "stackRight5" | "stackLeft2" | "stackLeft3" | "stackLeft4" | "stackLeft5";
|
|
330
|
+
/**
|
|
331
|
+
* Helper: Applies global arrangement to an array of windows logic.
|
|
332
|
+
* Returns an array of updates to batch dispatch.
|
|
333
|
+
*/
|
|
334
|
+
declare function computeGlobalArrangement(layout: GlobalLayoutType, windowIds: string[], vw: number, vh: number, dirX?: "ltr" | "rtl", dirY?: "ttb" | "btt", primary?: "horizontal" | "vertical"): {
|
|
335
|
+
id: string;
|
|
336
|
+
rect: WindowRect;
|
|
337
|
+
}[];
|
|
338
|
+
|
|
339
|
+
interface OpenOverlayPayload<Id extends OverlayId = OverlayId> {
|
|
340
|
+
overlayId: Id;
|
|
341
|
+
instanceId?: string;
|
|
342
|
+
data?: OverlayDataOf<Id> | null;
|
|
343
|
+
}
|
|
344
|
+
interface CloseOverlayPayload<Id extends OverlayId = OverlayId> {
|
|
345
|
+
overlayId: Id;
|
|
346
|
+
instanceId?: string;
|
|
347
|
+
}
|
|
348
|
+
type ToggleOverlayPayload<Id extends OverlayId = OverlayId> = OpenOverlayPayload<Id>;
|
|
349
|
+
interface CloseAllInstancesPayload<Id extends OverlayId = OverlayId> {
|
|
350
|
+
overlayId: Id;
|
|
351
|
+
}
|
|
352
|
+
interface CloseOverlaysBoundToPagePayload {
|
|
353
|
+
/** Overlay ids whose definitions say `closesOnNavigation`. */
|
|
354
|
+
overlayIds: readonly string[];
|
|
355
|
+
}
|
|
356
|
+
interface PruneStaleInstancesPayload {
|
|
357
|
+
olderThanMs: number;
|
|
358
|
+
}
|
|
359
|
+
/** Raw reducer payload: untyped ids + the registry defaults the creator resolved. */
|
|
360
|
+
interface RawOpenPayload {
|
|
361
|
+
overlayId: string;
|
|
362
|
+
instanceId?: string;
|
|
363
|
+
data?: unknown;
|
|
364
|
+
defaults?: Readonly<Record<string, unknown>>;
|
|
365
|
+
}
|
|
366
|
+
interface SummonAction<P> {
|
|
367
|
+
type: string;
|
|
368
|
+
payload: P;
|
|
369
|
+
/** Structurally a Redux `UnknownAction`. */
|
|
370
|
+
[extra: string]: unknown;
|
|
371
|
+
}
|
|
372
|
+
type Creator<Args extends unknown[], P> = ((...args: Args) => SummonAction<P>) & {
|
|
373
|
+
readonly type: string;
|
|
374
|
+
match(action: unknown): action is SummonAction<P>;
|
|
375
|
+
};
|
|
376
|
+
/** A creator whose call signature stays generic (the inferred `creator` form erases `Id`). */
|
|
377
|
+
type Generic<F> = F & {
|
|
378
|
+
readonly type: string;
|
|
379
|
+
match(action: unknown): action is SummonAction<unknown>;
|
|
380
|
+
};
|
|
381
|
+
declare const openOverlay: Generic<(<Id extends OverlayId>(payload: OpenOverlayPayload<Id>) => SummonAction<RawOpenPayload>)>;
|
|
382
|
+
declare const closeOverlay: Generic<(<Id extends OverlayId>(payload: CloseOverlayPayload<Id>) => SummonAction<{
|
|
383
|
+
overlayId: string;
|
|
384
|
+
instanceId?: string;
|
|
385
|
+
}>)>;
|
|
386
|
+
declare const toggleOverlay: Generic<(<Id extends OverlayId>(payload: ToggleOverlayPayload<Id>) => SummonAction<RawOpenPayload>)>;
|
|
387
|
+
declare const closeAllInstancesOfOverlay: Generic<(<Id extends OverlayId>(payload: CloseAllInstancesPayload<Id>) => SummonAction<{
|
|
388
|
+
overlayId: string;
|
|
389
|
+
}>)>;
|
|
390
|
+
/** Ids of every registered overlay whose definition says `closesOnNavigation`. */
|
|
391
|
+
declare function overlayIdsBoundToPage(): string[];
|
|
392
|
+
/** Close page-bound overlays. Omit the ids to use the registry's `closesOnNavigation` list. */
|
|
393
|
+
declare const closeOverlaysBoundToPage: Creator<[payload?: Partial<CloseOverlaysBoundToPagePayload> | undefined], CloseOverlaysBoundToPagePayload>;
|
|
394
|
+
declare const closeAllOverlays: Creator<[], undefined>;
|
|
395
|
+
declare const pruneStaleInstances: Creator<[payload: PruneStaleInstancesPayload], PruneStaleInstancesPayload>;
|
|
396
|
+
declare const focusWindow$1: Creator<[payload: string], string>;
|
|
397
|
+
declare const restoreWindow$1: Creator<[payload: string], string>;
|
|
398
|
+
declare const toggleWindowsHidden$1: Creator<[], undefined>;
|
|
399
|
+
declare const restoreAll$1: Creator<[], undefined>;
|
|
400
|
+
declare const minimizeAll$1: Creator<[payload: {
|
|
401
|
+
viewportWidth: number;
|
|
402
|
+
viewportHeight: number;
|
|
403
|
+
}], {
|
|
404
|
+
viewportWidth: number;
|
|
405
|
+
viewportHeight: number;
|
|
406
|
+
}>;
|
|
407
|
+
interface ArrangeActiveWindowsPayload {
|
|
408
|
+
layout: GlobalLayoutType;
|
|
409
|
+
viewportWidth: number;
|
|
410
|
+
viewportHeight: number;
|
|
411
|
+
dirX?: "ltr" | "rtl";
|
|
412
|
+
dirY?: "ttb" | "btt";
|
|
413
|
+
primary?: "horizontal" | "vertical";
|
|
414
|
+
}
|
|
415
|
+
declare const arrangeActiveWindows$1: Creator<[payload: ArrangeActiveWindowsPayload], ArrangeActiveWindowsPayload>;
|
|
416
|
+
interface UrlSyncEntryPayload {
|
|
417
|
+
typeKey: string;
|
|
418
|
+
instanceId: string;
|
|
419
|
+
args?: Readonly<Record<string, string>>;
|
|
420
|
+
}
|
|
421
|
+
declare const registerSyncEntry: Creator<[payload: UrlSyncEntryPayload], UrlSyncEntryPayload>;
|
|
422
|
+
declare const unregisterSyncEntry: Creator<[payload: {
|
|
423
|
+
typeKey: string;
|
|
424
|
+
instanceId: string;
|
|
425
|
+
}], {
|
|
426
|
+
typeKey: string;
|
|
427
|
+
instanceId: string;
|
|
428
|
+
}>;
|
|
429
|
+
/** Every slice key the summon reducers own; an action under one of them needs the runtime. */
|
|
430
|
+
declare const SUMMON_SLICE_KEYS: readonly ["overlays", "windowManager", "urlSync", "overlayState"];
|
|
431
|
+
declare function isSummonAction(action: unknown): action is {
|
|
432
|
+
type: string;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
interface DockWindowPayload {
|
|
436
|
+
id: string;
|
|
437
|
+
viewportWidth: number;
|
|
438
|
+
viewportHeight: number;
|
|
439
|
+
}
|
|
440
|
+
/** Build a dock action payload from the live parent viewport. Client-only. */
|
|
441
|
+
declare function buildDockWindowPayload(windowId: string): DockWindowPayload;
|
|
442
|
+
|
|
443
|
+
type WindowState = "windowed" | "maximized" | "minimized";
|
|
444
|
+
declare const WINDOW_SESSION_SCHEMA_VERSION: 1;
|
|
445
|
+
/** Canonical persistence identity. Runtime window ids and registry slugs are not identities. */
|
|
446
|
+
declare function windowSessionKey(overlayId: string, instanceId: string): string;
|
|
447
|
+
interface WindowPersistenceRegistration {
|
|
448
|
+
overlayId: string;
|
|
449
|
+
instanceId: string;
|
|
450
|
+
data: Record<string, unknown>;
|
|
451
|
+
sidebarOpen: boolean;
|
|
452
|
+
sidebarSize: number | null;
|
|
453
|
+
}
|
|
454
|
+
interface WindowPersistenceState extends WindowPersistenceRegistration {
|
|
455
|
+
/** Explicit close suppresses every later snapshot/unmount path. */
|
|
456
|
+
closing: boolean;
|
|
457
|
+
}
|
|
458
|
+
/** Compact, JSON-only record written to the local window workspace cache. */
|
|
459
|
+
interface PersistedWindowSession {
|
|
460
|
+
schemaVersion: typeof WINDOW_SESSION_SCHEMA_VERSION;
|
|
461
|
+
sessionKey: string;
|
|
462
|
+
overlayId: string;
|
|
463
|
+
instanceId: string;
|
|
464
|
+
/** Runtime id is diagnostic/matching metadata, never the canonical identity. */
|
|
465
|
+
windowId: string;
|
|
466
|
+
title: string;
|
|
467
|
+
state: WindowState;
|
|
468
|
+
/** Always the full windowed rect, never minimized-card geometry. */
|
|
469
|
+
windowedRect: WindowRect;
|
|
470
|
+
traySlot: number | null;
|
|
471
|
+
zIndex: number;
|
|
472
|
+
sidebarOpen: boolean;
|
|
473
|
+
sidebarSize: number | null;
|
|
474
|
+
data: Record<string, unknown>;
|
|
475
|
+
savedAt: number;
|
|
476
|
+
}
|
|
477
|
+
/** Viewport-normalized session staged for a live WindowPanel registration. */
|
|
478
|
+
interface HydratedWindowSession extends PersistedWindowSession {
|
|
479
|
+
/** Current-viewport render rect; tray geometry is recomputed, never stored. */
|
|
480
|
+
renderRect: WindowRect;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Pop-out mode for windows that have been detached into a separate browser
|
|
484
|
+
* window. Orthogonal to `WindowState` — a popped-out window still has a
|
|
485
|
+
* "logical" docked state remembered on `prePopoutRect` for the dock-back path.
|
|
486
|
+
*
|
|
487
|
+
* - `"pip"`: Document Picture-in-Picture (Chromium) — frameless, always-on-top.
|
|
488
|
+
* Subject to the single-PiP-per-origin constraint enforced via
|
|
489
|
+
* `activePipWindowId`.
|
|
490
|
+
* - `"popup"`: `window.open()` fallback for browsers without DPiP support
|
|
491
|
+
* (Safari, Firefox). Shows browser chrome.
|
|
492
|
+
* - `null`: Window is docked inside the parent viewport (the default).
|
|
493
|
+
*/
|
|
494
|
+
type PopoutMode = "pip" | "popup" | null;
|
|
495
|
+
interface WindowEntry {
|
|
496
|
+
id: string;
|
|
497
|
+
title: string;
|
|
498
|
+
state: WindowState;
|
|
499
|
+
/** Last windowed size/position — restored when coming back from max/min */
|
|
500
|
+
windowed: WindowRect;
|
|
501
|
+
/** Saved rect before minimize so restore can return to the original size */
|
|
502
|
+
preMinimizedRect: WindowRect | null;
|
|
503
|
+
/** z-index order — higher = on top */
|
|
504
|
+
zIndex: number;
|
|
505
|
+
/** Order in the minimized tray (0-based). */
|
|
506
|
+
traySlot: number | null;
|
|
507
|
+
/**
|
|
508
|
+
* Pop-out mode. `null` while docked. When set, the window is rendered into
|
|
509
|
+
* a separate browser window via Document PiP or `window.open()` fallback.
|
|
510
|
+
* Never written to the local workspace cache — always reset on hydration
|
|
511
|
+
* (see `restoreWindowState`).
|
|
512
|
+
*/
|
|
513
|
+
popoutMode: PopoutMode;
|
|
514
|
+
/**
|
|
515
|
+
* Saved windowed rect at popout time. Restored to `windowed` on dock-back
|
|
516
|
+
* via `dockWindow`. `null` while docked (matches `preMinimizedRect` pattern).
|
|
517
|
+
*/
|
|
518
|
+
prePopoutRect: WindowRect | null;
|
|
519
|
+
/** Present only for registry entries explicitly approved for preservation. */
|
|
520
|
+
persistence?: WindowPersistenceState;
|
|
521
|
+
}
|
|
522
|
+
interface WindowManagerState {
|
|
523
|
+
windows: Record<string, WindowEntry>;
|
|
524
|
+
/** Validated sessions waiting for their WindowPanel registration. */
|
|
525
|
+
pendingRestores: Record<string, HydratedWindowSession>;
|
|
526
|
+
/** Next z-index to assign when a window is focused */
|
|
527
|
+
nextZIndex: number;
|
|
528
|
+
/** How many slots are currently occupied in the tray */
|
|
529
|
+
trayCount: number;
|
|
530
|
+
/** Last viewport used to place tray cards; enables safe reflow on removal. */
|
|
531
|
+
trayViewport: {
|
|
532
|
+
width: number;
|
|
533
|
+
height: number;
|
|
534
|
+
} | null;
|
|
535
|
+
/** Global show/hide toggle — windows stay mounted but are visually hidden */
|
|
536
|
+
windowsHidden: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* The id of the window currently occupying the single Document PiP slot
|
|
539
|
+
* (Chromium allows only one DPiP window per origin at a time). `null` when
|
|
540
|
+
* the slot is free. Windows in `"popup"` mode do NOT count toward this slot.
|
|
541
|
+
*/
|
|
542
|
+
activePipWindowId: string | null;
|
|
543
|
+
/**
|
|
544
|
+
* The id of the window currently being dragged outside the viewport beyond
|
|
545
|
+
* the popout threshold. Used purely for visual feedback ("Release to pop
|
|
546
|
+
* out" outline + ghost label). Cleared on every `pointerup`.
|
|
547
|
+
*/
|
|
548
|
+
popoutCandidateId: string | null;
|
|
549
|
+
/**
|
|
550
|
+
* Z-index lane for LITE windows (`MatrxDynamicPanelHost presentation="floating"`).
|
|
551
|
+
*
|
|
552
|
+
* They are deliberately NOT entries in `windows`: a lite window is a
|
|
553
|
+
* transient form/picker host with no tray chip, no minimize and no
|
|
554
|
+
* persistence, so joining `windows` would put a half-typed create form into
|
|
555
|
+
* "minimize all" and the tray — the lost-work trap the lite window exists to
|
|
556
|
+
* avoid. Keeping them in their own map means every tray/minimize/arrange
|
|
557
|
+
* selector excludes them BY CONSTRUCTION rather than by a flag somebody must
|
|
558
|
+
* remember to filter on.
|
|
559
|
+
*
|
|
560
|
+
* They still draw from the SAME `nextZIndex` counter, so there is one
|
|
561
|
+
* z-order: a lite window opened from a WindowPanel always lands above it,
|
|
562
|
+
* and clicking the WindowPanel afterwards raises it above the lite window.
|
|
563
|
+
*/
|
|
564
|
+
transientZ: Record<string, number>;
|
|
565
|
+
}
|
|
566
|
+
declare const TRAY_CHIP_W = 240;
|
|
567
|
+
declare const TRAY_CHIP_H = 160;
|
|
568
|
+
declare const raiseTransientWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/raiseTransientWindow">;
|
|
569
|
+
declare const releaseTransientWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/releaseTransientWindow">;
|
|
570
|
+
declare const registerWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
571
|
+
id: string;
|
|
572
|
+
title?: string;
|
|
573
|
+
initial: WindowRect;
|
|
574
|
+
initialState?: "windowed" | "minimized";
|
|
575
|
+
persistence?: WindowPersistenceRegistration;
|
|
576
|
+
viewport?: {
|
|
577
|
+
width: number;
|
|
578
|
+
height: number;
|
|
579
|
+
};
|
|
580
|
+
}, "windowManager/registerWindow">;
|
|
581
|
+
declare const unregisterWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/unregisterWindow">;
|
|
582
|
+
declare const focusWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/focusWindow">;
|
|
583
|
+
declare const restoreWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/restoreWindow">;
|
|
584
|
+
declare const revealWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
585
|
+
id: string;
|
|
586
|
+
viewportWidth: number;
|
|
587
|
+
viewportHeight: number;
|
|
588
|
+
}, "windowManager/revealWindow">;
|
|
589
|
+
declare const maximizeWindow: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/maximizeWindow">;
|
|
590
|
+
declare const minimizeWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
591
|
+
id: string;
|
|
592
|
+
viewportWidth: number;
|
|
593
|
+
viewportHeight: number;
|
|
594
|
+
}, "windowManager/minimizeWindow">;
|
|
595
|
+
declare const minimizeAll: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
596
|
+
viewportWidth: number;
|
|
597
|
+
viewportHeight: number;
|
|
598
|
+
}, "windowManager/minimizeAll">;
|
|
599
|
+
declare const restoreAll: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/restoreAll">;
|
|
600
|
+
declare const recomputeTrayPositions: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
601
|
+
viewportWidth: number;
|
|
602
|
+
viewportHeight: number;
|
|
603
|
+
}, "windowManager/recomputeTrayPositions">;
|
|
604
|
+
declare const updateWindowRect: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
605
|
+
id: string;
|
|
606
|
+
rect: Partial<WindowRect>;
|
|
607
|
+
}, "windowManager/updateWindowRect">;
|
|
608
|
+
declare const updateWindowTitle: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
609
|
+
id: string;
|
|
610
|
+
title: string;
|
|
611
|
+
}, "windowManager/updateWindowTitle">;
|
|
612
|
+
declare const toggleWindowsHidden: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/toggleWindowsHidden">;
|
|
613
|
+
declare const moveTraySlot: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
614
|
+
id: string;
|
|
615
|
+
toSlot: number;
|
|
616
|
+
}, "windowManager/moveTraySlot">;
|
|
617
|
+
declare const arrangeActiveWindows: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
618
|
+
layout: GlobalLayoutType;
|
|
619
|
+
viewportWidth: number;
|
|
620
|
+
viewportHeight: number;
|
|
621
|
+
dirX?: "ltr" | "rtl";
|
|
622
|
+
dirY?: "ttb" | "btt";
|
|
623
|
+
primary?: "horizontal" | "vertical";
|
|
624
|
+
}, "windowManager/arrangeActiveWindows">;
|
|
625
|
+
declare const popOutWindow: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
626
|
+
id: string;
|
|
627
|
+
mode: "pip" | "popup";
|
|
628
|
+
}, "windowManager/popOutWindow">;
|
|
629
|
+
declare const dockWindow: _reduxjs_toolkit.ActionCreatorWithPayload<DockWindowPayload, "windowManager/dockWindow">;
|
|
630
|
+
declare const setPopoutCandidate: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
631
|
+
id: string | null;
|
|
632
|
+
}, "windowManager/setPopoutCandidate">;
|
|
633
|
+
declare const clampWindowRect: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
634
|
+
id: string;
|
|
635
|
+
viewportWidth: number;
|
|
636
|
+
viewportHeight: number;
|
|
637
|
+
}, "windowManager/clampWindowRect">;
|
|
638
|
+
declare const clampAllWindowRects: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
639
|
+
viewportWidth: number;
|
|
640
|
+
viewportHeight: number;
|
|
641
|
+
}, "windowManager/clampAllWindowRects">;
|
|
642
|
+
declare const restoreWindowState: _reduxjs_toolkit.ActionCreatorWithPayload<Record<string, WindowEntry>, "windowManager/restoreWindowState">;
|
|
643
|
+
declare const hydrateWindowSessions: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
644
|
+
sessions: HydratedWindowSession[];
|
|
645
|
+
viewportWidth: number;
|
|
646
|
+
viewportHeight: number;
|
|
647
|
+
}, "windowManager/hydrateWindowSessions">;
|
|
648
|
+
declare const confirmWindowRestored: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/confirmWindowRestored">;
|
|
649
|
+
declare const discardPendingWindowSession: _reduxjs_toolkit.ActionCreatorWithPayload<string, "windowManager/discardPendingWindowSession">;
|
|
650
|
+
declare const updateWindowPersistence: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
651
|
+
id: string;
|
|
652
|
+
data?: Record<string, unknown>;
|
|
653
|
+
sidebarOpen?: boolean;
|
|
654
|
+
sidebarSize?: number | null;
|
|
655
|
+
}, "windowManager/updateWindowPersistence">;
|
|
656
|
+
declare const markWindowClosing: _reduxjs_toolkit.ActionCreatorWithPayload<{
|
|
657
|
+
overlayId: string;
|
|
658
|
+
instanceId: string;
|
|
659
|
+
}, "windowManager/markWindowClosing">;
|
|
660
|
+
declare const clearWindowPersistenceState: _reduxjs_toolkit.ActionCreatorWithoutPayload<"windowManager/clearWindowPersistenceState">;
|
|
661
|
+
type StateWithWM = {
|
|
662
|
+
windowManager: WindowManagerState;
|
|
663
|
+
};
|
|
664
|
+
declare const selectPendingWindowRestores: (state: StateWithWM) => Record<string, HydratedWindowSession>;
|
|
665
|
+
declare const selectWindowPersistence: (id: string) => (state: StateWithWM) => WindowPersistenceState | undefined;
|
|
666
|
+
declare const selectWindow: (id: string) => (state: StateWithWM) => WindowEntry | undefined;
|
|
667
|
+
declare const selectWindowState: (id: string) => (state: StateWithWM) => WindowState | undefined;
|
|
668
|
+
declare const selectWindowRect: (id: string) => (state: StateWithWM) => WindowRect | undefined;
|
|
669
|
+
declare const selectWindowZIndex: (id: string) => (state: StateWithWM) => number;
|
|
670
|
+
/** z-index for a transient (lite) window; BASE_Z until it has been raised. */
|
|
671
|
+
declare const selectTransientZIndex: (id: string) => (state: StateWithWM) => number;
|
|
672
|
+
declare const selectWindowTitle: (id: string) => (state: StateWithWM) => string;
|
|
673
|
+
declare const selectTraySlotWidth: () => number;
|
|
674
|
+
declare const selectWindowsHidden$1: (state: StateWithWM) => boolean;
|
|
675
|
+
/**
|
|
676
|
+
* Minimized windows sorted by tray slot ascending.
|
|
677
|
+
* Memoized — only recalculates when the windows map reference changes.
|
|
678
|
+
*/
|
|
679
|
+
declare const selectTrayWindows: ((state: StateWithWM) => WindowEntry[]) & {
|
|
680
|
+
clearCache: () => void;
|
|
681
|
+
resultsCount: () => number;
|
|
682
|
+
resetResultsCount: () => void;
|
|
683
|
+
} & {
|
|
684
|
+
resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
|
|
685
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
|
|
686
|
+
clearCache: () => void;
|
|
687
|
+
resultsCount: () => number;
|
|
688
|
+
resetResultsCount: () => void;
|
|
689
|
+
};
|
|
690
|
+
lastResult: () => WindowEntry[];
|
|
691
|
+
dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
|
|
692
|
+
recomputations: () => number;
|
|
693
|
+
resetRecomputations: () => void;
|
|
694
|
+
dependencyRecomputations: () => number;
|
|
695
|
+
resetDependencyRecomputations: () => void;
|
|
696
|
+
} & {
|
|
697
|
+
memoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
698
|
+
argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
699
|
+
};
|
|
700
|
+
/** All registered windows sorted by zIndex descending (most-recently-focused first). */
|
|
701
|
+
declare const selectAllWindows$1: ((state: StateWithWM) => WindowEntry[]) & {
|
|
702
|
+
clearCache: () => void;
|
|
703
|
+
resultsCount: () => number;
|
|
704
|
+
resetResultsCount: () => void;
|
|
705
|
+
} & {
|
|
706
|
+
resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
|
|
707
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
|
|
708
|
+
clearCache: () => void;
|
|
709
|
+
resultsCount: () => number;
|
|
710
|
+
resetResultsCount: () => void;
|
|
711
|
+
};
|
|
712
|
+
lastResult: () => WindowEntry[];
|
|
713
|
+
dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
|
|
714
|
+
recomputations: () => number;
|
|
715
|
+
resetRecomputations: () => void;
|
|
716
|
+
dependencyRecomputations: () => number;
|
|
717
|
+
resetDependencyRecomputations: () => void;
|
|
718
|
+
} & {
|
|
719
|
+
memoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
720
|
+
argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
721
|
+
};
|
|
722
|
+
/** True when every registered window is minimized (or there are none). */
|
|
723
|
+
declare const selectAllMinimized$1: ((state: StateWithWM) => boolean) & {
|
|
724
|
+
clearCache: () => void;
|
|
725
|
+
resultsCount: () => number;
|
|
726
|
+
resetResultsCount: () => void;
|
|
727
|
+
} & {
|
|
728
|
+
resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => boolean;
|
|
729
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => boolean) & {
|
|
730
|
+
clearCache: () => void;
|
|
731
|
+
resultsCount: () => number;
|
|
732
|
+
resetResultsCount: () => void;
|
|
733
|
+
};
|
|
734
|
+
lastResult: () => boolean;
|
|
735
|
+
dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
|
|
736
|
+
recomputations: () => number;
|
|
737
|
+
resetRecomputations: () => void;
|
|
738
|
+
dependencyRecomputations: () => number;
|
|
739
|
+
resetDependencyRecomputations: () => void;
|
|
740
|
+
} & {
|
|
741
|
+
memoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
742
|
+
argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
743
|
+
};
|
|
744
|
+
/** Current popout mode for a window. Returns `null` if docked or unknown id. */
|
|
745
|
+
declare const selectPopoutMode: (id: string) => (state: StateWithWM) => "pip" | "popup" | null;
|
|
746
|
+
/** True if the window is currently popped out (either pip or popup mode). */
|
|
747
|
+
declare const selectIsPoppedOut: (id: string) => (state: StateWithWM) => boolean;
|
|
748
|
+
/** The id of the window holding the single Document PiP slot, or `null`. */
|
|
749
|
+
declare const selectActivePipWindowId: (state: StateWithWM) => string | null;
|
|
750
|
+
/**
|
|
751
|
+
* The id of the window currently being dragged outside the viewport beyond
|
|
752
|
+
* the popout threshold. Used by WindowPanel to render the "Release to pop
|
|
753
|
+
* out" outline.
|
|
754
|
+
*/
|
|
755
|
+
declare const selectPopoutCandidateId: (state: StateWithWM) => string | null;
|
|
756
|
+
/** Saved rect to dock back to. `null` while docked or after dock-back. */
|
|
757
|
+
declare const selectPrePopoutRect: (id: string) => (state: StateWithWM) => WindowRect | null;
|
|
758
|
+
/**
|
|
759
|
+
* All windows currently docked (popoutMode === null), sorted by zIndex
|
|
760
|
+
* descending. Used by arrange/tray logic so popped-out windows don't get
|
|
761
|
+
* assigned slots in parent-viewport layouts.
|
|
762
|
+
*/
|
|
763
|
+
declare const selectDockedWindows: ((state: StateWithWM) => WindowEntry[]) & {
|
|
764
|
+
clearCache: () => void;
|
|
765
|
+
resultsCount: () => number;
|
|
766
|
+
resetResultsCount: () => void;
|
|
767
|
+
} & {
|
|
768
|
+
resultFunc: (resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[];
|
|
769
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<string, WindowEntry>) => WindowEntry[]) & {
|
|
770
|
+
clearCache: () => void;
|
|
771
|
+
resultsCount: () => number;
|
|
772
|
+
resetResultsCount: () => void;
|
|
773
|
+
};
|
|
774
|
+
lastResult: () => WindowEntry[];
|
|
775
|
+
dependencies: [(state: StateWithWM) => Record<string, WindowEntry>];
|
|
776
|
+
recomputations: () => number;
|
|
777
|
+
resetRecomputations: () => void;
|
|
778
|
+
dependencyRecomputations: () => number;
|
|
779
|
+
resetDependencyRecomputations: () => void;
|
|
780
|
+
} & {
|
|
781
|
+
memoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
782
|
+
argsMemoize: typeof _reduxjs_toolkit.weakMapMemoize;
|
|
783
|
+
};
|
|
784
|
+
declare const windowManagerReducer: _reduxjs_toolkit.Reducer<WindowManagerState>;
|
|
785
|
+
|
|
786
|
+
interface OverlayInstance {
|
|
787
|
+
isOpen: boolean;
|
|
788
|
+
data: unknown;
|
|
789
|
+
/** Unix ms of the last open (pruneStaleInstances reads it). */
|
|
790
|
+
lastUsedAt?: number;
|
|
791
|
+
}
|
|
792
|
+
interface OverlayState {
|
|
793
|
+
overlays: Record<string, Record<string, OverlayInstance>>;
|
|
794
|
+
}
|
|
795
|
+
/** The slice of any store these selectors need (absent until the summon runtime is installed). */
|
|
796
|
+
type StateWithOverlays = {
|
|
797
|
+
overlays?: OverlayState;
|
|
798
|
+
} | object;
|
|
799
|
+
interface OpenInstanceView {
|
|
800
|
+
instanceId: string;
|
|
801
|
+
data: unknown;
|
|
802
|
+
}
|
|
803
|
+
declare const selectOverlay: (state: StateWithOverlays, overlayId: string, instanceId?: string) => OverlayInstance;
|
|
804
|
+
declare const selectIsOverlayOpen: (state: StateWithOverlays, overlayId: string, instanceId?: string) => boolean;
|
|
805
|
+
declare const selectOverlayData: (state: StateWithOverlays, overlayId: string, instanceId?: string) => unknown;
|
|
806
|
+
/** All open instances of an overlay id; the array reference is stable while the open set is unchanged. */
|
|
807
|
+
declare const selectOpenInstances: (state: StateWithOverlays, overlayId: string) => readonly OpenInstanceView[];
|
|
808
|
+
/** Every open instance key (`overlayId:instanceId`). */
|
|
809
|
+
declare function listOpenInstanceKeys(state: StateWithOverlays): string[];
|
|
810
|
+
/** True once anything has ever been opened in this store (a key exists in the slice). */
|
|
811
|
+
declare function selectAnyOverlayTouched(state: StateWithOverlays): boolean;
|
|
812
|
+
/** The global hide-all flag (false before the runtime is installed). */
|
|
813
|
+
declare const selectWindowsHidden: (state: object) => boolean;
|
|
814
|
+
type WindowLike = WindowEntry;
|
|
815
|
+
/** Every registered window, topmost first (empty before the runtime is installed). Memoized on the map. */
|
|
816
|
+
declare function selectAllWindows<W extends WindowLike = WindowLike>(state: object): readonly W[];
|
|
817
|
+
/** True when windows exist and every one is minimized (false before the runtime is installed). */
|
|
818
|
+
declare function selectAllMinimized(state: object): boolean;
|
|
819
|
+
|
|
820
|
+
/** What the core hands the gate when it loads. */
|
|
821
|
+
interface SummonCore {
|
|
822
|
+
readonly reducers: Readonly<Record<string, Reducer>>;
|
|
823
|
+
createMiddleware(ports?: Partial<SummonPorts>): Middleware[];
|
|
824
|
+
}
|
|
825
|
+
/** Dispatched once after the slices are injected into a live store, so they hold their initial state. */
|
|
826
|
+
declare const SUMMON_INSTALLED_ACTION = "@@summon/installed";
|
|
827
|
+
/** Called by the core module when it evaluates (idempotent). */
|
|
828
|
+
declare function installSummonCore(core: SummonCore): void;
|
|
829
|
+
declare function isSummonInstalled(): boolean;
|
|
830
|
+
declare function subscribeSummonInstalled(listener: () => void): () => void;
|
|
831
|
+
/** Load the summon core (one import(), shared by every caller). Resolves once it is installed. */
|
|
832
|
+
declare function ensureSummonRuntime(): Promise<void>;
|
|
833
|
+
/** Start loading the core without waiting (idle, pointer intent). Errors surface on the next real request. */
|
|
834
|
+
declare function prefetchSummonRuntime(): void;
|
|
835
|
+
interface SummonGate {
|
|
836
|
+
/** Put this in the host store's middleware chain. */
|
|
837
|
+
readonly middleware: Middleware;
|
|
838
|
+
/**
|
|
839
|
+
* Give the gate the host root reducer's inject function — before `configureStore`, so a core
|
|
840
|
+
* that is already loaded (a page that imported the window section) is injected before the
|
|
841
|
+
* store's first state exists.
|
|
842
|
+
*/
|
|
843
|
+
attachReducer(inject: (reducers: Readonly<Record<string, Reducer>>) => void): void;
|
|
844
|
+
}
|
|
845
|
+
interface CreateSummonGateOptions {
|
|
846
|
+
/** Ports for the summon middleware (render watchdog: notify, errors, debug). */
|
|
847
|
+
readonly ports?: Partial<SummonPorts>;
|
|
848
|
+
}
|
|
849
|
+
declare function createSummonGate(options?: CreateSummonGateOptions): SummonGate;
|
|
850
|
+
|
|
851
|
+
export { allOverlayMeta as $, type AnyOverlayMeta as A, type StoredValue as B, type CloseOverlaysBoundToPagePayload as C, DEFAULT_INSTANCE_ID as D, type ErrorSinkPort as E, TRAY_CHIP_W as F, type GlobalLayoutType as G, type HydratedWindowSession as H, type InstanceKey as I, type ToggleOverlayPayload as J, type KeepAlive as K, type LinkHydrateContext as L, type MobilePresentation as M, type NotifyOptions as N, type OverlayState as O, type PruneStaleInstancesPayload as P, type Unsubscribe as Q, type RawOpenPayload as R, type SummonPorts as S, TRAY_CHIP_H as T, type UnbiddenHomeRoute as U, WINDOW_SESSION_SCHEMA_VERSION as V, type WindowManagerState as W, type WindowPersistenceRegistration as X, type WindowPersistenceState as Y, type WindowPreservation as Z, type WindowState as _, type StateWithOverlays as a, selectIsPoppedOut as a$, anonymousIdentity as a0, arrangeActiveWindows as a1, buildDockWindowPayload as a2, clampAllWindowRects as a3, clampWindowRect as a4, clearWindowPersistenceState as a5, closeAllInstancesOfOverlay as a6, closeOverlay as a7, closeOverlaysBoundToPage as a8, computeGlobalArrangement as a9, listOpenInstanceKeys as aA, locationRouter as aB, markWindowClosing as aC, maximizeWindow as aD, minimizeAll as aE, minimizeWindow as aF, moveTraySlot as aG, openOverlay as aH, overlayIdsBoundToPage as aI, parseInstanceKey as aJ, popOutWindow as aK, raiseTransientWindow as aL, recomputeTrayPositions as aM, registerOverlayMeta as aN, registerWindow as aO, releaseTransientWindow as aP, resetOverlayRegistry as aQ, resolvePorts as aR, restoreAll as aS, restoreWindow as aT, restoreWindowState as aU, revealWindow as aV, selectActivePipWindowId as aW, selectAllMinimized$1 as aX, selectAllWindows$1 as aY, selectDockedWindows as aZ, selectIsOverlayOpen as a_, confirmWindowRestored as aa, consoleErrorSink as ab, consoleNotify as ac, debugOff as ad, defaultWindowIdFor as ae, discardPendingWindowSession as af, dockWindow as ag, focusWindow as ah, getGrid12Rect as ai, getGrid4Rect as aj, getGrid6Rect as ak, getGrid8Rect as al, getGrid9Rect as am, getOverlayMeta as an, getOverlayMetaByLinkKey as ao, getStackedLeft2Rect as ap, getStackedLeft3Rect as aq, getStackedLeft4Rect as ar, getStackedLeft5Rect as as, getStackedRight2Rect as at, getStackedRight3Rect as au, getStackedRight4Rect as av, getStackedRight5Rect as aw, hydrateWindowSessions as ax, instanceKey as ay, isRegisteredOverlay as az, type WindowEntry as b, selectOpenInstances as b0, selectOverlay as b1, selectOverlayData as b2, selectPendingWindowRestores as b3, selectPopoutCandidateId as b4, selectPopoutMode as b5, selectPrePopoutRect as b6, selectTransientZIndex as b7, selectTraySlotWidth as b8, selectTrayWindows as b9, createSummonGate as bA, ensureSummonRuntime as bB, focusWindow$1 as bC, installSummonCore as bD, isSummonAction as bE, isSummonInstalled as bF, minimizeAll$1 as bG, prefetchSummonRuntime as bH, pruneStaleInstances as bI, registerSyncEntry as bJ, restoreAll$1 as bK, restoreWindow$1 as bL, selectAllMinimized as bM, selectAllWindows as bN, selectAnyOverlayTouched as bO, selectWindowsHidden as bP, subscribeSummonInstalled as bQ, toggleWindowsHidden$1 as bR, unregisterSyncEntry as bS, selectWindow as ba, selectWindowPersistence as bb, selectWindowRect as bc, selectWindowState as bd, selectWindowTitle as be, selectWindowZIndex as bf, selectWindowsHidden$1 as bg, setPopoutCandidate as bh, subscribeToOverlayRegistry as bi, toggleOverlay as bj, toggleWindowsHidden as bk, unregisterWindow as bl, updateWindowPersistence as bm, updateWindowRect as bn, updateWindowTitle as bo, windowManagerReducer as bp, windowSessionKey as bq, type ArrangeActiveWindowsPayload as br, type CreateSummonGateOptions as bs, SUMMON_INSTALLED_ACTION as bt, SUMMON_SLICE_KEYS as bu, type SummonAction as bv, type SummonGate as bw, type UrlSyncEntryPayload as bx, arrangeActiveWindows$1 as by, closeAllOverlays as bz, type WindowRect as c, type OverlayDefinitionMeta as d, type SummonCore as e, type CloseAllInstancesPayload as f, type CloseOverlayPayload as g, DEFAULT_PORTS as h, type DebugPort as i, type DockWindowPayload as j, type IdentityPort as k, type InstanceMode as l, type NotifyPort as m, type OpenInstanceView as n, type OpenOverlayPayload as o, type OverlayDataOf as p, type OverlayHostDispatch as q, type OverlayId as r, type OverlayInstance as s, type OverlayLinkSpec as t, type OverlayPersistencePort as u, type OverlayRawData as v, type OverlayWindowOptions as w, type PersistedWindowSession as x, type PopoutMode as y, type RouterPort as z };
|