react-dockable-desktop 6.3.2 → 7.0.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/README.md +96 -119
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +761 -798
- package/dist/index.d.ts +761 -798
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +504 -392
- package/package.json +5 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,341 +1,4 @@
|
|
|
1
|
-
import React$1, { ComponentType
|
|
2
|
-
|
|
3
|
-
interface ContextMenuPredefinedMessage$1 {
|
|
4
|
-
id: string;
|
|
5
|
-
defaultMessage?: string;
|
|
6
|
-
values?: Record<string, string | number>;
|
|
7
|
-
}
|
|
8
|
-
type MessageFormatter$1 = (msg: ContextMenuPredefinedMessage$1) => string;
|
|
9
|
-
type ContextMenuLabel = string | ContextMenuPredefinedMessage$1;
|
|
10
|
-
type MenuItemAction = () => void;
|
|
11
|
-
|
|
12
|
-
interface ContextMenuCheckbox {
|
|
13
|
-
/** Whether the checkbox column renders at all (default: true). */
|
|
14
|
-
active?: boolean;
|
|
15
|
-
/** Whether the item is interactive (default: true). Prefer top-level `disabled` on the item instead. */
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
/** Current checked state. */
|
|
18
|
-
value: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface ContextMenuSimpleItem {
|
|
21
|
-
label: ContextMenuLabel;
|
|
22
|
-
icon?: React$1.ReactNode;
|
|
23
|
-
title?: ContextMenuLabel;
|
|
24
|
-
checkbox?: ContextMenuCheckbox;
|
|
25
|
-
action?: MenuItemAction;
|
|
26
|
-
cyAction?: string;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
}
|
|
29
|
-
interface ContextMenuSeparator {
|
|
30
|
-
separator: true;
|
|
31
|
-
}
|
|
32
|
-
interface ContextMenuSubMenu {
|
|
33
|
-
label: ContextMenuLabel;
|
|
34
|
-
title?: ContextMenuLabel;
|
|
35
|
-
items?: ContextMenuItem[];
|
|
36
|
-
}
|
|
37
|
-
type ContextMenuItem = ContextMenuSimpleItem | ContextMenuSeparator | ContextMenuSubMenu;
|
|
38
|
-
interface ShowContextMenuOptions {
|
|
39
|
-
event?: React$1.MouseEvent | React$1.TouchEvent | MouseEvent | TouchEvent;
|
|
40
|
-
x?: number;
|
|
41
|
-
y?: number;
|
|
42
|
-
items: ContextMenuItem[];
|
|
43
|
-
}
|
|
44
|
-
interface ContextMenuHandle {
|
|
45
|
-
show(options: ShowContextMenuOptions): void;
|
|
46
|
-
}
|
|
47
|
-
interface ContextMenuProps {
|
|
48
|
-
theme?: string;
|
|
49
|
-
animation?: string;
|
|
50
|
-
formatMessageProvider?: MessageFormatter$1;
|
|
51
|
-
onShow?: () => void;
|
|
52
|
-
onHide?: () => void;
|
|
53
|
-
onOpenChange?: (open: boolean) => void;
|
|
54
|
-
className?: string;
|
|
55
|
-
style?: React$1.CSSProperties;
|
|
56
|
-
}
|
|
57
|
-
interface ContextMenuAdapter {
|
|
58
|
-
Component: React$1.ForwardRefExoticComponent<ContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
|
|
59
|
-
}
|
|
60
|
-
declare const ContextMenu: React$1.ForwardRefExoticComponent<ContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
|
|
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;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @file WindowManager.tsx
|
|
70
|
-
* @description Core component for react-dockable-desktop layout engine.
|
|
71
|
-
* Renders the workspace desktop containing docked splits, tabbed panels, floated windows,
|
|
72
|
-
* resize handles, context menus, and taskbar docks. Exposes lifecycle event listeners.
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
/** Controls when the minimized-panel taskbar is visible. */
|
|
76
|
-
type TaskbarVisibility = 'always' | 'compact' | 'autohide';
|
|
77
|
-
/** Props for `<WindowManager>`. */
|
|
78
|
-
interface WindowManagerProps {
|
|
79
|
-
/** Built-in skin name or a custom skin key registered via CSS. @default 'vscode' */
|
|
80
|
-
skin?: string;
|
|
81
|
-
/** Fallback icon shown in panel tabs when no panel-specific icon is provided. */
|
|
82
|
-
defaultPanelIcon?: React$1.ReactNode;
|
|
83
|
-
/**
|
|
84
|
-
* Controls taskbar visibility.
|
|
85
|
-
* - `'always'` — permanent bar at the bottom (default)
|
|
86
|
-
* - `'compact'` — only visible when minimized panels exist
|
|
87
|
-
* - `'autohide'` — overlay bar with 8 px peek strip
|
|
88
|
-
* @default 'always'
|
|
89
|
-
*/
|
|
90
|
-
taskbarVisibility?: TaskbarVisibility;
|
|
91
|
-
/** Custom context menu renderer. Defaults to the built-in `DefaultContextMenuAdapter`. */
|
|
92
|
-
contextMenuAdapter?: ContextMenuAdapter;
|
|
93
|
-
/** Enables the library's own transitions/animations (tab hover, dock preview, etc.). Never affects the consumer's own page. @default true */
|
|
94
|
-
animations?: boolean;
|
|
95
|
-
}
|
|
96
|
-
declare const WindowManager: React$1.FC<WindowManagerProps>;
|
|
97
|
-
|
|
98
|
-
/** Built-in lifecycle events always available on the WorkspaceClient event bus. */
|
|
99
|
-
interface BuiltInPanelEvents {
|
|
100
|
-
'panel:opened': {
|
|
101
|
-
id: string;
|
|
102
|
-
component: string;
|
|
103
|
-
};
|
|
104
|
-
'panel:closed': {
|
|
105
|
-
id: string;
|
|
106
|
-
};
|
|
107
|
-
'panel:minimized': {
|
|
108
|
-
id: string;
|
|
109
|
-
};
|
|
110
|
-
'panel:restored': {
|
|
111
|
-
id: string;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Fires whenever something `saveLayout()` would capture changes — open/close/minimize/restore,
|
|
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
|
|
118
|
-
* `registerStateProvider` callback's return value changing on its own — that's a pull, there's
|
|
119
|
-
* no way to observe it changing without the panel separately notifying — nor resize/split-ratio
|
|
120
|
-
* drag, which has no hook yet.
|
|
121
|
-
*/
|
|
122
|
-
'layout:changed': Record<string, never>;
|
|
123
|
-
/**
|
|
124
|
-
* Fires from inside `saveLayout()` itself, only when that specific call excluded at least one
|
|
125
|
-
* panel (a panel whose current `props` — static or from a `registerStateProvider` — failed
|
|
126
|
-
* {@link isSerializable}). A passive `PanelInfo.serializable` flag alone isn't enough for this:
|
|
127
|
-
* nobody may be polling it at the exact moment a save happens and something silently drops out
|
|
128
|
-
* (e.g. a floating window rendering data from a live class instance). This is deliberately just
|
|
129
|
-
* a signal, not a UI opinion — decide for yourself whether that becomes a toast, a console
|
|
130
|
-
* warning, or nothing.
|
|
131
|
-
*/
|
|
132
|
-
'layout:panels-excluded': {
|
|
133
|
-
panels: {
|
|
134
|
-
id: string;
|
|
135
|
-
component: string;
|
|
136
|
-
}[];
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
/** Per-panel definition supplied to WorkspaceClient constructor. */
|
|
140
|
-
interface PanelDefinition {
|
|
141
|
-
component: ComponentType<any>;
|
|
142
|
-
defaultOptions?: PanelRegistryEntry['defaultOptions'];
|
|
143
|
-
}
|
|
144
|
-
/** Configuration object accepted by the WorkspaceClient constructor. */
|
|
145
|
-
interface WorkspaceClientConfig {
|
|
146
|
-
/**
|
|
147
|
-
* Declarative panel catalog. Replaces imperative PanelRegistry.register() calls.
|
|
148
|
-
* Keys are the component identifiers used in openPanel() and serialised layouts.
|
|
149
|
-
*/
|
|
150
|
-
panels?: Record<string, PanelDefinition>;
|
|
151
|
-
/**
|
|
152
|
-
* Serialised layout produced by a previous saveLayout() call.
|
|
153
|
-
* Pass null or omit to start with an empty canvas.
|
|
154
|
-
*
|
|
155
|
-
* Parsed synchronously before the first render. The restored `activePanelId` is the one the
|
|
156
|
-
* snapshot recorded, or — for layouts saved before that was persisted — the selected tab of
|
|
157
|
-
* the first leaf in the grid.
|
|
158
|
-
*/
|
|
159
|
-
initialState?: string | null;
|
|
160
|
-
/** Custom i18n formatter for all internal strings. */
|
|
161
|
-
formatMessage?: MessageFormatter;
|
|
162
|
-
/** Override any subset of the built-in predefined message catalog. */
|
|
163
|
-
predefinedMessages?: Record<string, ContextMenuPredefinedMessage>;
|
|
164
|
-
/** Initial layout direction. */
|
|
165
|
-
dir?: 'ltr' | 'rtl';
|
|
166
|
-
/**
|
|
167
|
-
* Fraction of the target panel the new panel takes when dropped on a panel's
|
|
168
|
-
* top/bottom/left/right cross target. Range 0.1–0.9. Default: 0.5.
|
|
169
|
-
*/
|
|
170
|
-
defaultSplitRatio?: number;
|
|
171
|
-
/**
|
|
172
|
-
* Fraction of the workspace the new panel takes when dropped on the workspace
|
|
173
|
-
* outer edge. Range 0.1–0.9. Default: 0.2.
|
|
174
|
-
*/
|
|
175
|
-
defaultEdgeSplitRatio?: number;
|
|
176
|
-
/**
|
|
177
|
-
* Starting z-index for floating windows and the library's own chrome overlays
|
|
178
|
-
* (context menu, toolbar flyout, modal stack, toast, workspace edge zones),
|
|
179
|
-
* all of which shift together via `--rdd-z-base`. Set this above/below a host
|
|
180
|
-
* app's own modal z-index range to control stacking against it. Default: 1000.
|
|
181
|
-
*/
|
|
182
|
-
zIndexBase?: number;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* WorkspaceClient is the central configuration and imperative API object for
|
|
186
|
-
* react-dockable-desktop. Create one instance outside the React tree and pass
|
|
187
|
-
* it to `<WindowManagerProvider client={client}>`.
|
|
188
|
-
*
|
|
189
|
-
* Pattern: TanStack QueryClient / Redux store — configuration and imperative
|
|
190
|
-
* access live on the client; rendering is delegated to the thin React provider.
|
|
191
|
-
*
|
|
192
|
-
* @remarks
|
|
193
|
-
* Calls made before the provider mounts are queued and replayed automatically
|
|
194
|
-
* in order once `_connect()` fires. Duplicate `openPanel` calls for the same
|
|
195
|
-
* ID are deduplicated while queued. Subscriptions made before mount are
|
|
196
|
-
* buffered and re-registered on each connect/reconnect.
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* const workspace = new WorkspaceClient<MyEvents>({
|
|
200
|
-
* panels: {
|
|
201
|
-
* map: { component: MapPanel },
|
|
202
|
-
* editor: { component: EditorPanel, defaultOptions: { title: 'Code Editor' } },
|
|
203
|
-
* },
|
|
204
|
-
* initialState: localStorage.getItem('layout'),
|
|
205
|
-
* });
|
|
206
|
-
*
|
|
207
|
-
* <WindowManagerProvider client={workspace}>
|
|
208
|
-
* <WindowManager />
|
|
209
|
-
* </WindowManagerProvider>
|
|
210
|
-
*
|
|
211
|
-
* // Imperative access from anywhere:
|
|
212
|
-
* workspace.saveLayout();
|
|
213
|
-
* workspace.openPanel('map-1', 'map');
|
|
214
|
-
* workspace.focusPanel('map-1');
|
|
215
|
-
*/
|
|
216
|
-
declare class WorkspaceClient<TUserEvents extends object = Record<string, unknown>> {
|
|
217
|
-
/** Scoped panel registry — fully independent from the global singleton. */
|
|
218
|
-
readonly registry: PanelRegistryClass;
|
|
219
|
-
/** Serialised layout to restore on mount, or null to start with an empty canvas. */
|
|
220
|
-
readonly initialState: string | null;
|
|
221
|
-
/** Non-rendering configuration forwarded to the provider. */
|
|
222
|
-
readonly config: Pick<WorkspaceClientConfig, 'formatMessage' | 'predefinedMessages' | 'dir' | 'defaultSplitRatio' | 'defaultEdgeSplitRatio' | 'zIndexBase'>;
|
|
223
|
-
private _actions;
|
|
224
|
-
private _initialized;
|
|
225
|
-
/** Calls queued before _connect() fires — replayed in order on first connect. */
|
|
226
|
-
private _pendingCalls;
|
|
227
|
-
/** Tracks openPanel IDs in the pending queue to prevent duplicates before mount. */
|
|
228
|
-
private _pendingOpenPanelIds;
|
|
229
|
-
/** Subscriptions buffered before connect — re-registered on every connect/reconnect. */
|
|
230
|
-
private _pendingSubscriptions;
|
|
231
|
-
/** Timer that emits an error if _connect() is never called with pending work. */
|
|
232
|
-
private _disconnectedWarnTimer;
|
|
233
|
-
constructor(config?: WorkspaceClientConfig);
|
|
234
|
-
/** @internal Called by WindowManagerProvider after mount. */
|
|
235
|
-
_connect(actions: WindowActions): void;
|
|
236
|
-
/** @internal Called by WindowManagerProvider on unmount. */
|
|
237
|
-
_disconnect(): void;
|
|
238
|
-
/** True while the provider is mounted and React state is accessible. */
|
|
239
|
-
get isConnected(): boolean;
|
|
240
|
-
private _startWarnTimer;
|
|
241
|
-
private _dispatch;
|
|
242
|
-
private _subscribeRaw;
|
|
243
|
-
openPanel(...args: Parameters<WindowActions['openPanel']>): void;
|
|
244
|
-
closePanel(id: string): void;
|
|
245
|
-
minimizePanel(id: string): void;
|
|
246
|
-
restorePanel(...args: Parameters<WindowActions['restorePanel']>): void;
|
|
247
|
-
floatPanel(...args: Parameters<WindowActions['floatPanel']>): void;
|
|
248
|
-
dockPanel(...args: Parameters<WindowActions['dockPanel']>): void;
|
|
249
|
-
maximizePanel(id: string): void;
|
|
250
|
-
/**
|
|
251
|
-
* Activates the given panel regardless of its current state.
|
|
252
|
-
* For floating panels: raises z-index so the window appears on top.
|
|
253
|
-
* For docked panels: selects the tab within its leaf group.
|
|
254
|
-
*/
|
|
255
|
-
focusPanel(id: string): void;
|
|
256
|
-
/** Returns `true` if a panel with this ID is currently open. */
|
|
257
|
-
isOpen(id: string): boolean;
|
|
258
|
-
/** Returns the IDs of all currently open panels. */
|
|
259
|
-
getOpenPanelIds(): string[];
|
|
260
|
-
/** Finds an already-open panel of the given component with a matching `dedupeKey` (set via
|
|
261
|
-
* `openPanel`'s `dedupeKey` option). Returns `null` if none is open. */
|
|
262
|
-
findPanelId(component: string, dedupeKey: string): string | null;
|
|
263
|
-
saveLayout(): string;
|
|
264
|
-
loadLayout(json: string): boolean;
|
|
265
|
-
setDirection(dir: 'ltr' | 'rtl'): void;
|
|
266
|
-
/** Updates the split-size fractions at the given grid path. */
|
|
267
|
-
updateSplitSizes(path: number[], sizes: number[]): void;
|
|
268
|
-
/** Updates position/size/anchor of a floating panel. */
|
|
269
|
-
updateFloatingPosition(id: string, updates: Partial<Pick<FloatingWindow, 'x' | 'y' | 'width' | 'height' | 'anchor'>>): void;
|
|
270
|
-
/** @internal Drives the drag-in-progress visual state; normally only the library's own drag UI calls this. */
|
|
271
|
-
setDraggedPanelId(id: string | null): void;
|
|
272
|
-
/** Docks a panel into an existing leaf group at the given drop position. */
|
|
273
|
-
dockPanelToGroup(id: string, targetLeafId: string, position: DropPosition): void;
|
|
274
|
-
/** Reorders a panel's tab within its leaf group. */
|
|
275
|
-
movePanelOrder(panelId: string, targetLeafId: string, targetIndex: number): 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>;
|
|
288
|
-
/** Registers a guard that can veto closing the given panel. */
|
|
289
|
-
registerCloseGuard(id: string, guard: () => boolean | Promise<boolean>): void;
|
|
290
|
-
/** Removes a previously registered close guard. */
|
|
291
|
-
unregisterCloseGuard(id: string): void;
|
|
292
|
-
/** Registers a callback reporting a panel's current restorable state, pulled fresh on every
|
|
293
|
-
* `saveLayout()` call — see {@link BuiltInPanelEvents}'s `'layout:panels-excluded'` doc and
|
|
294
|
-
* `FormContainerContract.registerStateProvider`. */
|
|
295
|
-
registerStateProvider(id: string, provider: () => unknown): void;
|
|
296
|
-
/** Removes a previously registered state provider. */
|
|
297
|
-
unregisterStateProvider(id: string): void;
|
|
298
|
-
/** Sets/clears a panel's dirty (unsaved changes) flag. */
|
|
299
|
-
setPanelDirty(id: string, dirty: boolean, options?: DirtyStateOptions): void;
|
|
300
|
-
/** Updates a panel's displayed title. */
|
|
301
|
-
updatePanelTitle(id: string, title: string | ContextMenuPredefinedMessage): void;
|
|
302
|
-
/**
|
|
303
|
-
* Requests that a panel close, honoring its dirty flag and any registered close guard.
|
|
304
|
-
* Resolves once the close (or user cancellation) has been resolved.
|
|
305
|
-
*
|
|
306
|
-
* @remarks If called before the provider mounts, the request is queued and this
|
|
307
|
-
* returns an already-resolved promise immediately — the caller can't observe the
|
|
308
|
-
* eventual outcome of a queued call, only that the request was accepted.
|
|
309
|
-
*/
|
|
310
|
-
requestClosePanel(id: string, options?: {
|
|
311
|
-
force?: boolean;
|
|
312
|
-
onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
|
|
313
|
-
}): Promise<void>;
|
|
314
|
-
/** Docks a panel to one of the workspace's outer edges. */
|
|
315
|
-
dockPanelToWorkspaceEdge(id: string, position: SplitDirection): void;
|
|
316
|
-
/** Shows a context menu using the app's configured ContextMenuAdapter. */
|
|
317
|
-
showContextMenu(options: ShowContextMenuOptions): void;
|
|
318
|
-
publish<K extends keyof (TUserEvents & BuiltInPanelEvents)>(event: K, data: (TUserEvents & BuiltInPanelEvents)[K]): void;
|
|
319
|
-
subscribe<K extends keyof (TUserEvents & BuiltInPanelEvents)>(event: K, callback: (data: (TUserEvents & BuiltInPanelEvents)[K]) => void): () => void;
|
|
320
|
-
/** Subscribe to panel open events. Fires only for newly created panels. */
|
|
321
|
-
onPanelOpen(callback: (id: string, component: string) => void): () => void;
|
|
322
|
-
/** Subscribe to panel close events. */
|
|
323
|
-
onPanelClose(callback: (id: string) => void): () => void;
|
|
324
|
-
/** Subscribe to panel minimize events. */
|
|
325
|
-
onPanelMinimize(callback: (id: string) => void): () => void;
|
|
326
|
-
/** Subscribe to panel restore events. */
|
|
327
|
-
onPanelRestore(callback: (id: string) => void): () => void;
|
|
328
|
-
/** Subscribe to the coalesced layout-change signal — see {@link BuiltInPanelEvents}'s
|
|
329
|
-
* `'layout:changed'` doc for exactly what it covers (and doesn't). */
|
|
330
|
-
onLayoutChanged(callback: () => void): () => void;
|
|
331
|
-
/** Subscribe to notification that a `saveLayout()` call excluded one or more panels because
|
|
332
|
-
* their current props weren't serializable — see {@link BuiltInPanelEvents}'s
|
|
333
|
-
* `'layout:panels-excluded'` doc. */
|
|
334
|
-
onPanelsExcluded(callback: (panels: {
|
|
335
|
-
id: string;
|
|
336
|
-
component: string;
|
|
337
|
-
}[]) => void): () => void;
|
|
338
|
-
}
|
|
1
|
+
import React$1, { ComponentType } from 'react';
|
|
339
2
|
|
|
340
3
|
/**
|
|
341
4
|
* @file predefinedMessages.ts
|
|
@@ -346,8 +9,8 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
|
|
|
346
9
|
* define in their IntlProvider messages table. The `defaultMessage` is used
|
|
347
10
|
* as a fallback when no external formatter is provided.
|
|
348
11
|
*
|
|
349
|
-
* Pass a partial or full override
|
|
350
|
-
* to customise labels without replacing the whole table.
|
|
12
|
+
* Pass a partial or full override as `createWorkspace({ messages })` or
|
|
13
|
+
* `<DockableDesktopProvider messages={…}>` to customise labels without replacing the whole table.
|
|
351
14
|
*/
|
|
352
15
|
declare const defaultPredefinedMessages: {
|
|
353
16
|
readonly floatWindow: {
|
|
@@ -434,18 +97,82 @@ declare const defaultPredefinedMessages: {
|
|
|
434
97
|
readonly id: "dockable-desktop-closeTooltip";
|
|
435
98
|
readonly defaultMessage: "Close";
|
|
436
99
|
};
|
|
100
|
+
readonly notifications: {
|
|
101
|
+
readonly id: "dockable-desktop-notifications";
|
|
102
|
+
readonly defaultMessage: "Notifications";
|
|
103
|
+
};
|
|
104
|
+
readonly closeNotification: {
|
|
105
|
+
readonly id: "dockable-desktop-closeNotification";
|
|
106
|
+
readonly defaultMessage: "Close notification";
|
|
107
|
+
};
|
|
108
|
+
readonly scrollTabsLeft: {
|
|
109
|
+
readonly id: "dockable-desktop-scrollTabsLeft";
|
|
110
|
+
readonly defaultMessage: "Scroll tabs left";
|
|
111
|
+
};
|
|
112
|
+
readonly scrollTabsRight: {
|
|
113
|
+
readonly id: "dockable-desktop-scrollTabsRight";
|
|
114
|
+
readonly defaultMessage: "Scroll tabs right";
|
|
115
|
+
};
|
|
116
|
+
readonly scrollTaskbarLeft: {
|
|
117
|
+
readonly id: "dockable-desktop-scrollTaskbarLeft";
|
|
118
|
+
readonly defaultMessage: "Scroll taskbar left";
|
|
119
|
+
};
|
|
120
|
+
readonly scrollTaskbarRight: {
|
|
121
|
+
readonly id: "dockable-desktop-scrollTaskbarRight";
|
|
122
|
+
readonly defaultMessage: "Scroll taskbar right";
|
|
123
|
+
};
|
|
124
|
+
readonly moreActions: {
|
|
125
|
+
readonly id: "dockable-desktop-moreActions";
|
|
126
|
+
readonly defaultMessage: "More actions";
|
|
127
|
+
};
|
|
128
|
+
readonly search: {
|
|
129
|
+
readonly id: "dockable-desktop-search";
|
|
130
|
+
readonly defaultMessage: "Search";
|
|
131
|
+
};
|
|
132
|
+
readonly closeSearch: {
|
|
133
|
+
readonly id: "dockable-desktop-closeSearch";
|
|
134
|
+
readonly defaultMessage: "Close search";
|
|
135
|
+
};
|
|
136
|
+
readonly searchPlaceholder: {
|
|
137
|
+
readonly id: "dockable-desktop-searchPlaceholder";
|
|
138
|
+
readonly defaultMessage: "Search…";
|
|
139
|
+
};
|
|
140
|
+
readonly modalTitle: {
|
|
141
|
+
readonly id: "dockable-desktop-modalTitle";
|
|
142
|
+
readonly defaultMessage: "Confirmation";
|
|
143
|
+
};
|
|
144
|
+
readonly emptyGroup: {
|
|
145
|
+
readonly id: "dockable-desktop-emptyGroup";
|
|
146
|
+
readonly defaultMessage: "Empty Workspace Section";
|
|
147
|
+
};
|
|
148
|
+
readonly emptyGrid: {
|
|
149
|
+
readonly id: "dockable-desktop-emptyGrid";
|
|
150
|
+
readonly defaultMessage: "Grid Empty";
|
|
151
|
+
};
|
|
152
|
+
readonly componentUnregistered: {
|
|
153
|
+
readonly id: "dockable-desktop-componentUnregistered";
|
|
154
|
+
readonly defaultMessage: "Component Unregistered";
|
|
155
|
+
};
|
|
156
|
+
readonly componentKey: {
|
|
157
|
+
readonly id: "dockable-desktop-componentKey";
|
|
158
|
+
readonly defaultMessage: "Key: {key}";
|
|
159
|
+
};
|
|
160
|
+
readonly untitledPanel: {
|
|
161
|
+
readonly id: "dockable-desktop-untitledPanel";
|
|
162
|
+
readonly defaultMessage: "Panel";
|
|
163
|
+
};
|
|
437
164
|
};
|
|
438
165
|
/**
|
|
439
|
-
* Union of every key in `
|
|
166
|
+
* Union of every key in `defaultMessages`.
|
|
440
167
|
*
|
|
441
168
|
* Import this type in your i18n message tables to get a compile-time
|
|
442
169
|
* guarantee that all keys are present and no typos exist:
|
|
443
170
|
*
|
|
444
|
-
* import type {
|
|
171
|
+
* import type { MessageKey } from 'react-dockable-desktop';
|
|
445
172
|
*
|
|
446
|
-
* const myMessages: Record<
|
|
173
|
+
* const myMessages: Record<MessageKey, string> = { ... };
|
|
447
174
|
*/
|
|
448
|
-
type
|
|
175
|
+
type MessageKey = keyof typeof defaultPredefinedMessages;
|
|
449
176
|
|
|
450
177
|
/**
|
|
451
178
|
* @file dirtyOptions.ts
|
|
@@ -460,12 +187,12 @@ interface DirtyStateOptions {
|
|
|
460
187
|
* Custom header title text or localizable message descriptor.
|
|
461
188
|
* Replaces the default "Unsaved Changes" title.
|
|
462
189
|
*/
|
|
463
|
-
title?: string |
|
|
190
|
+
title?: string | MessageDescriptor;
|
|
464
191
|
/**
|
|
465
192
|
* Custom warning explanation text or localizable message descriptor.
|
|
466
193
|
* Replaces the standard default message body templates.
|
|
467
194
|
*/
|
|
468
|
-
message?: string |
|
|
195
|
+
message?: string | MessageDescriptor;
|
|
469
196
|
/**
|
|
470
197
|
* Optional custom alert notification banner text.
|
|
471
198
|
* Typically lists missing validation field requirements or backup statuses.
|
|
@@ -478,10 +205,69 @@ interface DirtyStateOptions {
|
|
|
478
205
|
alertType?: 'info' | 'warning' | 'success' | 'danger';
|
|
479
206
|
}
|
|
480
207
|
|
|
208
|
+
interface MessageDescriptor$1 {
|
|
209
|
+
id: string;
|
|
210
|
+
defaultMessage?: string;
|
|
211
|
+
values?: Record<string, string | number>;
|
|
212
|
+
}
|
|
213
|
+
type MessageFormatter$1 = (msg: MessageDescriptor$1) => string;
|
|
214
|
+
type ContextMenuLabel = string | MessageDescriptor$1;
|
|
215
|
+
type MenuItemAction = () => void;
|
|
216
|
+
|
|
217
|
+
interface ContextMenuCheckbox {
|
|
218
|
+
/** Whether the checkbox column renders at all (default: true). */
|
|
219
|
+
active?: boolean;
|
|
220
|
+
/** Whether the item is interactive (default: true). Prefer top-level `disabled` on the item instead. */
|
|
221
|
+
enabled?: boolean;
|
|
222
|
+
/** Current checked state. */
|
|
223
|
+
value: boolean;
|
|
224
|
+
}
|
|
225
|
+
interface ContextMenuSimpleItem {
|
|
226
|
+
label: ContextMenuLabel;
|
|
227
|
+
icon?: React$1.ReactNode;
|
|
228
|
+
title?: ContextMenuLabel;
|
|
229
|
+
checkbox?: ContextMenuCheckbox;
|
|
230
|
+
action?: MenuItemAction;
|
|
231
|
+
cyAction?: string;
|
|
232
|
+
disabled?: boolean;
|
|
233
|
+
}
|
|
234
|
+
interface ContextMenuSeparator {
|
|
235
|
+
separator: true;
|
|
236
|
+
}
|
|
237
|
+
interface ContextMenuSubMenu {
|
|
238
|
+
label: ContextMenuLabel;
|
|
239
|
+
title?: ContextMenuLabel;
|
|
240
|
+
items?: ContextMenuItem[];
|
|
241
|
+
}
|
|
242
|
+
type ContextMenuItem = ContextMenuSimpleItem | ContextMenuSeparator | ContextMenuSubMenu;
|
|
243
|
+
interface ShowContextMenuOptions {
|
|
244
|
+
event?: React$1.MouseEvent | React$1.TouchEvent | MouseEvent | TouchEvent;
|
|
245
|
+
x?: number;
|
|
246
|
+
y?: number;
|
|
247
|
+
items: ContextMenuItem[];
|
|
248
|
+
}
|
|
249
|
+
interface ContextMenuHandle {
|
|
250
|
+
show(options: ShowContextMenuOptions): void;
|
|
251
|
+
}
|
|
252
|
+
interface ContextMenuProps {
|
|
253
|
+
theme?: string;
|
|
254
|
+
animation?: string;
|
|
255
|
+
formatMessageProvider?: MessageFormatter$1;
|
|
256
|
+
onShow?: () => void;
|
|
257
|
+
onHide?: () => void;
|
|
258
|
+
onOpenChange?: (open: boolean) => void;
|
|
259
|
+
className?: string;
|
|
260
|
+
style?: React$1.CSSProperties;
|
|
261
|
+
}
|
|
262
|
+
interface ContextMenuAdapter {
|
|
263
|
+
Component: React$1.ForwardRefExoticComponent<ContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
|
|
264
|
+
}
|
|
265
|
+
declare function useShowContextMenu(): (options: ShowContextMenuOptions) => void;
|
|
266
|
+
|
|
481
267
|
/**
|
|
482
268
|
* Structure representing localizable message descriptors used in context menus.
|
|
483
269
|
*/
|
|
484
|
-
interface
|
|
270
|
+
interface MessageDescriptor {
|
|
485
271
|
/** Translation dictionary key. */
|
|
486
272
|
id: string;
|
|
487
273
|
/** Fallback label text if translation key is missing. */
|
|
@@ -490,7 +276,7 @@ interface ContextMenuPredefinedMessage {
|
|
|
490
276
|
values?: Record<string, string | number>;
|
|
491
277
|
}
|
|
492
278
|
/** Function type interface responsible for resolving localizable messages to flat strings. */
|
|
493
|
-
type MessageFormatter = (msg:
|
|
279
|
+
type MessageFormatter = (msg: MessageDescriptor) => string;
|
|
494
280
|
/** Orientation modifier indicating split directions. */
|
|
495
281
|
type SplitOrientation = 'horizontal' | 'vertical';
|
|
496
282
|
/** The four cardinal directions a panel can be docked relative to another. */
|
|
@@ -571,8 +357,8 @@ interface PanelInfo {
|
|
|
571
357
|
/** Unique panel identifier. */
|
|
572
358
|
id: string;
|
|
573
359
|
/** Plain text label or localizable message descriptor. */
|
|
574
|
-
title: string |
|
|
575
|
-
/** String matching the component registration ID in the {@link PanelRegistry}. */
|
|
360
|
+
title: string | MessageDescriptor;
|
|
361
|
+
/** String matching the component registration ID in the workspace's {@link PanelRegistry}. */
|
|
576
362
|
component: string;
|
|
577
363
|
/** Current workspace placement mode. */
|
|
578
364
|
state: 'docked' | 'floating' | 'minimized';
|
|
@@ -594,7 +380,7 @@ interface PanelInfo {
|
|
|
594
380
|
dirtyOptions?: DirtyStateOptions;
|
|
595
381
|
/** Custom per-instance data passed via `openPanel(id, component, { props })`. Unconstrained —
|
|
596
382
|
* any value is accepted, but only a value that passes {@link isSerializable} is actually
|
|
597
|
-
* included in {@link
|
|
383
|
+
* included in {@link WorkspaceActions.saveLayout}'s output. See {@link PanelInfo.serializable}. */
|
|
598
384
|
props?: Record<string, unknown>;
|
|
599
385
|
/** Whether this panel's current `props` can round-trip through `saveLayout()`/`loadLayout()`.
|
|
600
386
|
* Computed automatically — `true` when no `props` were passed, or when they were and passed
|
|
@@ -604,15 +390,15 @@ interface PanelInfo {
|
|
|
604
390
|
serializable: boolean;
|
|
605
391
|
/** Optional dedup key. If another open panel of the same `component` already has this exact
|
|
606
392
|
* key, `openPanel` focuses that existing panel instead of creating a new one — see
|
|
607
|
-
* {@link
|
|
393
|
+
* {@link WorkspaceActions.openPanel}'s `dedupeKey` option and {@link WorkspaceActions.findPanelId}. */
|
|
608
394
|
dedupeKey?: string;
|
|
609
395
|
}
|
|
610
396
|
/**
|
|
611
|
-
* Options accepted by {@link
|
|
397
|
+
* Options accepted by {@link WorkspaceActions.openPanel}.
|
|
612
398
|
*/
|
|
613
399
|
interface OpenPanelOptions<P extends object = Record<string, unknown>> {
|
|
614
400
|
/** Override the panel tab/window title. Accepts a plain string or an i18n message descriptor. */
|
|
615
|
-
title?: string |
|
|
401
|
+
title?: string | MessageDescriptor;
|
|
616
402
|
/** Initial placement: `'floating'`, `'docked'` (default when a grid exists), or `'tabbed'`. */
|
|
617
403
|
initialTarget?: 'floating' | 'docked' | 'tabbed';
|
|
618
404
|
/** Pin the new floating window to a workspace corner on creation. Has no effect when
|
|
@@ -634,14 +420,14 @@ interface OpenPanelOptions<P extends object = Record<string, unknown>> {
|
|
|
634
420
|
* passed to *this* call are ignored in that case, the same way re-opening an already-open exact
|
|
635
421
|
* `id` already focuses it instead of duplicating it. Use this when multiple call sites might
|
|
636
422
|
* not agree on the same literal `id` for what is semantically the same entity (e.g. "the panel
|
|
637
|
-
* for the document at this path"). See also {@link
|
|
423
|
+
* for the document at this path"). See also {@link WorkspaceActions.findPanelId}.
|
|
638
424
|
*/
|
|
639
425
|
dedupeKey?: string;
|
|
640
426
|
}
|
|
641
427
|
/**
|
|
642
428
|
* Global window manager state tree representing grid nodes, windows, and panels.
|
|
643
429
|
*/
|
|
644
|
-
interface
|
|
430
|
+
interface WorkspaceState {
|
|
645
431
|
/** Root branch node representing the grid. */
|
|
646
432
|
gridRoot: LayoutNode;
|
|
647
433
|
/** Array of active floated windows. */
|
|
@@ -649,7 +435,7 @@ interface WindowState {
|
|
|
649
435
|
/** Array of minimized panels waiting in the taskbar dock. */
|
|
650
436
|
minimized: {
|
|
651
437
|
id: string;
|
|
652
|
-
title: string |
|
|
438
|
+
title: string | MessageDescriptor;
|
|
653
439
|
component: string;
|
|
654
440
|
}[];
|
|
655
441
|
/** Map indexing panel metadata descriptors. */
|
|
@@ -658,7 +444,7 @@ interface WindowState {
|
|
|
658
444
|
draggedPanelId: string | null;
|
|
659
445
|
/**
|
|
660
446
|
* The ID of the active/focused panel — the one contributions are read from
|
|
661
|
-
* (see `
|
|
447
|
+
* (see `useActiveContribution`) and the one drawn with focused chrome.
|
|
662
448
|
*
|
|
663
449
|
* Always a panel the user can actually see: the selected tab of its leaf, or a floating
|
|
664
450
|
* window. Never a minimized panel, except when an app explicitly calls `focusPanel()` on
|
|
@@ -676,22 +462,20 @@ interface WindowState {
|
|
|
676
462
|
edgeSplitRatio: number;
|
|
677
463
|
}
|
|
678
464
|
/**
|
|
679
|
-
*
|
|
680
|
-
* exposed by the `WindowManagerProvider`.
|
|
465
|
+
* Every layout action, the event bus, and layout serialization — the methods of a workspace.
|
|
681
466
|
*
|
|
682
|
-
*
|
|
683
|
-
*
|
|
467
|
+
* Call them on the workspace from `useWorkspace()` inside a component, or on the object
|
|
468
|
+
* `createWorkspace()` returned, from anywhere.
|
|
684
469
|
*
|
|
685
|
-
* @group Hooks
|
|
686
470
|
* @example
|
|
687
471
|
* ```tsx
|
|
688
|
-
* function
|
|
689
|
-
* const
|
|
690
|
-
* return <button onClick={() =>
|
|
472
|
+
* function OpenMapButton() {
|
|
473
|
+
* const { openPanel } = useWorkspace();
|
|
474
|
+
* return <button onClick={() => openPanel('map-1', 'map')}>Open Map</button>;
|
|
691
475
|
* }
|
|
692
476
|
* ```
|
|
693
477
|
*/
|
|
694
|
-
interface
|
|
478
|
+
interface WorkspaceActions {
|
|
695
479
|
/**
|
|
696
480
|
* Opens a registered panel into the workspace.
|
|
697
481
|
* If the panel ID is already open, the panel is focused instead of duplicated.
|
|
@@ -927,7 +711,7 @@ interface WindowActions {
|
|
|
927
711
|
* @param id - Panel instance ID.
|
|
928
712
|
* @param title - New title string or localizable message descriptor.
|
|
929
713
|
*/
|
|
930
|
-
updatePanelTitle: (id: string, title: string |
|
|
714
|
+
updatePanelTitle: (id: string, title: string | MessageDescriptor) => void;
|
|
931
715
|
/**
|
|
932
716
|
* Closes a panel, first running any registered close guards.
|
|
933
717
|
* If the panel is dirty, shows the built-in unsaved-changes confirmation dialog.
|
|
@@ -951,13 +735,29 @@ interface WindowActions {
|
|
|
951
735
|
setDirection: (dir: 'ltr' | 'rtl') => void;
|
|
952
736
|
/**
|
|
953
737
|
* Imperatively shows the workspace context menu at the given position.
|
|
954
|
-
*
|
|
955
|
-
*
|
|
738
|
+
* Uses the workspace's context menu (the `contextMenuAdapter` given to
|
|
739
|
+
* `<DockableDesktopProvider>`, or an enclosing `<RddContextMenu>`).
|
|
956
740
|
*/
|
|
957
741
|
showContextMenu: (options: ShowContextMenuOptions) => void;
|
|
958
742
|
}
|
|
743
|
+
/**
|
|
744
|
+
* Extension of {@link WorkspaceActions} used internally by WindowManager components.
|
|
745
|
+
* `setActivePanel` is not part of the public API — it is a low-level tab-focus
|
|
746
|
+
* primitive used exclusively within this library's rendering layer.
|
|
747
|
+
* @internal
|
|
748
|
+
*/
|
|
749
|
+
interface InternalWindowActions extends WorkspaceActions {
|
|
750
|
+
/** @internal */
|
|
751
|
+
setActivePanel: (id: string | null) => void;
|
|
752
|
+
/** @internal */
|
|
753
|
+
registerPanelContextMenu: (panelId: string, getItems: () => ContextMenuItem[]) => () => void;
|
|
754
|
+
/** @internal */
|
|
755
|
+
getPanelContextMenuItems: (panelId: string) => ContextMenuItem[];
|
|
756
|
+
/** @internal */
|
|
757
|
+
registerContextMenuFn: (fn: (options: ShowContextMenuOptions) => void) => () => void;
|
|
758
|
+
}
|
|
959
759
|
/** Represents custom CSS classes injected into layout parts. */
|
|
960
|
-
interface
|
|
760
|
+
interface HostClasses {
|
|
961
761
|
modalClass?: string;
|
|
962
762
|
modalBodyClass?: string;
|
|
963
763
|
sidePanelClass?: string;
|
|
@@ -966,24 +766,7 @@ interface StyleClasses {
|
|
|
966
766
|
windowBodyClass?: string;
|
|
967
767
|
}
|
|
968
768
|
/** Custom hook to read configured style class contexts. */
|
|
969
|
-
declare const useStyleClasses: () =>
|
|
970
|
-
/**
|
|
971
|
-
* React hook to read the scoped {@link PanelRegistryClass} for the current provider.
|
|
972
|
-
* When the provider was created with a {@link WorkspaceClient}, this returns the client's
|
|
973
|
-
* private registry. Otherwise it returns the global `PanelRegistry` singleton.
|
|
974
|
-
*
|
|
975
|
-
* @group Hooks
|
|
976
|
-
* @returns The panel registry instance in scope.
|
|
977
|
-
* @example
|
|
978
|
-
* ```tsx
|
|
979
|
-
* function MyComponent() {
|
|
980
|
-
* const registry = useRegistry();
|
|
981
|
-
* const entry = registry.get('map');
|
|
982
|
-
* return entry ? <entry.Component panelId="preview" /> : null;
|
|
983
|
-
* }
|
|
984
|
-
* ```
|
|
985
|
-
*/
|
|
986
|
-
declare const useRegistry: () => PanelRegistryClass;
|
|
769
|
+
declare const useStyleClasses: () => HostClasses;
|
|
987
770
|
/** The on-disk shape produced by `saveLayout()` and accepted by `loadLayout()`/`initialState`. */
|
|
988
771
|
interface SerializedLayout {
|
|
989
772
|
/** Schema version — absent on layouts saved before this field was introduced (treated as 0). */
|
|
@@ -992,7 +775,7 @@ interface SerializedLayout {
|
|
|
992
775
|
* The globally active panel at save time — the one the user was actually looking at.
|
|
993
776
|
*
|
|
994
777
|
* Omitted when nothing was active, and when the active panel didn't survive this snapshot's
|
|
995
|
-
* serializability pruning (see {@link
|
|
778
|
+
* serializability pruning (see {@link WorkspaceActions.saveLayout}) — so it never names a panel
|
|
996
779
|
* absent from this payload's own `panels`. Absent on every layout saved before this field
|
|
997
780
|
* existed, in which case the restore derives it from `gridRoot`'s own per-leaf selection
|
|
998
781
|
* instead; a present-but-no-longer-valid value falls back to the same derivation. `version`
|
|
@@ -1004,72 +787,24 @@ interface SerializedLayout {
|
|
|
1004
787
|
floating: FloatingWindow[];
|
|
1005
788
|
minimized: {
|
|
1006
789
|
id: string;
|
|
1007
|
-
title: string |
|
|
790
|
+
title: string | MessageDescriptor;
|
|
1008
791
|
component: string;
|
|
1009
792
|
}[];
|
|
1010
793
|
panels: Record<string, PanelInfo>;
|
|
1011
794
|
}
|
|
1012
|
-
/**
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
*/
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
client?: WorkspaceClient;
|
|
1023
|
-
/** Custom i18n formatter. Receives a `{ id, defaultMessage }` descriptor and returns
|
|
1024
|
-
* the translated string. When omitted, `defaultMessage` is used as-is. */
|
|
1025
|
-
formatMessage?: MessageFormatter;
|
|
1026
|
-
/** Override the built-in predefined UI strings (confirm button labels, close tooltips, etc.).
|
|
1027
|
-
* Merge with or replace `defaultPredefinedMessages` to localise system strings. */
|
|
1028
|
-
predefinedMessages?: Record<string, ContextMenuPredefinedMessage>;
|
|
1029
|
-
/** Layout direction. `'rtl'` mirrors all controls, tab order, and drop zones.
|
|
1030
|
-
* Can also be changed at runtime via `WorkspaceClient.setDirection()`. @default 'ltr' */
|
|
1031
|
-
dir?: 'ltr' | 'rtl';
|
|
1032
|
-
/** CSS class applied to the outer wrapper element of every modal overlay. */
|
|
1033
|
-
modalClass?: string;
|
|
1034
|
-
/** CSS class applied to the inner content area of every modal overlay. */
|
|
1035
|
-
modalBodyClass?: string;
|
|
1036
|
-
/** CSS class applied to the outer wrapper of left/right side-panel drawers. */
|
|
1037
|
-
sidePanelClass?: string;
|
|
1038
|
-
/** CSS class applied to the inner content area of side-panel drawers. */
|
|
1039
|
-
sidePanelBodyClass?: string;
|
|
1040
|
-
/** CSS class applied to the outer wrapper of floating panel windows. */
|
|
1041
|
-
windowClass?: string;
|
|
1042
|
-
/** CSS class applied to the inner content area of floating panel windows. */
|
|
1043
|
-
windowBodyClass?: string;
|
|
1044
|
-
/**
|
|
1045
|
-
* Starting z-index for floating windows and the library's own chrome overlays
|
|
1046
|
-
* (context menu, toolbar flyout, modal stack, toast, workspace edge zones),
|
|
1047
|
-
* all of which shift together via `--rdd-z-base`. Set this above/below a host
|
|
1048
|
-
* app's own modal z-index range to control stacking against it. @default 1000
|
|
1049
|
-
*/
|
|
1050
|
-
zIndexBase?: number;
|
|
795
|
+
/** @internal What a workspace store exposes: its actions, and a subscribable snapshot. */
|
|
796
|
+
interface WorkspaceCore {
|
|
797
|
+
actions: InternalWindowActions;
|
|
798
|
+
getSnapshot: () => WorkspaceState;
|
|
799
|
+
subscribeToState: (cb: () => void) => () => void;
|
|
800
|
+
/** Provider props fill in what the workspace's own config left unset (dir, zIndexBase). */
|
|
801
|
+
applyProviderDefaults: (defaults: {
|
|
802
|
+
dir?: 'ltr' | 'rtl';
|
|
803
|
+
zIndexBase?: number;
|
|
804
|
+
}) => void;
|
|
1051
805
|
}
|
|
1052
|
-
declare
|
|
1053
|
-
declare function useWindowManagerState():
|
|
1054
|
-
declare function useWindowManagerState<T>(selector: (state: WindowState) => T): T;
|
|
1055
|
-
/**
|
|
1056
|
-
* React hook to retrieve all layout mutation actions.
|
|
1057
|
-
* Returns the public {@link WindowActions} interface.
|
|
1058
|
-
*
|
|
1059
|
-
* @group Hooks
|
|
1060
|
-
* @returns The full set of workspace mutation methods.
|
|
1061
|
-
* @throws Error if used outside of a {@link WindowManagerProvider}.
|
|
1062
|
-
* @example
|
|
1063
|
-
* ```tsx
|
|
1064
|
-
* function Toolbar() {
|
|
1065
|
-
* const actions = useWindowManagerActions();
|
|
1066
|
-
* return (
|
|
1067
|
-
* <button onClick={() => actions.openPanel('map-1', 'map')}>Open Map</button>
|
|
1068
|
-
* );
|
|
1069
|
-
* }
|
|
1070
|
-
* ```
|
|
1071
|
-
*/
|
|
1072
|
-
declare const useWindowManagerActions: () => WindowActions;
|
|
806
|
+
declare function useWindowManagerState(): WorkspaceState;
|
|
807
|
+
declare function useWindowManagerState<T>(selector: (state: WorkspaceState) => T): T;
|
|
1073
808
|
/**
|
|
1074
809
|
* React hook to retrieve the active i18n formatter.
|
|
1075
810
|
*/
|
|
@@ -1077,36 +812,15 @@ declare const useFormatMessage: () => MessageFormatter;
|
|
|
1077
812
|
/**
|
|
1078
813
|
* Helper to resolve dynamic label strings or localizable descriptor objects into text.
|
|
1079
814
|
*/
|
|
1080
|
-
declare const formatLabel: (label: string |
|
|
1081
|
-
/**
|
|
1082
|
-
* React hook providing pub-sub helper methods for inter-panel event messaging.
|
|
1083
|
-
*/
|
|
1084
|
-
declare const usePanelContext: () => Pick<WindowActions, "publish" | "subscribe">;
|
|
815
|
+
declare const formatLabel: (label: string | MessageDescriptor | undefined, formatter: MessageFormatter) => string;
|
|
1085
816
|
/**
|
|
1086
817
|
* React hook to fetch the localizable predefined message map catalog.
|
|
1087
818
|
*/
|
|
1088
|
-
declare const usePredefinedMessages: () => Record<
|
|
1089
|
-
/**
|
|
1090
|
-
* React hook to retrieve the panel instance ID for the component currently rendered inside
|
|
1091
|
-
* the dockable desktop. Works for docked, floating, modal, and side-panel containers.
|
|
1092
|
-
* Opt-in — components that don't need the ID require no changes.
|
|
1093
|
-
*
|
|
1094
|
-
* @group Hooks
|
|
1095
|
-
* @returns The unique panel instance ID string.
|
|
1096
|
-
* @example
|
|
1097
|
-
* ```tsx
|
|
1098
|
-
* function MyPanel() {
|
|
1099
|
-
* const panelId = usePanelId();
|
|
1100
|
-
* const { closePanel } = useWindowManagerActions();
|
|
1101
|
-
* return <button onClick={() => closePanel(panelId)}>Close</button>;
|
|
1102
|
-
* }
|
|
1103
|
-
* ```
|
|
1104
|
-
*/
|
|
1105
|
-
declare const usePanelId: () => string;
|
|
819
|
+
declare const usePredefinedMessages: () => Record<MessageKey, MessageDescriptor>;
|
|
1106
820
|
/**
|
|
1107
821
|
* React hook for injecting custom context menu items into a panel's context menu from inside the panel component.
|
|
1108
822
|
* Items are dynamic — the array is re-read each time the menu opens, so state-driven changes (enable/disable, add/remove) work automatically.
|
|
1109
|
-
* The hook
|
|
823
|
+
* The hook knows which panel it is in — no id needed.
|
|
1110
824
|
*
|
|
1111
825
|
* @param items - Array of `ContextMenuItem` entries (simple items, separators, submenus).
|
|
1112
826
|
* @example
|
|
@@ -1167,9 +881,9 @@ interface PanelRegistryEntry {
|
|
|
1167
881
|
/**
|
|
1168
882
|
* Registry mapping catalog entries to allow programmatic panel instantiation
|
|
1169
883
|
* inside dynamic layout cells or floating windows.
|
|
1170
|
-
* Exported so
|
|
884
|
+
* Exported so `createWorkspace()` can create scoped, per-instance registries.
|
|
1171
885
|
*/
|
|
1172
|
-
declare class
|
|
886
|
+
declare class PanelRegistry {
|
|
1173
887
|
private registry;
|
|
1174
888
|
/**
|
|
1175
889
|
* Register a new component to the panel catalog registry.
|
|
@@ -1187,66 +901,226 @@ declare class PanelRegistryClass {
|
|
|
1187
901
|
*/
|
|
1188
902
|
getRegisteredIds(): string[];
|
|
1189
903
|
}
|
|
1190
|
-
/** Global singleton instance of the Panel Registry. */
|
|
1191
|
-
declare const PanelRegistry: PanelRegistryClass;
|
|
1192
904
|
|
|
1193
|
-
/**
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
905
|
+
/** Built-in lifecycle events always available on the workspace event bus. */
|
|
906
|
+
interface BuiltInEvents {
|
|
907
|
+
'panel:opened': {
|
|
908
|
+
id: string;
|
|
909
|
+
component: string;
|
|
910
|
+
};
|
|
911
|
+
'panel:closed': {
|
|
912
|
+
id: string;
|
|
913
|
+
};
|
|
914
|
+
'panel:minimized': {
|
|
915
|
+
id: string;
|
|
916
|
+
};
|
|
917
|
+
'panel:restored': {
|
|
918
|
+
id: string;
|
|
919
|
+
};
|
|
920
|
+
/**
|
|
921
|
+
* Fires whenever something `saveLayout()` would capture changes — open/close/minimize/restore,
|
|
922
|
+
* float/dock/re-order/dock-to-edge, closing a group, maximizing a minimized panel, and an
|
|
923
|
+
* `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
|
|
924
|
+
* consumers, so they don't need to subscribe to separate events. Does **not** cover a
|
|
925
|
+
* `registerStateProvider` callback's return value changing on its own — that's a pull, there's
|
|
926
|
+
* no way to observe it changing without the panel separately notifying — nor resize/split-ratio
|
|
927
|
+
* drag, which has no hook yet.
|
|
928
|
+
*/
|
|
929
|
+
'layout:changed': Record<string, never>;
|
|
930
|
+
/**
|
|
931
|
+
* Fires from inside `saveLayout()` itself, only when that specific call excluded at least one
|
|
932
|
+
* panel (a panel whose current `props` — static or from a `registerStateProvider` — failed
|
|
933
|
+
* {@link isSerializable}). A passive `PanelInfo.serializable` flag alone isn't enough for this:
|
|
934
|
+
* nobody may be polling it at the exact moment a save happens and something silently drops out
|
|
935
|
+
* (e.g. a floating window rendering data from a live class instance). This is deliberately just
|
|
936
|
+
* a signal, not a UI opinion — decide for yourself whether that becomes a toast, a console
|
|
937
|
+
* warning, or nothing.
|
|
938
|
+
*/
|
|
939
|
+
'layout:panels-excluded': {
|
|
940
|
+
panels: {
|
|
941
|
+
id: string;
|
|
942
|
+
component: string;
|
|
943
|
+
}[];
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
/** Per-panel definition supplied to `createWorkspace({ panels })`. */
|
|
947
|
+
interface PanelDefinition {
|
|
948
|
+
component: ComponentType<any>;
|
|
949
|
+
defaultOptions?: PanelRegistryEntry['defaultOptions'];
|
|
950
|
+
}
|
|
951
|
+
/** Configuration object accepted by `createWorkspace()`. */
|
|
952
|
+
interface WorkspaceClientConfig {
|
|
953
|
+
/**
|
|
954
|
+
* Declarative panel catalog. Replaces imperative globalPanelRegistry.register() calls.
|
|
955
|
+
* Keys are the component identifiers used in openPanel() and serialised layouts.
|
|
956
|
+
*/
|
|
957
|
+
panels?: Record<string, PanelDefinition>;
|
|
958
|
+
/**
|
|
959
|
+
* Serialised layout produced by a previous saveLayout() call.
|
|
960
|
+
* Pass null or omit to start with an empty canvas.
|
|
961
|
+
*
|
|
962
|
+
* Parsed synchronously before the first render. The restored `activePanelId` is the one the
|
|
963
|
+
* snapshot recorded, or — for layouts saved before that was persisted — the selected tab of
|
|
964
|
+
* the first leaf in the grid.
|
|
965
|
+
*/
|
|
966
|
+
initialState?: string | null;
|
|
967
|
+
/** Custom i18n formatter for all internal strings. */
|
|
968
|
+
formatMessage?: MessageFormatter;
|
|
969
|
+
/** Override any subset of the built-in predefined message catalog. */
|
|
970
|
+
predefinedMessages?: Record<string, MessageDescriptor>;
|
|
971
|
+
/** Initial layout direction. */
|
|
972
|
+
dir?: 'ltr' | 'rtl';
|
|
973
|
+
/**
|
|
974
|
+
* Fraction of the target panel the new panel takes when dropped on a panel's
|
|
975
|
+
* top/bottom/left/right cross target. Range 0.1–0.9. Default: 0.5.
|
|
976
|
+
*/
|
|
977
|
+
defaultSplitRatio?: number;
|
|
978
|
+
/**
|
|
979
|
+
* Fraction of the workspace the new panel takes when dropped on the workspace
|
|
980
|
+
* outer edge. Range 0.1–0.9. Default: 0.2.
|
|
981
|
+
*/
|
|
982
|
+
defaultEdgeSplitRatio?: number;
|
|
1198
983
|
/**
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
984
|
+
* Starting z-index for floating windows and the library's own chrome overlays
|
|
985
|
+
* (context menu, toolbar flyout, modal stack, toast, workspace edge zones),
|
|
986
|
+
* all of which shift together via `--rdd-z-base`. Set this above/below a host
|
|
987
|
+
* app's own modal z-index range to control stacking against it. Default: 1000.
|
|
1202
988
|
*/
|
|
1203
|
-
|
|
989
|
+
zIndexBase?: number;
|
|
1204
990
|
}
|
|
1205
991
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
* `
|
|
1209
|
-
* `showContextMenu()` and `useShowContextMenu()` work from any component in the tree —
|
|
1210
|
-
* including siblings of `<WindowManager>` such as `<Sidebar>`, `<SidePanelRenderer>`,
|
|
1211
|
-
* and `<ModalStackRenderer>`.
|
|
992
|
+
* A workspace: the layout, every action on it, the panel registry and the event bus. Create one
|
|
993
|
+
* with `createWorkspace()` outside the React tree and pass it to
|
|
994
|
+
* `<DockableDesktopProvider workspace={…}>`; inside the tree, `useWorkspace()` returns it.
|
|
1212
995
|
*
|
|
1213
|
-
*
|
|
996
|
+
* Pattern: TanStack QueryClient / Redux store — configuration and imperative access live on the
|
|
997
|
+
* workspace; rendering is delegated to the thin React provider.
|
|
1214
998
|
*
|
|
1215
|
-
*
|
|
1216
|
-
*
|
|
999
|
+
* @remarks
|
|
1000
|
+
* The workspace is live from the moment it is created: calls made before any provider mounts
|
|
1001
|
+
* apply immediately, and a provider that mounts later shows the result.
|
|
1217
1002
|
*
|
|
1218
1003
|
* @example
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1225
|
-
*
|
|
1226
|
-
* </DockableDesktopProvider>
|
|
1227
|
-
* ```
|
|
1228
|
-
*/
|
|
1229
|
-
declare const DockableDesktopProvider: React$1.FC<DockableDesktopProviderProps>;
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* Recursively checks whether a value can round-trip through `JSON.stringify`/`JSON.parse`
|
|
1233
|
-
* without silently losing information.
|
|
1234
|
-
*
|
|
1235
|
-
* Deliberately **not** a `JSON.stringify` try/catch — that call doesn't throw for the actual
|
|
1236
|
-
* failure case this guards against: a function-valued property is simply dropped by
|
|
1237
|
-
* `JSON.stringify`, not rejected. This walks the value tree instead, returning `false` as soon as
|
|
1238
|
-
* it finds a function, symbol, `undefined`, React element, or any non-plain object (a class
|
|
1239
|
-
* instance, `Map`, `Set`, `RegExp`, etc.).
|
|
1004
|
+
* const workspace = createWorkspace<MyEvents>({
|
|
1005
|
+
* panels: {
|
|
1006
|
+
* map: { component: MapPanel },
|
|
1007
|
+
* editor: { component: EditorPanel, defaultOptions: { title: 'Code Editor' } },
|
|
1008
|
+
* },
|
|
1009
|
+
* initialState: localStorage.getItem('layout'),
|
|
1010
|
+
* });
|
|
1240
1011
|
*
|
|
1241
|
-
*
|
|
1242
|
-
*
|
|
1243
|
-
*
|
|
1244
|
-
* than treated as a disqualifying case.
|
|
1012
|
+
* <DockableDesktopProvider workspace={workspace}>
|
|
1013
|
+
* <RddDesktop />
|
|
1014
|
+
* </DockableDesktopProvider>
|
|
1245
1015
|
*
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1016
|
+
* // Imperative access from anywhere:
|
|
1017
|
+
* workspace.saveLayout();
|
|
1018
|
+
* workspace.openPanel('map-1', 'map');
|
|
1019
|
+
* workspace.focusPanel('map-1');
|
|
1248
1020
|
*/
|
|
1249
|
-
declare
|
|
1021
|
+
declare class WorkspaceClient<TUserEvents extends object = Record<string, unknown>> {
|
|
1022
|
+
/** Scoped panel registry — fully independent from the global singleton. */
|
|
1023
|
+
readonly registry: PanelRegistry;
|
|
1024
|
+
/** Serialised layout to restore on mount, or null to start with an empty canvas. */
|
|
1025
|
+
readonly initialState: string | null;
|
|
1026
|
+
/** Non-rendering configuration forwarded to the provider. */
|
|
1027
|
+
readonly config: Pick<WorkspaceClientConfig, 'formatMessage' | 'predefinedMessages' | 'dir' | 'defaultSplitRatio' | 'defaultEdgeSplitRatio' | 'zIndexBase'>;
|
|
1028
|
+
/** @internal The workspace store. Live from construction; a provider only subscribes to it. */
|
|
1029
|
+
readonly _core: WorkspaceCore;
|
|
1030
|
+
/** The store's actions, to which every method below forwards. */
|
|
1031
|
+
private get _actions();
|
|
1032
|
+
constructor(config?: WorkspaceClientConfig);
|
|
1033
|
+
private _dispatch;
|
|
1034
|
+
private _subscribeRaw;
|
|
1035
|
+
openPanel(...args: Parameters<WorkspaceActions['openPanel']>): void;
|
|
1036
|
+
closePanel(id: string): void;
|
|
1037
|
+
minimizePanel(id: string): void;
|
|
1038
|
+
restorePanel(...args: Parameters<WorkspaceActions['restorePanel']>): void;
|
|
1039
|
+
floatPanel(...args: Parameters<WorkspaceActions['floatPanel']>): void;
|
|
1040
|
+
dockPanel(...args: Parameters<WorkspaceActions['dockPanel']>): void;
|
|
1041
|
+
maximizePanel(id: string): void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Activates the given panel regardless of its current state.
|
|
1044
|
+
* For floating panels: raises z-index so the window appears on top.
|
|
1045
|
+
* For docked panels: selects the tab within its leaf group.
|
|
1046
|
+
*/
|
|
1047
|
+
focusPanel(id: string): void;
|
|
1048
|
+
/** Returns `true` if a panel with this ID is currently open. */
|
|
1049
|
+
isOpen(id: string): boolean;
|
|
1050
|
+
/** Returns the IDs of all currently open panels. */
|
|
1051
|
+
getOpenPanelIds(): string[];
|
|
1052
|
+
/** Finds an already-open panel of the given component with a matching `dedupeKey` (set via
|
|
1053
|
+
* `openPanel`'s `dedupeKey` option). Returns `null` if none is open. */
|
|
1054
|
+
findPanelId(component: string, dedupeKey: string): string | null;
|
|
1055
|
+
saveLayout(): string;
|
|
1056
|
+
loadLayout(json: string): boolean;
|
|
1057
|
+
setDirection(dir: 'ltr' | 'rtl'): void;
|
|
1058
|
+
/** Updates the split-size fractions at the given grid path. */
|
|
1059
|
+
updateSplitSizes(path: number[], sizes: number[]): void;
|
|
1060
|
+
/** Updates position/size/anchor of a floating panel. */
|
|
1061
|
+
updateFloatingPosition(id: string, updates: Partial<Pick<FloatingWindow, 'x' | 'y' | 'width' | 'height' | 'anchor'>>): void;
|
|
1062
|
+
/** @internal Drives the drag-in-progress visual state; normally only the library's own drag UI calls this. */
|
|
1063
|
+
setDraggedPanelId(id: string | null): void;
|
|
1064
|
+
/** Docks a panel into an existing leaf group at the given drop position. */
|
|
1065
|
+
dockPanelToGroup(id: string, targetLeafId: string, position: DropPosition): void;
|
|
1066
|
+
/** Reorders a panel's tab within its leaf group. */
|
|
1067
|
+
movePanelOrder(panelId: string, targetLeafId: string, targetIndex: number): void;
|
|
1068
|
+
/**
|
|
1069
|
+
* Closes a leaf group: each of its tabs is closed through the guarded close path, then the
|
|
1070
|
+
* group is removed once empty. A tab whose close guard refuses — or a dirty tab that
|
|
1071
|
+
* `onConfirm` doesn't approve — stays open, and so does its group.
|
|
1072
|
+
* Resolves once every close request has been settled.
|
|
1073
|
+
*/
|
|
1074
|
+
closeLeafGroup(leafId: string, options?: {
|
|
1075
|
+
onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
|
|
1076
|
+
}): Promise<void>;
|
|
1077
|
+
/** Registers a guard that can veto closing the given panel. */
|
|
1078
|
+
registerCloseGuard(id: string, guard: () => boolean | Promise<boolean>): void;
|
|
1079
|
+
/** Removes a previously registered close guard. */
|
|
1080
|
+
unregisterCloseGuard(id: string): void;
|
|
1081
|
+
/** Registers a callback reporting a panel's current restorable state, pulled fresh on every
|
|
1082
|
+
* `saveLayout()` call — see {@link BuiltInEvents}'s `'layout:panels-excluded'` doc and
|
|
1083
|
+
* `FormContainerContract.registerStateProvider`. */
|
|
1084
|
+
registerStateProvider(id: string, provider: () => unknown): void;
|
|
1085
|
+
/** Removes a previously registered state provider. */
|
|
1086
|
+
unregisterStateProvider(id: string): void;
|
|
1087
|
+
/** Sets/clears a panel's dirty (unsaved changes) flag. */
|
|
1088
|
+
setPanelDirty(id: string, dirty: boolean, options?: DirtyStateOptions): void;
|
|
1089
|
+
/** Updates a panel's displayed title. */
|
|
1090
|
+
updatePanelTitle(id: string, title: string | MessageDescriptor): void;
|
|
1091
|
+
/**
|
|
1092
|
+
* Requests that a panel close, honoring its dirty flag and any registered close guard.
|
|
1093
|
+
* Resolves once the close (or user cancellation) has been resolved.
|
|
1094
|
+
*/
|
|
1095
|
+
requestClosePanel(id: string, options?: {
|
|
1096
|
+
force?: boolean;
|
|
1097
|
+
onConfirm?: (opts?: DirtyStateOptions) => Promise<boolean>;
|
|
1098
|
+
}): Promise<void>;
|
|
1099
|
+
/** Docks a panel to one of the workspace's outer edges. */
|
|
1100
|
+
dockPanelToWorkspaceEdge(id: string, position: SplitDirection): void;
|
|
1101
|
+
/** Shows a context menu using the app's configured ContextMenuAdapter. */
|
|
1102
|
+
showContextMenu(options: ShowContextMenuOptions): void;
|
|
1103
|
+
publish<K extends keyof (TUserEvents & BuiltInEvents)>(event: K, data: (TUserEvents & BuiltInEvents)[K]): void;
|
|
1104
|
+
subscribe<K extends keyof (TUserEvents & BuiltInEvents)>(event: K, callback: (data: (TUserEvents & BuiltInEvents)[K]) => void): () => void;
|
|
1105
|
+
/** Subscribe to panel open events. Fires only for newly created panels. */
|
|
1106
|
+
onPanelOpen(callback: (id: string, component: string) => void): () => void;
|
|
1107
|
+
/** Subscribe to panel close events. */
|
|
1108
|
+
onPanelClose(callback: (id: string) => void): () => void;
|
|
1109
|
+
/** Subscribe to panel minimize events. */
|
|
1110
|
+
onPanelMinimize(callback: (id: string) => void): () => void;
|
|
1111
|
+
/** Subscribe to panel restore events. */
|
|
1112
|
+
onPanelRestore(callback: (id: string) => void): () => void;
|
|
1113
|
+
/** Subscribe to the coalesced layout-change signal — see {@link BuiltInEvents}'s
|
|
1114
|
+
* `'layout:changed'` doc for exactly what it covers (and doesn't). */
|
|
1115
|
+
onLayoutChanged(callback: () => void): () => void;
|
|
1116
|
+
/** Subscribe to notification that a `saveLayout()` call excluded one or more panels because
|
|
1117
|
+
* their current props weren't serializable — see {@link BuiltInEvents}'s
|
|
1118
|
+
* `'layout:panels-excluded'` doc. */
|
|
1119
|
+
onPanelsExcluded(callback: (panels: {
|
|
1120
|
+
id: string;
|
|
1121
|
+
component: string;
|
|
1122
|
+
}[]) => void): () => void;
|
|
1123
|
+
}
|
|
1250
1124
|
|
|
1251
1125
|
/**
|
|
1252
1126
|
* Options used when requesting to close a container.
|
|
@@ -1258,88 +1132,7 @@ interface CloseOptions {
|
|
|
1258
1132
|
/** Represents the type of container context a panel/form is currently rendered inside. */
|
|
1259
1133
|
type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'floating-window' | 'standalone';
|
|
1260
1134
|
/**
|
|
1261
|
-
*
|
|
1262
|
-
* to its children forms, enabling them to control or listen to container events.
|
|
1263
|
-
*/
|
|
1264
|
-
interface FormContainerContract {
|
|
1265
|
-
/** Request the container to close itself. Bypassed by default unless options.force is true. */
|
|
1266
|
-
requestClose: (options?: CloseOptions) => void;
|
|
1267
|
-
/** Mark the form's content as dirty (having unsaved changes), triggering alert dialogs on close. */
|
|
1268
|
-
setDirty: (dirty: boolean, options?: DirtyStateOptions) => void;
|
|
1269
|
-
/** Register a custom close guard handler. Returning false or a promise resolving to false blocks closing. */
|
|
1270
|
-
onCloseRequested: (handler: () => boolean | Promise<boolean>) => (() => void);
|
|
1271
|
-
/**
|
|
1272
|
-
* Registers a callback reporting this panel's *current* restorable state, pulled fresh by
|
|
1273
|
-
* `WorkspaceClient.saveLayout()` every time it's called — for panels whose static open-time
|
|
1274
|
-
* props can't capture state accumulated after opening (scroll position, an in-progress edit, a
|
|
1275
|
-
* view-mode toggle). Only meaningful for docked/floating panels — left/right side panels and
|
|
1276
|
-
* modals already have a complete answer to this via `openLeftPanel`/`openRightPanel`/
|
|
1277
|
-
* `openModal`'s own `props` argument plus `updateInstance`, so this is `undefined` there.
|
|
1278
|
-
* The returned value must be synchronous — `saveLayout()` itself never returns a `Promise`.
|
|
1279
|
-
* Return `undefined` to fall back to the static `props` this panel was opened with.
|
|
1280
|
-
*/
|
|
1281
|
-
registerStateProvider?: (getState: () => unknown) => (() => void);
|
|
1282
|
-
/** Change the display title of the containing tab or window dynamically. */
|
|
1283
|
-
setTitle: (title: string | {
|
|
1284
|
-
id: string;
|
|
1285
|
-
defaultMessage: string;
|
|
1286
|
-
values?: Record<string, any>;
|
|
1287
|
-
}) => void;
|
|
1288
|
-
/** Change the tab or window icon dynamically. */
|
|
1289
|
-
setIcon?: (icon: React.ReactNode) => void;
|
|
1290
|
-
/** The type of container the panel is mounted in. Reflects the state at mount time; subscribe to {@link onContainerTypeChange} for live updates. */
|
|
1291
|
-
containerType?: ContainerType;
|
|
1292
|
-
/** Unique identifier of the panel or window instance. */
|
|
1293
|
-
instanceId: string;
|
|
1294
|
-
/** Subscribe to the container's close event. Returns an unsubscribe function. */
|
|
1295
|
-
onClose?: (handler: () => void) => () => void;
|
|
1296
|
-
/** Subscribe to the container's minimize event. Returns an unsubscribe function. */
|
|
1297
|
-
onMinimize?: (handler: () => void) => () => void;
|
|
1298
|
-
/** Subscribe to the container's restore event. Returns an unsubscribe function. */
|
|
1299
|
-
onRestore?: (handler: () => void) => () => void;
|
|
1300
|
-
/** Subscribe to the container's window resize event, returning width and height. Returns an unsubscribe function. */
|
|
1301
|
-
onResize?: (handler: (width: number, height: number) => void) => () => void;
|
|
1302
|
-
/** Request the container to minimize itself to the taskbar. No-op if the container type does not support minimize. */
|
|
1303
|
-
requestMinimize?: () => void;
|
|
1304
|
-
/** Returns the current rendered dimensions of this panel, or `null` if the panel has not been laid out yet. */
|
|
1305
|
-
getDimensions?: () => {
|
|
1306
|
-
width: number;
|
|
1307
|
-
height: number;
|
|
1308
|
-
} | null;
|
|
1309
|
-
/**
|
|
1310
|
-
* Subscribe to this panel becoming the globally active panel.
|
|
1311
|
-
* Fires when `activePanelId` transitions to this panel's id.
|
|
1312
|
-
* Returns an unsubscribe function.
|
|
1313
|
-
*/
|
|
1314
|
-
onActivate?: (handler: () => void) => () => void;
|
|
1315
|
-
/**
|
|
1316
|
-
* Subscribe to this panel losing active status.
|
|
1317
|
-
* Fires when `activePanelId` transitions away from this panel's id,
|
|
1318
|
-
* and also fires if the panel is destroyed while it is active.
|
|
1319
|
-
* Returns an unsubscribe function.
|
|
1320
|
-
*/
|
|
1321
|
-
onDeactivate?: (handler: () => void) => () => void;
|
|
1322
|
-
/**
|
|
1323
|
-
* Subscribe to changes in the panel's container type (e.g. docked ↔ floating).
|
|
1324
|
-
* Does not fire for minimize/restore cycles — use {@link onMinimize} / {@link onRestore} for those.
|
|
1325
|
-
* Returns an unsubscribe function.
|
|
1326
|
-
*/
|
|
1327
|
-
onContainerTypeChange?: (handler: (type: ContainerType) => void) => () => void;
|
|
1328
|
-
}
|
|
1329
|
-
/**
|
|
1330
|
-
* Context that supplies the {@link FormContainerContract} to panels inside the Window Manager.
|
|
1331
|
-
*/
|
|
1332
|
-
declare const FormContainerContext: Context<FormContainerContract>;
|
|
1333
|
-
declare const FormContainerProvider: Provider<FormContainerContract>;
|
|
1334
|
-
/**
|
|
1335
|
-
* React hook to retrieve the current {@link FormContainerContract} from context.
|
|
1336
|
-
* Enables sub-forms to trigger close/minimize requests, mark themselves dirty,
|
|
1337
|
-
* rename their tabs, query dimensions, or subscribe to lifecycle events
|
|
1338
|
-
* (resize, close, minimize, restore, activate, deactivate, container-type changes).
|
|
1339
|
-
*/
|
|
1340
|
-
declare const useFormContainer: () => FormContainerContract;
|
|
1341
|
-
/**
|
|
1342
|
-
* Reactive alternative to calling {@link FormContainerContract.getDimensions} yourself.
|
|
1135
|
+
* Reactive alternative to measuring the panel's container yourself.
|
|
1343
1136
|
* Returns the panel's current `{ width, height }`, or `null` before it has been laid
|
|
1344
1137
|
* out, and re-renders whenever the panel's rendered box changes — including resizes
|
|
1345
1138
|
* caused by the workspace itself (a grid split being dragged, docking, floating, or
|
|
@@ -1351,7 +1144,7 @@ declare const usePanelSize: () => {
|
|
|
1351
1144
|
} | null;
|
|
1352
1145
|
|
|
1353
1146
|
/** Unique string identifier for panel/modal instances. */
|
|
1354
|
-
type
|
|
1147
|
+
type OverlayId = string;
|
|
1355
1148
|
/**
|
|
1356
1149
|
* Descriptor object for localizable panel titles, supporting context translation systems.
|
|
1357
1150
|
*/
|
|
@@ -1400,9 +1193,9 @@ interface ModalOptions {
|
|
|
1400
1193
|
/**
|
|
1401
1194
|
* Represents a rendered instance of a panel or modal in the layout.
|
|
1402
1195
|
*/
|
|
1403
|
-
interface
|
|
1196
|
+
interface OverlayInstance {
|
|
1404
1197
|
/** Unique ID generated for this instance. */
|
|
1405
|
-
id:
|
|
1198
|
+
id: OverlayId;
|
|
1406
1199
|
/** React Component to mount inside the panel. */
|
|
1407
1200
|
Component: ComponentType<any>;
|
|
1408
1201
|
/** Property props passed to the Component. */
|
|
@@ -1417,89 +1210,276 @@ interface PanelInstance {
|
|
|
1417
1210
|
dirtyOptions?: DirtyStateOptions;
|
|
1418
1211
|
}
|
|
1419
1212
|
/** Stores the active layout structures for floating overlays. */
|
|
1420
|
-
interface
|
|
1213
|
+
interface OverlayState {
|
|
1421
1214
|
/** The currently open left drawer panel instance, or null. */
|
|
1422
|
-
leftPanel:
|
|
1215
|
+
leftPanel: OverlayInstance | null;
|
|
1423
1216
|
/** The currently open right drawer panel instance, or null. */
|
|
1424
|
-
rightPanel:
|
|
1217
|
+
rightPanel: OverlayInstance | null;
|
|
1425
1218
|
/** Stack containing all active floating modal instances. */
|
|
1426
|
-
modals:
|
|
1427
|
-
}
|
|
1428
|
-
/** Exposes methods to trigger state actions on drawers and modals. */
|
|
1429
|
-
interface PanelActions {
|
|
1430
|
-
/** Mounts a panel in the left-side container drawer. */
|
|
1431
|
-
openLeftPanel: <P extends object>(Component: ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<PanelInstanceId | null>;
|
|
1432
|
-
/** Mounts a panel in the right-side container drawer. */
|
|
1433
|
-
openRightPanel: <P extends object>(Component: ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<PanelInstanceId | null>;
|
|
1434
|
-
/** Pushes a new modal component instance to the top of the stack. */
|
|
1435
|
-
openModal: <P extends object>(Component: ComponentType<P>, props: P, options?: ModalOptions) => PanelInstanceId;
|
|
1436
|
-
/** Closes an instance by ID. */
|
|
1437
|
-
close: (id: PanelInstanceId) => void;
|
|
1438
|
-
/** Closes all drawers and modals in a single action. */
|
|
1439
|
-
closeAll: () => void;
|
|
1440
|
-
/** Closes all open modals. */
|
|
1441
|
-
closeAllModals: () => void;
|
|
1442
|
-
/** Retrieves metadata for an active instance by ID. */
|
|
1443
|
-
getInstance: (id: PanelInstanceId) => PanelInstance | undefined;
|
|
1444
|
-
/** Updates the props, configuration options, or dirty flag of an active panel. */
|
|
1445
|
-
updateInstance: (id: PanelInstanceId, updates: Partial<Pick<PanelInstance, 'props' | 'options' | 'dirty' | 'dirtyOptions'>>) => void;
|
|
1446
|
-
/** Flags an instance as dirty (contains unsaved changes). */
|
|
1447
|
-
setDirty: (id: PanelInstanceId, dirty: boolean, options?: DirtyStateOptions) => void;
|
|
1448
|
-
/** Subscribes a custom close confirmation intercept handler. */
|
|
1449
|
-
registerCloseHandler: (id: PanelInstanceId, handler: () => Promise<boolean>) => void;
|
|
1450
|
-
/** Unsubscribes close confirmation handler. */
|
|
1451
|
-
unregisterCloseHandler: (id: PanelInstanceId) => void;
|
|
1219
|
+
modals: OverlayInstance[];
|
|
1452
1220
|
}
|
|
1221
|
+
|
|
1453
1222
|
/**
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
1223
|
+
* The 7.0 public API layer: `createWorkspace()`, the hooks a panel or an app component uses, and
|
|
1224
|
+
* the two components that replace several 6.x ones (`RddSidePanels`, `RddContextMenu`).
|
|
1225
|
+
*
|
|
1226
|
+
* Everything here is built on the library's internal modules; `src/index.ts` exports it together
|
|
1227
|
+
* with the internal components under their 7.0 names.
|
|
1456
1228
|
*/
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1229
|
+
|
|
1230
|
+
/** Configuration for {@link createWorkspace}. */
|
|
1231
|
+
interface WorkspaceConfig extends Omit<WorkspaceClientConfig, 'predefinedMessages'> {
|
|
1232
|
+
/** Overrides any subset of the built-in message table. */
|
|
1233
|
+
messages?: Record<string, MessageDescriptor>;
|
|
1234
|
+
}
|
|
1460
1235
|
/**
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1236
|
+
* A workspace: the layout, every action on it, the panel registry and the event bus. It is live
|
|
1237
|
+
* from the moment it is created — calls made before any `<DockableDesktopProvider>` mounts apply
|
|
1238
|
+
* immediately.
|
|
1463
1239
|
*/
|
|
1464
|
-
|
|
1240
|
+
interface Workspace<TEvents extends object = Record<string, unknown>> extends WorkspaceClient<TEvents> {
|
|
1241
|
+
}
|
|
1465
1242
|
/**
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1243
|
+
* Creates a workspace. Pass it to `<DockableDesktopProvider workspace={…}>`.
|
|
1244
|
+
*
|
|
1245
|
+
* @example
|
|
1246
|
+
* ```ts
|
|
1247
|
+
* interface AppEvents { 'layer:select': { layerId: string } }
|
|
1248
|
+
* export const workspace = createWorkspace<AppEvents>({
|
|
1249
|
+
* panels: { map: { component: MapPanel } },
|
|
1250
|
+
* initialState: localStorage.getItem('layout'),
|
|
1251
|
+
* });
|
|
1252
|
+
* ```
|
|
1468
1253
|
*/
|
|
1469
|
-
declare
|
|
1470
|
-
|
|
1254
|
+
declare function createWorkspace<TEvents extends object = Record<string, unknown>>(config?: WorkspaceConfig): Workspace<TEvents>;
|
|
1471
1255
|
/**
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1256
|
+
* The workspace of the nearest `<DockableDesktopProvider>`. A stable object: it never changes, so
|
|
1257
|
+
* a component that only calls actions never re-renders because of it.
|
|
1474
1258
|
*/
|
|
1475
|
-
declare
|
|
1259
|
+
declare function useWorkspace<TEvents extends object = Record<string, unknown>>(): Workspace<TEvents>;
|
|
1260
|
+
/** The state of a workspace panel: where it is. */
|
|
1261
|
+
type PanelState = PanelInfo['state'];
|
|
1262
|
+
/** What a panel component knows about, and can do to, its own container. See {@link usePanel}. */
|
|
1263
|
+
interface PanelHandle {
|
|
1264
|
+
/** This panel's instance id. */
|
|
1265
|
+
id: string;
|
|
1266
|
+
/** Where it is rendered. Updates live (a docked panel that is floated re-renders as `'floating-window'`). */
|
|
1267
|
+
containerType: ContainerType;
|
|
1268
|
+
/** A workspace panel that is the globally active one. Always false in a modal or drawer. */
|
|
1269
|
+
isActive: boolean;
|
|
1270
|
+
/** A workspace panel that is minimized to the taskbar. */
|
|
1271
|
+
isMinimized: boolean;
|
|
1272
|
+
/** A workspace panel shown as a floating window. */
|
|
1273
|
+
isFloating: boolean;
|
|
1274
|
+
/** Asks the container to close, honouring close guards and the dirty flag. */
|
|
1275
|
+
close: (options?: CloseOptions) => void;
|
|
1276
|
+
/** Minimizes a workspace panel. No effect in a modal or drawer. */
|
|
1277
|
+
minimize: () => void;
|
|
1278
|
+
/** Marks the panel as having unsaved changes. */
|
|
1279
|
+
setDirty: (dirty: boolean, options?: DirtyStateOptions) => void;
|
|
1280
|
+
/** Changes the title shown on the tab, window or modal. */
|
|
1281
|
+
setTitle: (title: string | MessageDescriptor) => void;
|
|
1282
|
+
/** Changes the icon shown on the tab or window. */
|
|
1283
|
+
setIcon: (icon: React$1.ReactNode) => void;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* The panel's own container: its id, where it is, and what it can do. Works in docked panels,
|
|
1287
|
+
* floating windows, modals and side drawers.
|
|
1288
|
+
*/
|
|
1289
|
+
declare function usePanel(): PanelHandle;
|
|
1290
|
+
/** Lifecycle callbacks for {@link usePanelEvents}. Each is called at the moment it describes. */
|
|
1291
|
+
interface PanelEvents {
|
|
1292
|
+
onActivate?: () => void;
|
|
1293
|
+
onDeactivate?: () => void;
|
|
1294
|
+
onMinimize?: () => void;
|
|
1295
|
+
onRestore?: () => void;
|
|
1296
|
+
onClose?: () => void;
|
|
1297
|
+
onResize?: (width: number, height: number) => void;
|
|
1298
|
+
onContainerTypeChange?: (type: ContainerType) => void;
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Subscribes to the panel's lifecycle. Call it at the top level of the panel component; it always
|
|
1302
|
+
* calls the latest callbacks passed in and cleans up on unmount — no dependency array.
|
|
1303
|
+
*/
|
|
1304
|
+
declare function usePanelEvents(events: PanelEvents): void;
|
|
1305
|
+
/**
|
|
1306
|
+
* Registers a close guard: resolve `false` to keep the panel open (ask the user, save first, …).
|
|
1307
|
+
* Pass `null` to register none. Always calls the latest guard passed in.
|
|
1308
|
+
*/
|
|
1309
|
+
declare function useBeforeClose(guard: (() => boolean | Promise<boolean>) | null): void;
|
|
1310
|
+
/**
|
|
1311
|
+
* Reports the panel's restorable state, pulled fresh on every `saveLayout()` and saved as the
|
|
1312
|
+
* panel's props. Pass `null` to report none. Always calls the latest function passed in.
|
|
1313
|
+
*/
|
|
1314
|
+
declare function useSaveState(getState: (() => unknown) | null): void;
|
|
1315
|
+
type OverlayUpdate = Partial<Pick<OverlayInstance, 'props' | 'options' | 'dirty' | 'dirtyOptions'>>;
|
|
1316
|
+
/** Returned by {@link useModals}. */
|
|
1317
|
+
interface ModalsApi {
|
|
1318
|
+
/** Open modals, bottom to top. */
|
|
1319
|
+
stack: OverlayInstance[];
|
|
1320
|
+
/** The top modal, or null. */
|
|
1321
|
+
topmost: OverlayInstance | null;
|
|
1322
|
+
open: <P extends object>(component: React$1.ComponentType<P>, props: P, options?: ModalOptions) => OverlayId;
|
|
1323
|
+
close: (id: OverlayId) => void;
|
|
1324
|
+
closeAll: () => void;
|
|
1325
|
+
get: (id: OverlayId) => OverlayInstance | undefined;
|
|
1326
|
+
update: (id: OverlayId, updates: OverlayUpdate) => void;
|
|
1327
|
+
setDirty: (id: OverlayId, dirty: boolean, options?: DirtyStateOptions) => void;
|
|
1328
|
+
}
|
|
1329
|
+
/** Returned by {@link useSidePanels}. */
|
|
1330
|
+
interface SidePanelsApi {
|
|
1331
|
+
left: OverlayInstance | null;
|
|
1332
|
+
right: OverlayInstance | null;
|
|
1333
|
+
openLeft: <P extends object>(component: React$1.ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<OverlayId | null>;
|
|
1334
|
+
openRight: <P extends object>(component: React$1.ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<OverlayId | null>;
|
|
1335
|
+
close: (id: OverlayId) => void;
|
|
1336
|
+
/** Closes both drawers. */
|
|
1337
|
+
closeAll: () => void;
|
|
1338
|
+
get: (id: OverlayId) => OverlayInstance | undefined;
|
|
1339
|
+
update: (id: OverlayId, updates: OverlayUpdate) => void;
|
|
1340
|
+
setDirty: (id: OverlayId, dirty: boolean, options?: DirtyStateOptions) => void;
|
|
1341
|
+
}
|
|
1342
|
+
/** Opens and tracks modals. */
|
|
1343
|
+
declare function useModals(): ModalsApi;
|
|
1344
|
+
/** Opens and tracks the left and right side drawers. */
|
|
1345
|
+
declare function useSidePanels(): SidePanelsApi;
|
|
1346
|
+
/** Props for {@link RddSidePanels}. */
|
|
1347
|
+
interface RddSidePanelsProps {
|
|
1348
|
+
/** Render only one side's drawer. Omit to render both. */
|
|
1349
|
+
side?: 'left' | 'right';
|
|
1350
|
+
/** Width used when an `openLeft`/`openRight` call doesn't give one. Number = px. @default 400 */
|
|
1351
|
+
defaultWidth?: number | string;
|
|
1352
|
+
}
|
|
1353
|
+
/** Renders the side drawers opened through {@link useSidePanels}. */
|
|
1354
|
+
declare function RddSidePanels({ side, defaultWidth }: RddSidePanelsProps): React$1.ReactElement;
|
|
1355
|
+
/** Props for {@link RddContextMenu}. */
|
|
1356
|
+
type RddContextMenuProps = ContextMenuProps & {
|
|
1357
|
+
/** With children: the context-menu implementation for them. @default the built-in menu */
|
|
1358
|
+
adapter?: ContextMenuAdapter;
|
|
1359
|
+
/**
|
|
1360
|
+
* With children, `RddContextMenu` provides a context menu to them (`useContextMenu()` inside
|
|
1361
|
+
* shows it) — for a surface outside `<DockableDesktopProvider>`, or to override the menu for a
|
|
1362
|
+
* subtree. Without children, it is a single menu you drive through its `ref`.
|
|
1363
|
+
*/
|
|
1364
|
+
children?: React$1.ReactNode;
|
|
1365
|
+
};
|
|
1366
|
+
/**
|
|
1367
|
+
* A context menu. Inside `<DockableDesktopProvider>` one is already provided — use
|
|
1368
|
+
* `useContextMenu()` or `showContextMenu()` and you need no `RddContextMenu` at all.
|
|
1369
|
+
*/
|
|
1370
|
+
declare const RddContextMenu: React$1.ForwardRefExoticComponent<RddContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
|
|
1476
1371
|
|
|
1477
|
-
|
|
1372
|
+
/** Props for `<DockableDesktopProvider>`. */
|
|
1373
|
+
interface DockableDesktopProviderProps {
|
|
1374
|
+
children: React$1.ReactNode;
|
|
1478
1375
|
/**
|
|
1479
|
-
*
|
|
1480
|
-
*
|
|
1481
|
-
* Falls back to 400px if omitted.
|
|
1376
|
+
* The workspace to render, from `createWorkspace()`. Omit it and the provider creates an empty
|
|
1377
|
+
* one of its own (register panels through `useWorkspace().registry`).
|
|
1482
1378
|
*/
|
|
1483
|
-
|
|
1379
|
+
workspace?: Workspace<object>;
|
|
1380
|
+
/** Translates every built-in label. Overridden by the workspace's own `formatMessage`. */
|
|
1381
|
+
formatMessage?: MessageFormatter;
|
|
1382
|
+
/** Overrides any subset of the built-in message table. Overridden by the workspace's own `messages`. */
|
|
1383
|
+
messages?: Record<string, MessageDescriptor>;
|
|
1384
|
+
/** Initial layout direction, when the workspace doesn't set one. */
|
|
1385
|
+
dir?: 'ltr' | 'rtl';
|
|
1386
|
+
/** CSS class for the outer wrapper of every modal. */
|
|
1387
|
+
modalClass?: string;
|
|
1388
|
+
/** CSS class for the content area of every modal. */
|
|
1389
|
+
modalBodyClass?: string;
|
|
1390
|
+
/** CSS class for the outer wrapper of the side drawers. */
|
|
1391
|
+
sidePanelClass?: string;
|
|
1392
|
+
/** CSS class for the content area of the side drawers. */
|
|
1393
|
+
sidePanelBodyClass?: string;
|
|
1394
|
+
/** CSS class for the outer wrapper of floating windows. */
|
|
1395
|
+
windowClass?: string;
|
|
1396
|
+
/** CSS class for the content area of floating windows. */
|
|
1397
|
+
windowBodyClass?: string;
|
|
1398
|
+
/**
|
|
1399
|
+
* Starting z-index for floating windows and all of the library's chrome overlays, which shift
|
|
1400
|
+
* together via `--rdd-z-base`. @default 1000
|
|
1401
|
+
*/
|
|
1402
|
+
zIndexBase?: number;
|
|
1403
|
+
/** Context menu implementation. Defaults to the built-in menu. */
|
|
1404
|
+
contextMenuAdapter?: ContextMenuAdapter;
|
|
1484
1405
|
}
|
|
1485
1406
|
/**
|
|
1486
|
-
*
|
|
1487
|
-
*
|
|
1407
|
+
* The one provider. Place it above everything from this library: `<RddDesktop>`, `<RddSidebar>`,
|
|
1408
|
+
* `<RddToolbar>`, `<RddSidePanels>`, `<RddModals>`.
|
|
1409
|
+
*
|
|
1410
|
+
* @example
|
|
1411
|
+
* ```tsx
|
|
1412
|
+
* const workspace = createWorkspace({ panels: { map: { component: MapPanel } } });
|
|
1413
|
+
*
|
|
1414
|
+
* <DockableDesktopProvider workspace={workspace}>
|
|
1415
|
+
* <RddSidebar tabs={tabs}>
|
|
1416
|
+
* <RddDesktop />
|
|
1417
|
+
* </RddSidebar>
|
|
1418
|
+
* <RddSidePanels />
|
|
1419
|
+
* <RddModals />
|
|
1420
|
+
* </DockableDesktopProvider>
|
|
1421
|
+
* ```
|
|
1422
|
+
*/
|
|
1423
|
+
declare const DockableDesktopProvider: React$1.FC<DockableDesktopProviderProps>;
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* Recursively checks whether a value can round-trip through `JSON.stringify`/`JSON.parse`
|
|
1427
|
+
* without silently losing information.
|
|
1428
|
+
*
|
|
1429
|
+
* Deliberately **not** a `JSON.stringify` try/catch — that call doesn't throw for the actual
|
|
1430
|
+
* failure case this guards against: a function-valued property is simply dropped by
|
|
1431
|
+
* `JSON.stringify`, not rejected. This walks the value tree instead, returning `false` as soon as
|
|
1432
|
+
* it finds a function, symbol, `undefined`, React element, or any non-plain object (a class
|
|
1433
|
+
* instance, `Map`, `Set`, `RegExp`, etc.).
|
|
1434
|
+
*
|
|
1435
|
+
* `Date` is treated as an explicit exception — serializable-enough, matching `JSON.stringify`'s
|
|
1436
|
+
* own behavior — even though it doesn't round-trip back to a `Date` instance on parse. That's a
|
|
1437
|
+
* smaller, more tolerable gotcha than a silently-vanishing function, so it's documented rather
|
|
1438
|
+
* than treated as a disqualifying case.
|
|
1439
|
+
*
|
|
1440
|
+
* Used to decide whether a docked/floating panel's `props` can be included in
|
|
1441
|
+
* the workspace's `saveLayout()` output — see {@link PanelInfo.serializable}.
|
|
1488
1442
|
*/
|
|
1489
|
-
declare
|
|
1443
|
+
declare function isSerializable(value: unknown): boolean;
|
|
1444
|
+
|
|
1490
1445
|
/**
|
|
1491
|
-
*
|
|
1446
|
+
* @file WindowManager.tsx
|
|
1447
|
+
* @description Core component for react-dockable-desktop layout engine.
|
|
1448
|
+
* Renders the workspace desktop containing docked splits, tabbed panels, floated windows,
|
|
1449
|
+
* resize handles, context menus, and taskbar docks. Exposes lifecycle event listeners.
|
|
1492
1450
|
*/
|
|
1493
|
-
|
|
1451
|
+
|
|
1452
|
+
/** Controls when the minimized-panel taskbar is visible. */
|
|
1453
|
+
type TaskbarVisibility = 'always' | 'compact' | 'autohide';
|
|
1454
|
+
/** Props for `<RddDesktop>`. */
|
|
1455
|
+
interface RddDesktopProps {
|
|
1456
|
+
/** Built-in skin name or a custom skin key registered via CSS. @default 'vscode' */
|
|
1457
|
+
skin?: string;
|
|
1458
|
+
/** Fallback icon shown in panel tabs when no panel-specific icon is provided. */
|
|
1459
|
+
defaultPanelIcon?: React$1.ReactNode;
|
|
1460
|
+
/**
|
|
1461
|
+
* Controls taskbar visibility.
|
|
1462
|
+
* - `'always'` — permanent bar at the bottom
|
|
1463
|
+
* - `'compact'` — only visible when minimized panels exist
|
|
1464
|
+
* - `'autohide'` — overlay bar with 8 px peek strip (default)
|
|
1465
|
+
* @default 'autohide'
|
|
1466
|
+
*/
|
|
1467
|
+
taskbarVisibility?: TaskbarVisibility;
|
|
1468
|
+
/** Enables the library's own transitions/animations (tab hover, dock preview, etc.). Never affects the consumer's own page. @default true */
|
|
1469
|
+
animations?: boolean;
|
|
1470
|
+
}
|
|
1471
|
+
declare const WindowManager: React$1.FC<RddDesktopProps>;
|
|
1472
|
+
|
|
1494
1473
|
/**
|
|
1495
|
-
*
|
|
1474
|
+
* Renders the modals opened through `useModals()`, stacked, topmost last. Mount one, inside
|
|
1475
|
+
* `<DockableDesktopProvider>`.
|
|
1496
1476
|
*/
|
|
1497
|
-
declare const
|
|
1477
|
+
declare const ModalStackRenderer: React$1.FC;
|
|
1498
1478
|
|
|
1499
1479
|
/**
|
|
1500
|
-
* Props for the {@link
|
|
1480
|
+
* Props for the {@link RddConfirm} component.
|
|
1501
1481
|
*/
|
|
1502
|
-
interface
|
|
1482
|
+
interface RddConfirmProps {
|
|
1503
1483
|
/** Optional custom title text or localizable descriptor for the dialog container. */
|
|
1504
1484
|
title?: string | {
|
|
1505
1485
|
id: string;
|
|
@@ -1524,10 +1504,10 @@ interface ConfirmationFormProps {
|
|
|
1524
1504
|
onCancel?: () => void;
|
|
1525
1505
|
}
|
|
1526
1506
|
/**
|
|
1527
|
-
*
|
|
1507
|
+
* RddConfirm component renders a standard dialog content layout,
|
|
1528
1508
|
* allowing users to confirm actions or abort them. Exposes action callbacks.
|
|
1529
1509
|
*/
|
|
1530
|
-
declare const ConfirmationForm: React$1.FC<
|
|
1510
|
+
declare const ConfirmationForm: React$1.FC<RddConfirmProps>;
|
|
1531
1511
|
|
|
1532
1512
|
/**
|
|
1533
1513
|
* @file Sidebar.tsx
|
|
@@ -1574,11 +1554,11 @@ interface SidebarTab {
|
|
|
1574
1554
|
renderContent: (tabId: string, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
|
|
1575
1555
|
}
|
|
1576
1556
|
/**
|
|
1577
|
-
* Simple case for `
|
|
1557
|
+
* Simple case for `RddSidebarProps.headerAction`/`footerAction`: the library renders a
|
|
1578
1558
|
* default-styled icon button (visually consistent with the regular tab buttons) and forwards
|
|
1579
1559
|
* the click.
|
|
1580
1560
|
*/
|
|
1581
|
-
interface
|
|
1561
|
+
interface SidebarActionButton {
|
|
1582
1562
|
/** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
|
|
1583
1563
|
id?: string;
|
|
1584
1564
|
icon: React$1.ReactNode;
|
|
@@ -1588,12 +1568,12 @@ interface SidebarHeaderActionButton {
|
|
|
1588
1568
|
disabled?: boolean;
|
|
1589
1569
|
}
|
|
1590
1570
|
/**
|
|
1591
|
-
* Full-control case for `
|
|
1571
|
+
* Full-control case for `RddSidebarProps.headerAction`/`footerAction`: the consumer supplies their
|
|
1592
1572
|
* own markup (a Material UI `IconButton`, a Bootstrap `Button`, a Tailwind-styled `<button>`, or
|
|
1593
1573
|
* anything else) wholesale. The library renders exactly what this returns, unwrapped, so the
|
|
1594
1574
|
* consumer's own hover/active/focus/ripple behavior and click handling are untouched.
|
|
1595
1575
|
*/
|
|
1596
|
-
interface
|
|
1576
|
+
interface SidebarCustomEntry {
|
|
1597
1577
|
/** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
|
|
1598
1578
|
id?: string;
|
|
1599
1579
|
render: () => React$1.ReactNode;
|
|
@@ -1604,15 +1584,15 @@ interface SidebarHeaderActionCustom {
|
|
|
1604
1584
|
* it and forwards the click; what happens next (opening a side panel, a modal, anything else)
|
|
1605
1585
|
* is entirely up to the consumer.
|
|
1606
1586
|
*/
|
|
1607
|
-
type SidebarHeaderAction =
|
|
1587
|
+
type SidebarHeaderAction = SidebarActionButton | SidebarCustomEntry;
|
|
1608
1588
|
/**
|
|
1609
|
-
* A single entry inside `
|
|
1589
|
+
* A single entry inside `RddSidebarProps.headerAction`/`footerAction` when used as an array: either
|
|
1610
1590
|
* a non-toggling action button/custom render (see `SidebarHeaderAction`), or a real `SidebarTab`
|
|
1611
1591
|
* that behaves exactly like a main-list tab — it mounts, activates, and closes through the same
|
|
1612
1592
|
* lifecycle, so e.g. a "Settings" entry pinned to the footer can expand like any other tab.
|
|
1613
1593
|
*/
|
|
1614
|
-
type SidebarRailEntry = SidebarTab |
|
|
1615
|
-
interface
|
|
1594
|
+
type SidebarRailEntry = SidebarTab | SidebarActionButton | SidebarCustomEntry;
|
|
1595
|
+
interface RddSidebarProps {
|
|
1616
1596
|
/** Which side the activity bar and drawer appear on. Default: 'right' */
|
|
1617
1597
|
position?: 'left' | 'right';
|
|
1618
1598
|
tabs: SidebarTab[];
|
|
@@ -1691,7 +1671,7 @@ interface SidebarProps {
|
|
|
1691
1671
|
renderHeader?: (tab: SidebarTab, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
|
|
1692
1672
|
/**
|
|
1693
1673
|
* @internal Marks this instance as a secondary sidebar for context-broadcasting
|
|
1694
|
-
* purposes. Set automatically by `<
|
|
1674
|
+
* purposes. Set automatically by `<RddSecondarySidebar>` — do not pass this directly.
|
|
1695
1675
|
* Default: false
|
|
1696
1676
|
*/
|
|
1697
1677
|
isSecondary?: boolean;
|
|
@@ -1699,7 +1679,7 @@ interface SidebarProps {
|
|
|
1699
1679
|
children?: React$1.ReactNode;
|
|
1700
1680
|
}
|
|
1701
1681
|
/**
|
|
1702
|
-
* Imperative handle exposed by `<
|
|
1682
|
+
* Imperative handle exposed by `<RddSidebar ref={...}>`.
|
|
1703
1683
|
*/
|
|
1704
1684
|
interface SidebarHandle {
|
|
1705
1685
|
openTab: (tabId: string) => void;
|
|
@@ -1715,7 +1695,7 @@ interface SidebarHandle {
|
|
|
1715
1695
|
}
|
|
1716
1696
|
/**
|
|
1717
1697
|
* Value provided by `useSidebar()`. Available to any component inside the
|
|
1718
|
-
* `<
|
|
1698
|
+
* `<RddSidebar>` React tree, including panels rendered via `{children}`.
|
|
1719
1699
|
*/
|
|
1720
1700
|
interface SidebarContextValue {
|
|
1721
1701
|
openTab: (tabId: string) => void;
|
|
@@ -1723,7 +1703,7 @@ interface SidebarContextValue {
|
|
|
1723
1703
|
getActiveTab: () => string | null;
|
|
1724
1704
|
/** Which side this Sidebar instance is rendering on. */
|
|
1725
1705
|
position: 'left' | 'right';
|
|
1726
|
-
/** True if this instance is a `<
|
|
1706
|
+
/** True if this instance is a `<RddSecondarySidebar>`, false for a primary `<RddSidebar>`. */
|
|
1727
1707
|
isSecondary: boolean;
|
|
1728
1708
|
}
|
|
1729
1709
|
/**
|
|
@@ -1736,13 +1716,13 @@ interface SidebarTabContextValue {
|
|
|
1736
1716
|
onClose: () => void;
|
|
1737
1717
|
openTab: (tabId: string) => void;
|
|
1738
1718
|
}
|
|
1739
|
-
declare const Sidebar: React$1.ForwardRefExoticComponent<
|
|
1719
|
+
declare const Sidebar: React$1.ForwardRefExoticComponent<RddSidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1740
1720
|
/**
|
|
1741
|
-
* Props for {@link
|
|
1721
|
+
* Props for {@link RddSecondarySidebar} — identical to {@link RddSidebarProps} except
|
|
1742
1722
|
* `position` (always the opposite of whatever primary `Sidebar` it's nested inside)
|
|
1743
1723
|
* and `isSecondary` (always `true`) are not settable.
|
|
1744
1724
|
*/
|
|
1745
|
-
type
|
|
1725
|
+
type RddSecondarySidebarProps = Omit<RddSidebarProps, 'position' | 'isSecondary'>;
|
|
1746
1726
|
/**
|
|
1747
1727
|
* A second, independent `Sidebar` instance for the opposite edge of the screen —
|
|
1748
1728
|
* same component, same behavior, zero forked code. Must be rendered inside a
|
|
@@ -1750,12 +1730,12 @@ type SecondarySidebarProps = Omit<SidebarProps, 'position' | 'isSecondary'>;
|
|
|
1750
1730
|
* isn't using, so the side is never specified directly.
|
|
1751
1731
|
*
|
|
1752
1732
|
* @throws Error if rendered without an ancestor `Sidebar`, or nested inside another
|
|
1753
|
-
* `
|
|
1733
|
+
* `RddSecondarySidebar` — this library supports exactly one primary and one secondary,
|
|
1754
1734
|
* nothing deeper.
|
|
1755
1735
|
*/
|
|
1756
|
-
declare const SecondarySidebar: React$1.ForwardRefExoticComponent<
|
|
1736
|
+
declare const SecondarySidebar: React$1.ForwardRefExoticComponent<RddSecondarySidebarProps & React$1.RefAttributes<SidebarHandle>>;
|
|
1757
1737
|
/**
|
|
1758
|
-
* Returns sidebar control functions from anywhere inside a `<
|
|
1738
|
+
* Returns sidebar control functions from anywhere inside a `<RddSidebar>` tree,
|
|
1759
1739
|
* including floating panels rendered via `{children}`.
|
|
1760
1740
|
*
|
|
1761
1741
|
* @throws Error if used outside of a {@link Sidebar}.
|
|
@@ -1787,9 +1767,6 @@ interface ToolbarContextValue {
|
|
|
1787
1767
|
/** Flip a toggle modifier between active and inactive. */
|
|
1788
1768
|
toggleModifier: (id: string) => void;
|
|
1789
1769
|
}
|
|
1790
|
-
declare const ToolbarProvider: React$1.FC<{
|
|
1791
|
-
children: React$1.ReactNode;
|
|
1792
|
-
}>;
|
|
1793
1770
|
/**
|
|
1794
1771
|
* Returns toolbar state and control functions from anywhere inside
|
|
1795
1772
|
* a `<DockableDesktopProvider>` tree.
|
|
@@ -1912,7 +1889,7 @@ interface ToolbarGroupItem {
|
|
|
1912
1889
|
onActiveItemChange?: (id: string) => void;
|
|
1913
1890
|
}
|
|
1914
1891
|
type ToolbarItem$1 = ToolbarActionItem | ToolbarRadioItem | ToolbarToggleItem | ToolbarGroupItem | ToolbarSeparator$1;
|
|
1915
|
-
interface
|
|
1892
|
+
interface RddToolbarProps {
|
|
1916
1893
|
/** Side the strip is attached to. Controls strip orientation. Default: 'left' */
|
|
1917
1894
|
position?: 'left' | 'right' | 'top' | 'bottom';
|
|
1918
1895
|
/** Ordered list of items to render. */
|
|
@@ -1929,15 +1906,15 @@ interface ToolbarHandle {
|
|
|
1929
1906
|
hide(): void;
|
|
1930
1907
|
toggle(): void;
|
|
1931
1908
|
}
|
|
1932
|
-
declare const Toolbar: React$1.ForwardRefExoticComponent<
|
|
1909
|
+
declare const Toolbar: React$1.ForwardRefExoticComponent<RddToolbarProps & React$1.RefAttributes<ToolbarHandle>>;
|
|
1933
1910
|
|
|
1934
1911
|
/** Visual type of a toast notification. Determines the icon and accent color. */
|
|
1935
1912
|
type ToastType = 'info' | 'success' | 'warning' | 'error';
|
|
1936
|
-
/** Corner position of the `<
|
|
1913
|
+
/** Corner position of the `<RddToasts>` relative to the viewport. */
|
|
1937
1914
|
type ToastPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
1938
1915
|
/**
|
|
1939
1916
|
* Per-notification options passed to `toast()`, `toast.info()`, etc.
|
|
1940
|
-
* All fields are optional and fall back to `<
|
|
1917
|
+
* All fields are optional and fall back to `<RddToasts>` defaults when unset.
|
|
1941
1918
|
*/
|
|
1942
1919
|
interface ToastOptions {
|
|
1943
1920
|
/** Visual type. Overridden by the `toast.info/success/warning/error` shorthands. @default 'info' */
|
|
@@ -1969,11 +1946,11 @@ interface ResolvedToastOptions {
|
|
|
1969
1946
|
onClose?: () => void;
|
|
1970
1947
|
}
|
|
1971
1948
|
/**
|
|
1972
|
-
* Props for `<
|
|
1949
|
+
* Props for `<RddToasts>`. Mount one instance at your app root, alongside `<RddModals>`.
|
|
1973
1950
|
* @example
|
|
1974
|
-
* <
|
|
1951
|
+
* <RddToasts position="top-right" progressBar />
|
|
1975
1952
|
*/
|
|
1976
|
-
interface
|
|
1953
|
+
interface RddToastsProps {
|
|
1977
1954
|
/** Where notifications appear in the viewport. @default 'top-right' */
|
|
1978
1955
|
position?: ToastPosition;
|
|
1979
1956
|
/** Maximum number of notifications shown simultaneously. Extras are queued. @default 3 */
|
|
@@ -2010,9 +1987,9 @@ interface ToastPromiseMessages<T> {
|
|
|
2010
1987
|
}
|
|
2011
1988
|
/**
|
|
2012
1989
|
* Strategy interface for replacing the built-in toast renderer with an external library.
|
|
2013
|
-
* Pass an instance via `<
|
|
1990
|
+
* Pass an instance via `<RddToasts adapter={...} />` to redirect all `toast.*` calls
|
|
2014
1991
|
* without changing any call sites in your application.
|
|
2015
|
-
* @see
|
|
1992
|
+
* @see RddToastsProps.adapter
|
|
2016
1993
|
*/
|
|
2017
1994
|
interface ToastAdapter {
|
|
2018
1995
|
/** Called when a new notification is requested. */
|
|
@@ -2022,8 +1999,8 @@ interface ToastAdapter {
|
|
|
2022
1999
|
/** Called to dismiss one notification (`id` provided) or all active notifications (no `id`). */
|
|
2023
2000
|
dismiss(id?: string): void;
|
|
2024
2001
|
/**
|
|
2025
|
-
* `null` means the adapter manages its own DOM and `<
|
|
2026
|
-
* A component causes `<
|
|
2002
|
+
* `null` means the adapter manages its own DOM and `<RddToasts>` renders nothing.
|
|
2003
|
+
* A component causes `<RddToasts>` to portal-render it with a `position` prop.
|
|
2027
2004
|
*/
|
|
2028
2005
|
Container: React$1.ComponentType<{
|
|
2029
2006
|
position: ToastPosition;
|
|
@@ -2057,7 +2034,7 @@ interface ToastFunction {
|
|
|
2057
2034
|
}
|
|
2058
2035
|
/**
|
|
2059
2036
|
* Imperative notification singleton. Call from anywhere — inside or outside React.
|
|
2060
|
-
* Mount `<
|
|
2037
|
+
* Mount `<RddToasts>` once at your app root to activate the renderer.
|
|
2061
2038
|
* @example
|
|
2062
2039
|
* toast.success('File saved.');
|
|
2063
2040
|
* toast.error('Upload failed.', { duration: 0 }); // sticky
|
|
@@ -2068,9 +2045,9 @@ declare const toast: ToastFunction;
|
|
|
2068
2045
|
* Portal-rendered notification host. Mount once at your app root, outside the workspace
|
|
2069
2046
|
* container. All `toast.*` calls are routed here automatically via the internal event emitter.
|
|
2070
2047
|
* @example
|
|
2071
|
-
* <
|
|
2048
|
+
* <RddToasts position="top-right" progressBar />
|
|
2072
2049
|
*/
|
|
2073
|
-
declare function ToastContainer({ position, maxVisible, defaultDuration, defaultClosable, pauseOnHover, animation, newestOnTop, progressBar, width, adapter, }:
|
|
2050
|
+
declare function ToastContainer({ position, maxVisible, defaultDuration, defaultClosable, pauseOnHover, animation, newestOnTop, progressBar, width, adapter, }: RddToastsProps): React$1.ReactElement | null;
|
|
2074
2051
|
|
|
2075
2052
|
/** Edge of a panel to which a `PanelToolbar` attaches. */
|
|
2076
2053
|
type ToolbarPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -2097,10 +2074,9 @@ interface PanelFloatPlacement {
|
|
|
2097
2074
|
stretch: Stretch | null;
|
|
2098
2075
|
}
|
|
2099
2076
|
/**
|
|
2100
|
-
* Configuration for a
|
|
2101
|
-
* @see usePanelFloatingWindowManager
|
|
2077
|
+
* Configuration for a widget spawned imperatively via `useFloatingWidgets().open()`.
|
|
2102
2078
|
*/
|
|
2103
|
-
interface
|
|
2079
|
+
interface ManagedWidget {
|
|
2104
2080
|
/**
|
|
2105
2081
|
* Text shown in the window's header bar. Accepts a plain string or an i18n message descriptor.
|
|
2106
2082
|
*
|
|
@@ -2126,32 +2102,32 @@ interface ManagedWindowConfig {
|
|
|
2126
2102
|
*/
|
|
2127
2103
|
stretch?: Stretch;
|
|
2128
2104
|
}
|
|
2129
|
-
/** Props for `<
|
|
2130
|
-
interface
|
|
2105
|
+
/** Props for `<RddPanelOverlay>`. */
|
|
2106
|
+
interface RddPanelOverlayProps {
|
|
2131
2107
|
children: React$1.ReactNode;
|
|
2132
2108
|
className?: string;
|
|
2133
2109
|
style?: React$1.CSSProperties;
|
|
2134
2110
|
}
|
|
2135
2111
|
/**
|
|
2136
2112
|
* Context provider and layout root for the Panel Overlay system. Wrap your panel content
|
|
2137
|
-
* with this to enable `
|
|
2113
|
+
* with this to enable `RddPanelToolbar`, `RddFloatingWidget`, and `useFloatingWidgets`.
|
|
2138
2114
|
* @example
|
|
2139
2115
|
* function MyPanel() {
|
|
2140
2116
|
* return (
|
|
2141
|
-
* <
|
|
2142
|
-
* <
|
|
2143
|
-
* <div className="panel-body">content</div>
|
|
2144
|
-
* </
|
|
2117
|
+
* <RddPanelOverlay style={{ position: 'relative', width: '100%', height: '100%' }}>
|
|
2118
|
+
* <RddPanelToolbar position="top">...</RddPanelToolbar>
|
|
2119
|
+
* <div className="my-panel-body">content</div>
|
|
2120
|
+
* </RddPanelOverlay>
|
|
2145
2121
|
* );
|
|
2146
2122
|
* }
|
|
2147
2123
|
*/
|
|
2148
|
-
declare function PanelOverlayRoot({ children, className, style }:
|
|
2124
|
+
declare function PanelOverlayRoot({ children, className, style }: RddPanelOverlayProps): React$1.ReactElement;
|
|
2149
2125
|
/** Background style of a `PanelToolbar`. */
|
|
2150
2126
|
type ToolbarVariant = 'transparent' | 'frosted' | 'solid';
|
|
2151
2127
|
/** Visual style applied to `ToolbarButton` and `ToolbarToggle` components. */
|
|
2152
2128
|
type ButtonVariant = 'ghost' | 'soft' | 'outlined' | 'filled';
|
|
2153
|
-
/** Props for `<
|
|
2154
|
-
interface
|
|
2129
|
+
/** Props for `<RddPanelToolbar>`. */
|
|
2130
|
+
interface RddPanelToolbarProps {
|
|
2155
2131
|
/** Edge of the panel overlay to attach to. @see ToolbarPosition */
|
|
2156
2132
|
position: ToolbarPosition;
|
|
2157
2133
|
/** Background style of the toolbar strip. @default 'transparent' */
|
|
@@ -2165,18 +2141,18 @@ interface PanelToolbarProps {
|
|
|
2165
2141
|
children?: React$1.ReactNode;
|
|
2166
2142
|
}
|
|
2167
2143
|
/**
|
|
2168
|
-
* Toolbar strip that attaches to any edge of
|
|
2144
|
+
* Toolbar strip that attaches to any edge of an `RddPanelOverlay`.
|
|
2169
2145
|
* Left/right toolbars inset automatically to avoid overlapping top/bottom toolbars.
|
|
2170
2146
|
* RTL layouts are detected and handled automatically.
|
|
2171
2147
|
* @example
|
|
2172
|
-
* <
|
|
2173
|
-
* <
|
|
2174
|
-
* <
|
|
2175
|
-
* </
|
|
2176
|
-
*/
|
|
2177
|
-
declare function PanelToolbar({ position, variant, buttonVariant, buttonSize, style, className, children }:
|
|
2178
|
-
/** Props for `<
|
|
2179
|
-
interface
|
|
2148
|
+
* <RddPanelToolbar position="top" variant="frosted">
|
|
2149
|
+
* <RddToolbarButton icon={<SaveIcon />} title="Save" onClick={save} />
|
|
2150
|
+
* <RddToolbarToggle icon={<GridIcon />} title="Grid" active={grid} onToggle={() => setGrid(v => !v)} />
|
|
2151
|
+
* </RddPanelToolbar>
|
|
2152
|
+
*/
|
|
2153
|
+
declare function PanelToolbar({ position, variant, buttonVariant, buttonSize, style, className, children }: RddPanelToolbarProps): React$1.ReactElement;
|
|
2154
|
+
/** Props for `<RddToolbarButton>`. */
|
|
2155
|
+
interface RddToolbarButtonProps {
|
|
2180
2156
|
/** Button icon — typically a small SVG component. */
|
|
2181
2157
|
icon: React$1.ReactNode;
|
|
2182
2158
|
/** Click handler. */
|
|
@@ -2188,9 +2164,9 @@ interface ToolbarButtonProps {
|
|
|
2188
2164
|
variant?: ButtonVariant;
|
|
2189
2165
|
}
|
|
2190
2166
|
/** Icon button for use inside a `PanelToolbar`. */
|
|
2191
|
-
declare function ToolbarButton({ icon, onClick, disabled, title, variant }:
|
|
2192
|
-
/** Props for `<
|
|
2193
|
-
interface
|
|
2167
|
+
declare function ToolbarButton({ icon, onClick, disabled, title, variant }: RddToolbarButtonProps): React$1.ReactElement;
|
|
2168
|
+
/** Props for `<RddToolbarToggle>`. */
|
|
2169
|
+
interface RddToolbarToggleProps {
|
|
2194
2170
|
/** Button icon — typically a small SVG component. */
|
|
2195
2171
|
icon: React$1.ReactNode;
|
|
2196
2172
|
/** Whether the toggle is in the active/pressed state. Sets `aria-pressed` automatically. */
|
|
@@ -2204,7 +2180,7 @@ interface ToolbarToggleProps {
|
|
|
2204
2180
|
variant?: ButtonVariant;
|
|
2205
2181
|
}
|
|
2206
2182
|
/** Two-state icon toggle button for use inside a `PanelToolbar`. Sets `aria-pressed` automatically. */
|
|
2207
|
-
declare function ToolbarToggle({ icon, active, onToggle, disabled, title, variant }:
|
|
2183
|
+
declare function ToolbarToggle({ icon, active, onToggle, disabled, title, variant }: RddToolbarToggleProps): React$1.ReactElement;
|
|
2208
2184
|
/** Vertical (or horizontal) divider line between groups of toolbar items. */
|
|
2209
2185
|
declare function ToolbarSeparator(): React$1.ReactElement;
|
|
2210
2186
|
/** Flex-grow spacer that pushes subsequent toolbar items to the far edge. */
|
|
@@ -2217,7 +2193,7 @@ declare function ToolbarItem({ children }: {
|
|
|
2217
2193
|
declare function ToolbarCenter({ children }: {
|
|
2218
2194
|
children: React$1.ReactNode;
|
|
2219
2195
|
}): React$1.ReactElement;
|
|
2220
|
-
/** A single result item returned by `
|
|
2196
|
+
/** A single result item returned by `RddToolbarSearchProps.onSearch`. */
|
|
2221
2197
|
interface SearchResult {
|
|
2222
2198
|
/** Unique identifier for this result — passed to `onSelect`. */
|
|
2223
2199
|
id: string;
|
|
@@ -2230,9 +2206,9 @@ interface SearchResult {
|
|
|
2230
2206
|
/** Optional icon shown to the left of the label. */
|
|
2231
2207
|
icon?: React$1.ReactNode;
|
|
2232
2208
|
}
|
|
2233
|
-
/** Props for `<
|
|
2234
|
-
interface
|
|
2235
|
-
/** Placeholder text shown in the expanded input field. @default 'Search…' */
|
|
2209
|
+
/** Props for `<RddToolbarSearch>`. */
|
|
2210
|
+
interface RddToolbarSearchProps {
|
|
2211
|
+
/** Placeholder text shown in the expanded input field. @default the `searchPlaceholder` message ('Search…') */
|
|
2236
2212
|
placeholder?: string;
|
|
2237
2213
|
/**
|
|
2238
2214
|
* Called with the current query and an `AbortSignal` each time the input changes (debounced).
|
|
@@ -2254,9 +2230,9 @@ interface ToolbarSearchInputProps {
|
|
|
2254
2230
|
* onSelect={result => workspace.focusLayer(result.id)}
|
|
2255
2231
|
* />
|
|
2256
2232
|
*/
|
|
2257
|
-
declare function ToolbarSearchInput({ placeholder, onSearch, onSelect }:
|
|
2258
|
-
/** Props for `<
|
|
2259
|
-
interface
|
|
2233
|
+
declare function ToolbarSearchInput({ placeholder, onSearch, onSelect }: RddToolbarSearchProps): React$1.ReactElement;
|
|
2234
|
+
/** Props for `<RddFloatingWidget>`. */
|
|
2235
|
+
interface RddFloatingWidgetProps {
|
|
2260
2236
|
/** Unique identifier within the panel overlay. Used for z-order and stack tracking. */
|
|
2261
2237
|
id: string;
|
|
2262
2238
|
/** Text shown in the window's header bar. Accepts a plain string or an i18n message descriptor. */
|
|
@@ -2282,7 +2258,7 @@ interface PanelFloatingWindowProps {
|
|
|
2282
2258
|
defaultStretch?: Stretch;
|
|
2283
2259
|
/**
|
|
2284
2260
|
* Controlled stretch state. When provided — **including as `null`** — the caller is the single
|
|
2285
|
-
* source of truth: gestures report through {@link
|
|
2261
|
+
* source of truth: gestures report through {@link RddFloatingWidgetProps.onPlacementChange}
|
|
2286
2262
|
* instead of updating internally, and the caller must echo the new value back. Omit entirely
|
|
2287
2263
|
* (`undefined`) for uncontrolled behaviour, matching `ToolbarToggleItem.active` and
|
|
2288
2264
|
* `Sidebar.activeTabId`.
|
|
@@ -2305,65 +2281,46 @@ interface PanelFloatingWindowProps {
|
|
|
2305
2281
|
children?: React$1.ReactNode;
|
|
2306
2282
|
}
|
|
2307
2283
|
/**
|
|
2308
|
-
*
|
|
2284
|
+
* A floating widget inside a panel — anchored within an `RddPanelOverlay`.
|
|
2309
2285
|
*
|
|
2310
2286
|
* Docks to any corner, drags free of it, and drops back onto one. Windows sharing a corner stack
|
|
2311
2287
|
* along the block axis with animated offsets. An axis can also **span the panel** instead of
|
|
2312
2288
|
* carrying a fixed size, so the window tracks the panel as it resizes — see
|
|
2313
|
-
* {@link
|
|
2289
|
+
* {@link RddFloatingWidgetProps.defaultStretch} and {@link Stretch}.
|
|
2314
2290
|
*
|
|
2315
2291
|
* Resize handles follow what is actually movable: a free-floating window is pinned by nothing and
|
|
2316
2292
|
* offers all eight, while a docked one offers only its free edges — plus both ends of any spanning
|
|
2317
2293
|
* axis, either of which releases it.
|
|
2318
2294
|
*
|
|
2319
2295
|
* @example
|
|
2320
|
-
* const
|
|
2321
|
-
* <
|
|
2296
|
+
* const [infoOpen, setInfoOpen] = useState(false);
|
|
2297
|
+
* <RddFloatingWidget
|
|
2322
2298
|
* id="layer-info" title="Layer Info"
|
|
2323
|
-
* open={
|
|
2299
|
+
* open={infoOpen} onClose={() => setInfoOpen(false)}
|
|
2324
2300
|
* defaultAnchor="top-right" defaultWidth={300} defaultHeight={200}
|
|
2325
2301
|
* >
|
|
2326
2302
|
* <LayerInfoContent />
|
|
2327
|
-
* </
|
|
2303
|
+
* </RddFloatingWidget>
|
|
2328
2304
|
*
|
|
2329
2305
|
* @example
|
|
2330
2306
|
* // A full-width status strip along the bottom, tracking the panel's width.
|
|
2331
2307
|
* // defaultHeight still applies; defaultWidth is what the inline axis returns to if released.
|
|
2332
|
-
* <
|
|
2308
|
+
* <RddFloatingWidget
|
|
2333
2309
|
* id="timeline" title="Timeline"
|
|
2334
2310
|
* open onClose={close}
|
|
2335
2311
|
* defaultAnchor="bottom-left" defaultStretch="width"
|
|
2336
2312
|
* defaultWidth={240} defaultHeight={120}
|
|
2337
2313
|
* >
|
|
2338
2314
|
* <TimelineContent />
|
|
2339
|
-
* </
|
|
2340
|
-
*/
|
|
2341
|
-
declare function PanelFloatingWindow(props: PanelFloatingWindowProps): React$1.ReactElement | null;
|
|
2342
|
-
/** Return type of `usePanelFloatingWindow`. @see usePanelFloatingWindow */
|
|
2343
|
-
interface UsePanelFloatingWindowReturn {
|
|
2344
|
-
/** Whether the floating window is currently open. */
|
|
2345
|
-
isOpen: boolean;
|
|
2346
|
-
/** Open the floating window. */
|
|
2347
|
-
open(): void;
|
|
2348
|
-
/** Close the floating window. */
|
|
2349
|
-
close(): void;
|
|
2350
|
-
}
|
|
2351
|
-
/**
|
|
2352
|
-
* Manages the open/close boolean state for a single `PanelFloatingWindow`.
|
|
2353
|
-
* Pass `isOpen` to `open`, `close` to `onClose` on the component directly.
|
|
2354
|
-
* @returns A stable `UsePanelFloatingWindowReturn` object.
|
|
2355
|
-
* @example
|
|
2356
|
-
* const info = usePanelFloatingWindow();
|
|
2357
|
-
* <PanelFloatingWindow id="info" open={info.isOpen} onClose={info.close} ... />
|
|
2315
|
+
* </RddFloatingWidget>
|
|
2358
2316
|
*/
|
|
2359
|
-
declare function
|
|
2317
|
+
declare function PanelFloatingWindow(props: RddFloatingWidgetProps): React$1.ReactElement | null;
|
|
2360
2318
|
/**
|
|
2361
|
-
*
|
|
2362
|
-
* @see usePanelFloatingWindowManager
|
|
2319
|
+
* What `useFloatingWidgets()` returns.
|
|
2363
2320
|
*/
|
|
2364
|
-
interface
|
|
2321
|
+
interface FloatingWidgetsApi {
|
|
2365
2322
|
/** Spawn or reconfigure a named window. Safe to call with an already-open ID to update config. */
|
|
2366
|
-
open(id: string, config:
|
|
2323
|
+
open(id: string, config: ManagedWidget): void;
|
|
2367
2324
|
/** Close a named window by ID. No-op if the window is not open. */
|
|
2368
2325
|
close(id: string): void;
|
|
2369
2326
|
/** Close all managed windows. */
|
|
@@ -2375,28 +2332,28 @@ interface PanelFloatingWindowManagerHandle {
|
|
|
2375
2332
|
}
|
|
2376
2333
|
/**
|
|
2377
2334
|
* Imperative hook for spawning N named floating windows at runtime from data or event handlers.
|
|
2378
|
-
* All
|
|
2379
|
-
* and accept the same placement options — including {@link
|
|
2335
|
+
* All widgets share z-ordering, drag, and corner-docking infrastructure of the `RddPanelOverlay`,
|
|
2336
|
+
* and accept the same placement options — including {@link ManagedWidget.stretch} to span an
|
|
2380
2337
|
* axis of the panel.
|
|
2381
2338
|
*
|
|
2382
|
-
* Must be called inside a **descendant** of `
|
|
2383
|
-
* @returns A stable `
|
|
2339
|
+
* Must be called inside a **descendant** of `RddPanelOverlay`, not in the component that renders it.
|
|
2340
|
+
* @returns A stable `FloatingWidgetsApi`.
|
|
2384
2341
|
* @example
|
|
2385
|
-
* const manager =
|
|
2342
|
+
* const manager = useFloatingWidgets();
|
|
2386
2343
|
* manager.open('feature-42', { title: 'Feature 42', content: <FeatureDetail id={42} />, anchor: 'top-right' });
|
|
2387
2344
|
*
|
|
2388
2345
|
* // A full-width strip along the bottom edge:
|
|
2389
2346
|
* manager.open('timeline', { title: 'Timeline', content: <Timeline />, anchor: 'bottom-left', stretch: 'width', height: 120 });
|
|
2390
2347
|
*/
|
|
2391
|
-
declare function usePanelFloatingWindowManager():
|
|
2348
|
+
declare function usePanelFloatingWindowManager(): FloatingWidgetsApi;
|
|
2392
2349
|
|
|
2393
2350
|
/**
|
|
2394
2351
|
* @file PanelContributionContext.tsx
|
|
2395
2352
|
* @description Lets any panel publish toolbar items and/or sidebar sections that
|
|
2396
2353
|
* should only be surfaced while it is the globally active panel (`state.activePanelId`).
|
|
2397
2354
|
* Optional, additive module — `DockableDesktopProvider` wires it up automatically.
|
|
2398
|
-
* Neither `<
|
|
2399
|
-
* merges `
|
|
2355
|
+
* Neither `<RddToolbar>` nor `<RddSidebar>` reads from this automatically; the app shell
|
|
2356
|
+
* merges `useActiveContribution()`'s result into its own `items`/`tabs` calls.
|
|
2400
2357
|
*/
|
|
2401
2358
|
|
|
2402
2359
|
/** A single named, labeled slot of content a panel contributes to the app's Sidebar while active. */
|
|
@@ -2416,14 +2373,6 @@ interface PanelContribution {
|
|
|
2416
2373
|
toolbarItems?: ToolbarItem$1[];
|
|
2417
2374
|
sidebarSections?: PanelSidebarSection[];
|
|
2418
2375
|
}
|
|
2419
|
-
/**
|
|
2420
|
-
* Provider enabling `usePanelContribution()` / `useActivePanelContribution()`.
|
|
2421
|
-
* Mounted automatically by `DockableDesktopProvider` — only needed manually when
|
|
2422
|
-
* composing `WindowManagerProvider` directly without it.
|
|
2423
|
-
*/
|
|
2424
|
-
declare const PanelContributionProvider: React$1.FC<{
|
|
2425
|
-
children: React$1.ReactNode;
|
|
2426
|
-
}>;
|
|
2427
2376
|
/**
|
|
2428
2377
|
* Publish this panel's toolbar items and/or sidebar sections. Call on every render —
|
|
2429
2378
|
* republishes automatically whenever `contribution` changes, and is cleared when the
|
|
@@ -2431,9 +2380,9 @@ declare const PanelContributionProvider: React$1.FC<{
|
|
|
2431
2380
|
* `useMemo`/`useCallback`) to avoid republishing on every unrelated re-render.
|
|
2432
2381
|
*
|
|
2433
2382
|
* Contributions are only ever surfaced while this panel is `state.activePanelId` —
|
|
2434
|
-
* see `
|
|
2383
|
+
* see `useActiveContribution()`.
|
|
2435
2384
|
*
|
|
2436
|
-
* @throws Error if used outside of a {@link
|
|
2385
|
+
* @throws Error if used outside of a {@link DockableDesktopProvider}.
|
|
2437
2386
|
* @example
|
|
2438
2387
|
* function MapPanel() {
|
|
2439
2388
|
* const [controller, setController] = useState<'pan' | 'draw' | 'measure'>('pan');
|
|
@@ -2452,13 +2401,13 @@ declare function usePanelContribution(contribution: PanelContribution): void;
|
|
|
2452
2401
|
* Returns whatever the currently active panel (`state.activePanelId`) has published
|
|
2453
2402
|
* via `usePanelContribution()`, or `null` if no panel is active or the active panel
|
|
2454
2403
|
* hasn't contributed anything. Intended for the app shell to merge into its own
|
|
2455
|
-
* `<
|
|
2404
|
+
* `<RddToolbar items={...}>` / `<RddSidebar tabs={...}>` calls.
|
|
2456
2405
|
*
|
|
2457
|
-
* @throws Error if used outside of a {@link
|
|
2406
|
+
* @throws Error if used outside of a {@link DockableDesktopProvider}.
|
|
2458
2407
|
*/
|
|
2459
2408
|
declare function useActivePanelContribution(): PanelContribution | null;
|
|
2460
2409
|
/**
|
|
2461
|
-
* Converts a contributed sidebar section into a `SidebarTab` for `<
|
|
2410
|
+
* Converts a contributed sidebar section into a `SidebarTab` for `<RddSidebar tabs={...}>`.
|
|
2462
2411
|
* `SidebarTab.icon` is optional but recommended unless the tab is `hidden`; supply
|
|
2463
2412
|
* `fallbackIcon` for sections that omit one.
|
|
2464
2413
|
* `eagerMount`/`preserveState` have no contribution-side equivalent — a contribution
|
|
@@ -2466,16 +2415,16 @@ declare function useActivePanelContribution(): PanelContribution | null;
|
|
|
2466
2415
|
*/
|
|
2467
2416
|
declare function sidebarSectionToTab(section: PanelSidebarSection, fallbackIcon?: React$1.ReactNode): SidebarTab;
|
|
2468
2417
|
/**
|
|
2469
|
-
* Convenience wrapper around `
|
|
2418
|
+
* Convenience wrapper around `useActiveContribution()` for the common case:
|
|
2470
2419
|
* append the active panel's contributed toolbar items (behind a separator) to a
|
|
2471
2420
|
* static list. Returns `staticItems` unchanged when there's nothing to add.
|
|
2472
2421
|
* For manual control (a different merge position, no separator, etc.), call
|
|
2473
|
-
* `
|
|
2422
|
+
* `useActiveContribution()` directly instead.
|
|
2474
2423
|
*/
|
|
2475
2424
|
declare function useMergedToolbarItems(staticItems: ToolbarItem$1[]): ToolbarItem$1[];
|
|
2476
2425
|
/**
|
|
2477
|
-
* Convenience wrapper around `
|
|
2478
|
-
* append the active panel's contributed sidebar sections (via `
|
|
2426
|
+
* Convenience wrapper around `useActiveContribution()` for the common case:
|
|
2427
|
+
* append the active panel's contributed sidebar sections (via `sectionToTab`)
|
|
2479
2428
|
* to a static tab list, as dynamic tabs that appear only while their panel is active.
|
|
2480
2429
|
* Returns `staticTabs` unchanged when there's nothing to add.
|
|
2481
2430
|
*/
|
|
@@ -2549,15 +2498,29 @@ interface ResizeConstraints {
|
|
|
2549
2498
|
*/
|
|
2550
2499
|
declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, start: ResizeRect, constraints: ResizeConstraints): ResizeRect;
|
|
2551
2500
|
|
|
2501
|
+
type ColorScheme = 'dark' | 'light';
|
|
2552
2502
|
/**
|
|
2553
2503
|
* Reactively reads the workspace's current `data-color-scheme` attribute
|
|
2554
|
-
* (set on `document.documentElement` by `<
|
|
2504
|
+
* (set on `document.documentElement` by `<RddDesktop />`), returning
|
|
2555
2505
|
* `'dark'` or `'light'` and re-rendering whenever it changes.
|
|
2556
2506
|
*
|
|
2557
2507
|
* Useful for panel content that needs to react to the same scheme the
|
|
2558
2508
|
* workspace itself is using — e.g. swapping a map's tile layer or an
|
|
2559
2509
|
* embedded editor's theme to match.
|
|
2510
|
+
*
|
|
2511
|
+
* Returns `'dark'` when rendered on the server.
|
|
2512
|
+
*/
|
|
2513
|
+
declare function useColorScheme(): ColorScheme;
|
|
2514
|
+
|
|
2515
|
+
declare function isElementRtl(el: HTMLElement | null): boolean;
|
|
2516
|
+
/**
|
|
2517
|
+
* Whether `el` is laid out right-to-left, as the browser computes it — from a `dir` attribute on
|
|
2518
|
+
* any ancestor, the CSS `direction` property, or the workspace's own `setDirection`.
|
|
2519
|
+
*
|
|
2520
|
+
* Use this, not `document.documentElement.dir`, wherever a pointer delta (physical) is turned into
|
|
2521
|
+
* a size, side or index (logical): RTL is often set on `<body>` or a wrapper rather than `<html>`, and
|
|
2522
|
+
* the workspace can be RTL on an LTR page.
|
|
2560
2523
|
*/
|
|
2561
|
-
declare function
|
|
2524
|
+
declare function isComputedRtl(el: Element | null | undefined): boolean;
|
|
2562
2525
|
|
|
2563
|
-
export { type
|
|
2526
|
+
export { type BuiltInEvents, type ButtonVariant, type CloseOptions, 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 PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, 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 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 Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, 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 };
|