@forgeax/app-shell 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dock.d.ts CHANGED
@@ -3,6 +3,14 @@ type Region = typeof REGIONS[number];
3
3
  declare const DOCK_REGIONS: readonly ["DockShell", "AuxBar", "ChatDock"];
4
4
  type DockRegion = typeof DOCK_REGIONS[number];
5
5
  declare function isDockRegion(value: string): value is DockRegion;
6
+ interface DockReadyCleanup {
7
+ /** Register one teardown while active; late registrations are disposed immediately. */
8
+ add(dispose: () => void): boolean;
9
+ /** Dispose registered teardowns once, in reverse registration order. */
10
+ dispose(): void;
11
+ }
12
+ /** Own the best-effort teardown lifecycle of one dock-ready session. */
13
+ declare function createDockReadyCleanup(): DockReadyCleanup;
6
14
  interface PanelDescriptorLite {
7
15
  defaultRegion?: DockRegion;
8
16
  }
@@ -174,4 +182,4 @@ declare function handleCrossInstanceDrop(event: CrossInstanceDropEvent, targetRe
174
182
  titleFor?: (panelId: string) => string | undefined;
175
183
  }): void;
176
184
 
177
- export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutOrientation, type DockLayoutPersistence, type DockLayoutPersistenceAdapter, type DockLayoutPersistenceScope, type DockPanelCommandAdapter, type DockPanelCommands, type DockPanelVisibilityEventSource, type DockPanelVisibilityHooks, type DockRegion, type DockRegionEntry, type DockReopenDirection, type DockviewApiLike, type PanelDescriptorLite, REGIONS, type RectLike, type Region, type SerializedDockLayoutLike, type SerializedDockPanelLike, type SideEdge, createDockLayoutPersistence, createDockPanelCommands, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, resolveRegion, trackDockPanelVisibility };
185
+ export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutOrientation, type DockLayoutPersistence, type DockLayoutPersistenceAdapter, type DockLayoutPersistenceScope, type DockPanelCommandAdapter, type DockPanelCommands, type DockPanelVisibilityEventSource, type DockPanelVisibilityHooks, type DockReadyCleanup, type DockRegion, type DockRegionEntry, type DockReopenDirection, type DockviewApiLike, type PanelDescriptorLite, REGIONS, type RectLike, type Region, type SerializedDockLayoutLike, type SerializedDockPanelLike, type SideEdge, createDockLayoutPersistence, createDockPanelCommands, createDockReadyCleanup, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, resolveRegion, trackDockPanelVisibility };
package/dist/dock.js CHANGED
@@ -4,6 +4,33 @@ var DOCK_REGIONS = ["DockShell", "AuxBar", "ChatDock"];
4
4
  function isDockRegion(value) {
5
5
  return DOCK_REGIONS.includes(value);
6
6
  }
7
+ function createDockReadyCleanup() {
8
+ const disposers = [];
9
+ let active = true;
10
+ return {
11
+ add(dispose) {
12
+ if (active) {
13
+ disposers.push(dispose);
14
+ return true;
15
+ }
16
+ try {
17
+ dispose();
18
+ } catch {
19
+ }
20
+ return false;
21
+ },
22
+ dispose() {
23
+ if (!active) return;
24
+ active = false;
25
+ while (disposers.length > 0) {
26
+ try {
27
+ disposers.pop()?.();
28
+ } catch {
29
+ }
30
+ }
31
+ }
32
+ };
33
+ }
7
34
  function resolveRegion(id, descriptor, overrides) {
8
35
  return overrides[id] ?? descriptor.defaultRegion ?? "DockShell";
9
36
  }
@@ -347,6 +374,7 @@ export {
347
374
  REGIONS,
348
375
  createDockLayoutPersistence,
349
376
  createDockPanelCommands,
377
+ createDockReadyCleanup,
350
378
  designedDockPanelPosition,
351
379
  getDockRegions,
352
380
  getDockviewApi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",