react-dockable-desktop 1.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 +327 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +427 -0
- package/dist/index.d.ts +427 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1766 -0
- package/package.json +70 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ComponentType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface WindowManagerProps {
|
|
5
|
+
skin?: string;
|
|
6
|
+
defaultPanelIcon?: React__default.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const WindowManager: React__default.FC<WindowManagerProps>;
|
|
9
|
+
|
|
10
|
+
interface PanelRegistryEntry {
|
|
11
|
+
Component: ComponentType<any>;
|
|
12
|
+
defaultOptions?: {
|
|
13
|
+
title?: string;
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
initialTarget?: 'floating' | 'docked' | 'tabbed';
|
|
16
|
+
favoritePosition?: {
|
|
17
|
+
x: number | string;
|
|
18
|
+
y: number | string;
|
|
19
|
+
width: number | string;
|
|
20
|
+
height: number | string;
|
|
21
|
+
};
|
|
22
|
+
canDrag?: boolean;
|
|
23
|
+
canMinimize?: boolean;
|
|
24
|
+
canClose?: boolean;
|
|
25
|
+
defaultStickyRight?: boolean;
|
|
26
|
+
defaultStickyBottom?: boolean;
|
|
27
|
+
disableLivePreview?: boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
declare class PanelRegistryClass {
|
|
31
|
+
private registry;
|
|
32
|
+
register<P extends object>(id: string, Component: ComponentType<P>, defaultOptions?: PanelRegistryEntry['defaultOptions']): void;
|
|
33
|
+
get(id: string): PanelRegistryEntry | undefined;
|
|
34
|
+
getRegisteredIds(): string[];
|
|
35
|
+
}
|
|
36
|
+
declare const PanelRegistry: PanelRegistryClass;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Default English messages for every action exposed by Dockable Desktop.
|
|
40
|
+
*
|
|
41
|
+
* Each value's `id` is the react-intl message ID that the consumer should
|
|
42
|
+
* define in their IntlProvider messages table. The `defaultMessage` is used
|
|
43
|
+
* as a fallback when no external formatter is provided.
|
|
44
|
+
*
|
|
45
|
+
* Pass a partial or full override to <WindowManagerProvider predefinedMessages={…} />
|
|
46
|
+
* to customise labels without replacing the whole table.
|
|
47
|
+
*/
|
|
48
|
+
declare const defaultPredefinedMessages: {
|
|
49
|
+
readonly floatWindow: {
|
|
50
|
+
readonly id: "dockable-desktop-floatWindow";
|
|
51
|
+
readonly defaultMessage: "Float Window";
|
|
52
|
+
};
|
|
53
|
+
readonly minimizePanel: {
|
|
54
|
+
readonly id: "dockable-desktop-minimizePanel";
|
|
55
|
+
readonly defaultMessage: "Minimize Panel";
|
|
56
|
+
};
|
|
57
|
+
readonly closeTab: {
|
|
58
|
+
readonly id: "dockable-desktop-closeTab";
|
|
59
|
+
readonly defaultMessage: "Close Tab";
|
|
60
|
+
};
|
|
61
|
+
readonly restorePanel: {
|
|
62
|
+
readonly id: "dockable-desktop-restorePanel";
|
|
63
|
+
readonly defaultMessage: "Restore Panel";
|
|
64
|
+
};
|
|
65
|
+
readonly maximizePanel: {
|
|
66
|
+
readonly id: "dockable-desktop-maximizePanel";
|
|
67
|
+
readonly defaultMessage: "Maximize Panel";
|
|
68
|
+
};
|
|
69
|
+
readonly closePanel: {
|
|
70
|
+
readonly id: "dockable-desktop-closePanel";
|
|
71
|
+
readonly defaultMessage: "Close Panel";
|
|
72
|
+
};
|
|
73
|
+
readonly dockWindow: {
|
|
74
|
+
readonly id: "dockable-desktop-dockWindow";
|
|
75
|
+
readonly defaultMessage: "Dock Window";
|
|
76
|
+
};
|
|
77
|
+
readonly minimize: {
|
|
78
|
+
readonly id: "dockable-desktop-minimize";
|
|
79
|
+
readonly defaultMessage: "Minimize";
|
|
80
|
+
};
|
|
81
|
+
readonly maximize: {
|
|
82
|
+
readonly id: "dockable-desktop-maximize";
|
|
83
|
+
readonly defaultMessage: "Maximize";
|
|
84
|
+
};
|
|
85
|
+
readonly restoreSize: {
|
|
86
|
+
readonly id: "dockable-desktop-restoreSize";
|
|
87
|
+
readonly defaultMessage: "Restore Size";
|
|
88
|
+
};
|
|
89
|
+
readonly close: {
|
|
90
|
+
readonly id: "dockable-desktop-close";
|
|
91
|
+
readonly defaultMessage: "Close";
|
|
92
|
+
};
|
|
93
|
+
readonly closeEmptyGroup: {
|
|
94
|
+
readonly id: "dockable-desktop-closeEmptyGroup";
|
|
95
|
+
readonly defaultMessage: "Close empty split group";
|
|
96
|
+
};
|
|
97
|
+
readonly anchorToRightEdge: {
|
|
98
|
+
readonly id: "dockable-desktop-anchorToRightEdge";
|
|
99
|
+
readonly defaultMessage: "Anchor to Right Edge";
|
|
100
|
+
};
|
|
101
|
+
readonly anchorToBottomEdge: {
|
|
102
|
+
readonly id: "dockable-desktop-anchorToBottomEdge";
|
|
103
|
+
readonly defaultMessage: "Anchor to Bottom Edge";
|
|
104
|
+
};
|
|
105
|
+
readonly windowAnchoringOptions: {
|
|
106
|
+
readonly id: "dockable-desktop-windowAnchoringOptions";
|
|
107
|
+
readonly defaultMessage: "Window Anchoring Options";
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Union of every key in `defaultPredefinedMessages`.
|
|
112
|
+
*
|
|
113
|
+
* Import this type in your i18n message tables to get a compile-time
|
|
114
|
+
* guarantee that all keys are present and no typos exist:
|
|
115
|
+
*
|
|
116
|
+
* import type { PredefinedMessageKey } from 'react-dockable-desktop';
|
|
117
|
+
*
|
|
118
|
+
* const myMessages: Record<PredefinedMessageKey, string> = { ... };
|
|
119
|
+
*/
|
|
120
|
+
type PredefinedMessageKey = keyof typeof defaultPredefinedMessages;
|
|
121
|
+
|
|
122
|
+
interface ContextMenuPredefinedMessage {
|
|
123
|
+
id: string;
|
|
124
|
+
defaultMessage?: string;
|
|
125
|
+
values?: Record<string, string | number>;
|
|
126
|
+
}
|
|
127
|
+
type MessageFormatter = (msg: ContextMenuPredefinedMessage) => string;
|
|
128
|
+
type SplitOrientation = 'horizontal' | 'vertical';
|
|
129
|
+
interface LayoutGridNode {
|
|
130
|
+
type: 'branch';
|
|
131
|
+
orientation: SplitOrientation;
|
|
132
|
+
children: LayoutNode[];
|
|
133
|
+
sizes: number[];
|
|
134
|
+
}
|
|
135
|
+
interface LayoutLeafNode {
|
|
136
|
+
type: 'leaf';
|
|
137
|
+
id: string;
|
|
138
|
+
panels: string[];
|
|
139
|
+
activePanelId: string | null;
|
|
140
|
+
canClose?: boolean;
|
|
141
|
+
/** When true the leaf group persists in the layout even after its last panel
|
|
142
|
+
* is closed/floated/minimised. Defaults to false (auto-remove). */
|
|
143
|
+
keepOnEmpty?: boolean;
|
|
144
|
+
}
|
|
145
|
+
type LayoutNode = LayoutGridNode | LayoutLeafNode;
|
|
146
|
+
interface FloatingWindow {
|
|
147
|
+
id: string;
|
|
148
|
+
x: number | string;
|
|
149
|
+
y: number | string;
|
|
150
|
+
width: number | string;
|
|
151
|
+
height: number | string;
|
|
152
|
+
z: number;
|
|
153
|
+
maximized?: boolean;
|
|
154
|
+
stickyRight?: boolean;
|
|
155
|
+
stickyBottom?: boolean;
|
|
156
|
+
}
|
|
157
|
+
interface PanelInfo {
|
|
158
|
+
id: string;
|
|
159
|
+
title: string | ContextMenuPredefinedMessage;
|
|
160
|
+
component: string;
|
|
161
|
+
state: 'docked' | 'floating' | 'minimized';
|
|
162
|
+
previousState?: 'docked' | 'floating';
|
|
163
|
+
lastFloatingRect?: {
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
stickyRight?: boolean;
|
|
169
|
+
stickyBottom?: boolean;
|
|
170
|
+
};
|
|
171
|
+
lastLeafId?: string;
|
|
172
|
+
dirty?: boolean;
|
|
173
|
+
}
|
|
174
|
+
interface WindowState {
|
|
175
|
+
gridRoot: LayoutNode;
|
|
176
|
+
floating: FloatingWindow[];
|
|
177
|
+
minimized: {
|
|
178
|
+
id: string;
|
|
179
|
+
title: string | ContextMenuPredefinedMessage;
|
|
180
|
+
component: string;
|
|
181
|
+
}[];
|
|
182
|
+
panels: Record<string, PanelInfo>;
|
|
183
|
+
draggedPanelId: string | null;
|
|
184
|
+
pendingClose: {
|
|
185
|
+
id: string;
|
|
186
|
+
resolve: (discard: boolean) => void;
|
|
187
|
+
} | null;
|
|
188
|
+
}
|
|
189
|
+
interface WindowActions {
|
|
190
|
+
openPanel: (id: string, component: string, options?: {
|
|
191
|
+
title?: string | ContextMenuPredefinedMessage;
|
|
192
|
+
initialTarget?: 'floating' | 'docked' | 'tabbed';
|
|
193
|
+
stickyRight?: boolean;
|
|
194
|
+
stickyBottom?: boolean;
|
|
195
|
+
}) => void;
|
|
196
|
+
closePanel: (id: string) => void;
|
|
197
|
+
minimizePanel: (id: string) => void;
|
|
198
|
+
restorePanel: (id: string) => void;
|
|
199
|
+
floatPanel: (id: string, rect?: {
|
|
200
|
+
x: number;
|
|
201
|
+
y: number;
|
|
202
|
+
width: number;
|
|
203
|
+
height: number;
|
|
204
|
+
}) => void;
|
|
205
|
+
dockPanel: (id: string, targetLeafId?: string) => void;
|
|
206
|
+
maximizePanel: (id: string) => void;
|
|
207
|
+
updateSplitSizes: (path: number[], sizes: number[]) => void;
|
|
208
|
+
updateFloatingPosition: (id: string, updates: Partial<Pick<FloatingWindow, 'x' | 'y' | 'width' | 'height' | 'stickyRight' | 'stickyBottom'>>) => void;
|
|
209
|
+
bringToFront: (id: string) => void;
|
|
210
|
+
saveLayout: () => string;
|
|
211
|
+
loadLayout: (layoutJson: string) => void;
|
|
212
|
+
publish: (event: string, data: any) => void;
|
|
213
|
+
subscribe: (event: string, callback: (data: any) => void) => () => void;
|
|
214
|
+
setDraggedPanelId: (id: string | null) => void;
|
|
215
|
+
dockPanelToGroup: (id: string, targetLeafId: string, position: 'left' | 'right' | 'top' | 'bottom' | 'center') => void;
|
|
216
|
+
movePanelOrder: (panelId: string, targetLeafId: string, targetIndex: number) => void;
|
|
217
|
+
closeLeafGroup: (leafId: string) => void;
|
|
218
|
+
registerCloseGuard: (id: string, guard: () => boolean | Promise<boolean>) => void;
|
|
219
|
+
unregisterCloseGuard: (id: string) => void;
|
|
220
|
+
setPanelDirty: (id: string, dirty: boolean) => void;
|
|
221
|
+
updatePanelTitle: (id: string, title: string | ContextMenuPredefinedMessage) => void;
|
|
222
|
+
requestClosePanel: (id: string, options?: {
|
|
223
|
+
force?: boolean;
|
|
224
|
+
}) => Promise<void>;
|
|
225
|
+
resolvePendingClose: (discard: boolean) => void;
|
|
226
|
+
dockPanelToWorkspaceEdge: (id: string, position: 'left' | 'right' | 'top' | 'bottom') => void;
|
|
227
|
+
}
|
|
228
|
+
interface StyleClasses {
|
|
229
|
+
modalClass?: string;
|
|
230
|
+
modalBodyClass?: string;
|
|
231
|
+
sidePanelClass?: string;
|
|
232
|
+
sidePanelBodyClass?: string;
|
|
233
|
+
windowClass?: string;
|
|
234
|
+
windowBodyClass?: string;
|
|
235
|
+
}
|
|
236
|
+
declare const useStyleClasses: () => StyleClasses;
|
|
237
|
+
interface WindowManagerProviderProps {
|
|
238
|
+
children: React__default.ReactNode;
|
|
239
|
+
formatMessage?: MessageFormatter;
|
|
240
|
+
predefinedMessages?: Record<string, ContextMenuPredefinedMessage>;
|
|
241
|
+
modalClass?: string;
|
|
242
|
+
modalBodyClass?: string;
|
|
243
|
+
sidePanelClass?: string;
|
|
244
|
+
sidePanelBodyClass?: string;
|
|
245
|
+
windowClass?: string;
|
|
246
|
+
windowBodyClass?: string;
|
|
247
|
+
}
|
|
248
|
+
declare const WindowManagerProvider: React__default.FC<WindowManagerProviderProps>;
|
|
249
|
+
declare const useWindowManagerState: () => WindowState;
|
|
250
|
+
declare const useWindowManagerActions: () => WindowActions;
|
|
251
|
+
declare const useFormatMessage: () => MessageFormatter;
|
|
252
|
+
declare const formatLabel: (label: string | ContextMenuPredefinedMessage | undefined, formatter: MessageFormatter) => string;
|
|
253
|
+
declare const usePanelContext: () => {
|
|
254
|
+
publish: (event: string, data: any) => void;
|
|
255
|
+
subscribe: (event: string, callback: (data: any) => void) => () => void;
|
|
256
|
+
};
|
|
257
|
+
declare const usePredefinedMessages: () => Record<"floatWindow" | "minimizePanel" | "closeTab" | "restorePanel" | "maximizePanel" | "closePanel" | "dockWindow" | "minimize" | "maximize" | "restoreSize" | "close" | "closeEmptyGroup" | "anchorToRightEdge" | "anchorToBottomEdge" | "windowAnchoringOptions", ContextMenuPredefinedMessage>;
|
|
258
|
+
|
|
259
|
+
interface CloseOptions {
|
|
260
|
+
force?: boolean;
|
|
261
|
+
}
|
|
262
|
+
type ContainerType = 'left-panel' | 'right-panel' | 'modal' | 'dockable-panel' | 'standalone';
|
|
263
|
+
interface FormContainerContract {
|
|
264
|
+
requestClose: (options?: CloseOptions) => void;
|
|
265
|
+
setDirty: (dirty: boolean) => void;
|
|
266
|
+
onCloseRequested: (handler: () => boolean | Promise<boolean>) => (() => void);
|
|
267
|
+
setTitle: (title: string | {
|
|
268
|
+
id: string;
|
|
269
|
+
defaultMessage: string;
|
|
270
|
+
values?: Record<string, any>;
|
|
271
|
+
}) => void;
|
|
272
|
+
setIcon?: (icon: React.ReactNode) => void;
|
|
273
|
+
containerType?: ContainerType;
|
|
274
|
+
instanceId: string;
|
|
275
|
+
onClose?: (handler: () => void) => () => void;
|
|
276
|
+
onMinimize?: (handler: () => void) => () => void;
|
|
277
|
+
onRestore?: (handler: () => void) => () => void;
|
|
278
|
+
onResize?: (handler: (width: number, height: number) => void) => () => void;
|
|
279
|
+
}
|
|
280
|
+
declare const FormContainerContext: React$1.Context<FormContainerContract>;
|
|
281
|
+
declare const FormContainerProvider: React$1.Provider<FormContainerContract>;
|
|
282
|
+
declare const useFormContainer: () => FormContainerContract;
|
|
283
|
+
|
|
284
|
+
type PanelInstanceId = string;
|
|
285
|
+
interface PanelTitleDescriptor {
|
|
286
|
+
id: string;
|
|
287
|
+
defaultMessage?: string;
|
|
288
|
+
values?: Record<string, string | number>;
|
|
289
|
+
}
|
|
290
|
+
type PanelTitle = string | PanelTitleDescriptor;
|
|
291
|
+
interface SidePanelOptions {
|
|
292
|
+
title?: PanelTitle;
|
|
293
|
+
icon?: React__default.ReactNode;
|
|
294
|
+
width?: number | string;
|
|
295
|
+
}
|
|
296
|
+
interface ModalOptions {
|
|
297
|
+
title?: PanelTitle;
|
|
298
|
+
icon?: React__default.ReactNode;
|
|
299
|
+
size?: 'small' | 'medium' | 'large' | 'fullscreen' | 'auto';
|
|
300
|
+
closable?: boolean;
|
|
301
|
+
}
|
|
302
|
+
interface PanelInstance {
|
|
303
|
+
id: PanelInstanceId;
|
|
304
|
+
Component: ComponentType<any>;
|
|
305
|
+
props: Record<string, any>;
|
|
306
|
+
containerType: 'left-panel' | 'right-panel' | 'modal';
|
|
307
|
+
options: SidePanelOptions | ModalOptions;
|
|
308
|
+
dirty?: boolean;
|
|
309
|
+
}
|
|
310
|
+
interface PanelState {
|
|
311
|
+
leftPanel: PanelInstance | null;
|
|
312
|
+
rightPanel: PanelInstance | null;
|
|
313
|
+
modals: PanelInstance[];
|
|
314
|
+
}
|
|
315
|
+
interface PanelActions {
|
|
316
|
+
openLeftPanel: <P extends object>(Component: ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<PanelInstanceId | null>;
|
|
317
|
+
openRightPanel: <P extends object>(Component: ComponentType<P>, props: P, options?: SidePanelOptions) => Promise<PanelInstanceId | null>;
|
|
318
|
+
openModal: <P extends object>(Component: ComponentType<P>, props: P, options?: ModalOptions) => PanelInstanceId;
|
|
319
|
+
close: (id: PanelInstanceId) => void;
|
|
320
|
+
closeAll: () => void;
|
|
321
|
+
closeAllModals: () => void;
|
|
322
|
+
getInstance: (id: PanelInstanceId) => PanelInstance | undefined;
|
|
323
|
+
updateInstance: (id: PanelInstanceId, updates: Partial<Pick<PanelInstance, 'props' | 'options' | 'dirty'>>) => void;
|
|
324
|
+
setDirty: (id: PanelInstanceId, dirty: boolean) => void;
|
|
325
|
+
registerCloseHandler: (id: PanelInstanceId, handler: () => Promise<boolean>) => void;
|
|
326
|
+
unregisterCloseHandler: (id: PanelInstanceId) => void;
|
|
327
|
+
}
|
|
328
|
+
declare const PanelProvider: React__default.FC<{
|
|
329
|
+
children: ReactNode;
|
|
330
|
+
}>;
|
|
331
|
+
declare const usePanelState: () => PanelState;
|
|
332
|
+
declare const usePanelActions: () => PanelActions;
|
|
333
|
+
|
|
334
|
+
declare const ModalStackRenderer: React__default.FC;
|
|
335
|
+
|
|
336
|
+
interface SidePanelRendererProps {
|
|
337
|
+
/**
|
|
338
|
+
* Default panel width applied when openLeftPanel/openRightPanel do not specify one.
|
|
339
|
+
* Accepts a number (treated as px) or any CSS width string (e.g. '40vw').
|
|
340
|
+
* Falls back to 400px if omitted.
|
|
341
|
+
*/
|
|
342
|
+
defaultWidth?: number | string;
|
|
343
|
+
}
|
|
344
|
+
declare const SidePanelRenderer: React__default.FC<SidePanelRendererProps>;
|
|
345
|
+
declare const LeftPanelRenderer: React__default.FC<SidePanelRendererProps>;
|
|
346
|
+
declare const RightPanelRenderer: React__default.FC<SidePanelRendererProps>;
|
|
347
|
+
|
|
348
|
+
interface ConfirmationFormProps {
|
|
349
|
+
title?: string | {
|
|
350
|
+
id: string;
|
|
351
|
+
defaultMessage?: string;
|
|
352
|
+
values?: any;
|
|
353
|
+
};
|
|
354
|
+
message: string | {
|
|
355
|
+
id: string;
|
|
356
|
+
defaultMessage?: string;
|
|
357
|
+
values?: any;
|
|
358
|
+
};
|
|
359
|
+
alert?: string;
|
|
360
|
+
alertType?: 'info' | 'warning' | 'success' | 'danger';
|
|
361
|
+
useYesNoTitles?: boolean;
|
|
362
|
+
onOK?: () => void;
|
|
363
|
+
onCancel?: () => void;
|
|
364
|
+
}
|
|
365
|
+
declare const ConfirmationForm: React__default.FC<ConfirmationFormProps>;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Per-tab configuration supplied by the consuming application.
|
|
369
|
+
*/
|
|
370
|
+
interface SidebarTab {
|
|
371
|
+
id: string;
|
|
372
|
+
label: string;
|
|
373
|
+
icon: React__default.ReactNode;
|
|
374
|
+
/**
|
|
375
|
+
* Mount immediately when the Sidebar first renders, not on first user click.
|
|
376
|
+
* Implies `preserveState: true`.
|
|
377
|
+
* Use when other parts of the app need to interact with the panel before
|
|
378
|
+
* the user has opened it (e.g. push data into a context, warm up a WebGL map).
|
|
379
|
+
* Default: false
|
|
380
|
+
*/
|
|
381
|
+
eagerMount?: boolean;
|
|
382
|
+
/**
|
|
383
|
+
* Once mounted for the first time, keep the component alive in the DOM
|
|
384
|
+
* behind `display: none` when closed instead of unmounting it.
|
|
385
|
+
* Use for panels with expensive local state (long forms, WebGL scenes, etc.).
|
|
386
|
+
* Ignored when `eagerMount` is true (eagerly mounted panels are always preserved).
|
|
387
|
+
* Default: false
|
|
388
|
+
*/
|
|
389
|
+
preserveState?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Called to obtain the drawer content for this tab.
|
|
392
|
+
* @param tabId - the id of this tab
|
|
393
|
+
* @param onClose - call to collapse the sidebar drawer
|
|
394
|
+
* @param onOpen - call to expand the drawer and select this tab programmatically
|
|
395
|
+
* (useful when the panel itself detects it has new data to show)
|
|
396
|
+
*/
|
|
397
|
+
renderContent: (tabId: string, onClose: () => void, onOpen: () => void) => React__default.ReactNode;
|
|
398
|
+
}
|
|
399
|
+
interface SidebarProps {
|
|
400
|
+
/** Which side the tab strip and drawer appear on. Default: 'right' */
|
|
401
|
+
position?: 'left' | 'right';
|
|
402
|
+
tabs: SidebarTab[];
|
|
403
|
+
/** Width of the open drawer. Default: '220px' */
|
|
404
|
+
drawerWidth?: string;
|
|
405
|
+
/** Controlled active tab id. Leave undefined to use internal state. */
|
|
406
|
+
activeTabId?: string | null;
|
|
407
|
+
/** Called when the active tab changes in uncontrolled mode. */
|
|
408
|
+
onActiveTabChange?: (tabId: string | null) => void;
|
|
409
|
+
/** Main workspace content, rendered between the strip and drawer (or around them). */
|
|
410
|
+
children?: React__default.ReactNode;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Imperative handle exposed by <Sidebar ref={...}> via forwardRef.
|
|
414
|
+
* Allows external components (outside the sidebar tree) to control
|
|
415
|
+
* which tab is open without prop drilling.
|
|
416
|
+
*/
|
|
417
|
+
interface SidebarHandle {
|
|
418
|
+
/** Expand the drawer and activate the tab with the given id. */
|
|
419
|
+
openTab: (tabId: string) => void;
|
|
420
|
+
/** Collapse the drawer (equivalent to clicking the active tab icon). */
|
|
421
|
+
closeDrawer: () => void;
|
|
422
|
+
/** Returns the currently active tab id, or null if the drawer is collapsed. */
|
|
423
|
+
getActiveTab: () => string | null;
|
|
424
|
+
}
|
|
425
|
+
declare const Sidebar: React__default.ForwardRefExoticComponent<SidebarProps & React__default.RefAttributes<SidebarHandle>>;
|
|
426
|
+
|
|
427
|
+
export { type CloseOptions, ConfirmationForm, type ConfirmationFormProps, type ContextMenuPredefinedMessage, type FloatingWindow, FormContainerContext, type FormContainerContract, FormContainerProvider, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, LeftPanelRenderer, type MessageFormatter, type ModalOptions, ModalStackRenderer, type PanelActions, type PanelInfo, type PanelInstance, type PanelInstanceId, PanelProvider, PanelRegistry, type PanelState, type PanelTitle, type PredefinedMessageKey, RightPanelRenderer, type SidePanelOptions, SidePanelRenderer, type SidePanelRendererProps, Sidebar, type SidebarHandle, type SidebarProps, type SidebarTab, type SplitOrientation, type StyleClasses, type WindowActions, WindowManager, WindowManagerProvider, type WindowState, defaultPredefinedMessages, formatLabel, useFormContainer, useFormatMessage, usePanelActions, usePanelContext, usePanelState, usePredefinedMessages, useStyleClasses, useWindowManagerActions, useWindowManagerState };
|