@forgeax/app-shell 0.32.0 → 0.33.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
@@ -217,6 +217,25 @@ interface DockPanelCommands {
217
217
  }
218
218
  /** Own idempotent panel commands while callers retain membership and product policy. */
219
219
  declare function createDockPanelCommands(adapter: DockPanelCommandAdapter): DockPanelCommands;
220
+ interface DockPanelCommandSubscriptionSource {
221
+ onOpen(listener: (panelId: string) => void): {
222
+ dispose(): void;
223
+ };
224
+ onClose(listener: (panelId: string) => void): {
225
+ dispose(): void;
226
+ };
227
+ onFocus(listener: (panelId: string) => void): {
228
+ dispose(): void;
229
+ };
230
+ onReveal(listener: (panelId: string) => void): {
231
+ dispose(): void;
232
+ };
233
+ }
234
+ /**
235
+ * Own balanced panel-command subscriptions while callers retain event names,
236
+ * payload mapping, membership, titles, layout policy, and concrete Dock APIs.
237
+ */
238
+ declare function installDockPanelCommandSubscriptions(source: DockPanelCommandSubscriptionSource, commands: DockPanelCommands): () => void;
220
239
  type SideEdge = 'left' | 'right';
221
240
  interface RectLike {
222
241
  left: number;
@@ -254,4 +273,4 @@ declare function handleCrossInstanceDrop(event: CrossInstanceDropEvent, targetRe
254
273
  titleFor?: (panelId: string) => string | undefined;
255
274
  }): void;
256
275
 
257
- export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutObservationAdapter, type DockLayoutObservationSource, type DockLayoutOrientation, type DockLayoutPersistence, type DockLayoutPersistenceAdapter, type DockLayoutPersistenceScope, type DockLayoutResetAdapter, type DockLayoutResetSource, type DockPanelCommandAdapter, type DockPanelCommands, type DockPanelVisibilityEventSource, type DockPanelVisibilityHooks, type DockReadyActivation, type DockReadyAdapterInstaller, type DockReadyAdapterSession, type DockReadyCleanup, type DockRegion, type DockRegionEntry, type DockReopenDirection, type DockScopeTransition, type DockScopeTransitionAdapter, type DockviewApiLike, type PanelDescriptorLite, REGIONS, type RectLike, type Region, type SerializedDockLayoutLike, type SerializedDockPanelLike, type SideEdge, createDockLayoutPersistence, createDockPanelCommands, createDockReadyActivation, createDockReadyCleanup, createDockScopeTransition, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockLayoutObservation, installDockLayoutReset, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, replaceDockReadyAdapters, resolveRegion, trackDockPanelVisibility };
276
+ export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutObservationAdapter, type DockLayoutObservationSource, type DockLayoutOrientation, type DockLayoutPersistence, type DockLayoutPersistenceAdapter, type DockLayoutPersistenceScope, type DockLayoutResetAdapter, type DockLayoutResetSource, type DockPanelCommandAdapter, type DockPanelCommandSubscriptionSource, type DockPanelCommands, type DockPanelVisibilityEventSource, type DockPanelVisibilityHooks, type DockReadyActivation, type DockReadyAdapterInstaller, type DockReadyAdapterSession, type DockReadyCleanup, type DockRegion, type DockRegionEntry, type DockReopenDirection, type DockScopeTransition, type DockScopeTransitionAdapter, type DockviewApiLike, type PanelDescriptorLite, REGIONS, type RectLike, type Region, type SerializedDockLayoutLike, type SerializedDockPanelLike, type SideEdge, createDockLayoutPersistence, createDockPanelCommands, createDockReadyActivation, createDockReadyCleanup, createDockScopeTransition, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockLayoutObservation, installDockLayoutReset, installDockPanelCommandSubscriptions, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, replaceDockReadyAdapters, resolveRegion, trackDockPanelVisibility };
package/dist/dock.js CHANGED
@@ -517,6 +517,37 @@ function createDockPanelCommands(adapter) {
517
517
  }
518
518
  };
519
519
  }
520
+ function installDockPanelCommandSubscriptions(source, commands) {
521
+ const subscriptions = [];
522
+ let active = true;
523
+ const cleanup = () => {
524
+ if (!active) return;
525
+ active = false;
526
+ while (subscriptions.length > 0) {
527
+ try {
528
+ subscriptions.pop()?.dispose();
529
+ } catch {
530
+ }
531
+ }
532
+ };
533
+ const route = (command) => (panelId) => {
534
+ if (!active) return;
535
+ try {
536
+ command(panelId);
537
+ } catch {
538
+ }
539
+ };
540
+ try {
541
+ subscriptions.push(source.onOpen(route((id) => commands.open(id))));
542
+ subscriptions.push(source.onClose(route((id) => commands.close(id))));
543
+ subscriptions.push(source.onFocus(route((id) => commands.focus(id))));
544
+ subscriptions.push(source.onReveal(route((id) => commands.reveal(id))));
545
+ } catch (error) {
546
+ cleanup();
547
+ throw error;
548
+ }
549
+ return cleanup;
550
+ }
520
551
  function isOnSideEdge(location) {
521
552
  return location.type === "edge" && (location.position === "left" || location.position === "right");
522
553
  }
@@ -583,6 +614,7 @@ export {
583
614
  hasMountedPanelPlacement,
584
615
  installDockLayoutObservation,
585
616
  installDockLayoutReset,
617
+ installDockPanelCommandSubscriptions,
586
618
  installDockPanelVisibilityTracking,
587
619
  isDockPanelVisible,
588
620
  isDockRegion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",