@forgeax/app-shell 0.27.0 → 0.28.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
@@ -11,6 +11,12 @@ interface DockReadyCleanup {
11
11
  }
12
12
  /** Own the best-effort teardown lifecycle of one dock-ready session. */
13
13
  declare function createDockReadyCleanup(): DockReadyCleanup;
14
+ type DockReadyAdapterInstaller = () => void | (() => void);
15
+ interface DockReadyAdapterSession extends DockReadyCleanup {
16
+ readonly installed: boolean;
17
+ }
18
+ /** Replace one dock-ready adapter session with an ordered, rollback-safe transaction. */
19
+ declare function replaceDockReadyAdapters(previous: DockReadyCleanup | null | undefined, installers: readonly DockReadyAdapterInstaller[]): DockReadyAdapterSession;
14
20
  interface PanelDescriptorLite {
15
21
  defaultRegion?: DockRegion;
16
22
  }
@@ -182,4 +188,4 @@ declare function handleCrossInstanceDrop(event: CrossInstanceDropEvent, targetRe
182
188
  titleFor?: (panelId: string) => string | undefined;
183
189
  }): void;
184
190
 
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 };
191
+ 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 DockReadyAdapterInstaller, type DockReadyAdapterSession, 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, replaceDockReadyAdapters, resolveRegion, trackDockPanelVisibility };
package/dist/dock.js CHANGED
@@ -31,6 +31,23 @@ function createDockReadyCleanup() {
31
31
  }
32
32
  };
33
33
  }
34
+ function replaceDockReadyAdapters(previous, installers) {
35
+ try {
36
+ previous?.dispose();
37
+ } catch {
38
+ }
39
+ const cleanup = createDockReadyCleanup();
40
+ try {
41
+ for (const install of installers) {
42
+ const dispose = install();
43
+ if (dispose) cleanup.add(dispose);
44
+ }
45
+ return { ...cleanup, installed: true };
46
+ } catch {
47
+ cleanup.dispose();
48
+ return { ...cleanup, installed: false };
49
+ }
50
+ }
34
51
  function resolveRegion(id, descriptor, overrides) {
35
52
  return overrides[id] ?? descriptor.defaultRegion ?? "DockShell";
36
53
  }
@@ -388,6 +405,7 @@ export {
388
405
  pruneSerializedDockLayout,
389
406
  registerDockRegion,
390
407
  registerDockviewApi,
408
+ replaceDockReadyAdapters,
391
409
  resolveRegion,
392
410
  trackDockPanelVisibility
393
411
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",