react-dockable-desktop 6.3.1 → 6.4.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/index.d.cts CHANGED
@@ -112,11 +112,12 @@ interface BuiltInPanelEvents {
112
112
  };
113
113
  /**
114
114
  * Fires whenever something `saveLayout()` would capture changes — open/close/minimize/restore,
115
- * and an `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
116
- * consumers, so they don't need to subscribe to four separate events. Does **not** cover a
115
+ * float/dock/re-order/dock-to-edge, closing a group, maximizing a minimized panel, and an
116
+ * `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
117
+ * consumers, so they don't need to subscribe to separate events. Does **not** cover a
117
118
  * `registerStateProvider` callback's return value changing on its own — that's a pull, there's
118
119
  * no way to observe it changing without the panel separately notifying — nor resize/split-ratio
119
- * drag/dock-rearrange, which have no hooks yet.
120
+ * drag, which has no hook yet.
120
121
  */
121
122
  'layout:changed': Record<string, never>;
122
123
  /**
@@ -212,7 +213,7 @@ interface WorkspaceClientConfig {
212
213
  * workspace.openPanel('map-1', 'map');
213
214
  * workspace.focusPanel('map-1');
214
215
  */
215
- declare class WorkspaceClient<TUserEvents extends Record<string, unknown> = Record<string, unknown>> {
216
+ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknown>> {
216
217
  /** Scoped panel registry — fully independent from the global singleton. */
217
218
  readonly registry: PanelRegistryClass;
218
219
  /** Serialised layout to restore on mount, or null to start with an empty canvas. */
@@ -272,8 +273,18 @@ declare class WorkspaceClient<TUserEvents extends Record<string, unknown> = Reco
272
273
  dockPanelToGroup(id: string, targetLeafId: string, position: DropPosition): void;
273
274
  /** Reorders a panel's tab within its leaf group. */
274
275
  movePanelOrder(panelId: string, targetLeafId: string, targetIndex: number): void;
275
- /** Closes an entire leaf group (all of its tabs) at once. */
276
- closeLeafGroup(leafId: string): void;
276
+ /**
277
+ * Closes a leaf group: each of its tabs is closed through the guarded close path, then the
278
+ * group is removed once empty. A tab whose close guard refuses — or a dirty tab that
279
+ * `onConfirm` doesn't approve — stays open, and so does its group.
280
+ * Resolves once every close request has been settled.
281
+ *
282
+ * @remarks If called before the provider mounts, the request is queued and this returns an
283
+ * already-resolved promise, as `requestClosePanel` does.
284
+ */
285
+ closeLeafGroup(leafId: string, options?: {
286
+ onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
287
+ }): Promise<void>;
277
288
  /** Registers a guard that can veto closing the given panel. */
278
289
  registerCloseGuard(id: string, guard: () => boolean | Promise<boolean>): void;
279
290
  /** Removes a previously registered close guard. */
@@ -423,6 +434,70 @@ declare const defaultPredefinedMessages: {
423
434
  readonly id: "dockable-desktop-closeTooltip";
424
435
  readonly defaultMessage: "Close";
425
436
  };
437
+ readonly notifications: {
438
+ readonly id: "dockable-desktop-notifications";
439
+ readonly defaultMessage: "Notifications";
440
+ };
441
+ readonly closeNotification: {
442
+ readonly id: "dockable-desktop-closeNotification";
443
+ readonly defaultMessage: "Close notification";
444
+ };
445
+ readonly scrollTabsLeft: {
446
+ readonly id: "dockable-desktop-scrollTabsLeft";
447
+ readonly defaultMessage: "Scroll tabs left";
448
+ };
449
+ readonly scrollTabsRight: {
450
+ readonly id: "dockable-desktop-scrollTabsRight";
451
+ readonly defaultMessage: "Scroll tabs right";
452
+ };
453
+ readonly scrollTaskbarLeft: {
454
+ readonly id: "dockable-desktop-scrollTaskbarLeft";
455
+ readonly defaultMessage: "Scroll taskbar left";
456
+ };
457
+ readonly scrollTaskbarRight: {
458
+ readonly id: "dockable-desktop-scrollTaskbarRight";
459
+ readonly defaultMessage: "Scroll taskbar right";
460
+ };
461
+ readonly moreActions: {
462
+ readonly id: "dockable-desktop-moreActions";
463
+ readonly defaultMessage: "More actions";
464
+ };
465
+ readonly search: {
466
+ readonly id: "dockable-desktop-search";
467
+ readonly defaultMessage: "Search";
468
+ };
469
+ readonly closeSearch: {
470
+ readonly id: "dockable-desktop-closeSearch";
471
+ readonly defaultMessage: "Close search";
472
+ };
473
+ readonly searchPlaceholder: {
474
+ readonly id: "dockable-desktop-searchPlaceholder";
475
+ readonly defaultMessage: "Search…";
476
+ };
477
+ readonly modalTitle: {
478
+ readonly id: "dockable-desktop-modalTitle";
479
+ readonly defaultMessage: "Confirmation";
480
+ };
481
+ readonly emptyGroup: {
482
+ readonly id: "dockable-desktop-emptyGroup";
483
+ readonly defaultMessage: "Empty Workspace Section";
484
+ };
485
+ readonly emptyGrid: {
486
+ readonly id: "dockable-desktop-emptyGrid";
487
+ readonly defaultMessage: "Grid Empty";
488
+ };
489
+ readonly componentUnregistered: {
490
+ readonly id: "dockable-desktop-componentUnregistered";
491
+ readonly defaultMessage: "Component Unregistered";
492
+ };
493
+ readonly componentKey: {
494
+ readonly id: "dockable-desktop-componentKey";
495
+ readonly defaultMessage: "Key: {key}";
496
+ };
497
+ readonly untitledPanel: {
498
+ readonly id: "dockable-desktop-untitledPanel";
499
+ readonly defaultMessage: "Panel";
500
+ };
426
501
  };
427
502
  /**
428
503
  * Union of every key in `defaultPredefinedMessages`.
@@ -864,10 +939,17 @@ interface WindowActions {
864
939
  */
865
940
  movePanelOrder: (panelId: string, targetLeafId: string, targetIndex: number) => void;
866
941
  /**
867
- * Closes an empty leaf group (removes it from the grid tree).
868
- * @param leafId - Leaf node ID to remove.
942
+ * Closes a leaf group: each of its panels is closed through the guarded close path (as if by
943
+ * its own tab ×), then the group is removed once empty. A close guard that refuses, or a dirty
944
+ * panel that `onConfirm` doesn't approve, keeps that panel — and therefore the group.
945
+ * A group with `canClose: false` is left alone.
946
+ * @param leafId - Leaf node ID to close.
947
+ * @param options.onConfirm - Asked for each dirty panel; resolve `true` to discard its changes.
948
+ * @returns Resolves once every close request has been settled.
869
949
  */
870
- closeLeafGroup: (leafId: string) => void;
950
+ closeLeafGroup: (leafId: string, options?: {
951
+ onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
952
+ }) => Promise<void>;
871
953
  /**
872
954
  * Registers a close guard that can intercept and cancel panel close requests.
873
955
  * @param id - Panel instance ID to guard.
@@ -2214,7 +2296,7 @@ interface SearchResult {
2214
2296
  }
2215
2297
  /** Props for `<ToolbarSearchInput>`. */
2216
2298
  interface ToolbarSearchInputProps {
2217
- /** Placeholder text shown in the expanded input field. @default 'Search…' */
2299
+ /** Placeholder text shown in the expanded input field. @default the `searchPlaceholder` message ('Search…') */
2218
2300
  placeholder?: string;
2219
2301
  /**
2220
2302
  * Called with the current query and an `AbortSignal` each time the input changes (debounced).
@@ -2531,6 +2613,7 @@ interface ResizeConstraints {
2531
2613
  */
2532
2614
  declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, start: ResizeRect, constraints: ResizeConstraints): ResizeRect;
2533
2615
 
2616
+ type ColorScheme = 'dark' | 'light';
2534
2617
  /**
2535
2618
  * Reactively reads the workspace's current `data-color-scheme` attribute
2536
2619
  * (set on `document.documentElement` by `<WindowManager />`), returning
@@ -2539,7 +2622,20 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
2539
2622
  * Useful for panel content that needs to react to the same scheme the
2540
2623
  * workspace itself is using — e.g. swapping a map's tile layer or an
2541
2624
  * embedded editor's theme to match.
2625
+ *
2626
+ * Returns `'dark'` when rendered on the server.
2627
+ */
2628
+ declare function useColorScheme(): ColorScheme;
2629
+
2630
+ declare function isElementRtl(el: HTMLElement | null): boolean;
2631
+ /**
2632
+ * Whether `el` is laid out right-to-left, as the browser computes it — from a `dir` attribute on
2633
+ * any ancestor, the CSS `direction` property, or the workspace's own `setDirection`.
2634
+ *
2635
+ * Use this, not `document.documentElement.dir`, wherever a pointer delta (physical) is turned into
2636
+ * a size, side or index (logical): RTL is often set on `<body>` or a wrapper rather than `<html>`, and
2637
+ * the workspace can be RTL on an LTR page.
2542
2638
  */
2543
- declare function useColorScheme(): 'dark' | 'light';
2639
+ declare function isComputedRtl(el: Element | null | undefined): boolean;
2544
2640
 
2545
- 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 OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, type PanelFloatPlacement, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type Stretch, 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, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
2641
+ 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 OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, type PanelFloatPlacement, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type Stretch, 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, computeResizedRect, defaultPredefinedMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
package/dist/index.d.ts CHANGED
@@ -112,11 +112,12 @@ interface BuiltInPanelEvents {
112
112
  };
113
113
  /**
114
114
  * Fires whenever something `saveLayout()` would capture changes — open/close/minimize/restore,
115
- * and an `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
116
- * consumers, so they don't need to subscribe to four separate events. Does **not** cover a
115
+ * float/dock/re-order/dock-to-edge, closing a group, maximizing a minimized panel, and an
116
+ * `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
117
+ * consumers, so they don't need to subscribe to separate events. Does **not** cover a
117
118
  * `registerStateProvider` callback's return value changing on its own — that's a pull, there's
118
119
  * no way to observe it changing without the panel separately notifying — nor resize/split-ratio
119
- * drag/dock-rearrange, which have no hooks yet.
120
+ * drag, which has no hook yet.
120
121
  */
121
122
  'layout:changed': Record<string, never>;
122
123
  /**
@@ -212,7 +213,7 @@ interface WorkspaceClientConfig {
212
213
  * workspace.openPanel('map-1', 'map');
213
214
  * workspace.focusPanel('map-1');
214
215
  */
215
- declare class WorkspaceClient<TUserEvents extends Record<string, unknown> = Record<string, unknown>> {
216
+ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknown>> {
216
217
  /** Scoped panel registry — fully independent from the global singleton. */
217
218
  readonly registry: PanelRegistryClass;
218
219
  /** Serialised layout to restore on mount, or null to start with an empty canvas. */
@@ -272,8 +273,18 @@ declare class WorkspaceClient<TUserEvents extends Record<string, unknown> = Reco
272
273
  dockPanelToGroup(id: string, targetLeafId: string, position: DropPosition): void;
273
274
  /** Reorders a panel's tab within its leaf group. */
274
275
  movePanelOrder(panelId: string, targetLeafId: string, targetIndex: number): void;
275
- /** Closes an entire leaf group (all of its tabs) at once. */
276
- closeLeafGroup(leafId: string): void;
276
+ /**
277
+ * Closes a leaf group: each of its tabs is closed through the guarded close path, then the
278
+ * group is removed once empty. A tab whose close guard refuses — or a dirty tab that
279
+ * `onConfirm` doesn't approve — stays open, and so does its group.
280
+ * Resolves once every close request has been settled.
281
+ *
282
+ * @remarks If called before the provider mounts, the request is queued and this returns an
283
+ * already-resolved promise, as `requestClosePanel` does.
284
+ */
285
+ closeLeafGroup(leafId: string, options?: {
286
+ onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
287
+ }): Promise<void>;
277
288
  /** Registers a guard that can veto closing the given panel. */
278
289
  registerCloseGuard(id: string, guard: () => boolean | Promise<boolean>): void;
279
290
  /** Removes a previously registered close guard. */
@@ -423,6 +434,70 @@ declare const defaultPredefinedMessages: {
423
434
  readonly id: "dockable-desktop-closeTooltip";
424
435
  readonly defaultMessage: "Close";
425
436
  };
437
+ readonly notifications: {
438
+ readonly id: "dockable-desktop-notifications";
439
+ readonly defaultMessage: "Notifications";
440
+ };
441
+ readonly closeNotification: {
442
+ readonly id: "dockable-desktop-closeNotification";
443
+ readonly defaultMessage: "Close notification";
444
+ };
445
+ readonly scrollTabsLeft: {
446
+ readonly id: "dockable-desktop-scrollTabsLeft";
447
+ readonly defaultMessage: "Scroll tabs left";
448
+ };
449
+ readonly scrollTabsRight: {
450
+ readonly id: "dockable-desktop-scrollTabsRight";
451
+ readonly defaultMessage: "Scroll tabs right";
452
+ };
453
+ readonly scrollTaskbarLeft: {
454
+ readonly id: "dockable-desktop-scrollTaskbarLeft";
455
+ readonly defaultMessage: "Scroll taskbar left";
456
+ };
457
+ readonly scrollTaskbarRight: {
458
+ readonly id: "dockable-desktop-scrollTaskbarRight";
459
+ readonly defaultMessage: "Scroll taskbar right";
460
+ };
461
+ readonly moreActions: {
462
+ readonly id: "dockable-desktop-moreActions";
463
+ readonly defaultMessage: "More actions";
464
+ };
465
+ readonly search: {
466
+ readonly id: "dockable-desktop-search";
467
+ readonly defaultMessage: "Search";
468
+ };
469
+ readonly closeSearch: {
470
+ readonly id: "dockable-desktop-closeSearch";
471
+ readonly defaultMessage: "Close search";
472
+ };
473
+ readonly searchPlaceholder: {
474
+ readonly id: "dockable-desktop-searchPlaceholder";
475
+ readonly defaultMessage: "Search…";
476
+ };
477
+ readonly modalTitle: {
478
+ readonly id: "dockable-desktop-modalTitle";
479
+ readonly defaultMessage: "Confirmation";
480
+ };
481
+ readonly emptyGroup: {
482
+ readonly id: "dockable-desktop-emptyGroup";
483
+ readonly defaultMessage: "Empty Workspace Section";
484
+ };
485
+ readonly emptyGrid: {
486
+ readonly id: "dockable-desktop-emptyGrid";
487
+ readonly defaultMessage: "Grid Empty";
488
+ };
489
+ readonly componentUnregistered: {
490
+ readonly id: "dockable-desktop-componentUnregistered";
491
+ readonly defaultMessage: "Component Unregistered";
492
+ };
493
+ readonly componentKey: {
494
+ readonly id: "dockable-desktop-componentKey";
495
+ readonly defaultMessage: "Key: {key}";
496
+ };
497
+ readonly untitledPanel: {
498
+ readonly id: "dockable-desktop-untitledPanel";
499
+ readonly defaultMessage: "Panel";
500
+ };
426
501
  };
427
502
  /**
428
503
  * Union of every key in `defaultPredefinedMessages`.
@@ -864,10 +939,17 @@ interface WindowActions {
864
939
  */
865
940
  movePanelOrder: (panelId: string, targetLeafId: string, targetIndex: number) => void;
866
941
  /**
867
- * Closes an empty leaf group (removes it from the grid tree).
868
- * @param leafId - Leaf node ID to remove.
942
+ * Closes a leaf group: each of its panels is closed through the guarded close path (as if by
943
+ * its own tab ×), then the group is removed once empty. A close guard that refuses, or a dirty
944
+ * panel that `onConfirm` doesn't approve, keeps that panel — and therefore the group.
945
+ * A group with `canClose: false` is left alone.
946
+ * @param leafId - Leaf node ID to close.
947
+ * @param options.onConfirm - Asked for each dirty panel; resolve `true` to discard its changes.
948
+ * @returns Resolves once every close request has been settled.
869
949
  */
870
- closeLeafGroup: (leafId: string) => void;
950
+ closeLeafGroup: (leafId: string, options?: {
951
+ onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
952
+ }) => Promise<void>;
871
953
  /**
872
954
  * Registers a close guard that can intercept and cancel panel close requests.
873
955
  * @param id - Panel instance ID to guard.
@@ -2214,7 +2296,7 @@ interface SearchResult {
2214
2296
  }
2215
2297
  /** Props for `<ToolbarSearchInput>`. */
2216
2298
  interface ToolbarSearchInputProps {
2217
- /** Placeholder text shown in the expanded input field. @default 'Search…' */
2299
+ /** Placeholder text shown in the expanded input field. @default the `searchPlaceholder` message ('Search…') */
2218
2300
  placeholder?: string;
2219
2301
  /**
2220
2302
  * Called with the current query and an `AbortSignal` each time the input changes (debounced).
@@ -2531,6 +2613,7 @@ interface ResizeConstraints {
2531
2613
  */
2532
2614
  declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, start: ResizeRect, constraints: ResizeConstraints): ResizeRect;
2533
2615
 
2616
+ type ColorScheme = 'dark' | 'light';
2534
2617
  /**
2535
2618
  * Reactively reads the workspace's current `data-color-scheme` attribute
2536
2619
  * (set on `document.documentElement` by `<WindowManager />`), returning
@@ -2539,7 +2622,20 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
2539
2622
  * Useful for panel content that needs to react to the same scheme the
2540
2623
  * workspace itself is using — e.g. swapping a map's tile layer or an
2541
2624
  * embedded editor's theme to match.
2625
+ *
2626
+ * Returns `'dark'` when rendered on the server.
2627
+ */
2628
+ declare function useColorScheme(): ColorScheme;
2629
+
2630
+ declare function isElementRtl(el: HTMLElement | null): boolean;
2631
+ /**
2632
+ * Whether `el` is laid out right-to-left, as the browser computes it — from a `dir` attribute on
2633
+ * any ancestor, the CSS `direction` property, or the workspace's own `setDirection`.
2634
+ *
2635
+ * Use this, not `document.documentElement.dir`, wherever a pointer delta (physical) is turned into
2636
+ * a size, side or index (logical): RTL is often set on `<body>` or a wrapper rather than `<html>`, and
2637
+ * the workspace can be RTL on an LTR page.
2542
2638
  */
2543
- declare function useColorScheme(): 'dark' | 'light';
2639
+ declare function isComputedRtl(el: Element | null | undefined): boolean;
2544
2640
 
2545
- 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 OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, type PanelFloatPlacement, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type Stretch, 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, computeResizedRect, defaultPredefinedMessages, formatLabel, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };
2641
+ 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 OpenPanelOptions, type PanelActions, type PanelContribution, PanelContributionProvider, type PanelDefinition, type PanelFloatPlacement, PanelFloatingWindow, type PanelFloatingWindowManagerHandle, type PanelFloatingWindowProps, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelOverlayRoot, type PanelOverlayRootProps, PanelProvider, PanelRegistry, PanelRegistryClass, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, PanelToolbar, ToolbarItem as PanelToolbarItem, type PanelToolbarProps, ToolbarSeparator as PanelToolbarSeparator, type PointerDragConfig, type PredefinedMessageKey, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, RightPanelRenderer, type SearchResult, SecondarySidebar, type SecondarySidebarProps, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarContextValue, type SidebarHandle, type SidebarHeaderAction, type SidebarHeaderActionButton, type SidebarHeaderActionCustom, type SidebarProps, type SidebarTab, type SidebarTabContextValue, type SplitDirection, type SplitOrientation, type Stretch, 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, computeResizedRect, defaultPredefinedMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab, startPointerDrag, toast, useActivePanelContribution, useColorScheme, useFormContainer, useFormatMessage, useMergedSidebarTabs, useMergedToolbarItems, usePanelActions, usePanelContext, usePanelContextMenu, usePanelContribution, usePanelFloatingWindow, usePanelFloatingWindowManager, usePanelId, usePanelSize, usePanelState, usePredefinedMessages, useRegistry, useShowContextMenu, useSidebar, useSidebarTab, useStyleClasses, useToolbar, useWindowManagerActions, useWindowManagerState };