reddokia 0.0.0-stage → 1.0.0-alpha.2

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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -2
  3. package/dist/core/RedDokiaEngine.d.ts +20 -0
  4. package/dist/core/RedDokiaEngine.d.ts.map +1 -0
  5. package/dist/core/RedDokiaStore.d.ts +115 -0
  6. package/dist/core/RedDokiaStore.d.ts.map +1 -0
  7. package/dist/core/dom/DockOverlaysDom.d.ts +13 -0
  8. package/dist/core/dom/DockOverlaysDom.d.ts.map +1 -0
  9. package/dist/core/dom/EdgeBarDom.d.ts +12 -0
  10. package/dist/core/dom/EdgeBarDom.d.ts.map +1 -0
  11. package/dist/core/dom/FloatingLayerDom.d.ts +14 -0
  12. package/dist/core/dom/FloatingLayerDom.d.ts.map +1 -0
  13. package/dist/core/dom/GridGroupDom.d.ts +25 -0
  14. package/dist/core/dom/GridGroupDom.d.ts.map +1 -0
  15. package/dist/core/dom/PopoutWindowDom.d.ts +16 -0
  16. package/dist/core/dom/PopoutWindowDom.d.ts.map +1 -0
  17. package/dist/core/dom/SashLayerDom.d.ts +11 -0
  18. package/dist/core/dom/SashLayerDom.d.ts.map +1 -0
  19. package/dist/core/dom/StatusBarDom.d.ts +12 -0
  20. package/dist/core/dom/StatusBarDom.d.ts.map +1 -0
  21. package/dist/core/dom/TabContextMenuDom.d.ts +47 -0
  22. package/dist/core/dom/TabContextMenuDom.d.ts.map +1 -0
  23. package/dist/core/dom/TopBarDom.d.ts +16 -0
  24. package/dist/core/dom/TopBarDom.d.ts.map +1 -0
  25. package/dist/core/dom/domUtils.d.ts +69 -0
  26. package/dist/core/dom/domUtils.d.ts.map +1 -0
  27. package/dist/core/geometrySolver.d.ts +25 -0
  28. package/dist/core/geometrySolver.d.ts.map +1 -0
  29. package/dist/core/hitTester.d.ts +26 -0
  30. package/dist/core/hitTester.d.ts.map +1 -0
  31. package/dist/core/icons/svgRegistry.d.ts +83 -0
  32. package/dist/core/icons/svgRegistry.d.ts.map +1 -0
  33. package/dist/core/interactions/DockDragManager.d.ts +43 -0
  34. package/dist/core/interactions/DockDragManager.d.ts.map +1 -0
  35. package/dist/core/interactions/FloatingWindowManager.d.ts +14 -0
  36. package/dist/core/interactions/FloatingWindowManager.d.ts.map +1 -0
  37. package/dist/core/interactions/SashResizeManager.d.ts +14 -0
  38. package/dist/core/interactions/SashResizeManager.d.ts.map +1 -0
  39. package/dist/core/interactions/floatingUtils.d.ts +28 -0
  40. package/dist/core/interactions/floatingUtils.d.ts.map +1 -0
  41. package/dist/core/locales/index.d.ts +11 -0
  42. package/dist/core/locales/index.d.ts.map +1 -0
  43. package/dist/core/publicApi.d.ts +8 -0
  44. package/dist/core/publicApi.d.ts.map +1 -0
  45. package/dist/core/sashResizeSolver.d.ts +47 -0
  46. package/dist/core/sashResizeSolver.d.ts.map +1 -0
  47. package/dist/core/snapshotSerializer.d.ts +60 -0
  48. package/dist/core/snapshotSerializer.d.ts.map +1 -0
  49. package/dist/core/styles/ensureRedDokiaStyles.d.ts +25 -0
  50. package/dist/core/styles/ensureRedDokiaStyles.d.ts.map +1 -0
  51. package/dist/core/tabScrollErgonomics.d.ts +18 -0
  52. package/dist/core/tabScrollErgonomics.d.ts.map +1 -0
  53. package/dist/core/themes/index.d.ts +6 -0
  54. package/dist/core/themes/index.d.ts.map +1 -0
  55. package/dist/core/treeOps.d.ts +259 -0
  56. package/dist/core/treeOps.d.ts.map +1 -0
  57. package/dist/core/types/index.d.ts +1379 -0
  58. package/dist/core/types/index.d.ts.map +1 -0
  59. package/dist/favicon.svg +18 -0
  60. package/dist/index.d.ts +9 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/logo-dark.svg +13 -0
  63. package/dist/logo-light.svg +13 -0
  64. package/dist/react/RedDokiaReact.d.ts +11 -0
  65. package/dist/react/RedDokiaReact.d.ts.map +1 -0
  66. package/dist/react/ViewIcon.d.ts +13 -0
  67. package/dist/react/ViewIcon.d.ts.map +1 -0
  68. package/dist/react/index.d.ts +10 -0
  69. package/dist/react/index.d.ts.map +1 -0
  70. package/dist/react.js +1 -0
  71. package/dist/reddokia.js +1 -0
  72. package/dist/style.css +2 -0
  73. package/dist/svelte/RedDokiaSvelte.d.ts +33 -0
  74. package/dist/svelte/RedDokiaSvelte.d.ts.map +1 -0
  75. package/dist/svelte/index.d.ts +9 -0
  76. package/dist/svelte/index.d.ts.map +1 -0
  77. package/dist/svelte.js +1 -0
  78. package/dist/vue/RedDokiaVue.d.ts +25 -0
  79. package/dist/vue/RedDokiaVue.d.ts.map +1 -0
  80. package/dist/vue/index.d.ts +9 -0
  81. package/dist/vue/index.d.ts.map +1 -0
  82. package/dist/vue.js +1 -0
  83. package/package.json +101 -4
@@ -0,0 +1,1379 @@
1
+ /**
2
+ * Core TypeScript definitions, declarative layout/view schemas, geometry contracts, theme tokens, locale dictionaries, and controller interfaces for RedDokia.
3
+ * @packageDocumentation
4
+ */
5
+ import type { RedDokiaIconName } from '../icons/svgRegistry';
6
+ /**
7
+ * Framework-neutral inline CSS style object applied to the root `.reddokia-root` container.
8
+ * Compatible with standard CSS properties, numeric pixel values, CSS custom properties (`--*`), and `React.CSSProperties`.
9
+ */
10
+ export type RedDokiaStyle = Partial<Record<Exclude<keyof CSSStyleDeclaration, 'length' | 'parentRule' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty'>, string | number>> & Record<`--${string}`, string | number | undefined>;
11
+ /**
12
+ * Framework-neutral view component or DOM mount handler accepted by `views[].component` and `openView(..., { component })`.
13
+ * Supports React function/class/exotic components, Vue 3 components, Svelte 5 components, and Vanilla DOM mount handlers.
14
+ */
15
+ export type RedDokiaViewComponent<TParams = Record<string, any>> = ((props: RedDokiaViewRenderProps<TParams>) => unknown) | (new (props: RedDokiaViewRenderProps<TParams>, context?: any) => unknown) | RedDokiaViewMountHandler<TParams> | Record<string, any>;
16
+ /** Axis direction along which a split container arranges its children. */
17
+ export type RedDokiaLayoutOrientation = 'horizontal' | 'vertical';
18
+ /** Named peripheral tool-window slot anchored to an outer workbench edge. */
19
+ export type RedDokiaEdgeSlot = 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom' | 'bottom-left' | 'bottom-right';
20
+ /**
21
+ * Policy determining whether a group remains in the tree or is pruned once its last view closes.
22
+ */
23
+ export type RedDokiaEmptyBehavior = 'keep' | 'prune';
24
+ /**
25
+ * Directional drop zone within a target group or root container during drag-and-dock gestures.
26
+ */
27
+ export type RedDokiaDockZone = 'center' | 'left' | 'right' | 'top' | 'bottom';
28
+ /** Pixel-aligned bounding rectangle relative to the layout container origin. */
29
+ export interface RedDokiaRect {
30
+ /** Top offset in pixels. */
31
+ top: number;
32
+ /** Left offset in pixels. */
33
+ left: number;
34
+ /** Width in pixels. */
35
+ width: number;
36
+ /** Height in pixels. */
37
+ height: number;
38
+ }
39
+ /** Size bounds and resize behavior constraints attached to a layout tree node. */
40
+ export interface RedDokiaNodeConstraints {
41
+ /** Minimum guaranteed size in pixels along the parent split axis. */
42
+ minSize?: number;
43
+ /** Maximum allowed size in pixels along the parent split axis. */
44
+ maxSize?: number;
45
+ /** Minimum allowed width in pixels regardless of split orientation. */
46
+ minWidth?: number;
47
+ /** Maximum allowed width in pixels regardless of split orientation. */
48
+ maxWidth?: number;
49
+ /** Minimum allowed height in pixels regardless of split orientation. */
50
+ minHeight?: number;
51
+ /** Maximum allowed height in pixels regardless of split orientation. */
52
+ maxHeight?: number;
53
+ /**
54
+ * Whether dragging past the minimum size threshold snaps the node into a collapsed state (`false` by default).
55
+ */
56
+ snap?: boolean;
57
+ /** Locks the node at a fixed pixel size and prevents interactive sash resizing. */
58
+ fixed?: boolean;
59
+ }
60
+ /** Leaf node in the normalized layout tree representing a tabbed panel group. */
61
+ export interface RedDokiaGroupNode {
62
+ /** Unique identifier of the group node. */
63
+ id: string;
64
+ /** Discriminant node type tag (`'group'`). */
65
+ type: 'group';
66
+ /** Proportional weight or pixel size share within the parent split container. */
67
+ size: number;
68
+ /** Previously allocated pixel size preserved across collapse/expand cycles. */
69
+ cachedSize?: number;
70
+ /** Whether the group is currently collapsed to zero visible space in the grid. */
71
+ collapsed?: boolean;
72
+ /**
73
+ * Marks the primary contents document root group that persists even when all tabs are closed.
74
+ */
75
+ isContentsRootGroup?: boolean;
76
+ /** Explicit empty-group retention policy when the last tab in this group closes. */
77
+ emptyBehavior?: RedDokiaEmptyBehavior;
78
+ /**
79
+ * Associated peripheral edge-bar slot if this group acts as a docked tool sidebar/panel.
80
+ */
81
+ edgeSlot?: RedDokiaEdgeSlot;
82
+ /**
83
+ * Enables the peripheral tool window icon rail (`EdgeBar`) for this group's side (`left` or `right`).
84
+ */
85
+ edgeBar?: boolean;
86
+ /** Min/max dimension bounds and snap/fixed constraints for this group. */
87
+ constraints?: RedDokiaNodeConstraints;
88
+ /** Ordered list of view IDs currently hosted as tabs in this group. */
89
+ views: string[];
90
+ /** Currently active (foreground) view ID in this group, or `null` when empty. */
91
+ activeViewId: string | null;
92
+ /** Controls whether the group's tab header bar is rendered (`true` by default). */
93
+ showHeader?: boolean;
94
+ /**
95
+ * Prevents external tabs from being dropped into this group and blocks tab close/undock actions when locked.
96
+ */
97
+ locked?: boolean;
98
+ }
99
+ /**
100
+ * Branch node in the normalized layout tree that divides space among child nodes along an axis.
101
+ */
102
+ export interface RedDokiaSplitNode {
103
+ /** Unique identifier of the split container node. */
104
+ id: string;
105
+ /** Discriminant node type tag (`'split'`). */
106
+ type: 'split';
107
+ /** Axis along which child nodes are laid out (`'horizontal'` or `'vertical'`). */
108
+ orientation: RedDokiaLayoutOrientation;
109
+ /** Proportional weight or size share within the parent split container. */
110
+ size: number;
111
+ /** Cached pixel size preserved prior to collapsing this split branch. */
112
+ cachedSize?: number;
113
+ /** Whether the entire split branch is currently collapsed. */
114
+ collapsed?: boolean;
115
+ /**
116
+ * Marks the primary contents workspace stage container protected from automatic pruning.
117
+ */
118
+ isContentsStage?: boolean;
119
+ /** Size bounds and resize priority constraints applied to this split branch. */
120
+ constraints?: RedDokiaNodeConstraints;
121
+ /**
122
+ * Ordered child layout nodes (`RedDokiaGroupNode` or nested `RedDokiaSplitNode`).
123
+ */
124
+ children: RedDokiaLayoutNode[];
125
+ }
126
+ /**
127
+ * Discriminated union of any node (`RedDokiaGroupNode` or `RedDokiaSplitNode`) in the normalized layout tree.
128
+ */
129
+ export type RedDokiaLayoutNode = RedDokiaGroupNode | RedDokiaSplitNode;
130
+ /** Declarative authoring schema for defining a tabbed group in `layout`. */
131
+ export interface RedDokiaGroupSchema {
132
+ /** Optional stable group ID (auto-generated if omitted). */
133
+ id?: string;
134
+ /**
135
+ * Groups do not specify a split `type` (`'row' | 'col'` is reserved for {@link RedDokiaSplitSchema}).
136
+ */
137
+ type?: never;
138
+ /** Initial ordered array of view IDs to open as tabs in this group. */
139
+ children: string[];
140
+ /**
141
+ * View ID of the initially active tab (defaults to the first entry in `children`).
142
+ */
143
+ activeViewId?: string | null;
144
+ /** Relative flex weight or initial size share among siblings. */
145
+ size?: number;
146
+ /** Minimum size in pixels along the parent split orientation. */
147
+ minSize?: number;
148
+ /** Maximum size in pixels along the parent split orientation. */
149
+ maxSize?: number;
150
+ /** Minimum width in pixels. */
151
+ minWidth?: number;
152
+ /** Maximum width in pixels. */
153
+ maxWidth?: number;
154
+ /** Minimum height in pixels. */
155
+ minHeight?: number;
156
+ /** Maximum height in pixels. */
157
+ maxHeight?: number;
158
+ /**
159
+ * Enables drag-to-collapse snapping when resized below `minSize` (`false` by default).
160
+ */
161
+ snap?: boolean;
162
+ /** Locks the group at a fixed pixel size and disables sash dragging. */
163
+ fixed?: boolean;
164
+ /** Whether to display the group tab header bar (`true` by default). */
165
+ showHeader?: boolean;
166
+ /** Whether the group starts locked against external tab drops and tab removal. */
167
+ locked?: boolean;
168
+ /**
169
+ * Custom empty-state component or DOM mount handler displayed when all tabs in the `contents` root group are closed.
170
+ */
171
+ emptyContents?: RedDokiaSlotMountHandler | ((props: RedDokiaEmptyContentsRenderProps) => any) | unknown;
172
+ }
173
+ /**
174
+ * Declarative authoring schema for a peripheral EdgeBar slot group (`leftTopEdgeBar`, `leftBottomEdgeBar`, `rightTopEdgeBar`, `rightBottomEdgeBar`, `bottomLeftEdgeBar`, `bottomRightEdgeBar`).
175
+ */
176
+ export interface RedDokiaEdgeBarSchema {
177
+ /** Optional stable group ID (auto-generated from the edge slot if omitted). */
178
+ id?: string;
179
+ /** EdgeBar slots cannot be split containers (`type` is disallowed). */
180
+ type?: never;
181
+ /** Ordered array of view IDs registered in this EdgeBar slot. */
182
+ children: string[];
183
+ /**
184
+ * View ID of the initially active tab (defaults to the first entry in `children`).
185
+ */
186
+ activeViewId?: string | null;
187
+ /** Initial width (for left/right slots) or height (for bottom slots). */
188
+ size?: number;
189
+ /** Minimum size in pixels along the panel's resize axis. */
190
+ minSize?: number;
191
+ /** Maximum size in pixels along the panel's resize axis. */
192
+ maxSize?: number;
193
+ /** Minimum width in pixels. */
194
+ minWidth?: number;
195
+ /** Maximum width in pixels. */
196
+ maxWidth?: number;
197
+ /** Minimum height in pixels. */
198
+ minHeight?: number;
199
+ /** Maximum height in pixels. */
200
+ maxHeight?: number;
201
+ /**
202
+ * Enables drag-to-collapse snapping when resized below `minSize` (`false` by default).
203
+ */
204
+ snap?: boolean;
205
+ /** Locks the panel at a fixed pixel size and disables sash dragging. */
206
+ fixed?: boolean;
207
+ /** Whether the EdgeBar panel starts collapsed into the rail. */
208
+ collapsed?: boolean;
209
+ /** Whether to display the group header bar (`true` by default). */
210
+ showHeader?: boolean;
211
+ /** Whether the group starts locked. */
212
+ locked?: boolean;
213
+ }
214
+ /**
215
+ * Declarative authoring schema for defining a row/column split container in `layout`.
216
+ */
217
+ export interface RedDokiaSplitSchema {
218
+ /** Optional stable split container ID (auto-generated if omitted). */
219
+ id?: string;
220
+ /**
221
+ * Split axis direction (`'row'` for horizontal left-to-right, `'col'` for vertical top-to-bottom).
222
+ * Defaults to `'row'` when omitted.
223
+ * @defaultValue `'row'`
224
+ */
225
+ type?: 'row' | 'col';
226
+ /** Relative flex weight or size share within the parent split. */
227
+ size?: number;
228
+ /** Minimum size in pixels along the parent split axis. */
229
+ minSize?: number;
230
+ /** Maximum size in pixels along the parent split axis. */
231
+ maxSize?: number;
232
+ /** Minimum width in pixels. */
233
+ minWidth?: number;
234
+ /** Maximum width in pixels. */
235
+ maxWidth?: number;
236
+ /** Minimum height in pixels. */
237
+ minHeight?: number;
238
+ /** Maximum height in pixels. */
239
+ maxHeight?: number;
240
+ /** Enables drag-to-collapse snapping below minimum size (`false` by default). */
241
+ snap?: boolean;
242
+ /** Locks this split branch at a fixed pixel size. */
243
+ fixed?: boolean;
244
+ /** Child split or group schemas arranged along this container's axis. */
245
+ children: RedDokiaLayoutNodeSchema[];
246
+ /**
247
+ * Custom empty-state component or DOM mount handler displayed when all closable tabs in the `contents` stage are closed.
248
+ */
249
+ emptyContents?: RedDokiaSlotMountHandler | ((props: RedDokiaEmptyContentsRenderProps) => any) | unknown;
250
+ }
251
+ /**
252
+ * Union of declarative schema nodes or view-ID array shorthand (`string[]`) accepted inside a `RedDokiaSplitSchema.children` array.
253
+ */
254
+ export type RedDokiaLayoutNodeSchema = RedDokiaSplitSchema | RedDokiaGroupSchema | string[];
255
+ /**
256
+ * Value accepted for any peripheral `*EdgeBar` zone (`leftTopEdgeBar`, `leftBottomEdgeBar`, `rightTopEdgeBar`, `rightBottomEdgeBar`, `bottomLeftEdgeBar`, `bottomRightEdgeBar`) in {@link RedDokiaZoneLayoutSchema}.
257
+ */
258
+ export type RedDokiaEdgeBarZoneValue = string[] | RedDokiaEdgeBarSchema;
259
+ /**
260
+ * Value accepted for the central `contents` workspace zone in {@link RedDokiaZoneLayoutSchema}.
261
+ */
262
+ export type RedDokiaContentsZoneValue = string[] | RedDokiaGroupSchema | RedDokiaSplitSchema;
263
+ /**
264
+ * Props passed to custom shell bar components (`topBar.left`, `topBar.right`, `statusBar.left`, and `statusBar.right`).
265
+ */
266
+ export interface RedDokiaSlotRenderProps {
267
+ /** Imperative workbench controller API. */
268
+ controller: RedDokiaController;
269
+ /** Current reactive layout state snapshot. */
270
+ layoutState: RedDokiaLayoutState;
271
+ }
272
+ /** Declarative menu item inside a `topBar.menus` dropdown or cascading submenu. */
273
+ export interface RedDokiaTopBarMenuItem {
274
+ /** Optional unique identifier of the menu item. */
275
+ id?: string;
276
+ /**
277
+ * Display label of the menu action (supports mnemonic notation such as `'File(F)'`, `'New(N)'`, `'Open(O)...'`).
278
+ */
279
+ label: string;
280
+ /**
281
+ * Optional leading icon for the menu item (`RedDokiaIcons.*` constant, SVG string, or framework icon).
282
+ */
283
+ icon?: RedDokiaIconValue;
284
+ /**
285
+ * Optional keyboard shortcut hint badge displayed on the right (e.g. `'Ctrl+O'`, `'Alt+Z'`).
286
+ */
287
+ shortcut?: string;
288
+ /** Disables the menu item when `true`. */
289
+ disabled?: boolean;
290
+ /** Styles the menu item in destructive/danger red when `true`. */
291
+ danger?: boolean;
292
+ /** Renders a horizontal separator line immediately above this item when `true`. */
293
+ dividerBefore?: boolean;
294
+ /** Nested child menu items rendered as a cascading submenu (`>`) on hover. */
295
+ items?: RedDokiaTopBarMenuItem[];
296
+ /**
297
+ * Callback executed with the workbench `controller` when the user clicks this menu item.
298
+ */
299
+ action?: (controller: RedDokiaController) => void;
300
+ }
301
+ /**
302
+ * Top-level menu entry in `topBar.menus` (e.g. `'File(F)'`, `'Edit(E)'`, `'View(V)'`).
303
+ */
304
+ export interface RedDokiaTopBarMenu {
305
+ /** Optional unique identifier of the top-level menu. */
306
+ id?: string;
307
+ /**
308
+ * Label shown in the top bar menu strip (e.g. `'File(F)'`, `'Edit(E)'`, `'View(V)'`).
309
+ */
310
+ label: string;
311
+ /** Dropdown menu items opened when this menu is activated. */
312
+ items: RedDokiaTopBarMenuItem[];
313
+ }
314
+ /**
315
+ * Declarative schema for the top workbench bar (`topBar` in {@link RedDokiaZoneLayoutSchema}).
316
+ */
317
+ export interface RedDokiaTopBarSchema {
318
+ /** Application title displayed in the top workbench bar. */
319
+ title?: string;
320
+ /** Short brand/logo badge text shown at the leading edge of the top bar. */
321
+ logoText?: string;
322
+ /**
323
+ * Declarative desktop-style menu bar items (e.g. `'File(F)'`, `'Edit(E)'`, `'View(V)'`) with cascading submenu support.
324
+ */
325
+ menus?: RedDokiaTopBarMenu[];
326
+ /**
327
+ * Custom component or DOM mount handler rendered on the left side of the top bar (after `logoText` and `title` when present).
328
+ * Accepts a React component, Vue component, Svelte component, or Vanilla `(slotEl, controller) => ...` handler.
329
+ */
330
+ left?: RedDokiaSlotMountHandler | ((props: RedDokiaSlotRenderProps) => any) | unknown;
331
+ /**
332
+ * Custom component or DOM mount handler rendered on the right side of the top bar.
333
+ * Accepts a React component, Vue component, Svelte component, or Vanilla `(slotEl, controller) => ...` handler.
334
+ */
335
+ right?: RedDokiaSlotMountHandler | ((props: RedDokiaSlotRenderProps) => any) | unknown;
336
+ }
337
+ /**
338
+ * Declarative schema for the bottom workbench status bar (`statusBar` in {@link RedDokiaZoneLayoutSchema}).
339
+ */
340
+ export interface RedDokiaStatusBarSchema {
341
+ /**
342
+ * Custom component or DOM mount handler rendered on the left side of the bottom status bar.
343
+ * Accepts a React component, Vue component, Svelte component, or Vanilla `(slotEl, controller) => ...` handler.
344
+ */
345
+ left?: RedDokiaSlotMountHandler | ((props: RedDokiaSlotRenderProps) => any) | unknown;
346
+ /**
347
+ * Custom component or DOM mount handler rendered on the right side of the bottom status bar.
348
+ * Accepts a React component, Vue component, Svelte component, or Vanilla `(slotEl, controller) => ...` handler.
349
+ */
350
+ right?: RedDokiaSlotMountHandler | ((props: RedDokiaSlotRenderProps) => any) | unknown;
351
+ }
352
+ /**
353
+ * Concise flat zone map shorthand accepted by `layout` in place of a nested split tree.
354
+ */
355
+ export interface RedDokiaZoneLayoutSchema {
356
+ /**
357
+ * Top workbench bar configuration (`true` or a {@link RedDokiaTopBarSchema} object).
358
+ */
359
+ topBar?: boolean | RedDokiaTopBarSchema;
360
+ /**
361
+ * Views or group/split configuration placed in the central document/content stage.
362
+ */
363
+ contents?: RedDokiaContentsZoneValue;
364
+ /**
365
+ * Tool views pinned to the primary upper-left peripheral `EdgeBar` rail (`edgeSlot: 'left-top'`).
366
+ */
367
+ leftTopEdgeBar?: RedDokiaEdgeBarZoneValue;
368
+ /**
369
+ * Tool views pinned to the secondary lower-left peripheral `EdgeBar` rail (`edgeSlot: 'left-bottom'`).
370
+ */
371
+ leftBottomEdgeBar?: RedDokiaEdgeBarZoneValue;
372
+ /**
373
+ * Tool views pinned to the primary upper-right peripheral `EdgeBar` rail (`edgeSlot: 'right-top'`).
374
+ */
375
+ rightTopEdgeBar?: RedDokiaEdgeBarZoneValue;
376
+ /**
377
+ * Tool views pinned to the secondary lower-right peripheral `EdgeBar` rail (`edgeSlot: 'right-bottom'`).
378
+ */
379
+ rightBottomEdgeBar?: RedDokiaEdgeBarZoneValue;
380
+ /**
381
+ * Tool views pinned to the bottom-left peripheral `EdgeBar` rail (`edgeSlot: 'bottom-left'`), opening in the bottom-left tool panel.
382
+ */
383
+ bottomLeftEdgeBar?: RedDokiaEdgeBarZoneValue;
384
+ /**
385
+ * Tool views pinned to the bottom-right peripheral `EdgeBar` rail (`edgeSlot: 'bottom-right'`), opening in the bottom-right tool panel.
386
+ */
387
+ bottomRightEdgeBar?: RedDokiaEdgeBarZoneValue;
388
+ /**
389
+ * Bottom workbench status bar configuration (`true` or a {@link RedDokiaStatusBarSchema} object).
390
+ */
391
+ statusBar?: boolean | RedDokiaStatusBarSchema;
392
+ /**
393
+ * Custom empty-state component or DOM mount handler displayed when all closable tabs in the `contents` stage are closed.
394
+ */
395
+ emptyContents?: RedDokiaSlotMountHandler | ((props: RedDokiaEmptyContentsRenderProps) => any) | unknown;
396
+ }
397
+ /**
398
+ * Root layout tree definition or flat zone shorthand accepted by `layout` and layout presets.
399
+ */
400
+ export type RedDokiaLayoutSchema = RedDokiaSplitSchema | RedDokiaZoneLayoutSchema;
401
+ /** Computed pixel bounding box and render metadata for a docked group. */
402
+ export interface RedDokiaGroupGeometry extends RedDokiaRect {
403
+ /** Whether the group is currently collapsed and hidden from the grid. */
404
+ collapsed: boolean;
405
+ /** Reference to the underlying normalized `RedDokiaGroupNode` in the layout tree. */
406
+ node: RedDokiaGroupNode;
407
+ }
408
+ /** Computed viewport geometry and visibility state for an individual view body. */
409
+ export interface RedDokiaViewGeometry extends RedDokiaRect {
410
+ /** ID of the host docked or floating group currently owning this view. */
411
+ groupId: string;
412
+ /**
413
+ * Whether this view is currently the active visible tab in an expanded host group.
414
+ */
415
+ visible: boolean;
416
+ /** Whether this view is currently hosted inside a detached floating window. */
417
+ floating?: boolean;
418
+ /** Stacking order index when rendered inside a floating window layer. */
419
+ zOrder?: number;
420
+ }
421
+ /**
422
+ * Interactive resize sash (divider) geometry positioned between two adjacent split children.
423
+ */
424
+ export interface RedDokiaSashGeometry {
425
+ /** Unique identifier of the sash handle. */
426
+ id: string;
427
+ /** ID of the parent `RedDokiaSplitNode` governed by this sash. */
428
+ splitId: string;
429
+ /**
430
+ * Orientation of the parent split (`'horizontal'` produces a vertical divider; `'vertical'` produces a horizontal divider).
431
+ */
432
+ orientation: RedDokiaLayoutOrientation;
433
+ /** ID of the child node immediately preceding the sash. */
434
+ beforeId: string;
435
+ /** ID of the child node immediately following the sash. */
436
+ afterId: string;
437
+ /** Hit-box rectangle of the sash handle in pixels. */
438
+ rect: RedDokiaRect;
439
+ }
440
+ /**
441
+ * State model for an in-viewport Zero-Unmount floating window hosting one or more tabs.
442
+ */
443
+ export interface RedDokiaFloatingGroup {
444
+ /** Unique identifier of the floating window group. */
445
+ id: string;
446
+ /** Top coordinate in pixels relative to the grid container. */
447
+ top: number;
448
+ /** Left coordinate in pixels relative to the grid container. */
449
+ left: number;
450
+ /** Floating window width in pixels. */
451
+ width: number;
452
+ /** Floating window height in pixels. */
453
+ height: number;
454
+ /** Ordered list of view IDs hosted in this floating window. */
455
+ views: string[];
456
+ /** Currently active foreground view ID in this floating window. */
457
+ activeViewId: string | null;
458
+ /** Z-index stacking order among open floating windows. */
459
+ zOrder: number;
460
+ /**
461
+ * Original EdgeBar slot (`edgeSlot`) if this floating window was detached from an EdgeBar panel.
462
+ * Used to distinguish tool-window floating panels and redock them back to their originating EdgeBar slot.
463
+ */
464
+ originEdgeSlot?: RedDokiaEdgeSlot;
465
+ }
466
+ /**
467
+ * State descriptor for an OS-level native browser pop-out window (`window.open` portal).
468
+ */
469
+ export interface RedDokiaPopoutWindow {
470
+ /** Optional unique identifier of the pop-out window session. */
471
+ id?: string;
472
+ /** Currently active view ID rendered inside the pop-out window. */
473
+ viewId: string;
474
+ /** Optional ordered list of all view IDs hosted in a multi-tab pop-out window. */
475
+ views?: string[];
476
+ /** Initial or current width of the pop-out window in pixels. */
477
+ width: number;
478
+ /** Initial or current height of the pop-out window in pixels. */
479
+ height: number;
480
+ /**
481
+ * Original EdgeBar slot (`edgeSlot`) if this pop-out originated from an EdgeBar panel or EdgeBar-origin floating window.
482
+ */
483
+ originEdgeSlot?: RedDokiaEdgeSlot;
484
+ }
485
+ /**
486
+ * Complete output of the headless layout geometry solver for a given container viewport.
487
+ */
488
+ export interface RedDokiaSolvedGeometry {
489
+ /**
490
+ * Bounding rectangles indexed by layout node ID (`RedDokiaSplitNode` and `RedDokiaGroupNode`).
491
+ */
492
+ nodeRects: Record<string, RedDokiaRect>;
493
+ /** Computed group geometries indexed by `RedDokiaGroupNode` ID. */
494
+ groupRects: Record<string, RedDokiaGroupGeometry>;
495
+ /**
496
+ * Computed view content geometries indexed by view ID (including docked and floating views).
497
+ */
498
+ viewRects: Record<string, RedDokiaViewGeometry>;
499
+ /** Interactive 1D sash handles between visible split children. */
500
+ sashes: RedDokiaSashGeometry[];
501
+ }
502
+ /** Eight-way cardinal and diagonal resize handle directions on floating windows. */
503
+ export type FloatingResizeDirection = 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
504
+ /**
505
+ * Classification of drop target resolved during tab or group drag-and-dock hit-testing.
506
+ */
507
+ type DockHitKind = 'none' | 'group-zone' | 'edge-slot' | 'tab-bar' | 'root-zone' | 'floating-group' | 'tear-off-float';
508
+ /**
509
+ * Resolved drop target and preview overlay rectangle returned by the drag-and-dock hit-tester.
510
+ */
511
+ export interface DockHitTarget {
512
+ /** Resolved hit target category. */
513
+ kind: DockHitKind;
514
+ /**
515
+ * Target docked or floating group ID when hovering over a group or tab bar, otherwise `null`.
516
+ */
517
+ groupId: string | null;
518
+ /**
519
+ * Directional split/center drop zone when `kind` is `'group-zone'` or `'root-zone'`.
520
+ */
521
+ zone: RedDokiaDockZone | null;
522
+ /**
523
+ * Target peripheral edge slot when hovering over an edge bar (`kind === 'edge-slot'`).
524
+ */
525
+ edgeSlot: RedDokiaEdgeSlot | null;
526
+ /**
527
+ * Zero-based insertion index when reordering or inserting directly into a tab bar.
528
+ */
529
+ tabInsertIndex: number | null;
530
+ /**
531
+ * Bounding box in pixels used to render the translucent dock drop preview overlay.
532
+ */
533
+ previewRect: RedDokiaRect;
534
+ }
535
+ /**
536
+ * Payload emitted via `onViewResize` whenever a visible view's pixel dimensions change.
537
+ */
538
+ export interface RedDokiaResizeEvent {
539
+ /** ID of the resized view. */
540
+ viewId: string;
541
+ /** ID of the group currently hosting the view. */
542
+ groupId: string;
543
+ /** Updated top offset in pixels. */
544
+ top: number;
545
+ /** Updated left offset in pixels. */
546
+ left: number;
547
+ /** Updated content width in pixels. */
548
+ width: number;
549
+ /** Updated content height in pixels. */
550
+ height: number;
551
+ /**
552
+ * Persistent host DOM element (`div.rd-view-host`) containing this view's mounted content (works across docked, floating, and pop-out windows).
553
+ */
554
+ element: HTMLElement | null;
555
+ }
556
+ /** Built-in base theme palette identifier (`'dark'` or `'light'`). */
557
+ export type RedDokiaBaseThemeId = 'dark' | 'light';
558
+ /**
559
+ * Custom theme entry registered via `themes` prop — inherits from `base` (`'dark'` or `'light'`) and overrides `themeTokens` when active.
560
+ */
561
+ export interface RedDokiaCustomThemeDefinition extends Partial<Omit<RedDokiaTheme, 'id'>> {
562
+ /**
563
+ * Built-in base theme palette to inherit (`'dark'` by default; `'light'` when overriding `'light'`).
564
+ */
565
+ base?: RedDokiaBaseThemeId;
566
+ }
567
+ /**
568
+ * Design-token theme definition controlling workbench colors, spacing, typography, and island geometry.
569
+ */
570
+ export interface RedDokiaTheme {
571
+ /** Unique theme identifier (e.g. `'dark'`, `'light'`, or custom theme key). */
572
+ id: string;
573
+ /** Built-in base theme palette inherited by this theme (`'dark'` or `'light'`). */
574
+ base?: RedDokiaBaseThemeId;
575
+ /** Gap in pixels between island panel groups (`0` for flush borders). */
576
+ islandGap: number;
577
+ /** Outer workbench shell background color (`--rd-shell-bg`). */
578
+ shellBg?: string;
579
+ /** TopBar background color (`--rd-topbar-bg`). */
580
+ topBarBg?: string;
581
+ /** Peripheral EdgeBar rail background color (`--rd-edgebar-bg`). */
582
+ edgeBarBg?: string;
583
+ /** Tab group header bar background color (`--rd-group-header-bg`). */
584
+ groupHeaderBg?: string;
585
+ /** Central contents group background color (`--rd-contents-bg`). */
586
+ contentsBg?: string;
587
+ /** Tool panel content background color (`--rd-panel-bg`). */
588
+ panelBg?: string;
589
+ /** Primary border and divider stroke color (`--rd-border`). */
590
+ border?: string;
591
+ /**
592
+ * Primary brand accent color used for active indicators and focus rings (`--rd-accent`).
593
+ */
594
+ accent?: string;
595
+ /** Secondary accent color (`--rd-accent-secondary`). */
596
+ accentSecondary?: string;
597
+ /** Primary foreground text color (`--rd-text-main`). */
598
+ textMain?: string;
599
+ /** Muted/secondary foreground text color (`--rd-text-muted`). */
600
+ textMuted?: string;
601
+ /** Active tab pill background color (`--rd-tab-active-bg`). */
602
+ tabActiveBg?: string;
603
+ /**
604
+ * Border radius CSS value for island panel groups (`--rd-island-radius`, e.g. `'10px'`).
605
+ */
606
+ islandRadius?: string;
607
+ /** Sans-serif UI font family stack (`--rd-font-sans`). */
608
+ fontSans?: string;
609
+ /**
610
+ * Monospace font family stack for shortcuts, badges, and metrics (`--rd-font-mono`).
611
+ */
612
+ fontMono?: string;
613
+ /** Semantic warning indicator color (`--rd-warning`). */
614
+ warning?: string;
615
+ /** Semantic danger/destructive action color (`--rd-danger`). */
616
+ danger?: string;
617
+ }
618
+ /**
619
+ * Descriptor registering a panel or document view's metadata, constraints, and component renderer.
620
+ */
621
+ export interface RedDokiaViewSchema<TParams = Record<string, any>> {
622
+ /** Unique identifier of the view instance. */
623
+ id: string;
624
+ /**
625
+ * Optional base view template ID used to resolve renderer/component definitions for dynamically spawned instances.
626
+ */
627
+ templateId?: string;
628
+ /**
629
+ * Display title shown on the tab and edge bar button (defaults to a humanized label derived from `id` when omitted).
630
+ */
631
+ title?: string;
632
+ /**
633
+ * Icon rendered alongside the view title (`RedDokiaIcons.*` constant, built-in icon name, inline SVG, DOM node, or framework icon component).
634
+ */
635
+ icon?: RedDokiaIconValue;
636
+ /** Optional counter or status badge displayed on the tab and edge-bar button. */
637
+ badge?: string | number;
638
+ /** Whether the user can close this view tab (`true` by default). */
639
+ closable?: boolean;
640
+ /**
641
+ * Optional per-view close guard executed before closing this tab.
642
+ * When defined, takes precedence over the global `onBeforeCloseView` callback; return `false` or a `Promise<false>` to abort closing.
643
+ */
644
+ onBeforeClose?: (viewId: string, viewSchema?: RedDokiaViewSchema) => boolean | Promise<boolean>;
645
+ /**
646
+ * Marks the view as having unsaved changes (displays a dirty indicator dot on the tab).
647
+ */
648
+ dirty?: boolean;
649
+ /**
650
+ * Pins the tab to the leading edge of its group tab bar and prevents accidental closing.
651
+ */
652
+ pinned?: boolean;
653
+ /** Minimum content width constraint in pixels contributed to its host group. */
654
+ minWidth?: number;
655
+ /** Maximum content width constraint in pixels contributed to its host group. */
656
+ maxWidth?: number;
657
+ /** Minimum content height constraint in pixels contributed to its host group. */
658
+ minHeight?: number;
659
+ /** Maximum content height constraint in pixels contributed to its host group. */
660
+ maxHeight?: number;
661
+ /**
662
+ * Mounts the view component immediately even before its tab is first activated (`false` = lazy mount on first activation).
663
+ */
664
+ eagerMount?: boolean;
665
+ /** Custom serializable parameters passed into the view's `component`. */
666
+ params?: TParams;
667
+ /**
668
+ * Per-view right-click tab context menu configuration (static array, resolver callback, or `{ mode, items }`).
669
+ * Takes precedence over the global `tabContextMenu` prop for this view and any dynamic tabs cloned from it via `templateId`.
670
+ */
671
+ tabContextMenu?: RedDokiaTabContextMenuOption;
672
+ /**
673
+ * Per-view custom component or DOM mount handler rendered on the right side of the host group header bar when this view is active.
674
+ * Takes precedence over the global `groupActions` prop for this view and any dynamic tabs cloned from it via `templateId`.
675
+ */
676
+ groupActions?: RedDokiaGroupActionsSlot;
677
+ /**
678
+ * Component or mount handler used to render this view's content body across React, Vue, Svelte, or Vanilla environments.
679
+ */
680
+ component?: RedDokiaViewComponent<TParams>;
681
+ }
682
+ /**
683
+ * Options accepted by `controller.openView(viewId, options)` when opening an existing or dynamic runtime view.
684
+ */
685
+ export interface RedDokiaOpenViewOptions<TParams = Record<string, any>> {
686
+ /** Explicit destination group ID where the view tab should be opened. */
687
+ targetGroupId?: string;
688
+ /** Base registered view ID to inherit `component` and default metadata from. */
689
+ templateId?: string;
690
+ /** Override tab title for the opened view. */
691
+ title?: string;
692
+ /**
693
+ * Override icon for the opened view (`RedDokiaIcons.*` constant, built-in icon name, inline SVG, DOM node, or framework icon component).
694
+ */
695
+ icon?: RedDokiaIconValue;
696
+ /** Override badge value for the opened view. */
697
+ badge?: string | number;
698
+ /** Whether the opened tab can be closed by the user. */
699
+ closable?: boolean;
700
+ /** Initial unsaved-changes (`dirty`) indicator state. */
701
+ dirty?: boolean;
702
+ /** Whether to open the tab in a pinned state. */
703
+ pinned?: boolean;
704
+ /** Minimum content width in pixels. */
705
+ minWidth?: number;
706
+ /** Maximum content width in pixels. */
707
+ maxWidth?: number;
708
+ /** Minimum content height in pixels. */
709
+ minHeight?: number;
710
+ /** Maximum content height in pixels. */
711
+ maxHeight?: number;
712
+ /**
713
+ * Custom parameters passed to the view renderer and persisted in layout snapshots.
714
+ */
715
+ params?: TParams;
716
+ /** Runtime component or mount handler for dynamically registered views. */
717
+ component?: RedDokiaViewComponent<TParams>;
718
+ }
719
+ /**
720
+ * Partial mutable metadata patch accepted by `controller.updateView(viewId, patch)` and persisted in `runtimeViews`.
721
+ */
722
+ export type RedDokiaViewMetadataPatch<TParams = Record<string, any>> = Partial<Pick<RedDokiaViewSchema<TParams>, 'templateId' | 'title' | 'icon' | 'badge' | 'closable' | 'dirty' | 'pinned' | 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight' | 'params'>>;
723
+ /** Complete runtime state of a RedDokia workbench layout instance. */
724
+ export interface RedDokiaLayoutState {
725
+ /** Active theme ID currently applied to the workbench. */
726
+ themeId: string;
727
+ /** Visibility flags for the peripheral left and right edge bars. */
728
+ edgeBars: {
729
+ /** Whether the left peripheral EdgeBar rail is visible. */
730
+ left: boolean;
731
+ /** Whether the right peripheral EdgeBar rail is visible. */
732
+ right: boolean;
733
+ /**
734
+ * Whether EdgeBar rail buttons display tool window title labels underneath their icons.
735
+ */
736
+ showLabels?: boolean;
737
+ };
738
+ /** ID of the currently focused docked or floating group. */
739
+ activeGroupId: string;
740
+ /**
741
+ * ID of the currently maximized (Zen Mode) docked group, or `null` when in normal split view.
742
+ */
743
+ maximizedGroupId: string | null;
744
+ /** Root `RedDokiaSplitNode` of the normalized docked layout tree. */
745
+ rootGrid: RedDokiaSplitNode;
746
+ /** Open Zero-Unmount floating window groups layered above the grid. */
747
+ floatingGroups?: RedDokiaFloatingGroup[];
748
+ /**
749
+ * Runtime metadata overrides and dynamically spawned view patches indexed by view ID.
750
+ */
751
+ runtimeViews?: Record<string, RedDokiaViewMetadataPatch>;
752
+ }
753
+ /**
754
+ * Versioned JSON payload produced by snapshot serialization (`exportLayoutJson` / `localStorage`).
755
+ */
756
+ export interface RedDokiaSerializedSnapshot {
757
+ /** Brand sentinel confirming the JSON object is a valid RedDokia layout snapshot. */
758
+ __reddokiaSnapshot: true;
759
+ /** Snapshot format/application storage version string. */
760
+ version: string;
761
+ /** Persisted active theme ID. */
762
+ themeId: string;
763
+ /** Persisted edge-bar visibility state. */
764
+ edgeBars: {
765
+ /** Persisted visibility of the left peripheral EdgeBar rail. */
766
+ left: boolean;
767
+ /** Persisted visibility of the right peripheral EdgeBar rail. */
768
+ right: boolean;
769
+ /** Persisted visibility of tool window title labels on EdgeBar rails. */
770
+ showLabels?: boolean;
771
+ };
772
+ /** Persisted focused group ID. */
773
+ activeGroupId: string;
774
+ /** Persisted root `RedDokiaSplitNode` of the docked layout tree. */
775
+ rootGrid: RedDokiaSplitNode;
776
+ /** Persisted floating window groups. */
777
+ floatingGroups?: RedDokiaFloatingGroup[];
778
+ /**
779
+ * Persisted runtime view metadata patches (icons/components excluded if non-serializable).
780
+ */
781
+ runtimeViews?: Record<string, RedDokiaViewMetadataPatch>;
782
+ }
783
+ /**
784
+ * Lookup result returned when scanning the layout tree for peripheral `RedDokiaEdgeSlot` groups and side columns.
785
+ */
786
+ export interface EdgeGroupsScanResult {
787
+ /** Left vertical tool column split node, if present. */
788
+ leftCol: RedDokiaSplitNode | null;
789
+ /** Group bound to the `'left-top'` edge slot, if present. */
790
+ leftTopEdgeBar: RedDokiaGroupNode | null;
791
+ /** Group bound to the `'left-bottom'` edge slot, if present. */
792
+ leftBottomEdgeBar: RedDokiaGroupNode | null;
793
+ /** Right vertical tool column split node, if present. */
794
+ rightCol: RedDokiaSplitNode | null;
795
+ /** Group bound to the `'right-top'` edge slot, if present. */
796
+ rightTopEdgeBar: RedDokiaGroupNode | null;
797
+ /** Group bound to the `'right-bottom'` edge slot, if present. */
798
+ rightBottomEdgeBar: RedDokiaGroupNode | null;
799
+ /** Bottom horizontal tool row split node, if present. */
800
+ bottomRow: RedDokiaSplitNode | null;
801
+ /** Group bound to the `'bottom-left'` edge slot, if present. */
802
+ bottomLeftEdgeBar: RedDokiaGroupNode | null;
803
+ /** Group bound to the `'bottom-right'` edge slot, if present. */
804
+ bottomRightEdgeBar: RedDokiaGroupNode | null;
805
+ }
806
+ /**
807
+ * Locale code supported by RedDokia. Built-in dictionaries are provided for `'ko'` (Korean), `'en'` (English), and `'ja'` (Japanese), and any custom locale code (e.g. `'fr'`, `'zh-CN'`, `'de'`) is also accepted with `localeStrings` (falling back to `'en'` for unspecified keys).
808
+ */
809
+ export type RedDokiaLocale = 'ko' | 'en' | 'ja' | (string & {});
810
+ /**
811
+ * Custom UI string overrides passed to `localeStrings`: either a flat partial dictionary applied to every locale, or a per-locale map (e.g. `{ ko, en, ja, fr, 'zh-CN' }`) applied only when that locale is active.
812
+ */
813
+ export type RedDokiaLocaleOverrides = Partial<RedDokiaLocaleStrings> | Record<string, Partial<RedDokiaLocaleStrings> | undefined>;
814
+ /**
815
+ * Complete dictionary of localizable UI labels, tooltips, and context menu items used across RedDokia.
816
+ * Pass a {@link RedDokiaLocaleOverrides} (flat partial object or per-locale `{ ko, en, ja }` map) via `localeStrings` on `RedDokia` to customize individual strings.
817
+ */
818
+ export interface RedDokiaLocaleStrings {
819
+ /** Tooltip displayed on a pinned tab icon. */
820
+ pinnedTooltip: string;
821
+ /** Tooltip displayed on the close indicator of a dirty closable tab. */
822
+ dirtyClosableTooltip: string;
823
+ /** Tooltip displayed on a non-closable dirty tab indicator. */
824
+ dirtyTooltip: string;
825
+ /** Tooltip displayed on a tab close button. */
826
+ closeTabTooltip: string;
827
+ /** Tooltip displayed on the tab overflow dropdown button. */
828
+ overflowTabsTooltip: string;
829
+ /** Tooltip displayed on the button that restores a maximized group. */
830
+ restoreGroupTooltip: string;
831
+ /** Tooltip displayed on the button that collapses an EdgeBar tool panel. */
832
+ collapsePanelTooltip: string;
833
+ /** Tooltip displayed on a locked group badge. */
834
+ lockedGroupTooltip: string;
835
+ /** Primary heading displayed when the contents stage has no open tabs. */
836
+ emptyContentsMessage: string;
837
+ /** Secondary helper message displayed when the contents stage has no open tabs. */
838
+ emptyContentsSubMessage: string;
839
+ /** Tooltip displayed on resize sash handles. */
840
+ sashResizeTooltip: string;
841
+ /** Context menu label for pinning a tab. */
842
+ pinTab: string;
843
+ /** Context menu label for unpinning a tab. */
844
+ unpinTab: string;
845
+ /** Context menu label for closing the target tab. */
846
+ closeTab: string;
847
+ /** Context menu label for closing all other tabs in the group. */
848
+ closeOtherTabs: string;
849
+ /** Context menu label for closing all tabs to the right of the target tab. */
850
+ closeTabsToRight: string;
851
+ /** Context menu label for closing all saved (non-dirty) tabs in the group. */
852
+ closeSavedTabs: string;
853
+ /** Context menu label for closing all closable tabs in the group. */
854
+ closeAllTabs: string;
855
+ /** Context menu label for splitting and moving the tab to the right. */
856
+ splitRightMove: string;
857
+ /** Context menu label for splitting and moving the tab downward. */
858
+ splitDownMove: string;
859
+ /** Context menu label for re-docking a single floating tab back into the grid. */
860
+ redockToGrid: string;
861
+ /** Context menu label for re-docking an entire floating group back into the grid. */
862
+ redockGroupToGrid: string;
863
+ /** Context menu label for detaching a tab into a floating window. */
864
+ floatWindow: string;
865
+ /** Context menu label for detaching an entire group into a floating window. */
866
+ floatGroupWindow: string;
867
+ /** Context menu label for opening a tab in a native OS pop-out window. */
868
+ popoutWindow: string;
869
+ /** Context menu label for opening an entire group in a native OS pop-out window. */
870
+ popoutGroupWindow: string;
871
+ /** Context menu label for toggling group Zen Mode maximize/restore. */
872
+ maximizeRestoreGroup: string;
873
+ /** Context menu label for collapsing an EdgeBar tool panel. */
874
+ collapsePanel: string;
875
+ /** Context menu label for locking a group. */
876
+ lockGroup: string;
877
+ /** Context menu label for unlocking a group. */
878
+ unlockGroup: string;
879
+ /** Label and tooltip for re-docking a pop-out window back into the main window. */
880
+ redockToMainWindow: string;
881
+ /**
882
+ * Tooltip and label for docking an EdgeBar-origin floating panel back into its EdgeBar slot.
883
+ */
884
+ redockToEdgeBar: string;
885
+ /** Tooltip displayed on floating window resize handles. */
886
+ floatingResizeTooltip: string;
887
+ /** EdgeBar icon context menu label for hiding the active tool window. */
888
+ edgeHide: string;
889
+ /**
890
+ * EdgeBar icon context menu submenu label for moving a tool window to another edge slot.
891
+ */
892
+ edgeMoveTo: string;
893
+ /** EdgeBar icon context menu label for toggling tool window name labels on rails. */
894
+ edgeShowToolWindowNames: string;
895
+ /** EdgeBar slot label for `'left-top'`. */
896
+ edgeSlotLeftTop: string;
897
+ /** EdgeBar slot label for `'left-bottom'`. */
898
+ edgeSlotLeftBottom: string;
899
+ /** EdgeBar slot label for `'bottom-left'`. */
900
+ edgeSlotBottomLeft: string;
901
+ /** EdgeBar slot label for `'bottom-right'`. */
902
+ edgeSlotBottomRight: string;
903
+ /** EdgeBar slot label for `'right-bottom'`. */
904
+ edgeSlotRightBottom: string;
905
+ /** EdgeBar slot label for `'right-top'`. */
906
+ edgeSlotRightTop: string;
907
+ }
908
+ /**
909
+ * Options passed to `controller.startExternalDrag(pointerEvent, options)` to initiate a drag-to-dock session from an external DOM element (e.g. widget palette or file tree).
910
+ */
911
+ export interface RedDokiaExternalDragOptions {
912
+ /**
913
+ * View ID to dock on drop (existing registered view ID, or a new dynamic view ID when `templateId` is provided).
914
+ */
915
+ viewId: string;
916
+ /**
917
+ * Optional registered template view ID used to spawn a parameterized dynamic view on drop.
918
+ */
919
+ templateId?: string;
920
+ /** Optional display title shown on the drag ghost and the created tab. */
921
+ title?: string;
922
+ /** Optional icon assigned to the created tab. */
923
+ icon?: RedDokiaIconValue;
924
+ /** Optional custom parameters injected into the spawned view component. */
925
+ params?: Record<string, any>;
926
+ }
927
+ /**
928
+ * Imperative workbench controller exposed via `onReady`, view render props, and customization callbacks.
929
+ * Provides programmatic control over views, tab states, splits, floating/pop-out windows, themes, locales, and layout snapshots.
930
+ */
931
+ export interface RedDokiaController {
932
+ /**
933
+ * Opens an existing registered view or spawns a dynamic view in the target group (activates it if already open).
934
+ */
935
+ openView: (viewId: string, targetGroupOrOptions?: string | RedDokiaOpenViewOptions) => void;
936
+ /**
937
+ * Patches mutable runtime metadata (`title`, `badge`, `dirty`, `params`, constraints, etc.) of a view.
938
+ */
939
+ updateView: (viewId: string, patch: RedDokiaViewMetadataPatch) => void;
940
+ /**
941
+ * Dynamically registers a new `RedDokiaViewSchema` at runtime and optionally opens it immediately.
942
+ */
943
+ registerView: <TParams = Record<string, any>>(schema: RedDokiaViewSchema<TParams>, options?: {
944
+ open?: boolean;
945
+ targetGroupId?: string;
946
+ }) => void;
947
+ /** Toggles the pinned state of a tab within its host group. */
948
+ togglePinView: (viewId: string) => void;
949
+ /** Closes a view tab (respecting `onBeforeCloseView` guards if configured). */
950
+ closeView: (viewId: string) => void;
951
+ /** Closes all closable unpinned tabs in `groupId` except `keepViewId`. */
952
+ closeOtherViews: (groupId: string, keepViewId: string) => void;
953
+ /**
954
+ * Closes all closable unpinned tabs positioned to the right of `pivotViewId` in `groupId`.
955
+ */
956
+ closeViewsToRight: (groupId: string, pivotViewId: string) => void;
957
+ /**
958
+ * Closes all closable tabs in `groupId` (defaults to the active group) that are not marked `dirty`.
959
+ */
960
+ closeSavedViews: (groupId?: string) => void;
961
+ /** Closes all closable unpinned tabs in `groupId` (defaults to the active group). */
962
+ closeAllViews: (groupId?: string) => void;
963
+ /**
964
+ * Splits `groupId` (defaults to the active group when omitted) along `direction` (`'horizontal'` = right, `'vertical'` = down), moving its active tab (or `newViewId`) when splittable.
965
+ */
966
+ splitGroup: (groupId: string | undefined, direction: RedDokiaLayoutOrientation, newViewId?: string) => void;
967
+ /**
968
+ * Moves and docks `viewId` into `targetGroupId` at the specified directional `zone`.
969
+ */
970
+ dockViewToGroup: (viewId: string, targetGroupId: string, zone: RedDokiaDockZone) => void;
971
+ /**
972
+ * Detaches a single view tab into a Zero-Unmount floating window at optional `rect` coordinates.
973
+ */
974
+ floatView: (viewId: string, rect?: Partial<RedDokiaRect>) => void;
975
+ /**
976
+ * Detaches all tabs of a docked `groupId` (defaults to the active group) together into a multi-tab Zero-Unmount floating window.
977
+ */
978
+ floatGroup: (groupId?: string, rect?: Partial<RedDokiaRect>) => void;
979
+ /**
980
+ * Re-docks all views of a floating window back into `targetGroupId` or an appropriate grid group.
981
+ */
982
+ redockFloatingGroup: (floatingGroupId: string, targetGroupId?: string) => void;
983
+ /** Detaches a view into a native OS browser pop-out window via `window.open`. */
984
+ popoutView: (viewId: string, rect?: Partial<RedDokiaRect>) => void;
985
+ /**
986
+ * Detaches an entire group's tabs (defaults to the active group) into a multi-tab native OS browser pop-out window.
987
+ */
988
+ popoutGroup: (groupId?: string, rect?: Partial<RedDokiaRect>) => void;
989
+ /** Returns all view IDs currently hosted inside open native pop-out windows. */
990
+ getPopoutViewIds: () => string[];
991
+ /**
992
+ * Re-docks a single view from a native pop-out window back into the main workbench grid.
993
+ */
994
+ redockPopoutView: (viewId: string, targetGroupId?: string) => void;
995
+ /**
996
+ * Re-docks all views of a native pop-out window back into the main workbench grid.
997
+ * Accepts either a pop-out window ID or any view ID hosted inside that pop-out window.
998
+ */
999
+ redockPopoutGroup: (popoutIdOrViewId: string, targetGroupId?: string) => void;
1000
+ /**
1001
+ * Updates per-group chromeless header visibility (`showHeader`) or drop/close lock (`locked`) flags.
1002
+ */
1003
+ setGroupOptions: (groupId: string, options: {
1004
+ showHeader?: boolean;
1005
+ locked?: boolean;
1006
+ }) => void;
1007
+ /** Toggles the collapsed/expanded state of a docked group. */
1008
+ toggleCollapseGroup: (groupId: string) => void;
1009
+ /**
1010
+ * Toggles visibility of the tool panel bound to the specified peripheral `RedDokiaEdgeSlot`.
1011
+ */
1012
+ toggleEdgeSlot: (slot: RedDokiaEdgeSlot) => void;
1013
+ /**
1014
+ * Toggles collapse/expand of the specified peripheral edge bar (`'left'`, `'right'`, or `'bottom'`).
1015
+ */
1016
+ toggleEdgeBar: (edge: 'left' | 'right' | 'bottom') => void;
1017
+ /**
1018
+ * Moves a tool window view to one of the 6 peripheral EdgeBar slots (`'left-top'`, `'left-bottom'`, `'bottom-left'`, `'bottom-right'`, `'right-bottom'`, `'right-top'`).
1019
+ */
1020
+ moveViewToEdgeSlot: (viewId: string, slot: RedDokiaEdgeSlot) => void;
1021
+ /** Shows or hides tool window name labels on the peripheral EdgeBar icon rails. */
1022
+ setEdgeBarLabelsVisible: (visible: boolean) => void;
1023
+ /**
1024
+ * Toggles Zen Mode maximization on `groupId` (defaults to the currently active group).
1025
+ */
1026
+ toggleMaximizeGroup: (groupId?: string) => void;
1027
+ /**
1028
+ * Resets the workbench layout back to `layout` and clears persisted snapshot overrides.
1029
+ */
1030
+ resetLayout: () => void;
1031
+ /**
1032
+ * Switches the active workbench theme (`'dark'`, `'light'`, or any custom theme ID registered in `themes`).
1033
+ */
1034
+ setTheme: (themeId: RedDokiaThemeId) => void;
1035
+ /**
1036
+ * Returns the currently active workbench theme ID (`'dark'`, `'light'`, or a custom theme ID).
1037
+ */
1038
+ getTheme: () => RedDokiaThemeId;
1039
+ /** Changes the active UI locale (`'en'`, `'ko'`, or `'ja'`) at runtime. */
1040
+ setLocale: (locale: RedDokiaLocale) => void;
1041
+ /** Returns the currently active UI locale code. */
1042
+ getLocale: () => RedDokiaLocale;
1043
+ /** Serializes the current layout state into a versioned JSON snapshot string. */
1044
+ exportLayoutJson: () => string;
1045
+ /**
1046
+ * Restores the workbench layout from a serialized JSON snapshot string; returns `true` if valid and applied.
1047
+ */
1048
+ importLayoutJson: (json: string) => boolean;
1049
+ /** Returns a read-only snapshot of the current `RedDokiaLayoutState`. */
1050
+ getLayoutState: () => RedDokiaLayoutState;
1051
+ /** Toggles the drop/close lock flag on `groupId` (defaults to the active group). */
1052
+ toggleLockGroup: (groupId?: string) => void;
1053
+ /** Re-docks a single view from a floating window back into the main grid. */
1054
+ redockFloatingView: (viewId: string, targetGroupId?: string) => void;
1055
+ /** Switches the active workbench layout to the given declarative `layout` schema. */
1056
+ setLayout: (layout: RedDokiaLayoutSchema) => void;
1057
+ /**
1058
+ * Starts a PointerEvent drag-and-dock session from an external host DOM element (such as a widget palette or file list) using the native 5-zone dock overlay and hit-tester.
1059
+ *
1060
+ * @example
1061
+ * ```ts
1062
+ * chip.addEventListener('pointerdown', (e) => {
1063
+ * controller.startExternalDrag(e, {
1064
+ * viewId: 'widget-1',
1065
+ * templateId: 'widget-template',
1066
+ * title: 'Metrics Widget',
1067
+ * params: { metric: 'fps' },
1068
+ * });
1069
+ * });
1070
+ * ```
1071
+ */
1072
+ startExternalDrag: (event: {
1073
+ clientX: number;
1074
+ clientY: number;
1075
+ button?: number;
1076
+ altKey?: boolean;
1077
+ }, options: RedDokiaExternalDragOptions) => void;
1078
+ }
1079
+ /** Props injected into every view component (`viewSchema.component`). */
1080
+ export interface RedDokiaViewRenderProps<TParams = Record<string, any>> {
1081
+ /** Unique ID of the rendered view instance. */
1082
+ viewId: string;
1083
+ /** Resolved `RedDokiaViewSchema` metadata merged with any runtime patches. */
1084
+ viewSchema?: RedDokiaViewSchema<TParams>;
1085
+ /** Custom typed parameters associated with this view instance. */
1086
+ params?: TParams;
1087
+ /** ID of the group currently hosting this view, or `null` if detached. */
1088
+ groupId: string | null;
1089
+ /** Whether this view is currently the active visible tab in its host group. */
1090
+ active: boolean;
1091
+ /** Whether this view is currently visible in a docked, floating, or pop-out host. */
1092
+ visible?: boolean;
1093
+ /** Whether this view is currently detached into an in-viewport floating window. */
1094
+ isFloating?: boolean;
1095
+ /**
1096
+ * Whether this view is currently detached into a separate OS browser pop-out window.
1097
+ */
1098
+ isPopout?: boolean;
1099
+ /** Current content viewport width in pixels. */
1100
+ width: number;
1101
+ /** Current content viewport height in pixels. */
1102
+ height: number;
1103
+ /** Current workbench layout state snapshot. */
1104
+ layoutState: RedDokiaLayoutState;
1105
+ /** Latest solved layout geometry across all nodes, groups, views, and sashes. */
1106
+ geometry: RedDokiaSolvedGeometry;
1107
+ /** Imperative workbench controller instance. */
1108
+ controller: RedDokiaController;
1109
+ }
1110
+ /**
1111
+ * Props passed to the `emptyContents` slot when the persistent contents document area has zero open tabs.
1112
+ */
1113
+ export interface RedDokiaEmptyContentsRenderProps {
1114
+ /**
1115
+ * Imperative workbench controller for opening new views or triggering actions from the empty state.
1116
+ */
1117
+ controller: RedDokiaController;
1118
+ }
1119
+ /**
1120
+ * Props passed to the `groupActions` slot rendered on the right side of each docked group header bar.
1121
+ */
1122
+ export interface RedDokiaGroupActionsRenderProps {
1123
+ /** Unique identifier of the docked group. */
1124
+ groupId: string;
1125
+ /** ID of the currently active view tab in this group, or `null` if empty. */
1126
+ activeViewId: string | null;
1127
+ /** Schema of the currently active view in this group, if available. */
1128
+ viewSchema?: RedDokiaViewSchema;
1129
+ /** Ordered list of view IDs currently open in this group. */
1130
+ views: string[];
1131
+ /** Imperative workbench controller instance. */
1132
+ controller: RedDokiaController;
1133
+ /** Current workbench layout state snapshot. */
1134
+ layoutState: RedDokiaLayoutState;
1135
+ }
1136
+ /**
1137
+ * Custom component or DOM mount handler accepted by `RedDokiaProps.groupActions` and `RedDokiaViewSchema.groupActions`.
1138
+ */
1139
+ export type RedDokiaGroupActionsSlot = ((container: HTMLElement, ctx: RedDokiaGroupActionsRenderProps) => void | (() => void) | RedDokiaSlotLifecycle<RedDokiaGroupActionsRenderProps>) | ((props: RedDokiaGroupActionsRenderProps) => any) | unknown;
1140
+ /**
1141
+ * Controls how custom items combine with RedDokia's built-in tab context menu items.
1142
+ * - `'append'` (default): appends custom items below the built-in menu items.
1143
+ * - `'replace'`: hides the built-in items and renders only the provided items (which may selectively reuse `defaultItems`).
1144
+ */
1145
+ export type RedDokiaTabContextMenuMode = 'append' | 'replace';
1146
+ /** Static array or dynamic resolver callback returning tab context menu items. */
1147
+ export type RedDokiaTabContextMenuItemsResolver = RedDokiaTabContextMenuItem[] | ((props: RedDokiaTabContextMenuProps) => RedDokiaTabContextMenuItem[]);
1148
+ /**
1149
+ * Object configuration for `tabContextMenu` specifying both merge `mode` and `items`.
1150
+ */
1151
+ export interface RedDokiaTabContextMenuConfig {
1152
+ /** Merge mode (`'append'` by default, or `'replace'` to hide built-in items). */
1153
+ mode?: RedDokiaTabContextMenuMode;
1154
+ /** Custom menu items (static array or callback receiving `defaultItems`). */
1155
+ items: RedDokiaTabContextMenuItemsResolver;
1156
+ }
1157
+ /**
1158
+ * Unified option type accepted by both global `<RedDokia tabContextMenu={...} />` and per-view `viewSchema.tabContextMenu`.
1159
+ * Accepts a static item array, a resolver callback (shorthand for `mode: 'append'`), or a `{ mode, items }` config object.
1160
+ */
1161
+ export type RedDokiaTabContextMenuOption = RedDokiaTabContextMenuItemsResolver | RedDokiaTabContextMenuConfig;
1162
+ /**
1163
+ * Custom menu item rendered in the right-click tab context menu via `tabContextMenu`.
1164
+ */
1165
+ export interface RedDokiaTabContextMenuItem {
1166
+ /** Unique identifier of the context menu item. */
1167
+ id: string;
1168
+ /** Display label of the menu action. */
1169
+ label: string;
1170
+ /** Optional shortcut hint rendered on the right side of the menu item. */
1171
+ shortcut?: string;
1172
+ /** Optional leading icon for the menu item. */
1173
+ icon?: RedDokiaIconValue;
1174
+ /** Styles the menu item in destructive/danger red when `true`. */
1175
+ danger?: boolean;
1176
+ /** Disables the menu item and prevents clicking when `true`. */
1177
+ disabled?: boolean;
1178
+ /** Renders a horizontal separator line immediately above this item when `true`. */
1179
+ dividerBefore?: boolean;
1180
+ /** Callback executed when the user clicks this menu item. */
1181
+ action: () => void;
1182
+ }
1183
+ /**
1184
+ * Context passed to a `tabContextMenu` resolver callback when building right-click actions for a tab.
1185
+ */
1186
+ export interface RedDokiaTabContextMenuProps {
1187
+ /** ID of the right-clicked tab view. */
1188
+ viewId: string;
1189
+ /** Resolved specification of the right-clicked view. */
1190
+ viewSchema?: RedDokiaViewSchema;
1191
+ /** ID of the group owning the right-clicked tab. */
1192
+ groupId: string;
1193
+ /** Imperative workbench controller instance. */
1194
+ controller: RedDokiaController;
1195
+ /**
1196
+ * Built-in RedDokia context menu items for this tab; useful when filtering or composing items in `'replace'` mode.
1197
+ */
1198
+ defaultItems: RedDokiaTabContextMenuItem[];
1199
+ }
1200
+ /**
1201
+ * Built-in (`'dark'`, `'light'`) or custom theme identifier registered via `themes`.
1202
+ */
1203
+ export type RedDokiaThemeId = 'dark' | 'light' | (string & {});
1204
+ /** Props accepted by the top-level `<RedDokia />` component. */
1205
+ export interface RedDokiaProps {
1206
+ /** Collection of view specifications available in the workbench. */
1207
+ views: RedDokiaViewSchema[];
1208
+ /**
1209
+ * Declarative layout schema used on initial mount and when `resetLayout()` is invoked.
1210
+ */
1211
+ layout?: RedDokiaLayoutSchema;
1212
+ /** Optional CSS class name appended to `.reddokia-root`. */
1213
+ className?: string;
1214
+ /** Optional inline style object applied to `.reddokia-root`. */
1215
+ style?: RedDokiaStyle;
1216
+ /**
1217
+ * Invoked once the workbench mounts with the imperative {@link RedDokiaController} handle.
1218
+ */
1219
+ onReady?: (controller: RedDokiaController) => void;
1220
+ /**
1221
+ * Global right-click tab context menu configuration applied to all tabs unless overridden by `viewSchema.tabContextMenu`.
1222
+ * Accepts a static item array, a resolver callback (`mode: 'append'`), or `{ mode: 'append' | 'replace', items }`.
1223
+ */
1224
+ tabContextMenu?: RedDokiaTabContextMenuOption;
1225
+ /**
1226
+ * Global custom component or DOM mount handler rendered on the right side of each docked group header bar unless overridden by `viewSchema.groupActions`.
1227
+ */
1228
+ groupActions?: RedDokiaGroupActionsSlot;
1229
+ /**
1230
+ * Synchronous or asynchronous guard invoked before a view closes; return `false` (or `Promise<false>`) to cancel closing.
1231
+ */
1232
+ onBeforeCloseView?: (viewId: string, viewSchema?: RedDokiaViewSchema) => boolean | void | Promise<boolean>;
1233
+ /**
1234
+ * Common design-token overrides applied across all themes as shared defaults (overridden by per-theme entries in `themes`).
1235
+ */
1236
+ themeTokens?: Partial<RedDokiaTheme>;
1237
+ /**
1238
+ * Named custom theme registry (`{ ocean: { base: 'dark', ... }, warmPaper: { base: 'light', ... } }`).
1239
+ * Also supports partial per-theme overrides for built-in `'dark'` and `'light'`.
1240
+ */
1241
+ themes?: Record<string, RedDokiaCustomThemeDefinition>;
1242
+ /**
1243
+ * Initial theme ID (`'dark'`, `'light'`, or a custom key registered in `themes`; `'dark'` by default).
1244
+ */
1245
+ theme?: RedDokiaThemeId;
1246
+ /**
1247
+ * `localStorage` key used to automatically persist and restore layout snapshots across reloads.
1248
+ */
1249
+ storageKey?: string;
1250
+ /** Fired whenever the workbench layout state changes. */
1251
+ onLayoutChange?: (state: RedDokiaLayoutState) => void;
1252
+ /**
1253
+ * Fired once per layout frame with a `viewId`-keyed map of all visible views whose solved pixel dimensions changed.
1254
+ */
1255
+ onViewResize?: (events: Readonly<Record<string, RedDokiaResizeEvent>>) => void;
1256
+ /** Active UI language locale (`'en'`, `'ko'`, or `'ja'`, `'en'` by default). */
1257
+ locale?: RedDokiaLocale;
1258
+ /**
1259
+ * Partial UI string overrides — accepts either a flat `Partial<RedDokiaLocaleStrings>` or a per-locale map (`{ ko?: ..., en?: ..., ja?: ... }`).
1260
+ */
1261
+ localeStrings?: RedDokiaLocaleOverrides;
1262
+ /**
1263
+ * Whether RedDokia automatically injects its scoped `.rd-*` `<style>` tag into `<head>` (`true` by default).
1264
+ * Set to `false` in Strict CSP environments when loading `reddokia/style.css` externally.
1265
+ */
1266
+ injectStyles?: boolean;
1267
+ /**
1268
+ * Optional Content Security Policy (CSP) `nonce` applied to auto-injected `<style>` tags (including pop-out windows).
1269
+ */
1270
+ styleNonce?: string;
1271
+ /**
1272
+ * Optional custom favicon URL (or `data:` URI) applied to OS-level native pop-out browser windows.
1273
+ * When omitted, pop-out windows inherit `<link rel*="icon">` from the host document and fall back to the built-in RedDokia SVG favicon if the host defines none.
1274
+ */
1275
+ popoutFavicon?: string;
1276
+ /**
1277
+ * Optional HTML5 native drag-and-drop handler invoked when OS files or `draggable="true"` elements are dropped onto the docking grid.
1278
+ * Returning one or more {@link RedDokiaExternalDragOptions} automatically registers and docks them into the dropped group/zone.
1279
+ *
1280
+ * @example
1281
+ * ```ts
1282
+ * onExternalNativeDrop: ({ files }) =>
1283
+ * files.map((file, idx) => ({
1284
+ * viewId: `file-${Date.now()}-${idx}`,
1285
+ * templateId: 'editor-template',
1286
+ * title: file.name,
1287
+ * params: { file },
1288
+ * }))
1289
+ * ```
1290
+ */
1291
+ onExternalNativeDrop?: (event: RedDokiaExternalNativeDropEvent) => RedDokiaExternalDragOptions | RedDokiaExternalDragOptions[] | void;
1292
+ }
1293
+ /**
1294
+ * Payload delivered to {@link RedDokiaProps.onExternalNativeDrop} when an OS file or HTML5 `draggable` item is dropped onto the docking grid.
1295
+ */
1296
+ export interface RedDokiaExternalNativeDropEvent {
1297
+ /** Original browser `DragEvent`. */
1298
+ event: DragEvent;
1299
+ /** Browser `DataTransfer` object from the drop event. */
1300
+ dataTransfer: DataTransfer | null;
1301
+ /** Convenience array of dropped OS `File` objects (empty if non-file drag). */
1302
+ files: File[];
1303
+ /**
1304
+ * Target group ID under the drop cursor, or `null` when dropped on a root edge or empty grid.
1305
+ */
1306
+ targetGroupId: string | null;
1307
+ /**
1308
+ * Resolved 5-direction docking zone (`'center' | 'left' | 'right' | 'top' | 'bottom'`).
1309
+ */
1310
+ zone: RedDokiaDockZone;
1311
+ /** Viewport client X coordinate at drop time. */
1312
+ clientX: number;
1313
+ /** Viewport client Y coordinate at drop time. */
1314
+ clientY: number;
1315
+ /** Active workbench controller for custom handling when returning `void`. */
1316
+ controller: RedDokiaController;
1317
+ }
1318
+ /**
1319
+ * Union of supported icon inputs across framework and Vanilla RedDokia engines (`RedDokiaIcons.*` constant, inline SVG / image URL string, DOM `Node`, or framework icon component/element).
1320
+ */
1321
+ export type RedDokiaIconValue = RedDokiaIconName | (string & {}) | Node | ((className: string) => Node | null) | ((props: {
1322
+ className?: string;
1323
+ }) => unknown) | (new (props: {
1324
+ className?: string;
1325
+ }) => unknown) | {
1326
+ readonly $$typeof?: symbol;
1327
+ readonly type?: unknown;
1328
+ readonly props?: unknown;
1329
+ };
1330
+ /**
1331
+ * Lifecycle object optionally returned by a framework-agnostic view `(container, ctx) => ...` callback.
1332
+ */
1333
+ export interface RedDokiaViewLifecycle<TParams = Record<string, any>> {
1334
+ /**
1335
+ * Invoked whenever the view's render props (`width`, `height`, `visible`, `groupId`, `params`, etc.) change.
1336
+ */
1337
+ update?: (ctx: RedDokiaViewRenderProps<TParams>) => void;
1338
+ /** Invoked when the view or workbench instance is permanently destroyed. */
1339
+ unmount?: () => void;
1340
+ }
1341
+ /**
1342
+ * Function signature for mounting a framework-agnostic view into its persistent `HTMLElement` host container.
1343
+ */
1344
+ export type RedDokiaViewMountHandler<TParams = Record<string, any>> = (container: HTMLElement, context: RedDokiaViewRenderProps<TParams>) => void | (() => void) | RedDokiaViewLifecycle<TParams>;
1345
+ /**
1346
+ * Lifecycle returned by custom DOM slot callbacks (`topBar.left`/`right`, `statusBar.left`/`right`, `emptyContents`).
1347
+ */
1348
+ export interface RedDokiaSlotLifecycle<TContext = RedDokiaController> {
1349
+ /** Called when slot context updates. */
1350
+ update?: (ctx: TContext) => void;
1351
+ /** Called when the slot DOM is torn down. */
1352
+ unmount?: () => void;
1353
+ }
1354
+ /**
1355
+ * Function signature for rendering/mounting custom DOM elements into a shell slot (`topBar.left`/`right`, `statusBar.left`/`right`, or `emptyContents`).
1356
+ */
1357
+ export type RedDokiaSlotMountHandler = (container: HTMLElement, controller: RedDokiaController) => void | (() => void) | RedDokiaSlotLifecycle<RedDokiaController>;
1358
+ /**
1359
+ * Active RedDokia workbench instance returned by `new RedDokia(container, props)`.
1360
+ * Directly exposes all {@link RedDokiaController} methods (`openView`, `closeView`, etc.) as well as `.controller`.
1361
+ */
1362
+ export interface RedDokiaInstance extends RedDokiaController {
1363
+ /** Imperative controller API for inspecting and mutating the workbench state. */
1364
+ readonly controller: RedDokiaController;
1365
+ /** Root `.reddokia-root` DOM element created inside the host container. */
1366
+ readonly rootElement: HTMLElement;
1367
+ /** Updates workbench props dynamically without destroying or remounting views. */
1368
+ setOptions: (nextProps: Partial<RedDokiaProps>) => void;
1369
+ /**
1370
+ * Returns the persistent `HTMLElement` host container for a mounted view ID, or `null` if not yet mounted.
1371
+ */
1372
+ getViewHostElement: (viewId: string) => HTMLElement | null;
1373
+ /**
1374
+ * Tears down all event listeners, ResizeObservers, pop-out windows, and DOM nodes created by this instance.
1375
+ */
1376
+ destroy: () => void;
1377
+ }
1378
+ export {};
1379
+ //# sourceMappingURL=index.d.ts.map