@dimina-kit/electron-deck 0.1.0-dev.20260702175315 → 0.1.0-dev.20260703051110
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/README.md +45 -15
- package/dist/client/index.d.ts +8 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/dock-react/dock-view.d.ts +43 -19
- package/dist/dock-react/dock-view.d.ts.map +1 -1
- package/dist/dock-react/drag-redock.d.ts +18 -0
- package/dist/dock-react/drag-redock.d.ts.map +1 -1
- package/dist/dock-react/group-view.d.ts +18 -0
- package/dist/dock-react/group-view.d.ts.map +1 -0
- package/dist/dock-react/index.d.ts +3 -2
- package/dist/dock-react/index.d.ts.map +1 -1
- package/dist/dock-react/index.js +384 -289
- package/dist/dock-react/index.js.map +1 -1
- package/dist/dock-react/panel-body.d.ts +24 -0
- package/dist/dock-react/panel-body.d.ts.map +1 -0
- package/dist/dock-react/split-sizing.d.ts +109 -0
- package/dist/dock-react/split-sizing.d.ts.map +1 -0
- package/dist/dock-react/split-view.d.ts +15 -0
- package/dist/dock-react/split-view.d.ts.map +1 -0
- package/dist/{electron-deck-B9fun93z.js → electron-deck-Bi-u-Aze.js} +175 -79
- package/dist/electron-deck-Bi-u-Aze.js.map +1 -0
- package/dist/electron-deck.d.ts +5 -0
- package/dist/electron-deck.d.ts.map +1 -1
- package/dist/events.d.ts +1 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/host/index.d.ts +5 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/deck-app-view-move.d.ts +17 -0
- package/dist/internal/deck-app-view-move.d.ts.map +1 -0
- package/dist/internal/deck-app.d.ts +58 -1
- package/dist/internal/deck-app.d.ts.map +1 -1
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/layout/model.d.ts.map +1 -1
- package/dist/layout/mutations.d.ts.map +1 -1
- package/dist/layout/tree-query.d.ts +18 -0
- package/dist/layout/tree-query.d.ts.map +1 -0
- package/dist/layout/types.d.ts +11 -9
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/{layout-ByOiOdnc.js → layout-D-LYJIpM.js} +57 -41
- package/dist/layout-D-LYJIpM.js.map +1 -0
- package/dist/main/compositor.d.ts.map +1 -1
- package/dist/main/index.js +1 -1
- package/dist/main/view-handle.d.ts.map +1 -1
- package/dist/preload/index.cjs +5 -0
- package/dist/preload/index.cjs.map +1 -1
- package/dist/preload/index.d.ts +5 -0
- package/dist/preload/index.d.ts.map +1 -1
- package/dist/preload/index.js +5 -0
- package/dist/preload/index.js.map +1 -1
- package/dist/types.d.ts +32 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/{view-handle-DDhpBuW-.js → view-handle-zav25k3-.js} +141 -86
- package/dist/view-handle-zav25k3-.js.map +1 -0
- package/package.json +11 -5
- package/dist/electron-deck-B9fun93z.js.map +0 -1
- package/dist/layout-ByOiOdnc.js.map +0 -1
- package/dist/view-handle-DDhpBuW-.js.map +0 -1
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AA0DlE,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAK3E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,SAAS,CAAC,SAAS,CAAC,CAGnE;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAChD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,GAC7B,IAAI,CAQN;AAED,wCAAwC;AACxC,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAM9E"}
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AA0DlE,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAK3E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,SAAS,CAAC,SAAS,CAAC,CAGnE;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAChD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,GAC7B,IAAI,CAQN;AAED,wCAAwC;AACxC,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAM9E"}
|
package/dist/host/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@dimina-kit/electron-deck/host` — the cross-process host-shell transport.
|
|
3
3
|
*
|
|
4
|
+
* `@experimental` No production consumer yet — no host in this repo imports
|
|
5
|
+
* `@dimina-kit/electron-deck/host`; devtools assembles through `backend` /
|
|
6
|
+
* `electronDeck({ backend })` instead, without touching this subpath. Contract
|
|
7
|
+
* may change until a second real consumer adopts it.
|
|
8
|
+
*
|
|
4
9
|
* These are the transport pieces the `electronDeck()` entry (exported from this
|
|
5
10
|
* package's root, `@dimina-kit/electron-deck`) and domain backends construct to
|
|
6
11
|
* carry `hostServices` (trusted-webview RPC) and `events` (main→webview push)
|
package/dist/host/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/host/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,aAAa,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAC7E;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACzF;;GAEG;AACH,OAAO,EACL,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,KAAK,GACX,MAAM,iBAAiB,CAAA;AACxB,yEAAyE;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD;;;;GAIG;AACH,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/host/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as WireTransport, c as InMemoryTypedIpcRegistry, i as createControlBus, l as EventBus, o as createCapabilityRegistry, r as validateConfig, s as createTrustSet } from "../electron-deck-
|
|
1
|
+
import { a as WireTransport, c as InMemoryTypedIpcRegistry, i as createControlBus, l as EventBus, o as createCapabilityRegistry, r as validateConfig, s as createTrustSet } from "../electron-deck-Bi-u-Aze.js";
|
|
2
2
|
export { EventBus, InMemoryTypedIpcRegistry, WireTransport, createCapabilityRegistry, createControlBus, createTrustSet, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as UndeclaredHostEventError, n as DeckRemoteError, r as EventNotBoundError, t as DeckClientNotReadyError } from "./errors-NE2ig7L5.js";
|
|
2
|
-
import { n as startElectronDeck, t as electronDeck, u as defineEvent } from "./electron-deck-
|
|
2
|
+
import { n as startElectronDeck, t as electronDeck, u as defineEvent } from "./electron-deck-Bi-u-Aze.js";
|
|
3
3
|
export { DeckClientNotReadyError, DeckRemoteError, EventNotBoundError, UndeclaredHostEventError, defineEvent, electronDeck, startElectronDeck };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MinimalBrowserWindow, MinimalWebContentsView } from './electron-types.js';
|
|
2
|
+
import type { ViewSubstrate } from './deck-app.js';
|
|
3
|
+
/**
|
|
4
|
+
* `DeckViewHandle.moveTo` failure cleanup. `inner.moveTo` does the atomic
|
|
5
|
+
* native Compositor migration + Scope adopt/rollback; when it rejects, the
|
|
6
|
+
* Compositor's own rollback only reverts state it TRACKED (`order`) — a
|
|
7
|
+
* native `addChildView` that throws MID-APPLY can leave the WCV attached to
|
|
8
|
+
* the dest window's `contentView` with no tracked record to remove it. This
|
|
9
|
+
* balances that leak with an explicit dest detach, then undoes the dest
|
|
10
|
+
* substrate registration made before the move attempt.
|
|
11
|
+
*
|
|
12
|
+
* Each step is independently guarded (its own try/catch) so a cleanup
|
|
13
|
+
* failure in one step never masks the other step or the ORIGINAL move
|
|
14
|
+
* error — `originalErr` is always rethrown, never shadowed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleanupDestOnMoveToFailure(destWin: MinimalBrowserWindow, destSub: ViewSubstrate, wcv: MinimalWebContentsView, viewId: string, originalErr: unknown): never;
|
|
17
|
+
//# sourceMappingURL=deck-app-view-move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deck-app-view-move.d.ts","sourceRoot":"","sources":["../../src/internal/deck-app-view-move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,sBAAsB,EAC3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,OAAO,GAClB,KAAK,CA4BP"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Disposable, RuntimeBackend, Runtime, SenderPolicy, DeckConfig } from '../types.js';
|
|
2
|
-
import type { MinimalBrowserWindow, MinimalElectron } from './electron-types.js';
|
|
2
|
+
import type { MinimalBrowserWindow, MinimalElectron, MinimalWebContentsView } from './electron-types.js';
|
|
3
3
|
import type { LifecyclePhase } from './lifecycle-manager.js';
|
|
4
4
|
import { type Scope } from '../main/scope.js';
|
|
5
|
+
import { type Compositor } from '../main/compositor.js';
|
|
5
6
|
import { type CapabilityPolicy } from '../host/capability.js';
|
|
6
7
|
import { type MinimalIpcMain, type MinimalWebContents } from './wire-transport.js';
|
|
7
8
|
/**
|
|
@@ -32,6 +33,24 @@ export interface DeckAppOptions {
|
|
|
32
33
|
*/
|
|
33
34
|
readonly backend?: RuntimeBackend;
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Per-window native-view substrate. Each tracked window
|
|
38
|
+
* gets ONE `Compositor` whose {@link ContentViewHost} adapts that window's
|
|
39
|
+
* `contentView`. The minimal `contentView` has no `children()`, so the host
|
|
40
|
+
* adapter TRACKS the Compositor-managed views' z-order itself (the toolbar,
|
|
41
|
+
* added directly to `contentView`, is invisible to this `order`). `registerView`
|
|
42
|
+
* binds a view id to its native `WebContentsView` so the adapter can translate a
|
|
43
|
+
* Compositor `NativeViewRef` into the real `addChildView`/`removeChildView` call.
|
|
44
|
+
*/
|
|
45
|
+
export interface ViewSubstrate {
|
|
46
|
+
compositor: Compositor;
|
|
47
|
+
windowScope: Scope;
|
|
48
|
+
registerView(id: string, wcv: MinimalWebContentsView): void;
|
|
49
|
+
/** Drop a disposed/detached view from this
|
|
50
|
+
* substrate's registry + tracked z-order, so a long-lived window doesn't
|
|
51
|
+
* accumulate dead views. Safe to call twice (Map.delete + guarded splice). */
|
|
52
|
+
unregisterView(id: string): void;
|
|
53
|
+
}
|
|
35
54
|
/**
|
|
36
55
|
* Framework-internal "app" object —— `electronDeck(config)` 顶层入口的 plain-class
|
|
37
56
|
* 形态,便于测试驱动 lifecycle 转换。加 wireTransport 注入
|
|
@@ -196,6 +215,33 @@ export declare class DeckApp {
|
|
|
196
215
|
get phase(): LifecyclePhase;
|
|
197
216
|
get runtime(): Runtime;
|
|
198
217
|
start(): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* half-state guard: electron + (toolbar | windows) without wireTransport
|
|
220
|
+
* would leave the host with webviews that can never reach back via
|
|
221
|
+
* __electron-deck:invoke. Reject early with a clear msg.
|
|
222
|
+
*/
|
|
223
|
+
private assertWireTransportPresentForWebviewContent;
|
|
224
|
+
/**
|
|
225
|
+
* Pre-`whenReady` sequencing: single-instance lock (opt-in, must quit
|
|
226
|
+
* BEFORE any other side effect) → `backend.beforeReady` (or the framework's
|
|
227
|
+
* best-effort `app.setName`) → `await app.whenReady()` → app-level lifecycle
|
|
228
|
+
* bindings. Returns `false` when the single-instance lock was lost (the
|
|
229
|
+
* second instance already called `app.quit()` — `start()` must stop with
|
|
230
|
+
* phase still `init`), `true` otherwise.
|
|
231
|
+
*/
|
|
232
|
+
private runPreReadyGate;
|
|
233
|
+
/**
|
|
234
|
+
* Single-instance gate (opt-in): a second instance must quit BEFORE any
|
|
235
|
+
* side effect (beforeReady bootstrap / whenReady / window). Returns `true`
|
|
236
|
+
* when the caller should continue (not opted in, or this instance holds the
|
|
237
|
+
* lock); `false` after the losing instance has called `app.quit()`.
|
|
238
|
+
*/
|
|
239
|
+
private acquireSingleInstanceLock;
|
|
240
|
+
/** Init → Bind → Setup → Ready. Assembly/bind must run AFTER the
|
|
241
|
+
* whenReady gate (handled by the caller); loadURL/loadFile must run
|
|
242
|
+
* AFTER bindWireTransport (a preload calling the bridge before its
|
|
243
|
+
* ipcMain handler is registered would see a "no handler" reject). */
|
|
244
|
+
private runBindAndSetupPhases;
|
|
199
245
|
/**
|
|
200
246
|
* Process-level Electron lifecycle bindings (post-whenReady, independent of
|
|
201
247
|
* `ownsWindows` — these are app events, not window events):
|
|
@@ -279,6 +325,12 @@ export declare class DeckApp {
|
|
|
279
325
|
* default close (the framework does not preventDefault).
|
|
280
326
|
*/
|
|
281
327
|
private armSubWindowCloseMachine;
|
|
328
|
+
/**
|
|
329
|
+
* Remove a previously-registered window event listener (Electron's
|
|
330
|
+
* `removeListener`/`off`). Tolerates minimal test fakes that expose neither by
|
|
331
|
+
* degrading to a no-op — the caller's ownership contract is best-effort cleanup.
|
|
332
|
+
*/
|
|
333
|
+
private removeWindowListener;
|
|
282
334
|
/**
|
|
283
335
|
* @internal Lifetime accessors. The live shadow map mirroring `trackedWindows`,
|
|
284
336
|
* the root Scope, and a consistency assertion.
|
|
@@ -343,6 +395,11 @@ export declare class DeckApp {
|
|
|
343
395
|
*/
|
|
344
396
|
private warnedInvalidKeepAliveMax;
|
|
345
397
|
private warnInvalidKeepAliveMax;
|
|
398
|
+
/** Drop `viewId` from `groupKey`'s HIDDEN list only (the group's `handles`
|
|
399
|
+
* entry stays — the view is still keep-alive-managed, just no longer
|
|
400
|
+
* evictable while visible). Idempotent: a no-op when the view isn't on the
|
|
401
|
+
* hidden list or the group doesn't exist. */
|
|
402
|
+
private dropViewFromKeepAliveHidden;
|
|
346
403
|
private constructWindow;
|
|
347
404
|
/**
|
|
348
405
|
* Register an EXTERNALLY-created window into the framework so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deck-app.d.ts","sourceRoot":"","sources":["../../src/internal/deck-app.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,UAAU,EAIV,cAAc,EACd,OAAO,EACP,YAAY,EAIZ,UAAU,EASV,MAAM,aAAa,CAAA;AAIpB,OAAO,KAAK,EAEX,oBAAoB,EAEpB,eAAe,
|
|
1
|
+
{"version":3,"file":"deck-app.d.ts","sourceRoot":"","sources":["../../src/internal/deck-app.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,UAAU,EAIV,cAAc,EACd,OAAO,EACP,YAAY,EAIZ,UAAU,EASV,MAAM,aAAa,CAAA;AAIpB,OAAO,KAAK,EAEX,oBAAoB,EAEpB,eAAe,EAEf,sBAAsB,EACtB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAEN,KAAK,UAAU,EAGf,MAAM,uBAAuB,CAAA;AAS9B,OAAO,EAEN,KAAK,gBAAgB,EACrB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,MAAM,qBAAqB,CAAA;AAQ5B;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE;QACxB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;QAChC,2DAA2D;QAC3D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,SAAS,kBAAkB,EAAE,CAAA;QACjE,4CAA4C;QAC5C,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;KACpC,CAAA;IACD;;;;OAI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7B;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAmD7B,OAAO,CAAC,gBAAgB;IAoOxB,4FAA4F;IAC5F,OAAO,CAAC,oBAAoB;IAmB5B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAehB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,iBAAiB;IAiGzB;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAI/B;;;;OAIG;IACH,OAAO,CAAC,yBAAyB,CAAQ;IACzC,OAAO,CAAC,uBAAuB;IAS/B;;;kDAG8C;IAC9C,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,eAAe;IAqFvB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,WAAW;IA4GnB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IAO/B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,cAAc;IAsBtB;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;6CACyC;IACzC,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,qBAAqB;IAuC7B;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,kBAAkB;YAiBZ,cAAc;YAOd,UAAU;IA8BxB,OAAO,CAAC,kBAAkB;YAYZ,iBAAiB;IA+E/B,OAAO,CAAC,YAAY;CA+nBpB"}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { sanitizeFlexibleWeights } from './sanitize.js';
|
|
|
12
12
|
export { setSizes, setConstraint, setActive, movePanel, splitPanel, closePanel, extractPanel, insertPanel, } from './mutations.js';
|
|
13
13
|
export { createLayoutModel } from './model.js';
|
|
14
14
|
export { closePanelForUser } from './user-actions.js';
|
|
15
|
+
export { findGroupById, findGroupContaining, findPanelGroupId, countPanels } from './tree-query.js';
|
|
15
16
|
export type { Bounds, Placement, DesiredView, PlacementSnapshot, ViewOp, ActualView, ReconcilerState, } from './placement-reconcile.js';
|
|
16
17
|
export { createInitialState, reconcile } from './placement-reconcile.js';
|
|
17
18
|
export type { CleanView, CleanSnapshot, Authorizer } from './snapshot-reconcile.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACX,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACX,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAEnG,YAAY,EACX,MAAM,EACN,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,eAAe,GACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAExE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/layout/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { cleanSnapshot, closePanel, closePanelForUser, createInitialState, createLayoutModel, createPanelRegistry, dispatchOps, extractPanel, insertPanel, movePanel, parseLayout, reconcile, sanitizeFlexibleWeights, serializeLayout, setActive, setConstraint, setSizes, splitPanel, validateTree };
|
|
1
|
+
import { C as createPanelRegistry, S as validateTree, _ as findGroupContaining, a as closePanelForUser, b as parseLayout, c as extractPanel, d as setActive, f as setConstraint, g as findGroupById, h as countPanels, i as reconcile, l as insertPanel, m as splitPanel, n as dispatchOps, o as createLayoutModel, p as setSizes, r as createInitialState, s as closePanel, t as cleanSnapshot, u as movePanel, v as findPanelGroupId, x as serializeLayout, y as sanitizeFlexibleWeights } from "../layout-D-LYJIpM.js";
|
|
2
|
+
export { cleanSnapshot, closePanel, closePanelForUser, countPanels, createInitialState, createLayoutModel, createPanelRegistry, dispatchOps, extractPanel, findGroupById, findGroupContaining, findPanelGroupId, insertPanel, movePanel, parseLayout, reconcile, sanitizeFlexibleWeights, serializeLayout, setActive, setConstraint, setSizes, splitPanel, validateTree };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/layout/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,WAAW,EAAkB,UAAU,EAAE,MAAM,YAAY,CAAA;AAEzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/layout/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,WAAW,EAAkB,UAAU,EAAE,MAAM,YAAY,CAAA;AAEzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,CA4FlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/layout/mutations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAc,UAAU,EAAE,WAAW,EAAE,cAAc,EAA2B,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/layout/mutations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAc,UAAU,EAAE,WAAW,EAAE,cAAc,EAA2B,MAAM,YAAY,CAAA;AAqK9G,wBAAgB,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAuB7F;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,CAAC,EAAE,UAAU,EACb,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,cAAc,GAAG,IAAI,GAC/B,UAAU,CAiCZ;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAQrF;AAaD,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAUrE;AAED,wBAAgB,YAAY,CAC3B,CAAC,EAAE,UAAU,EACb,OAAO,EAAE,MAAM,GACb;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAIzC;AAED,wBAAgB,WAAW,CAC1B,CAAC,EAAE,UAAU,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,UAAU,CAWZ;AASD,wBAAgB,SAAS,CACxB,CAAC,EAAE,UAAU,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,UAAU,CA+BZ;AAED,wBAAgB,UAAU,CACzB,CAAC,EAAE,UAAU,EACb,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,WAAW,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ,GAAG,OAAO,GACtB,UAAU,CAsDZ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only tree queries — the single authority for locating nodes/panels in a
|
|
3
|
+
* layout tree. PURE TS (types only): the mutation layer and the react renderer
|
|
4
|
+
* both consume these so the same traversal is never re-implemented per caller.
|
|
5
|
+
*/
|
|
6
|
+
import type { LayoutNode, TabGroupNode } from './types.js';
|
|
7
|
+
/** The tab-group node with `groupId`, or null. */
|
|
8
|
+
export declare function findGroupById(root: LayoutNode, groupId: string): TabGroupNode | null;
|
|
9
|
+
/** The tab-group node that holds `panelId`, or null. */
|
|
10
|
+
export declare function findGroupContaining(root: LayoutNode, panelId: string): TabGroupNode | null;
|
|
11
|
+
/** The id of the tab group currently holding `panelId`, or `undefined` if the
|
|
12
|
+
* panel is not in the tree. Used to detect a drop back into the dragged panel's
|
|
13
|
+
* own group and to guard a vanished split anchor. */
|
|
14
|
+
export declare function findPanelGroupId(root: LayoutNode, panelId: string): string | undefined;
|
|
15
|
+
/** Total panels anywhere in the tree. Drives last-panel close suppression: a
|
|
16
|
+
* group view knows only its own node, so the caller computes this global count. */
|
|
17
|
+
export declare function countPanels(node: LayoutNode): number;
|
|
18
|
+
//# sourceMappingURL=tree-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-query.d.ts","sourceRoot":"","sources":["../../src/layout/tree-query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE1D,kDAAkD;AAClD,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAapF;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAa1F;AAED;;qDAEqD;AACrD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEtF;AAED;mFACmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAGpD"}
|
package/dist/layout/types.d.ts
CHANGED
|
@@ -11,16 +11,18 @@ export type Orientation = 'row' | 'column';
|
|
|
11
11
|
* Per-child pixel size constraint. EXACTLY ONE of the two keys is set; the value
|
|
12
12
|
* is a finite number > 0 (validation lives in `serialize.ts`, not the type):
|
|
13
13
|
*
|
|
14
|
-
* - `fixedPx` — LOCKED to exactly N px (min === max).
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* draggable (e.g. a simulator column
|
|
14
|
+
* - `fixedPx` — LOCKED to exactly N px (min === max). Excluded from the
|
|
15
|
+
* flexible weight pool: it never resizes, weight changes don't touch it.
|
|
16
|
+
* - `minPx` — px-sized with a minimum floor of N px. Like `fixedPx`, it is
|
|
17
|
+
* excluded from the flexible weight pool (it never receives a share of the
|
|
18
|
+
* weight-driven remainder) — but unlike `fixedPx` it has no upper bound, so
|
|
19
|
+
* the user can still drag it wider than the floor. Use for a panel that must
|
|
20
|
+
* keep a minimum size while still being draggable (e.g. a simulator column
|
|
21
|
+
* floored at the device width).
|
|
21
22
|
*
|
|
22
|
-
* KEY SEMANTIC: "is this child
|
|
23
|
-
*
|
|
23
|
+
* KEY SEMANTIC: "is this child px-sized?" === "is the constraint non-null?"
|
|
24
|
+
* Both `fixedPx` and `minPx` are px-sized and excluded from the weight pool;
|
|
25
|
+
* only a `null` (or absent) constraint is weight-sized.
|
|
24
26
|
*/
|
|
25
27
|
export interface SizeConstraint {
|
|
26
28
|
readonly fixedPx?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/layout/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/layout/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG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,cAAc,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CACzD"}
|
|
@@ -226,6 +226,44 @@ function sanitizeFlexibleWeights(tree) {
|
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
+
//#region src/layout/tree-query.ts
|
|
230
|
+
/** The tab-group node with `groupId`, or null. */
|
|
231
|
+
function findGroupById(root, groupId) {
|
|
232
|
+
let found = null;
|
|
233
|
+
const walk = (n) => {
|
|
234
|
+
if (found) return;
|
|
235
|
+
if (n.kind === "tabs") {
|
|
236
|
+
if (n.id === groupId) found = n;
|
|
237
|
+
} else n.children.forEach(walk);
|
|
238
|
+
};
|
|
239
|
+
walk(root);
|
|
240
|
+
return found;
|
|
241
|
+
}
|
|
242
|
+
/** The tab-group node that holds `panelId`, or null. */
|
|
243
|
+
function findGroupContaining(root, panelId) {
|
|
244
|
+
let found = null;
|
|
245
|
+
const walk = (n) => {
|
|
246
|
+
if (found) return;
|
|
247
|
+
if (n.kind === "tabs") {
|
|
248
|
+
if (n.panels.includes(panelId)) found = n;
|
|
249
|
+
} else n.children.forEach(walk);
|
|
250
|
+
};
|
|
251
|
+
walk(root);
|
|
252
|
+
return found;
|
|
253
|
+
}
|
|
254
|
+
/** The id of the tab group currently holding `panelId`, or `undefined` if the
|
|
255
|
+
* panel is not in the tree. Used to detect a drop back into the dragged panel's
|
|
256
|
+
* own group and to guard a vanished split anchor. */
|
|
257
|
+
function findPanelGroupId(root, panelId) {
|
|
258
|
+
return findGroupContaining(root, panelId)?.id;
|
|
259
|
+
}
|
|
260
|
+
/** Total panels anywhere in the tree. Drives last-panel close suppression: a
|
|
261
|
+
* group view knows only its own node, so the caller computes this global count. */
|
|
262
|
+
function countPanels(node) {
|
|
263
|
+
if (node.kind === "tabs") return node.panels.length;
|
|
264
|
+
return node.children.reduce((sum, child) => sum + countPanels(child), 0);
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
229
267
|
//#region src/layout/mutations.ts
|
|
230
268
|
function tg(id, panels, active) {
|
|
231
269
|
return {
|
|
@@ -287,28 +325,6 @@ function normalizeRoot(root) {
|
|
|
287
325
|
if (n === null) throw new Error("mutation would empty the entire layout");
|
|
288
326
|
return n;
|
|
289
327
|
}
|
|
290
|
-
function findGroupContaining(root, panelId) {
|
|
291
|
-
let found = null;
|
|
292
|
-
const walk = (n) => {
|
|
293
|
-
if (found) return;
|
|
294
|
-
if (n.kind === "tabs") {
|
|
295
|
-
if (n.panels.includes(panelId)) found = n;
|
|
296
|
-
} else n.children.forEach(walk);
|
|
297
|
-
};
|
|
298
|
-
walk(root);
|
|
299
|
-
return found ? { group: found } : null;
|
|
300
|
-
}
|
|
301
|
-
function findGroupById(root, groupId) {
|
|
302
|
-
let found = null;
|
|
303
|
-
const walk = (n) => {
|
|
304
|
-
if (found) return;
|
|
305
|
-
if (n.kind === "tabs") {
|
|
306
|
-
if (n.id === groupId) found = n;
|
|
307
|
-
} else n.children.forEach(walk);
|
|
308
|
-
};
|
|
309
|
-
walk(root);
|
|
310
|
-
return found;
|
|
311
|
-
}
|
|
312
328
|
/** Collect every panelId present anywhere in the tree. */
|
|
313
329
|
function collectPanelIds(root) {
|
|
314
330
|
const out = /* @__PURE__ */ new Set();
|
|
@@ -452,9 +468,8 @@ function setActive(t, groupId, panelId) {
|
|
|
452
468
|
}
|
|
453
469
|
/** Remove a panel from whichever group holds it; collapse. */
|
|
454
470
|
function removePanel(root, panelId) {
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
457
|
-
const { group } = located;
|
|
471
|
+
const group = findGroupContaining(root, panelId);
|
|
472
|
+
if (!group) throw new Error(`panel not found: ${panelId}`);
|
|
458
473
|
const removedIndex = group.panels.indexOf(panelId);
|
|
459
474
|
const panels = group.panels.filter((p) => p !== panelId);
|
|
460
475
|
const replacement = tg(group.id, panels, deriveActive(panels, group.active, removedIndex));
|
|
@@ -489,34 +504,33 @@ function clampInsertIndex(index, len) {
|
|
|
489
504
|
return index;
|
|
490
505
|
}
|
|
491
506
|
function movePanel(t, panelId, dest) {
|
|
492
|
-
const
|
|
493
|
-
if (!
|
|
507
|
+
const srcGroup = findGroupContaining(t.root, panelId);
|
|
508
|
+
if (!srcGroup) throw new Error(`movePanel: panel not found: ${panelId}`);
|
|
494
509
|
const destGroup = findGroupById(t.root, dest.groupId);
|
|
495
510
|
if (!destGroup) throw new Error(`movePanel: dest group not found: ${dest.groupId}`);
|
|
496
|
-
if (
|
|
497
|
-
const without =
|
|
511
|
+
if (srcGroup.id === destGroup.id) {
|
|
512
|
+
const without = srcGroup.panels.filter((p) => p !== panelId);
|
|
498
513
|
const idx = clampInsertIndex(dest.index, without.length);
|
|
499
514
|
const panels = [...without];
|
|
500
515
|
panels.splice(idx, 0, panelId);
|
|
501
|
-
const replacement = tg(
|
|
502
|
-
return wrap(normalizeRoot(replaceNode(t.root,
|
|
516
|
+
const replacement = tg(srcGroup.id, panels, srcGroup.active);
|
|
517
|
+
return wrap(normalizeRoot(replaceNode(t.root, srcGroup.id, replacement)));
|
|
503
518
|
}
|
|
504
|
-
const removedIndex =
|
|
505
|
-
const srcPanels =
|
|
506
|
-
const srcReplacement = tg(
|
|
519
|
+
const removedIndex = srcGroup.panels.indexOf(panelId);
|
|
520
|
+
const srcPanels = srcGroup.panels.filter((p) => p !== panelId);
|
|
521
|
+
const srcReplacement = tg(srcGroup.id, srcPanels, deriveActive(srcPanels, srcGroup.active, removedIndex));
|
|
507
522
|
const destPanels = [...destGroup.panels];
|
|
508
523
|
const idx = clampInsertIndex(dest.index, destPanels.length);
|
|
509
524
|
destPanels.splice(idx, 0, panelId);
|
|
510
525
|
const destReplacement = tg(destGroup.id, destPanels, destGroup.active);
|
|
511
|
-
let root = replaceNode(t.root,
|
|
526
|
+
let root = replaceNode(t.root, srcGroup.id, srcReplacement);
|
|
512
527
|
root = replaceNode(root, destGroup.id, destReplacement);
|
|
513
528
|
return wrap(normalizeRoot(root));
|
|
514
529
|
}
|
|
515
530
|
function splitPanel(t, atPanelId, dir, newPanelId, side) {
|
|
516
531
|
if (hasPanel(t.root, newPanelId)) throw new Error(`splitPanel: new panel already exists in the tree: ${newPanelId}`);
|
|
517
|
-
const
|
|
518
|
-
if (!
|
|
519
|
-
const { group } = located;
|
|
532
|
+
const group = findGroupContaining(t.root, atPanelId);
|
|
533
|
+
if (!group) throw new Error(`splitPanel: panel not found: ${atPanelId}`);
|
|
520
534
|
const taken = collectNodeIds(t.root);
|
|
521
535
|
const origGroupId = group.id;
|
|
522
536
|
const extractedGroup = tg(freshId(taken, `${origGroupId}__split`), [atPanelId], atPanelId);
|
|
@@ -552,7 +566,9 @@ function createLayoutModel(initial) {
|
|
|
552
566
|
let applying = false;
|
|
553
567
|
const queue = [];
|
|
554
568
|
const commitAndNotify = (mut) => {
|
|
555
|
-
|
|
569
|
+
const next = mut(current);
|
|
570
|
+
if (next === current) return;
|
|
571
|
+
current = next;
|
|
556
572
|
revision += 1;
|
|
557
573
|
const snap = {
|
|
558
574
|
tree: current,
|
|
@@ -879,6 +895,6 @@ function dispatchOps(ops, state, resolveApply) {
|
|
|
879
895
|
}
|
|
880
896
|
}
|
|
881
897
|
//#endregion
|
|
882
|
-
export {
|
|
898
|
+
export { createPanelRegistry as C, validateTree as S, findGroupContaining as _, closePanelForUser as a, parseLayout as b, extractPanel as c, setActive as d, setConstraint as f, findGroupById as g, countPanels as h, reconcile as i, insertPanel as l, splitPanel as m, dispatchOps as n, createLayoutModel as o, setSizes as p, createInitialState as r, closePanel as s, cleanSnapshot as t, movePanel as u, findPanelGroupId as v, serializeLayout as x, sanitizeFlexibleWeights as y };
|
|
883
899
|
|
|
884
|
-
//# sourceMappingURL=layout-
|
|
900
|
+
//# sourceMappingURL=layout-D-LYJIpM.js.map
|