react-dockable-desktop 7.10.1 → 7.11.0-next.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/CHANGELOG.md +136 -1
- package/README.md +8 -4
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +277 -3
- package/dist/index.d.ts +277 -3
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +44 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -289,6 +289,24 @@ interface PanelInfo {
|
|
|
289
289
|
* shown instead of the registration's `defaultOptions.icon`. Never saved by `saveLayout()`;
|
|
290
290
|
* `loadLayout()` keeps it for a panel that is still open. */
|
|
291
291
|
icon?: React$1.ReactNode;
|
|
292
|
+
/**
|
|
293
|
+
* Set on a panel that shows a managed widget moved out of its owner panel, whose `component` is
|
|
294
|
+
* the reserved `'rdd:widget'`. Runtime only: such a panel is never written by `saveLayout()`, and
|
|
295
|
+
* the owner panel saves its widgets itself. (7.11.0)
|
|
296
|
+
*/
|
|
297
|
+
owner?: PanelOwner;
|
|
298
|
+
}
|
|
299
|
+
/** Who a hosted panel belongs to: see {@link PanelInfo.owner}. (7.11.0) */
|
|
300
|
+
interface PanelOwner {
|
|
301
|
+
/** The panel whose overlay opened the widget. */
|
|
302
|
+
panelId: string;
|
|
303
|
+
/** The widget's id in that overlay (`useFloatingWidgets().open(id, …)`). */
|
|
304
|
+
widgetId: string;
|
|
305
|
+
/** @internal The widget's own capabilities, applied by `optionsFor`. */
|
|
306
|
+
options?: {
|
|
307
|
+
canFloat?: boolean;
|
|
308
|
+
canDock?: boolean;
|
|
309
|
+
};
|
|
292
310
|
}
|
|
293
311
|
/**
|
|
294
312
|
* Options accepted by {@link WorkspaceActions.openPanel}.
|
|
@@ -477,6 +495,8 @@ interface WorkspaceActions {
|
|
|
477
495
|
* Activates the given panel regardless of its current state.
|
|
478
496
|
* - Floating panel: raises z-index so the window appears on top of others.
|
|
479
497
|
* - Docked panel: selects the tab within its leaf group.
|
|
498
|
+
* - Minimized panel: makes it the active one but leaves it minimized. To restore it as well, call
|
|
499
|
+
* `focusPanel(id, { restore: true })` on the workspace (`useWorkspace()`, 7.11.0).
|
|
480
500
|
* @param id - Panel instance ID.
|
|
481
501
|
* @example
|
|
482
502
|
* ```ts
|
|
@@ -626,6 +646,18 @@ interface WorkspaceActions {
|
|
|
626
646
|
* @param title - New title string or localizable message descriptor.
|
|
627
647
|
*/
|
|
628
648
|
updatePanelTitle: (id: string, title: string | MessageDescriptor | (() => string)) => void;
|
|
649
|
+
/**
|
|
650
|
+
* Replaces the props an open panel was opened with (7.11.0), or derives them from the current
|
|
651
|
+
* ones. The panel re-renders with them, `serializable` is re-checked (see {@link PanelInfo.serializable}),
|
|
652
|
+
* and `layout:changed` is published. Does nothing for a panel that isn't open.
|
|
653
|
+
* @param id - Panel instance ID.
|
|
654
|
+
* @param props - The new props, or a function of the current ones.
|
|
655
|
+
* @example
|
|
656
|
+
* ```ts
|
|
657
|
+
* workspace.updatePanelProps('section-1', prev => ({ ...prev, line: newLine }));
|
|
658
|
+
* ```
|
|
659
|
+
*/
|
|
660
|
+
updatePanelProps: (id: string, props: Record<string, unknown> | ((prev: Record<string, unknown> | undefined) => Record<string, unknown>)) => void;
|
|
629
661
|
/**
|
|
630
662
|
* Sets the icon shown on an open panel's tab, floating title bar and taskbar button, in place
|
|
631
663
|
* of its registration's `defaultOptions.icon`. `null` restores the registration's icon. The icon
|
|
@@ -672,6 +704,10 @@ interface WorkspaceActions {
|
|
|
672
704
|
* @internal
|
|
673
705
|
*/
|
|
674
706
|
interface InternalWindowActions extends WorkspaceActions {
|
|
707
|
+
/** @internal `focusPanel`, with the workspace's `restore` option (7.11.0). */
|
|
708
|
+
focusPanel: (id: string, options?: {
|
|
709
|
+
restore?: boolean;
|
|
710
|
+
}) => void;
|
|
675
711
|
/** @internal */
|
|
676
712
|
setActivePanel: (id: string | null) => void;
|
|
677
713
|
/** @internal */
|
|
@@ -682,7 +718,39 @@ interface InternalWindowActions extends WorkspaceActions {
|
|
|
682
718
|
registerContextMenuFn: (fn: (options: ShowContextMenuOptions) => void) => () => void;
|
|
683
719
|
/** @internal Whether the user may move `panelId` to `to`: its type's rules, then `canDrop`. (7.9.0) */
|
|
684
720
|
isDropAllowed: (panelId: string, to: PanelDropTarget) => boolean;
|
|
721
|
+
/**
|
|
722
|
+
* @internal Opens a hosted panel: one showing a managed widget moved out of its owner panel
|
|
723
|
+
* (7.11.0). Docked beside `dockTo.panel`, or floating exactly at `rect` (not cascaded). Returns
|
|
724
|
+
* `false`, changing nothing, when the id is taken or the panel to dock beside isn't docked.
|
|
725
|
+
*/
|
|
726
|
+
openHostedPanel: (id: string, owner: PanelOwner, title: PanelInfo['title'], at: HostedPanelPlacement) => boolean;
|
|
727
|
+
/** @internal Removes a hosted panel without its close handler: the widget is going back. (7.11.0) */
|
|
728
|
+
removeHostedPanel: (id: string) => void;
|
|
729
|
+
/** @internal Updates a hosted panel's own capabilities (the widget re-opened). (7.11.0) */
|
|
730
|
+
setHostedOptions: (id: string, options: NonNullable<PanelOwner['options']>) => void;
|
|
731
|
+
/**
|
|
732
|
+
* @internal `onClose` is called when a hosted panel is closed (×, menu, `closePanel`): the widget
|
|
733
|
+
* closes. `onDrop`, just before a `loadLayout` drops it: the widget is about to go home. (7.11.0)
|
|
734
|
+
*/
|
|
735
|
+
registerHostedCloseHandler: (id: string, onClose: () => void, onDrop?: () => void) => () => void;
|
|
685
736
|
}
|
|
737
|
+
/** @internal Where a hosted panel opens. (7.11.0) */
|
|
738
|
+
type HostedPanelPlacement = {
|
|
739
|
+
kind: 'dock';
|
|
740
|
+
dockTo: {
|
|
741
|
+
panel: string;
|
|
742
|
+
position: DropPosition;
|
|
743
|
+
size?: number;
|
|
744
|
+
};
|
|
745
|
+
} | {
|
|
746
|
+
kind: 'float';
|
|
747
|
+
rect: {
|
|
748
|
+
x: number;
|
|
749
|
+
y: number;
|
|
750
|
+
width: number;
|
|
751
|
+
height: number;
|
|
752
|
+
};
|
|
753
|
+
};
|
|
686
754
|
/** Represents custom CSS classes injected into layout parts. */
|
|
687
755
|
interface HostClasses {
|
|
688
756
|
modalClass?: string;
|
|
@@ -796,6 +864,14 @@ interface PanelRegistryEntry {
|
|
|
796
864
|
* state, as they always have. (7.8.0)
|
|
797
865
|
*/
|
|
798
866
|
keepAlive?: boolean;
|
|
867
|
+
/**
|
|
868
|
+
* Keep embedded documents and media alive when the panel moves (7.11.0): an `<iframe>` doesn't
|
|
869
|
+
* reload when the panel is docked, floated, minimised or restored. The library then moves the
|
|
870
|
+
* panel's element with `moveBefore()`, which keeps that state, in browsers that have it
|
|
871
|
+
* (Chrome and Edge 133+, Firefox 144+); in the others (Safari) it moves as before and an iframe
|
|
872
|
+
* reloads. Off by default. @default false
|
|
873
|
+
*/
|
|
874
|
+
preserveEmbeds?: boolean;
|
|
799
875
|
};
|
|
800
876
|
}
|
|
801
877
|
/**
|
|
@@ -1226,8 +1302,20 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
|
|
|
1226
1302
|
* Activates the given panel regardless of its current state.
|
|
1227
1303
|
* For floating panels: raises z-index so the window appears on top.
|
|
1228
1304
|
* For docked panels: selects the tab within its leaf group.
|
|
1305
|
+
* For minimized panels: makes it the active one, but leaves it minimized.
|
|
1229
1306
|
*/
|
|
1230
1307
|
focusPanel(id: string): void;
|
|
1308
|
+
/**
|
|
1309
|
+
* As `focusPanel(id)`; with `restore: true`, a minimized panel is restored first, with
|
|
1310
|
+
* `restorePanel`'s events (7.11.0).
|
|
1311
|
+
* @example
|
|
1312
|
+
* ```ts
|
|
1313
|
+
* workspace.focusPanel('map-1', { restore: true }); // bring the map forward, wherever it is
|
|
1314
|
+
* ```
|
|
1315
|
+
*/
|
|
1316
|
+
focusPanel(id: string, options: {
|
|
1317
|
+
restore?: boolean;
|
|
1318
|
+
}): void;
|
|
1231
1319
|
/** Returns `true` if a panel with this ID is currently open. */
|
|
1232
1320
|
isOpen(id: string): boolean;
|
|
1233
1321
|
/** Returns the IDs of all currently open panels. */
|
|
@@ -1271,6 +1359,8 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
|
|
|
1271
1359
|
setPanelDirty(id: string, dirty: boolean, options?: DirtyStateOptions): void;
|
|
1272
1360
|
/** Updates a panel's displayed title. */
|
|
1273
1361
|
updatePanelTitle(id: string, title: string | MessageDescriptor | (() => string)): void;
|
|
1362
|
+
/** Replaces an open panel's props, or derives them from the current ones (7.11.0). See {@link WorkspaceActions.updatePanelProps}. */
|
|
1363
|
+
updatePanelProps(...args: Parameters<WorkspaceActions['updatePanelProps']>): void;
|
|
1274
1364
|
/** Sets an open panel's tab/window/taskbar icon; `null` restores its registration's icon. Not saved by `saveLayout()`. */
|
|
1275
1365
|
setPanelIcon(id: string, icon: ReactNode | null): void;
|
|
1276
1366
|
/**
|
|
@@ -2467,7 +2557,117 @@ interface ManagedWidget {
|
|
|
2467
2557
|
* @see Stretch
|
|
2468
2558
|
*/
|
|
2469
2559
|
stretch?: Stretch;
|
|
2560
|
+
/**
|
|
2561
|
+
* The user may move it out of the panel into a docked panel or a tab (7.11.0): drags of its
|
|
2562
|
+
* workspace panel, and what the app offers in {@link ManagedWidget.titleMenu}. Restricts the user
|
|
2563
|
+
* only; `move()` always works. Changeable while open: call `open()` again. @default false
|
|
2564
|
+
*/
|
|
2565
|
+
canDock?: boolean;
|
|
2566
|
+
/**
|
|
2567
|
+
* The user may move it out of the panel into a floating window (7.11.0). As
|
|
2568
|
+
* {@link ManagedWidget.canDock}: the user only, changeable with another `open()`. @default false
|
|
2569
|
+
*/
|
|
2570
|
+
canFloat?: boolean;
|
|
2571
|
+
/**
|
|
2572
|
+
* The menu on the widget's title icon (7.11.0), in the app's own words: a "Dock below the map" or
|
|
2573
|
+
* "Back into the map" item calls `w.move()`. With it, the title icon becomes a button that opens
|
|
2574
|
+
* these items. Out of the panel, the items lead its workspace panel's tab and title-bar menus,
|
|
2575
|
+
* before the built-in Minimize and Close; the built-in Float is left out, because these replace it.
|
|
2576
|
+
* Called each time the menu opens, so items can depend on where the widget is.
|
|
2577
|
+
* @example
|
|
2578
|
+
* titleMenu: w => w.location === 'panel'
|
|
2579
|
+
* ? [{ label: 'Dock below the map', action: () => w.move({ to: 'docked', position: 'bottom' }) }]
|
|
2580
|
+
* : [{ label: 'Back into the map', action: () => w.move({ to: 'panel' }) }]
|
|
2581
|
+
*/
|
|
2582
|
+
titleMenu?: (w: WidgetMenuContext) => ContextMenuItem[];
|
|
2583
|
+
/**
|
|
2584
|
+
* Open **at** a placement saved earlier with `useFloatingWidgets().placement(id)` (7.11.0): where
|
|
2585
|
+
* it was in the panel, and whether it was docked, tabbed or floating out of it. Used only on the
|
|
2586
|
+
* first open of an id, like `anchor`; a re-open of a live id leaves it where it is.
|
|
2587
|
+
*
|
|
2588
|
+
* A value this version can't read (another `v`, or broken fields) falls back to the config's own
|
|
2589
|
+
* `anchor` / `width` / `height` / `stretch`. A valid one is clamped into the panel as it is now; in
|
|
2590
|
+
* a panel that has no size yet (a background tab) a free position waits until it has one. If
|
|
2591
|
+
* moving out of the panel is refused (the owner isn't docked), the widget stays in the panel.
|
|
2592
|
+
*/
|
|
2593
|
+
placement?: WidgetPlacement;
|
|
2594
|
+
/**
|
|
2595
|
+
* Keep embedded documents and media alive when the widget moves (7.11.0): an `<iframe>` in it
|
|
2596
|
+
* doesn't reload when it moves out of its panel, back, or between docked, tabbed and floating.
|
|
2597
|
+
* Uses `moveBefore()` where the browser has it (Chrome and Edge 133+, Firefox 144+); in the others
|
|
2598
|
+
* an iframe reloads as before. As `preserveEmbeds` on a panel type's `defaultOptions`. @default false
|
|
2599
|
+
*/
|
|
2600
|
+
preserveEmbeds?: boolean;
|
|
2470
2601
|
}
|
|
2602
|
+
/**
|
|
2603
|
+
* Where a managed widget is, as plain JSON (7.11.0): from `useFloatingWidgets().placement(id)`,
|
|
2604
|
+
* back to `open(id, { placement })`. Opaque: store it as it is (JSON-serialisable) and don't read
|
|
2605
|
+
* its fields; they may change between versions, and `v` says which. The same in vdd and ndd.
|
|
2606
|
+
*/
|
|
2607
|
+
type WidgetPlacement = {
|
|
2608
|
+
readonly v: 1;
|
|
2609
|
+
} & Record<string, unknown>;
|
|
2610
|
+
/** What {@link ManagedWidget.titleMenu} is given to build its items from (7.11.0). */
|
|
2611
|
+
interface WidgetMenuContext {
|
|
2612
|
+
/** The widget's id. */
|
|
2613
|
+
id: string;
|
|
2614
|
+
/** Where it is now. */
|
|
2615
|
+
location: WidgetLocation;
|
|
2616
|
+
/** Its config's `canDock`. */
|
|
2617
|
+
canDock: boolean;
|
|
2618
|
+
/** Its config's `canFloat`. */
|
|
2619
|
+
canFloat: boolean;
|
|
2620
|
+
/** `useFloatingWidgets().move()` for this widget. */
|
|
2621
|
+
move(to: WidgetTarget): MoveResult;
|
|
2622
|
+
/** Closes the widget, wherever it is. */
|
|
2623
|
+
close(): void;
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Where a managed widget is shown (7.11.0). `'panel'` is inside its owner panel, as a floating
|
|
2627
|
+
* widget; the others are a workspace panel of its own, beside its owner (`'docked'`), a tab in its
|
|
2628
|
+
* owner's group (`'tabbed'`), a floating window (`'floating'`), or minimised to the taskbar.
|
|
2629
|
+
*/
|
|
2630
|
+
type WidgetLocation = 'panel' | 'docked' | 'tabbed' | 'floating' | 'minimized';
|
|
2631
|
+
/**
|
|
2632
|
+
* Where to move a managed widget with `useFloatingWidgets().move()` (7.11.0). Its owner panel is
|
|
2633
|
+
* always the reference: `'docked'` splits the owner's group on that side (`size` is the new
|
|
2634
|
+
* panel's share, 0.1–0.9, as in `openPanel`'s `dockTo`), `'tabbed'` adds a tab to the owner's
|
|
2635
|
+
* group. `'floating'` opens a floating window at `rect` (workspace pixels), or where the widget is
|
|
2636
|
+
* on screen. `'panel'` brings it back to where it last was inside the panel.
|
|
2637
|
+
*/
|
|
2638
|
+
type WidgetTarget = {
|
|
2639
|
+
to: 'panel';
|
|
2640
|
+
} | {
|
|
2641
|
+
to: 'docked';
|
|
2642
|
+
position: 'left' | 'right' | 'top' | 'bottom';
|
|
2643
|
+
size?: number;
|
|
2644
|
+
} | {
|
|
2645
|
+
to: 'tabbed';
|
|
2646
|
+
} | {
|
|
2647
|
+
to: 'floating';
|
|
2648
|
+
rect?: {
|
|
2649
|
+
x: number;
|
|
2650
|
+
y: number;
|
|
2651
|
+
width: number;
|
|
2652
|
+
height: number;
|
|
2653
|
+
};
|
|
2654
|
+
};
|
|
2655
|
+
/**
|
|
2656
|
+
* What `move()` did (7.11.0). A refusal changes nothing:
|
|
2657
|
+
* - `not-open`: no widget with that id is open in this overlay;
|
|
2658
|
+
* - `owner-not-docked`: `'docked'` and `'tabbed'` need the owner panel in the grid (a floating or
|
|
2659
|
+
* minimised owner can still move a widget to `'floating'`);
|
|
2660
|
+
* - `owner-not-kept-alive`: the owner's panel type has `keepAlive: false`, so it unmounts while
|
|
2661
|
+
* hidden and would take the widget with it;
|
|
2662
|
+
* - `no-workspace`: the overlay isn't in a workspace panel (no `DockableDesktopProvider`, or a
|
|
2663
|
+
* modal or drawer), so there is nowhere to move to.
|
|
2664
|
+
*/
|
|
2665
|
+
type MoveResult = {
|
|
2666
|
+
ok: true;
|
|
2667
|
+
} | {
|
|
2668
|
+
ok: false;
|
|
2669
|
+
reason: 'not-open' | 'owner-not-docked' | 'owner-not-kept-alive' | 'no-workspace';
|
|
2670
|
+
};
|
|
2471
2671
|
|
|
2472
2672
|
/**
|
|
2473
2673
|
* @file PanelOverlayRoot.tsx
|
|
@@ -2718,8 +2918,34 @@ interface FloatingWidgetsApi {
|
|
|
2718
2918
|
closeAll(): void;
|
|
2719
2919
|
/** Returns `true` if the named window is currently open. */
|
|
2720
2920
|
isOpen(id: string): boolean;
|
|
2721
|
-
/** IDs of all currently open managed windows. Changes to this array trigger re-renders. */
|
|
2921
|
+
/** IDs of all currently open managed windows, wherever they are shown. Changes to this array trigger re-renders. */
|
|
2722
2922
|
openIds: string[];
|
|
2923
|
+
/**
|
|
2924
|
+
* Moves a widget out of its panel or back (7.11.0), without remounting its content: docked
|
|
2925
|
+
* beside its owner panel, a tab in the owner's group, a floating window, or back into the panel
|
|
2926
|
+
* where it last was. Out of the panel it is a workspace panel of its own, which the user can
|
|
2927
|
+
* move, minimise and close like any other; closing it closes the widget. It never goes into a
|
|
2928
|
+
* saved layout. Returns a result rather than throwing; a refusal changes nothing.
|
|
2929
|
+
* @example
|
|
2930
|
+
* const widgets = useFloatingWidgets();
|
|
2931
|
+
* widgets.move('table', { to: 'docked', position: 'bottom', size: 0.35 });
|
|
2932
|
+
* widgets.move('table', { to: 'panel' });
|
|
2933
|
+
*/
|
|
2934
|
+
move(id: string, to: WidgetTarget): MoveResult;
|
|
2935
|
+
/**
|
|
2936
|
+
* Where a widget is shown (7.11.0), or `null` if it isn't open. Read when called; it doesn't
|
|
2937
|
+
* re-render anything by itself.
|
|
2938
|
+
*/
|
|
2939
|
+
location(id: string): WidgetLocation | null;
|
|
2940
|
+
/**
|
|
2941
|
+
* Where a widget is, as plain JSON to save with the rest of your panel's state (7.11.0): in the
|
|
2942
|
+
* panel (corner, stretch, free position, size) or out of it (docked, tabbed or floating, and where
|
|
2943
|
+
* it goes back to). Give it back to `open(id, { placement })` after a reload. `null` if it isn't open.
|
|
2944
|
+
* @example
|
|
2945
|
+
* const saved = widgets.placement('table'); // store it
|
|
2946
|
+
* widgets.open('table', { ...config, placement: saved }); // later: it opens where it was
|
|
2947
|
+
*/
|
|
2948
|
+
placement(id: string): WidgetPlacement | null;
|
|
2723
2949
|
}
|
|
2724
2950
|
/**
|
|
2725
2951
|
* Imperative hook for spawning N named floating windows at runtime from data or event handlers.
|
|
@@ -2738,6 +2964,53 @@ interface FloatingWidgetsApi {
|
|
|
2738
2964
|
*/
|
|
2739
2965
|
declare function usePanelFloatingWindowManager(): FloatingWidgetsApi;
|
|
2740
2966
|
|
|
2967
|
+
/**
|
|
2968
|
+
* @file widgetContext.ts
|
|
2969
|
+
* @description `useWidget()`: what a managed widget's own content knows about the widget (7.11.0).
|
|
2970
|
+
*/
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* What `useWidget()` returns inside a managed widget's content (7.11.0).
|
|
2974
|
+
*
|
|
2975
|
+
* `usePanel()` there is still the **owner** panel, so content bound to its owner (a table bound to
|
|
2976
|
+
* its map) keeps working wherever the widget is. This is the widget's own side.
|
|
2977
|
+
*/
|
|
2978
|
+
interface WidgetHandle {
|
|
2979
|
+
/** The widget's id, as given to `useFloatingWidgets().open()`. */
|
|
2980
|
+
id: string;
|
|
2981
|
+
/** The workspace panel that owns it, or `null` when its overlay isn't in one. */
|
|
2982
|
+
ownerPanelId: string | null;
|
|
2983
|
+
/**
|
|
2984
|
+
* The id of the widget's own panel while it is out of its owner panel, for workspace calls such
|
|
2985
|
+
* as `updatePanelTitle`; `null` while it is in the panel (7.11.0-next.1).
|
|
2986
|
+
*/
|
|
2987
|
+
panelId: string | null;
|
|
2988
|
+
/** Where it is shown now. A component that reads it re-renders when it changes. */
|
|
2989
|
+
location: WidgetLocation;
|
|
2990
|
+
/**
|
|
2991
|
+
* Called just before the widget's content element moves to another container: into or out of
|
|
2992
|
+
* its panel, between docked, tabbed and floating, minimised or restored. Save what a move would
|
|
2993
|
+
* disturb here, such as a map's view. Returns the unsubscribe function.
|
|
2994
|
+
*/
|
|
2995
|
+
onWillMove(cb: () => void): () => void;
|
|
2996
|
+
/**
|
|
2997
|
+
* Called once the element is in its new container and has its new size (or, with no size, as
|
|
2998
|
+
* when minimised, on the next frames). Restore what you saved in `onWillMove` here. Returns the
|
|
2999
|
+
* unsubscribe function.
|
|
3000
|
+
*/
|
|
3001
|
+
onMoved(cb: () => void): () => void;
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* The managed widget this component is rendered in, or `null` outside one (7.11.0).
|
|
3005
|
+
* @example
|
|
3006
|
+
* function TableWidget() {
|
|
3007
|
+
* const widget = useWidget();
|
|
3008
|
+
* useEffect(() => widget?.onMoved(() => grid.current?.resize()), [widget]);
|
|
3009
|
+
* return <Grid ref={grid} compact={widget?.location === 'panel'} />;
|
|
3010
|
+
* }
|
|
3011
|
+
*/
|
|
3012
|
+
declare function useWidget(): WidgetHandle | null;
|
|
3013
|
+
|
|
2741
3014
|
/**
|
|
2742
3015
|
* @file PanelContributionContext.tsx
|
|
2743
3016
|
* @description Lets any panel publish toolbar items and/or sidebar sections that
|
|
@@ -2791,7 +3064,8 @@ declare function usePanelContribution(contribution: PanelContribution): void;
|
|
|
2791
3064
|
/**
|
|
2792
3065
|
* Returns whatever the currently active panel (`state.activePanelId`) has published
|
|
2793
3066
|
* via `usePanelContribution()`, or `null` if no panel is active or the active panel
|
|
2794
|
-
* hasn't contributed anything.
|
|
3067
|
+
* hasn't contributed anything. When the active panel shows a managed widget moved out of
|
|
3068
|
+
* its owner panel (7.11.0), this is the owner's contribution. Intended for the app shell to merge into its own
|
|
2795
3069
|
* `<RddToolbar items={...}>` / `<RddSidebar tabs={...}>` calls.
|
|
2796
3070
|
*
|
|
2797
3071
|
* @throws Error if used outside of a {@link DockableDesktopProvider}.
|
|
@@ -2920,4 +3194,4 @@ declare function isElementRtl(el: HTMLElement | null): boolean;
|
|
|
2920
3194
|
*/
|
|
2921
3195
|
declare function isComputedRtl(el: Element | null | undefined): boolean;
|
|
2922
3196
|
|
|
2923
|
-
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, type PanelMap, type PanelPropsOf, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TabContentProps, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type TypedWorkspace, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, definePanels, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWorkspace, useWindowManagerState as useWorkspaceState };
|
|
3197
|
+
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type MoveResult, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, type PanelMap, type PanelOwner, type PanelPropsOf, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TabContentProps, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type TypedWorkspace, type WidgetHandle, type WidgetLocation, type WidgetMenuContext, type WidgetPlacement, type WidgetTarget, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, definePanels, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWidget, useWorkspace, useWindowManagerState as useWorkspaceState };
|