@forgeax/app-shell 0.35.0 → 0.36.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
@@ -236,6 +236,19 @@ interface DockPanelCommandSubscriptionSource {
236
236
  * payload mapping, membership, titles, layout policy, and concrete Dock APIs.
237
237
  */
238
238
  declare function installDockPanelCommandSubscriptions(source: DockPanelCommandSubscriptionSource, commands: DockPanelCommands): () => void;
239
+ interface DockLayoutPanelControlAdapter {
240
+ isOpen(panelId: string): boolean;
241
+ close(panelId: string): void;
242
+ reopen(panelId: string): void;
243
+ }
244
+ interface DockLayoutPanelControl {
245
+ /** Project whether the live Dock currently contains the panel. */
246
+ isOpen(panelId: string): boolean;
247
+ /** Close an open panel or reopen a closed panel. Returns false when the adapter fails. */
248
+ toggle(panelId: string): boolean;
249
+ }
250
+ /** Own product-neutral panel projection and close-vs-reopen selection for a layout control. */
251
+ declare function createDockLayoutPanelControl(adapter: DockLayoutPanelControlAdapter): DockLayoutPanelControl;
239
252
  interface DockLayoutControlSnapshot<Anchor> {
240
253
  readonly open: boolean;
241
254
  readonly anchor: Anchor | null;
@@ -296,4 +309,4 @@ declare function handleCrossInstanceDrop(event: CrossInstanceDropEvent, targetRe
296
309
  titleFor?: (panelId: string) => string | undefined;
297
310
  }): void;
298
311
 
299
- export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutControlSnapshot, type DockLayoutControlState, type DockLayoutControlToggleSource, 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, createDockLayoutControlState, createDockLayoutPersistence, createDockPanelCommands, createDockReadyActivation, createDockReadyCleanup, createDockScopeTransition, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockLayoutControlToggle, installDockLayoutObservation, installDockLayoutReset, installDockPanelCommandSubscriptions, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, replaceDockReadyAdapters, resolveRegion, trackDockPanelVisibility };
312
+ export { type AuthoredDockLayoutLike, type AuthoredDockNodeLike, type CrossInstanceDropEvent, DOCK_REGIONS, type DesignedDockPanelPosition, type DockCommandPanel, type DockLayoutControlSnapshot, type DockLayoutControlState, type DockLayoutControlToggleSource, type DockLayoutObservationAdapter, type DockLayoutObservationSource, type DockLayoutOrientation, type DockLayoutPanelControl, type DockLayoutPanelControlAdapter, 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, createDockLayoutControlState, createDockLayoutPanelControl, createDockLayoutPersistence, createDockPanelCommands, createDockReadyActivation, createDockReadyCleanup, createDockScopeTransition, designedDockPanelPosition, getDockRegions, getDockviewApi, handleCrossInstanceDrop, hasMountedPanelPlacement, installDockLayoutControlToggle, installDockLayoutObservation, installDockLayoutReset, installDockPanelCommandSubscriptions, installDockPanelVisibilityTracking, isDockPanelVisible, isDockRegion, isOnSideEdge, nearerSideEdge, pruneSerializedDockLayout, registerDockRegion, registerDockviewApi, replaceDockReadyAdapters, resolveRegion, trackDockPanelVisibility };
package/dist/dock.js CHANGED
@@ -548,6 +548,32 @@ function installDockPanelCommandSubscriptions(source, commands) {
548
548
  }
549
549
  return cleanup;
550
550
  }
551
+ function createDockLayoutPanelControl(adapter) {
552
+ const readOpen = (panelId) => {
553
+ try {
554
+ return { ok: true, value: adapter.isOpen(panelId) };
555
+ } catch {
556
+ return { ok: false };
557
+ }
558
+ };
559
+ return {
560
+ isOpen(panelId) {
561
+ const result = readOpen(panelId);
562
+ return result.ok ? result.value : false;
563
+ },
564
+ toggle(panelId) {
565
+ const result = readOpen(panelId);
566
+ if (!result.ok) return false;
567
+ try {
568
+ if (result.value) adapter.close(panelId);
569
+ else adapter.reopen(panelId);
570
+ return true;
571
+ } catch {
572
+ return false;
573
+ }
574
+ }
575
+ };
576
+ }
551
577
  function createDockLayoutControlState(initialAnchor = null) {
552
578
  let snapshot = { open: false, anchor: initialAnchor };
553
579
  const listeners = /* @__PURE__ */ new Set();
@@ -653,6 +679,7 @@ export {
653
679
  DOCK_REGIONS,
654
680
  REGIONS,
655
681
  createDockLayoutControlState,
682
+ createDockLayoutPanelControl,
656
683
  createDockLayoutPersistence,
657
684
  createDockPanelCommands,
658
685
  createDockReadyActivation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",