react-dockable-desktop 4.2.0 → 4.2.1

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/index.d.cts CHANGED
@@ -59,6 +59,11 @@ interface ContextMenuAdapter {
59
59
  }
60
60
  declare const ContextMenu: React$1.ForwardRefExoticComponent<ContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
61
61
  declare const DefaultContextMenuAdapter: ContextMenuAdapter;
62
+ declare const ContextMenuProvider: React$1.FC<{
63
+ adapter?: ContextMenuAdapter;
64
+ children: React$1.ReactNode;
65
+ } & ContextMenuProps>;
66
+ declare function useShowContextMenu(): (options: ShowContextMenuOptions) => void;
62
67
 
63
68
  /**
64
69
  * @file WindowManager.tsx
@@ -424,7 +429,16 @@ interface LayoutLeafNode {
424
429
  }
425
430
  /** Union type representing either a branch or a leaf node in the layout grid. */
426
431
  type LayoutNode = LayoutGridNode | LayoutLeafNode;
427
- /** Corner of the workspace a floating window is pinned to. */
432
+ /**
433
+ * Corner of the workspace a floating window can be pinned to.
434
+ *
435
+ * When `anchor` is set on a `FloatingWindow`, the window is positioned
436
+ * relative to that corner using CSS `right`/`left` + `top`/`bottom` and
437
+ * stacks with other windows sharing the same anchor (8 px gap, uncapped).
438
+ * Dragging a window away from its corner clears the anchor and returns it
439
+ * to free-float mode. The value is RTL-aware — `'top-left'` always means the
440
+ * logical start corner regardless of document direction.
441
+ */
428
442
  type FloatAnchor = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
429
443
  /**
430
444
  * Bounds and depth metadata for floated panel windows.
@@ -527,10 +541,13 @@ interface WindowActions {
527
541
  * If the panel ID is already open, the panel is focused instead of duplicated.
528
542
  * @param id - Unique instance identifier for this panel.
529
543
  * @param component - Component key registered in the panel catalog.
530
- * @param options - Optional display and placement overrides.
544
+ * @param options.title - Override the panel tab/window title. Accepts a plain string or an i18n message descriptor.
545
+ * @param options.initialTarget - Initial placement: `'floating'`, `'docked'` (default when a grid exists), or `'tabbed'`.
546
+ * @param options.anchor - Pin the new floating window to a workspace corner on creation. Has no effect when `initialTarget` is `'docked'` or `'tabbed'`.
531
547
  * @example
532
548
  * ```ts
533
- * actions.openPanel('map-1', 'map', { title: 'Satellite View', initialTarget: 'floating' });
549
+ * // Open floating and pin to the top-right corner:
550
+ * actions.openPanel('layers', 'layertree', { initialTarget: 'floating', anchor: 'top-right' });
534
551
  * ```
535
552
  */
536
553
  openPanel: (id: string, component: string, options?: {
@@ -557,7 +574,8 @@ interface WindowActions {
557
574
  /**
558
575
  * Detaches a docked panel, converting it to a resizable floating window.
559
576
  * @param id - Panel instance ID.
560
- * @param rect - Optional initial position and size for the floating window.
577
+ * @param rect - Optional initial position and size. Omit to use the last known position or a cascaded default.
578
+ * @param anchor - Optional corner to pin the new floating window to. Omit (or pass `null`) for free-float.
561
579
  */
562
580
  floatPanel: (id: string, rect?: {
563
581
  x: number;
@@ -722,6 +740,12 @@ interface WindowActions {
722
740
  * @param dir - `'ltr'` or `'rtl'`.
723
741
  */
724
742
  setDirection: (dir: 'ltr' | 'rtl') => void;
743
+ /**
744
+ * Imperatively shows the workspace context menu at the given position.
745
+ * Delegates to the active {@link ContextMenuProvider}, so custom adapters
746
+ * and externally-placed providers are respected automatically.
747
+ */
748
+ showContextMenu: (options: ShowContextMenuOptions) => void;
725
749
  }
726
750
  /** Represents custom CSS classes injected into layout parts. */
727
751
  interface StyleClasses {
@@ -926,13 +950,25 @@ declare class PanelRegistryClass {
926
950
  declare const PanelRegistry: PanelRegistryClass;
927
951
 
928
952
  /**
929
- * Props for `<DockableDesktopProvider>`. Alias of `WindowManagerProviderProps`.
930
- * @see WindowManagerProviderProps
953
+ * Props for `<DockableDesktopProvider>`.
954
+ * Extends `WindowManagerProviderProps` with workspace-level context menu configuration.
931
955
  */
932
- type DockableDesktopProviderProps = WindowManagerProviderProps;
956
+ interface DockableDesktopProviderProps extends WindowManagerProviderProps {
957
+ /**
958
+ * Context menu adapter for the workspace-level `ContextMenuProvider`.
959
+ * Defaults to `DefaultContextMenuAdapter`. Ignored if a `<ContextMenuProvider>`
960
+ * already exists above `<DockableDesktopProvider>` in the tree.
961
+ */
962
+ contextMenuAdapter?: ContextMenuAdapter;
963
+ }
933
964
  /**
934
- * Composite provider that wraps both `WindowManagerProvider` and `PanelProvider`
935
- * in the correct order. Drop-in replacement for manually nesting both providers.
965
+ * Composite provider that wraps `WindowManagerProvider`, `PanelProvider`, and `ToolbarProvider`
966
+ * in the correct order, and mounts the workspace-level `ContextMenuProvider` so that
967
+ * `showContextMenu()` and `useShowContextMenu()` work from any component in the tree —
968
+ * including siblings of `<WindowManager>` such as `<Sidebar>`, `<SidePanelRenderer>`,
969
+ * and `<ModalStackRenderer>`.
970
+ *
971
+ * Drop-in replacement for manually nesting both providers.
936
972
  *
937
973
  * `WindowManagerProvider` and `PanelProvider` remain independently exported
938
974
  * for cases that require custom nesting or separate configuration.
@@ -940,12 +976,15 @@ type DockableDesktopProviderProps = WindowManagerProviderProps;
940
976
  * @example
941
977
  * ```tsx
942
978
  * <DockableDesktopProvider client={workspace}>
943
- * <WindowManager />
979
+ * <Sidebar>
980
+ * <WindowManager />
981
+ * </Sidebar>
982
+ * <SidePanelRenderer />
944
983
  * <ModalStackRenderer />
945
984
  * </DockableDesktopProvider>
946
985
  * ```
947
986
  */
948
- declare const DockableDesktopProvider: React$1.FC<WindowManagerProviderProps>;
987
+ declare const DockableDesktopProvider: React$1.FC<DockableDesktopProviderProps>;
949
988
 
950
989
  /**
951
990
  * Options used when requesting to close a container.
@@ -955,7 +994,7 @@ interface CloseOptions {
955
994
  force?: boolean;
956
995
  }
957
996
  /** Represents the type of container context a panel/form is currently rendered inside. */
958
- type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'standalone';
997
+ type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'floating-window' | 'standalone';
959
998
  /**
960
999
  * Contract interface exposed by a container (like a tab, window, modal, or side-panel)
961
1000
  * to its children forms, enabling them to control or listen to container events.
@@ -975,7 +1014,7 @@ interface FormContainerContract {
975
1014
  }) => void;
976
1015
  /** Change the tab or window icon dynamically. */
977
1016
  setIcon?: (icon: React.ReactNode) => void;
978
- /** The type of container the panel is mounted in. */
1017
+ /** The type of container the panel is mounted in. Reflects the state at mount time; subscribe to {@link onContainerTypeChange} for live updates. */
979
1018
  containerType?: ContainerType;
980
1019
  /** Unique identifier of the panel or window instance. */
981
1020
  instanceId: string;
@@ -985,8 +1024,34 @@ interface FormContainerContract {
985
1024
  onMinimize?: (handler: () => void) => () => void;
986
1025
  /** Subscribe to the container's restore event. Returns an unsubscribe function. */
987
1026
  onRestore?: (handler: () => void) => () => void;
988
- /** Subscribe to the container's window resize event, returning width and height. */
1027
+ /** Subscribe to the container's window resize event, returning width and height. Returns an unsubscribe function. */
989
1028
  onResize?: (handler: (width: number, height: number) => void) => () => void;
1029
+ /** Request the container to minimize itself to the taskbar. No-op if the container type does not support minimize. */
1030
+ requestMinimize?: () => void;
1031
+ /** Returns the current rendered dimensions of this panel, or `null` if the panel has not been laid out yet. */
1032
+ getDimensions?: () => {
1033
+ width: number;
1034
+ height: number;
1035
+ } | null;
1036
+ /**
1037
+ * Subscribe to this panel becoming the globally active panel.
1038
+ * Fires when `activePanelId` transitions to this panel's id.
1039
+ * Returns an unsubscribe function.
1040
+ */
1041
+ onActivate?: (handler: () => void) => () => void;
1042
+ /**
1043
+ * Subscribe to this panel losing active status.
1044
+ * Fires when `activePanelId` transitions away from this panel's id,
1045
+ * and also fires if the panel is destroyed while it is active.
1046
+ * Returns an unsubscribe function.
1047
+ */
1048
+ onDeactivate?: (handler: () => void) => () => void;
1049
+ /**
1050
+ * Subscribe to changes in the panel's container type (e.g. docked ↔ floating).
1051
+ * Does not fire for minimize/restore cycles — use {@link onMinimize} / {@link onRestore} for those.
1052
+ * Returns an unsubscribe function.
1053
+ */
1054
+ onContainerTypeChange?: (handler: (type: ContainerType) => void) => () => void;
990
1055
  }
991
1056
  /**
992
1057
  * Context that supplies the {@link FormContainerContract} to panels inside the Window Manager.
@@ -995,7 +1060,9 @@ declare const FormContainerContext: Context<FormContainerContract>;
995
1060
  declare const FormContainerProvider: Provider<FormContainerContract>;
996
1061
  /**
997
1062
  * React hook to retrieve the current {@link FormContainerContract} from context.
998
- * Enables sub-forms to trigger close requests, mark themselves dirty, rename their tabs, or listen to resize events.
1063
+ * Enables sub-forms to trigger close/minimize requests, mark themselves dirty,
1064
+ * rename their tabs, query dimensions, or subscribe to lifecycle events
1065
+ * (resize, close, minimize, restore, activate, deactivate, container-type changes).
999
1066
  */
1000
1067
  declare const useFormContainer: () => FormContainerContract;
1001
1068
 
@@ -1798,4 +1865,4 @@ interface PanelFloatingWindowManagerHandle {
1798
1865
  */
1799
1866
  declare function usePanelFloatingWindowManager(): PanelFloatingWindowManagerHandle;
1800
1867
 
1801
- export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type PanelActions, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PredefinedMessageKey, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, defaultPredefinedMessages, formatLabel, toast, useFormContainer, useFormatMessage, usePanelActions, usePanelContext, usePanelContextMenu, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelState, usePredefinedMessages, useRegistry, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
1868
+ export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type PanelActions, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PredefinedMessageKey, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, defaultPredefinedMessages, formatLabel, toast, useFormContainer, useFormatMessage, usePanelActions, usePanelContext, usePanelContextMenu, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
package/dist/index.d.ts CHANGED
@@ -59,6 +59,11 @@ interface ContextMenuAdapter {
59
59
  }
60
60
  declare const ContextMenu: React$1.ForwardRefExoticComponent<ContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
61
61
  declare const DefaultContextMenuAdapter: ContextMenuAdapter;
62
+ declare const ContextMenuProvider: React$1.FC<{
63
+ adapter?: ContextMenuAdapter;
64
+ children: React$1.ReactNode;
65
+ } & ContextMenuProps>;
66
+ declare function useShowContextMenu(): (options: ShowContextMenuOptions) => void;
62
67
 
63
68
  /**
64
69
  * @file WindowManager.tsx
@@ -424,7 +429,16 @@ interface LayoutLeafNode {
424
429
  }
425
430
  /** Union type representing either a branch or a leaf node in the layout grid. */
426
431
  type LayoutNode = LayoutGridNode | LayoutLeafNode;
427
- /** Corner of the workspace a floating window is pinned to. */
432
+ /**
433
+ * Corner of the workspace a floating window can be pinned to.
434
+ *
435
+ * When `anchor` is set on a `FloatingWindow`, the window is positioned
436
+ * relative to that corner using CSS `right`/`left` + `top`/`bottom` and
437
+ * stacks with other windows sharing the same anchor (8 px gap, uncapped).
438
+ * Dragging a window away from its corner clears the anchor and returns it
439
+ * to free-float mode. The value is RTL-aware — `'top-left'` always means the
440
+ * logical start corner regardless of document direction.
441
+ */
428
442
  type FloatAnchor = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
429
443
  /**
430
444
  * Bounds and depth metadata for floated panel windows.
@@ -527,10 +541,13 @@ interface WindowActions {
527
541
  * If the panel ID is already open, the panel is focused instead of duplicated.
528
542
  * @param id - Unique instance identifier for this panel.
529
543
  * @param component - Component key registered in the panel catalog.
530
- * @param options - Optional display and placement overrides.
544
+ * @param options.title - Override the panel tab/window title. Accepts a plain string or an i18n message descriptor.
545
+ * @param options.initialTarget - Initial placement: `'floating'`, `'docked'` (default when a grid exists), or `'tabbed'`.
546
+ * @param options.anchor - Pin the new floating window to a workspace corner on creation. Has no effect when `initialTarget` is `'docked'` or `'tabbed'`.
531
547
  * @example
532
548
  * ```ts
533
- * actions.openPanel('map-1', 'map', { title: 'Satellite View', initialTarget: 'floating' });
549
+ * // Open floating and pin to the top-right corner:
550
+ * actions.openPanel('layers', 'layertree', { initialTarget: 'floating', anchor: 'top-right' });
534
551
  * ```
535
552
  */
536
553
  openPanel: (id: string, component: string, options?: {
@@ -557,7 +574,8 @@ interface WindowActions {
557
574
  /**
558
575
  * Detaches a docked panel, converting it to a resizable floating window.
559
576
  * @param id - Panel instance ID.
560
- * @param rect - Optional initial position and size for the floating window.
577
+ * @param rect - Optional initial position and size. Omit to use the last known position or a cascaded default.
578
+ * @param anchor - Optional corner to pin the new floating window to. Omit (or pass `null`) for free-float.
561
579
  */
562
580
  floatPanel: (id: string, rect?: {
563
581
  x: number;
@@ -722,6 +740,12 @@ interface WindowActions {
722
740
  * @param dir - `'ltr'` or `'rtl'`.
723
741
  */
724
742
  setDirection: (dir: 'ltr' | 'rtl') => void;
743
+ /**
744
+ * Imperatively shows the workspace context menu at the given position.
745
+ * Delegates to the active {@link ContextMenuProvider}, so custom adapters
746
+ * and externally-placed providers are respected automatically.
747
+ */
748
+ showContextMenu: (options: ShowContextMenuOptions) => void;
725
749
  }
726
750
  /** Represents custom CSS classes injected into layout parts. */
727
751
  interface StyleClasses {
@@ -926,13 +950,25 @@ declare class PanelRegistryClass {
926
950
  declare const PanelRegistry: PanelRegistryClass;
927
951
 
928
952
  /**
929
- * Props for `<DockableDesktopProvider>`. Alias of `WindowManagerProviderProps`.
930
- * @see WindowManagerProviderProps
953
+ * Props for `<DockableDesktopProvider>`.
954
+ * Extends `WindowManagerProviderProps` with workspace-level context menu configuration.
931
955
  */
932
- type DockableDesktopProviderProps = WindowManagerProviderProps;
956
+ interface DockableDesktopProviderProps extends WindowManagerProviderProps {
957
+ /**
958
+ * Context menu adapter for the workspace-level `ContextMenuProvider`.
959
+ * Defaults to `DefaultContextMenuAdapter`. Ignored if a `<ContextMenuProvider>`
960
+ * already exists above `<DockableDesktopProvider>` in the tree.
961
+ */
962
+ contextMenuAdapter?: ContextMenuAdapter;
963
+ }
933
964
  /**
934
- * Composite provider that wraps both `WindowManagerProvider` and `PanelProvider`
935
- * in the correct order. Drop-in replacement for manually nesting both providers.
965
+ * Composite provider that wraps `WindowManagerProvider`, `PanelProvider`, and `ToolbarProvider`
966
+ * in the correct order, and mounts the workspace-level `ContextMenuProvider` so that
967
+ * `showContextMenu()` and `useShowContextMenu()` work from any component in the tree —
968
+ * including siblings of `<WindowManager>` such as `<Sidebar>`, `<SidePanelRenderer>`,
969
+ * and `<ModalStackRenderer>`.
970
+ *
971
+ * Drop-in replacement for manually nesting both providers.
936
972
  *
937
973
  * `WindowManagerProvider` and `PanelProvider` remain independently exported
938
974
  * for cases that require custom nesting or separate configuration.
@@ -940,12 +976,15 @@ type DockableDesktopProviderProps = WindowManagerProviderProps;
940
976
  * @example
941
977
  * ```tsx
942
978
  * <DockableDesktopProvider client={workspace}>
943
- * <WindowManager />
979
+ * <Sidebar>
980
+ * <WindowManager />
981
+ * </Sidebar>
982
+ * <SidePanelRenderer />
944
983
  * <ModalStackRenderer />
945
984
  * </DockableDesktopProvider>
946
985
  * ```
947
986
  */
948
- declare const DockableDesktopProvider: React$1.FC<WindowManagerProviderProps>;
987
+ declare const DockableDesktopProvider: React$1.FC<DockableDesktopProviderProps>;
949
988
 
950
989
  /**
951
990
  * Options used when requesting to close a container.
@@ -955,7 +994,7 @@ interface CloseOptions {
955
994
  force?: boolean;
956
995
  }
957
996
  /** Represents the type of container context a panel/form is currently rendered inside. */
958
- type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'standalone';
997
+ type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'floating-window' | 'standalone';
959
998
  /**
960
999
  * Contract interface exposed by a container (like a tab, window, modal, or side-panel)
961
1000
  * to its children forms, enabling them to control or listen to container events.
@@ -975,7 +1014,7 @@ interface FormContainerContract {
975
1014
  }) => void;
976
1015
  /** Change the tab or window icon dynamically. */
977
1016
  setIcon?: (icon: React.ReactNode) => void;
978
- /** The type of container the panel is mounted in. */
1017
+ /** The type of container the panel is mounted in. Reflects the state at mount time; subscribe to {@link onContainerTypeChange} for live updates. */
979
1018
  containerType?: ContainerType;
980
1019
  /** Unique identifier of the panel or window instance. */
981
1020
  instanceId: string;
@@ -985,8 +1024,34 @@ interface FormContainerContract {
985
1024
  onMinimize?: (handler: () => void) => () => void;
986
1025
  /** Subscribe to the container's restore event. Returns an unsubscribe function. */
987
1026
  onRestore?: (handler: () => void) => () => void;
988
- /** Subscribe to the container's window resize event, returning width and height. */
1027
+ /** Subscribe to the container's window resize event, returning width and height. Returns an unsubscribe function. */
989
1028
  onResize?: (handler: (width: number, height: number) => void) => () => void;
1029
+ /** Request the container to minimize itself to the taskbar. No-op if the container type does not support minimize. */
1030
+ requestMinimize?: () => void;
1031
+ /** Returns the current rendered dimensions of this panel, or `null` if the panel has not been laid out yet. */
1032
+ getDimensions?: () => {
1033
+ width: number;
1034
+ height: number;
1035
+ } | null;
1036
+ /**
1037
+ * Subscribe to this panel becoming the globally active panel.
1038
+ * Fires when `activePanelId` transitions to this panel's id.
1039
+ * Returns an unsubscribe function.
1040
+ */
1041
+ onActivate?: (handler: () => void) => () => void;
1042
+ /**
1043
+ * Subscribe to this panel losing active status.
1044
+ * Fires when `activePanelId` transitions away from this panel's id,
1045
+ * and also fires if the panel is destroyed while it is active.
1046
+ * Returns an unsubscribe function.
1047
+ */
1048
+ onDeactivate?: (handler: () => void) => () => void;
1049
+ /**
1050
+ * Subscribe to changes in the panel's container type (e.g. docked ↔ floating).
1051
+ * Does not fire for minimize/restore cycles — use {@link onMinimize} / {@link onRestore} for those.
1052
+ * Returns an unsubscribe function.
1053
+ */
1054
+ onContainerTypeChange?: (handler: (type: ContainerType) => void) => () => void;
990
1055
  }
991
1056
  /**
992
1057
  * Context that supplies the {@link FormContainerContract} to panels inside the Window Manager.
@@ -995,7 +1060,9 @@ declare const FormContainerContext: Context<FormContainerContract>;
995
1060
  declare const FormContainerProvider: Provider<FormContainerContract>;
996
1061
  /**
997
1062
  * React hook to retrieve the current {@link FormContainerContract} from context.
998
- * Enables sub-forms to trigger close requests, mark themselves dirty, rename their tabs, or listen to resize events.
1063
+ * Enables sub-forms to trigger close/minimize requests, mark themselves dirty,
1064
+ * rename their tabs, query dimensions, or subscribe to lifecycle events
1065
+ * (resize, close, minimize, restore, activate, deactivate, container-type changes).
999
1066
  */
1000
1067
  declare const useFormContainer: () => FormContainerContract;
1001
1068
 
@@ -1798,4 +1865,4 @@ interface PanelFloatingWindowManagerHandle {
1798
1865
  */
1799
1866
  declare function usePanelFloatingWindowManager(): PanelFloatingWindowManagerHandle;
1800
1867
 
1801
- export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type PanelActions, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PredefinedMessageKey, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, defaultPredefinedMessages, formatLabel, toast, useFormContainer, useFormatMessage, usePanelActions, usePanelContext, usePanelContextMenu, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelState, usePredefinedMessages, useRegistry, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
1868
+ export { type BuiltInPanelEvents, type ButtonVariant, type CloseOptions, ConfirmationForm, type ConfirmationFormProps, ContextMenu, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuPredefinedMessage, type ContextMenuProps, ContextMenuProvider, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, DefaultContextMenuAdapter, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type ManagedWindowConfig, type MenuItemAction, type MessageFormatter, type ModalOptions, ModalStackRenderer, type PanelActions, type PanelDefinition, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PredefinedMessageKey, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type StyleClasses, type TaskbarVisibility, type ToastAdapter, ToastContainer, type ToastContainerProps, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, Toolbar, type ToolbarActionItem, ToolbarButton, type ToolbarButtonProps, ToolbarCenter, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarProps, ToolbarProvider, type ToolbarRadioItem, ToolbarSearchInput, type ToolbarSearchInputProps, type ToolbarSeparator$1 as ToolbarSeparator, ToolbarSpacer, ToolbarToggle, type ToolbarToggleItem, type ToolbarToggleProps, type ToolbarVariant, type UsePanelFloatingWindowReturn, type WindowActions, WindowManager, type WindowManagerProps, WindowManagerProvider, type WindowManagerProviderProps, type WindowState, WorkspaceClient, type WorkspaceClientConfig, defaultPredefinedMessages, formatLabel, toast, useFormContainer, useFormatMessage, usePanelActions, usePanelContext, usePanelContextMenu, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };