@eigenpal/docx-js-editor 0.0.12 → 0.0.13

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 (99) hide show
  1. package/dist/DocumentAgent-Ci6_T-XM.d.ts +412 -0
  2. package/dist/DocumentAgent-DEGFgYEN.d.cts +412 -0
  3. package/dist/FindReplaceDialog-BAACAU67.cjs +1 -0
  4. package/dist/FindReplaceDialog-RWYDRWHF.js +1 -0
  5. package/dist/FootnotePropertiesDialog-BC6JIPDA.cjs +1 -0
  6. package/dist/FootnotePropertiesDialog-CWQF5EBK.js +1 -0
  7. package/dist/HyperlinkDialog-EG2BSLPD.cjs +1 -0
  8. package/dist/HyperlinkDialog-YAVK64F4.js +1 -0
  9. package/dist/ImagePositionDialog-IGYS5KMK.cjs +1 -0
  10. package/dist/ImagePositionDialog-S6SMH7XH.js +1 -0
  11. package/dist/ImagePropertiesDialog-UO5QUIBS.js +1 -0
  12. package/dist/ImagePropertiesDialog-VGV4E4SN.cjs +1 -0
  13. package/dist/TablePropertiesDialog-VBOU4DID.js +1 -0
  14. package/dist/TablePropertiesDialog-WRM47JI6.cjs +1 -0
  15. package/dist/{types-BALm1KBi.d.cts → agentApi-CbVUCZRu.d.cts} +1 -308
  16. package/dist/{types-BALm1KBi.d.ts → agentApi-CbVUCZRu.d.ts} +1 -308
  17. package/dist/chunk-2ASOEN3V.js +1 -0
  18. package/dist/chunk-6MBDPZVD.js +111 -0
  19. package/dist/chunk-6YLNNCRZ.cjs +10 -0
  20. package/dist/chunk-BVQ2QRHA.cjs +4 -0
  21. package/dist/chunk-COP5BIBZ.js +10 -0
  22. package/dist/chunk-CZ7W7MCM.cjs +2 -0
  23. package/dist/chunk-E6XDMUAM.js +4 -0
  24. package/dist/chunk-EMKABJPH.js +1 -0
  25. package/dist/{chunk-GIZ5CTBD.cjs → chunk-EPCZ24TY.cjs} +5 -5
  26. package/dist/chunk-ESI4BSBF.js +1 -0
  27. package/dist/chunk-FLECKDK4.cjs +58 -0
  28. package/dist/chunk-ITWEFKGQ.cjs +1 -0
  29. package/dist/chunk-KESNGXGO.js +1 -0
  30. package/dist/chunk-KVAT5SVD.js +2 -0
  31. package/dist/chunk-L34XFLQZ.cjs +1 -0
  32. package/dist/chunk-M7F2CUUD.js +2 -0
  33. package/dist/chunk-MDPDH7KS.js +58 -0
  34. package/dist/chunk-MTX3EEBJ.js +258 -0
  35. package/dist/chunk-NT2REEAA.cjs +1 -0
  36. package/dist/{chunk-P332HWDE.js → chunk-OTG4NABM.js} +5 -5
  37. package/dist/chunk-OW5H5DNE.cjs +1 -0
  38. package/dist/chunk-PJVI53AH.js +2 -0
  39. package/dist/chunk-PNMZPPPI.cjs +2 -0
  40. package/dist/chunk-SF53KLDZ.cjs +1 -0
  41. package/dist/chunk-TOI5W3HK.js +8 -0
  42. package/dist/chunk-UAVOWAIF.cjs +8 -0
  43. package/dist/chunk-VN7XH644.cjs +258 -0
  44. package/dist/chunk-W4DUKACP.cjs +111 -0
  45. package/dist/chunk-XS2AQFMF.cjs +2 -0
  46. package/dist/chunk-ZDYHAYN6.js +1 -0
  47. package/dist/clipboard-BOocwmAM.d.ts +539 -0
  48. package/dist/clipboard-Cx7cb3kX.d.cts +539 -0
  49. package/dist/{colorResolver-BNj-uZ58.d.ts → colorResolver-CIDiSPWd.d.cts} +3 -411
  50. package/dist/{colorResolver-DiMquGWR.d.cts → colorResolver-KXbUgzWC.d.ts} +3 -411
  51. package/dist/core-plugins.cjs +1 -1
  52. package/dist/core-plugins.d.cts +4 -3
  53. package/dist/core-plugins.d.ts +4 -3
  54. package/dist/core-plugins.js +1 -1
  55. package/dist/core.cjs +1 -0
  56. package/dist/core.d.cts +23 -0
  57. package/dist/core.d.ts +23 -0
  58. package/dist/core.js +1 -0
  59. package/dist/headless.cjs +2 -2
  60. package/dist/headless.d.cts +8 -175
  61. package/dist/headless.d.ts +8 -175
  62. package/dist/headless.js +1 -1
  63. package/dist/index.cjs +9 -378
  64. package/dist/index.d.cts +17 -4161
  65. package/dist/index.d.ts +17 -4161
  66. package/dist/index.js +9 -378
  67. package/dist/insertOperations-CzB5b-Of.d.ts +176 -0
  68. package/dist/insertOperations-DKVmCV32.d.cts +176 -0
  69. package/dist/mcp-cli.js +21 -21
  70. package/dist/mcp.cjs +10 -10
  71. package/dist/mcp.d.cts +2 -1
  72. package/dist/mcp.d.ts +2 -1
  73. package/dist/mcp.js +9 -9
  74. package/dist/processTemplate-BHBTDAIC.js +1 -0
  75. package/dist/processTemplate-QOEAXCKA.cjs +1 -0
  76. package/dist/react-Be1YOl4z.d.ts +1356 -0
  77. package/dist/react-DPuSVbgY.d.cts +1356 -0
  78. package/dist/react.cjs +1 -0
  79. package/dist/react.css +1 -0
  80. package/dist/react.d.cts +9 -0
  81. package/dist/react.d.ts +9 -0
  82. package/dist/react.js +1 -0
  83. package/dist/{registry-CzqAPdui.d.ts → registry-D4tvj9f3.d.ts} +1 -1
  84. package/dist/{registry-BUTMLqSj.d.cts → registry-ngv6Bumt.d.cts} +1 -1
  85. package/dist/types-D96elyJF.d.cts +310 -0
  86. package/dist/types-xMzSPT4i.d.ts +310 -0
  87. package/dist/ui.cjs +1 -0
  88. package/dist/ui.d.cts +2103 -0
  89. package/dist/ui.d.ts +2103 -0
  90. package/dist/ui.js +1 -0
  91. package/dist/variableDetector-CPxKo9jP.d.cts +173 -0
  92. package/dist/variableDetector-DeM1N-_L.d.ts +173 -0
  93. package/package.json +85 -10
  94. package/dist/chunk-56AGRHVO.cjs +0 -58
  95. package/dist/chunk-E23CAQXT.js +0 -9
  96. package/dist/chunk-HIBC7HTU.cjs +0 -9
  97. package/dist/chunk-ICEPOA7G.js +0 -58
  98. package/dist/chunk-IZGUXSCC.js +0 -10
  99. package/dist/chunk-XF3IPO7C.cjs +0 -10
package/dist/ui.d.cts ADDED
@@ -0,0 +1,2103 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { CSSProperties, ReactNode } from 'react';
3
+ import { ag as ParagraphAlignment, K as Style, Y as Theme, C as SelectionContext, A as AIAction, d as AgentResponse, ah as StyleType, S as SectionProperties, ai as TabStop, aj as ShadingProperties, h as Document } from './agentApi-CbVUCZRu.cjs';
4
+ import { T as TableAction, j as ParsedClipboardContent } from './clipboard-Cx7cb3kX.cjs';
5
+ export { P as PageIndicatorPosition, c as PageIndicatorVariant, d as PageNavigator, e as PageNavigatorPosition, f as PageNavigatorProps, g as PageNavigatorVariant, h as PageNumberIndicator, i as PageNumberIndicatorProps, k as PrintButton, l as PrintButtonProps, m as PrintOptions, n as PrintStyles, o as TableContext, p as TableSelection, q as TableToolbar, r as TableToolbarProps, s as addColumn, t as addRow, u as calculateProgress, v as calculateScrollToPage, w as calculateVisiblePage, x as clampPageNumber, D as createPageFormat, E as createTableContext, F as deleteColumn, G as deleteRow, H as formatPageOrdinal, J as formatPageRange, K as formatPrintPageRange, L as getCellAt, M as getColumnCount, N as getDefaultPrintOptions, O as getNavigationShortcuts, Q as getPageProgress, V as isFirstPage, W as isLastPage, X as isPrintSupported, Y as isValidPageNumber, _ as mergeCells, $ as openPrintWindow, a2 as parsePageInput, a3 as parsePageRange, a6 as splitCell, a7 as triggerPrint } from './clipboard-Cx7cb3kX.cjs';
6
+
7
+ /**
8
+ * List type
9
+ */
10
+ type ListType = 'bullet' | 'numbered' | 'none';
11
+ /**
12
+ * List state for the current selection
13
+ */
14
+ interface ListState {
15
+ /** Type of list (bullet, numbered, or none) */
16
+ type: ListType;
17
+ /** Current list level (0-8) */
18
+ level: number;
19
+ /** Whether the selection is in a list */
20
+ isInList: boolean;
21
+ /** Numbering ID if in a list */
22
+ numId?: number;
23
+ }
24
+ /**
25
+ * Props for the ListButtons component
26
+ */
27
+ interface ListButtonsProps {
28
+ /** Current list state of the selection */
29
+ listState?: ListState;
30
+ /** Callback when bullet list is toggled */
31
+ onBulletList?: () => void;
32
+ /** Callback when numbered list is toggled */
33
+ onNumberedList?: () => void;
34
+ /** Callback to increase list indent */
35
+ onIndent?: () => void;
36
+ /** Callback to decrease list indent */
37
+ onOutdent?: () => void;
38
+ /** Whether the buttons are disabled */
39
+ disabled?: boolean;
40
+ /** Additional CSS class name */
41
+ className?: string;
42
+ /** Additional inline styles */
43
+ style?: CSSProperties;
44
+ /** Show indent/outdent buttons */
45
+ showIndentButtons?: boolean;
46
+ /** Compact mode (smaller buttons) */
47
+ compact?: boolean;
48
+ /** Whether the current paragraph has left indentation (for enabling outdent) */
49
+ hasIndent?: boolean;
50
+ }
51
+ /**
52
+ * List buttons component for bullet/numbered list controls
53
+ */
54
+ declare function ListButtons({ listState, onBulletList, onNumberedList, onIndent, onOutdent, disabled, className, style, showIndentButtons, compact, hasIndent, }: ListButtonsProps): react_jsx_runtime.JSX.Element;
55
+ /**
56
+ * Create a default list state (not in a list)
57
+ */
58
+ declare function createDefaultListState(): ListState;
59
+
60
+ /**
61
+ * Current formatting state of the selection
62
+ */
63
+ interface SelectionFormatting {
64
+ /** Whether selected text is bold */
65
+ bold?: boolean;
66
+ /** Whether selected text is italic */
67
+ italic?: boolean;
68
+ /** Whether selected text is underlined */
69
+ underline?: boolean;
70
+ /** Whether selected text has strikethrough */
71
+ strike?: boolean;
72
+ /** Whether selected text is superscript */
73
+ superscript?: boolean;
74
+ /** Whether selected text is subscript */
75
+ subscript?: boolean;
76
+ /** Font family of selected text */
77
+ fontFamily?: string;
78
+ /** Font size of selected text (in half-points) */
79
+ fontSize?: number;
80
+ /** Text color */
81
+ color?: string;
82
+ /** Highlight color */
83
+ highlight?: string;
84
+ /** Paragraph alignment */
85
+ alignment?: ParagraphAlignment;
86
+ /** List state of the current paragraph */
87
+ listState?: ListState;
88
+ /** Line spacing in twips (OOXML value, 240 = single spacing) */
89
+ lineSpacing?: number;
90
+ /** Paragraph style ID */
91
+ styleId?: string;
92
+ /** Paragraph left indentation in twips */
93
+ indentLeft?: number;
94
+ }
95
+ /**
96
+ * Formatting action types
97
+ */
98
+ type FormattingAction = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'superscript' | 'subscript' | 'clearFormatting' | 'bulletList' | 'numberedList' | 'indent' | 'outdent' | 'insertLink' | {
99
+ type: 'fontFamily';
100
+ value: string;
101
+ } | {
102
+ type: 'fontSize';
103
+ value: number;
104
+ } | {
105
+ type: 'textColor';
106
+ value: string;
107
+ } | {
108
+ type: 'highlightColor';
109
+ value: string;
110
+ } | {
111
+ type: 'alignment';
112
+ value: ParagraphAlignment;
113
+ } | {
114
+ type: 'lineSpacing';
115
+ value: number;
116
+ } | {
117
+ type: 'applyStyle';
118
+ value: string;
119
+ };
120
+ /**
121
+ * Props for the Toolbar component
122
+ */
123
+ interface ToolbarProps {
124
+ /** Current formatting of the selection */
125
+ currentFormatting?: SelectionFormatting;
126
+ /** Callback when a formatting action is triggered */
127
+ onFormat?: (action: FormattingAction) => void;
128
+ /** Callback for undo action */
129
+ onUndo?: () => void;
130
+ /** Callback for redo action */
131
+ onRedo?: () => void;
132
+ /** Whether undo is available */
133
+ canUndo?: boolean;
134
+ /** Whether redo is available */
135
+ canRedo?: boolean;
136
+ /** Whether the toolbar is disabled */
137
+ disabled?: boolean;
138
+ /** Additional CSS class name */
139
+ className?: string;
140
+ /** Additional inline styles */
141
+ style?: CSSProperties;
142
+ /** Whether to enable keyboard shortcuts (default: true) */
143
+ enableShortcuts?: boolean;
144
+ /** Ref to the editor container for keyboard events */
145
+ editorRef?: React__default.RefObject<HTMLElement>;
146
+ /** Custom toolbar items to render */
147
+ children?: ReactNode;
148
+ /** Whether to show font family picker (default: true) */
149
+ showFontPicker?: boolean;
150
+ /** Whether to show font size picker (default: true) */
151
+ showFontSizePicker?: boolean;
152
+ /** Whether to show text color picker (default: true) */
153
+ showTextColorPicker?: boolean;
154
+ /** Whether to show highlight color picker (default: true) */
155
+ showHighlightColorPicker?: boolean;
156
+ /** Whether to show alignment buttons (default: true) */
157
+ showAlignmentButtons?: boolean;
158
+ /** Whether to show list buttons (default: true) */
159
+ showListButtons?: boolean;
160
+ /** Whether to show line spacing picker (default: true) */
161
+ showLineSpacingPicker?: boolean;
162
+ /** Whether to show style picker (default: true) */
163
+ showStylePicker?: boolean;
164
+ /** Document styles for the style picker */
165
+ documentStyles?: Style[];
166
+ /** Theme for the style picker */
167
+ theme?: Theme | null;
168
+ /** Callback for print action */
169
+ onPrint?: () => void;
170
+ /** Whether to show print button (default: true) */
171
+ showPrintButton?: boolean;
172
+ /** Whether to show zoom control (default: true) */
173
+ showZoomControl?: boolean;
174
+ /** Current zoom level (1.0 = 100%) */
175
+ zoom?: number;
176
+ /** Callback when zoom changes */
177
+ onZoomChange?: (zoom: number) => void;
178
+ /** Callback to refocus the editor after toolbar interactions */
179
+ onRefocusEditor?: () => void;
180
+ /** Callback when a table should be inserted */
181
+ onInsertTable?: (rows: number, columns: number) => void;
182
+ /** Whether to show table insert button (default: true) */
183
+ showTableInsert?: boolean;
184
+ /** Callback when user wants to insert an image */
185
+ onInsertImage?: () => void;
186
+ /** Callback when user wants to insert a page break */
187
+ onInsertPageBreak?: () => void;
188
+ /** Callback when user wants to insert a table of contents */
189
+ onInsertTOC?: () => void;
190
+ /** Callback when user wants to insert a shape */
191
+ onInsertShape?: (data: {
192
+ shapeType: string;
193
+ width: number;
194
+ height: number;
195
+ fillColor?: string;
196
+ fillType?: string;
197
+ outlineWidth?: number;
198
+ outlineColor?: string;
199
+ }) => void;
200
+ /** Image context when an image is selected */
201
+ imageContext?: {
202
+ wrapType: string;
203
+ displayMode: string;
204
+ cssFloat: string | null;
205
+ } | null;
206
+ /** Callback when image wrap type changes */
207
+ onImageWrapType?: (wrapType: string) => void;
208
+ /** Callback for image transform (rotate/flip) */
209
+ onImageTransform?: (action: 'rotateCW' | 'rotateCCW' | 'flipH' | 'flipV') => void;
210
+ /** Callback to open image properties dialog (alt text + border) */
211
+ onOpenImageProperties?: () => void;
212
+ /** Table context when cursor is in a table */
213
+ tableContext?: {
214
+ isInTable: boolean;
215
+ rowCount?: number;
216
+ columnCount?: number;
217
+ canSplitCell?: boolean;
218
+ hasMultiCellSelection?: boolean;
219
+ } | null;
220
+ /** Callback when a table action is triggered */
221
+ onTableAction?: (action: TableAction) => void;
222
+ }
223
+ /**
224
+ * Props for individual toolbar buttons
225
+ */
226
+ interface ToolbarButtonProps {
227
+ /** Whether the button is in active/pressed state */
228
+ active?: boolean;
229
+ /** Whether the button is disabled */
230
+ disabled?: boolean;
231
+ /** Button title/tooltip */
232
+ title?: string;
233
+ /** Click handler */
234
+ onClick?: () => void;
235
+ /** Button content */
236
+ children: ReactNode;
237
+ /** Additional CSS class name */
238
+ className?: string;
239
+ /** ARIA label for accessibility */
240
+ ariaLabel?: string;
241
+ }
242
+ /**
243
+ * Props for toolbar button groups
244
+ */
245
+ interface ToolbarGroupProps$1 {
246
+ /** Group label for accessibility */
247
+ label?: string;
248
+ /** Group content */
249
+ children: ReactNode;
250
+ /** Additional CSS class name */
251
+ className?: string;
252
+ }
253
+ /**
254
+ * Individual toolbar button with shadcn styling
255
+ */
256
+ declare function ToolbarButton({ active, disabled, title, onClick, children, className, ariaLabel, }: ToolbarButtonProps): react_jsx_runtime.JSX.Element;
257
+ /**
258
+ * Toolbar button group with modern styling
259
+ */
260
+ declare function ToolbarGroup$1({ label, children, className }: ToolbarGroupProps$1): react_jsx_runtime.JSX.Element;
261
+ /**
262
+ * Toolbar separator
263
+ */
264
+ declare function ToolbarSeparator(): react_jsx_runtime.JSX.Element;
265
+ /**
266
+ * Formatting toolbar with all controls
267
+ */
268
+ declare function Toolbar({ currentFormatting, onFormat, onUndo, onRedo, canUndo, canRedo, disabled, className, style, enableShortcuts, editorRef, children, showFontPicker, showFontSizePicker, showTextColorPicker, showHighlightColorPicker, showAlignmentButtons, showListButtons, showLineSpacingPicker, showStylePicker, documentStyles, theme, onPrint, showPrintButton, showZoomControl, zoom, onZoomChange, onRefocusEditor, onInsertTable, showTableInsert, onInsertImage, onInsertPageBreak, onInsertTOC, imageContext, onImageWrapType, onImageTransform, onOpenImageProperties, tableContext, onTableAction, }: ToolbarProps): react_jsx_runtime.JSX.Element;
269
+
270
+ /**
271
+ * VariablePanel Component
272
+ *
273
+ * A panel that lists detected template variables with input fields for values:
274
+ * - Lists detected variables from document
275
+ * - Input field for each value
276
+ * - Apply button to process template
277
+ * - Shows empty state when no variables
278
+ */
279
+
280
+ /**
281
+ * Props for VariablePanel component
282
+ */
283
+ interface VariablePanelProps {
284
+ /** Detected variable names */
285
+ variables: string[];
286
+ /** Current variable values */
287
+ values?: Record<string, string>;
288
+ /** Callback when values change */
289
+ onValuesChange?: (values: Record<string, string>) => void;
290
+ /** Callback when Apply button is clicked */
291
+ onApply?: (values: Record<string, string>) => void;
292
+ /** Callback when Reset button is clicked */
293
+ onReset?: () => void;
294
+ /** Whether Apply is in progress */
295
+ isApplying?: boolean;
296
+ /** Whether the panel is disabled */
297
+ disabled?: boolean;
298
+ /** Additional CSS class name */
299
+ className?: string;
300
+ /** Additional inline styles */
301
+ style?: CSSProperties;
302
+ /** Panel title */
303
+ title?: string;
304
+ /** Show empty state message */
305
+ emptyMessage?: string;
306
+ /** Show variable count */
307
+ showCount?: boolean;
308
+ /** Collapsible panel */
309
+ collapsible?: boolean;
310
+ /** Initially collapsed */
311
+ defaultCollapsed?: boolean;
312
+ /** Show search filter */
313
+ showSearch?: boolean;
314
+ /** Custom variable descriptions */
315
+ descriptions?: Record<string, string>;
316
+ }
317
+ /**
318
+ * VariablePanel - Panel for managing template variable values
319
+ */
320
+ declare function VariablePanel({ variables, values: externalValues, onValuesChange, onApply, onReset, isApplying, disabled, className, style, title, emptyMessage, showCount, collapsible, defaultCollapsed, showSearch, descriptions, }: VariablePanelProps): React__default.ReactElement;
321
+
322
+ /**
323
+ * Context Menu Component
324
+ *
325
+ * Right-click context menu for AI actions on selected text.
326
+ * Shows AI options like rewrite, expand, summarize, translate, etc.
327
+ */
328
+
329
+ /**
330
+ * Context menu props
331
+ */
332
+ interface ContextMenuProps {
333
+ /** Whether the menu is visible */
334
+ isOpen: boolean;
335
+ /** Menu position */
336
+ position: {
337
+ x: number;
338
+ y: number;
339
+ };
340
+ /** Selected text */
341
+ selectedText: string;
342
+ /** Selection context for AI operations */
343
+ selectionContext?: SelectionContext;
344
+ /** Callback when an action is selected */
345
+ onAction: (action: AIAction, customPrompt?: string) => void;
346
+ /** Callback when menu is closed */
347
+ onClose: () => void;
348
+ /** Available actions (defaults to DEFAULT_AI_ACTIONS) */
349
+ actions?: AIAction[];
350
+ /** Whether to show custom prompt option */
351
+ showCustomPrompt?: boolean;
352
+ /** Additional className */
353
+ className?: string;
354
+ }
355
+ declare const ContextMenu: React__default.FC<ContextMenuProps>;
356
+ /**
357
+ * Hook to manage context menu state
358
+ */
359
+ declare function useContextMenu(): {
360
+ isOpen: boolean;
361
+ position: {
362
+ x: number;
363
+ y: number;
364
+ };
365
+ selectedText: string;
366
+ selectionContext: SelectionContext | undefined;
367
+ openMenu: (e: React__default.MouseEvent | MouseEvent, text: string, context?: SelectionContext) => void;
368
+ closeMenu: () => void;
369
+ };
370
+ /**
371
+ * Get action shortcuts
372
+ */
373
+ declare function getActionShortcut(action: AIAction): string | undefined;
374
+ /**
375
+ * Check if action is available for selection
376
+ */
377
+ declare function isActionAvailable(_action: AIAction, selectedText: string, _selectionContext?: SelectionContext): boolean;
378
+ /**
379
+ * Get default actions for selection
380
+ */
381
+ declare function getDefaultActions(): AIAction[];
382
+ /**
383
+ * Get all available actions
384
+ */
385
+ declare function getAllActions(): AIAction[];
386
+
387
+ /**
388
+ * Response Preview Component
389
+ *
390
+ * Shows AI response preview with diff view before applying changes.
391
+ * Allows user to accept, reject, or edit the response.
392
+ */
393
+
394
+ /**
395
+ * Response preview props
396
+ */
397
+ interface ResponsePreviewProps {
398
+ /** Original selected text */
399
+ originalText: string;
400
+ /** AI response (or null if loading/error) */
401
+ response: AgentResponse | null;
402
+ /** Action that was performed */
403
+ action: AIAction;
404
+ /** Whether the response is loading */
405
+ isLoading: boolean;
406
+ /** Error message if request failed */
407
+ error?: string;
408
+ /** Callback when user accepts the change */
409
+ onAccept: (newText: string) => void;
410
+ /** Callback when user rejects the change */
411
+ onReject: () => void;
412
+ /** Callback when user wants to retry */
413
+ onRetry?: () => void;
414
+ /** Allow editing before accepting */
415
+ allowEdit?: boolean;
416
+ /** Show diff view */
417
+ showDiff?: boolean;
418
+ /** Additional className */
419
+ className?: string;
420
+ /** Position for the preview */
421
+ position?: {
422
+ x: number;
423
+ y: number;
424
+ };
425
+ }
426
+ declare const ResponsePreview: React__default.FC<ResponsePreviewProps>;
427
+ /**
428
+ * State for response preview
429
+ */
430
+ interface ResponsePreviewState {
431
+ isVisible: boolean;
432
+ originalText: string;
433
+ response: AgentResponse | null;
434
+ action: AIAction;
435
+ isLoading: boolean;
436
+ error?: string;
437
+ position?: {
438
+ x: number;
439
+ y: number;
440
+ };
441
+ }
442
+ /**
443
+ * Hook to manage response preview state
444
+ */
445
+ declare function useResponsePreview(): {
446
+ state: ResponsePreviewState;
447
+ showPreview: (originalText: string, action: AIAction, position?: {
448
+ x: number;
449
+ y: number;
450
+ }) => void;
451
+ setResponse: (response: AgentResponse) => void;
452
+ setError: (error: string) => void;
453
+ hidePreview: () => void;
454
+ };
455
+ /**
456
+ * Create a mock response for testing
457
+ */
458
+ declare function createMockResponse(newText: string, warnings?: string[]): AgentResponse;
459
+ /**
460
+ * Create an error response
461
+ */
462
+ declare function createErrorResponse(error: string): AgentResponse;
463
+
464
+ /**
465
+ * Text Context Menu Component
466
+ *
467
+ * Right-click context menu for text editing operations.
468
+ * Shows Cut, Copy, Paste, and other text editing options.
469
+ */
470
+
471
+ /**
472
+ * Context menu action types
473
+ */
474
+ type TextContextAction = 'cut' | 'copy' | 'paste' | 'pasteAsPlainText' | 'selectAll' | 'delete' | 'separator';
475
+ /**
476
+ * Menu item configuration
477
+ */
478
+ interface TextContextMenuItem {
479
+ /** Action type */
480
+ action: TextContextAction;
481
+ /** Display label */
482
+ label: string;
483
+ /** Keyboard shortcut hint */
484
+ shortcut?: string;
485
+ /** Whether the item is disabled */
486
+ disabled?: boolean;
487
+ /** Whether to show divider after this item */
488
+ dividerAfter?: boolean;
489
+ }
490
+ /**
491
+ * Context menu props
492
+ */
493
+ interface TextContextMenuProps {
494
+ /** Whether the menu is visible */
495
+ isOpen: boolean;
496
+ /** Menu position */
497
+ position: {
498
+ x: number;
499
+ y: number;
500
+ };
501
+ /** Whether there's a selection (enables copy/cut) */
502
+ hasSelection: boolean;
503
+ /** Whether the editor is editable (enables paste/cut/delete) */
504
+ isEditable: boolean;
505
+ /** Whether clipboard has content (enables paste) */
506
+ hasClipboardContent?: boolean;
507
+ /** Callback when an action is selected */
508
+ onAction: (action: TextContextAction) => void;
509
+ /** Callback when menu is closed */
510
+ onClose: () => void;
511
+ /** Custom menu items (overrides default) */
512
+ items?: TextContextMenuItem[];
513
+ /** Additional className */
514
+ className?: string;
515
+ }
516
+ /**
517
+ * Hook options for text context menu
518
+ */
519
+ interface UseTextContextMenuOptions {
520
+ /** Whether the context menu is enabled */
521
+ enabled?: boolean;
522
+ /** Whether the editor is editable */
523
+ isEditable?: boolean;
524
+ /** Container element ref */
525
+ containerRef?: React__default.RefObject<HTMLElement>;
526
+ /** Callback when an action is triggered */
527
+ onAction?: (action: TextContextAction) => void;
528
+ }
529
+ /**
530
+ * Hook return value
531
+ */
532
+ interface UseTextContextMenuReturn {
533
+ /** Whether the menu is open */
534
+ isOpen: boolean;
535
+ /** Menu position */
536
+ position: {
537
+ x: number;
538
+ y: number;
539
+ };
540
+ /** Whether there's a text selection */
541
+ hasSelection: boolean;
542
+ /** Open the context menu */
543
+ openMenu: (event: React__default.MouseEvent | MouseEvent) => void;
544
+ /** Close the context menu */
545
+ closeMenu: () => void;
546
+ /** Handle action selection */
547
+ handleAction: (action: TextContextAction) => void;
548
+ /** Context menu event handler for onContextMenu prop */
549
+ onContextMenu: (event: React__default.MouseEvent) => void;
550
+ }
551
+ declare const TextContextMenu: React__default.FC<TextContextMenuProps>;
552
+ /**
553
+ * Hook to manage text context menu state
554
+ */
555
+ declare function useTextContextMenu(options?: UseTextContextMenuOptions): UseTextContextMenuReturn;
556
+ /**
557
+ * Get action label
558
+ */
559
+ declare function getTextActionLabel(action: TextContextAction): string;
560
+ /**
561
+ * Get action shortcut
562
+ */
563
+ declare function getTextActionShortcut(action: TextContextAction): string;
564
+ /**
565
+ * Get default menu items
566
+ */
567
+ declare function getDefaultTextContextMenuItems(): TextContextMenuItem[];
568
+ /**
569
+ * Check if action is available
570
+ */
571
+ declare function isTextActionAvailable(action: TextContextAction, hasSelection: boolean, isEditable: boolean): boolean;
572
+
573
+ /**
574
+ * Zoom Control Component (Radix UI)
575
+ *
576
+ * A dropdown for controlling document zoom level using Radix Select.
577
+ */
578
+ interface ZoomLevel {
579
+ value: number;
580
+ label: string;
581
+ }
582
+ interface ZoomControlProps {
583
+ value?: number;
584
+ onChange?: (zoom: number) => void;
585
+ levels?: ZoomLevel[];
586
+ disabled?: boolean;
587
+ className?: string;
588
+ minZoom?: number;
589
+ maxZoom?: number;
590
+ showButtons?: boolean;
591
+ persistZoom?: boolean;
592
+ storageKey?: string;
593
+ compact?: boolean;
594
+ }
595
+ declare function ZoomControl({ value, onChange, levels, disabled, className, compact, }: ZoomControlProps): react_jsx_runtime.JSX.Element;
596
+
597
+ /**
598
+ * Font Picker Component (Radix UI)
599
+ *
600
+ * A dropdown selector for choosing font families using Radix Select.
601
+ */
602
+ interface FontOption {
603
+ name: string;
604
+ fontFamily: string;
605
+ category?: 'sans-serif' | 'serif' | 'monospace' | 'other';
606
+ }
607
+ interface FontPickerProps {
608
+ value?: string;
609
+ onChange?: (fontFamily: string) => void;
610
+ fonts?: FontOption[];
611
+ disabled?: boolean;
612
+ className?: string;
613
+ placeholder?: string;
614
+ width?: number | string;
615
+ showPreview?: boolean;
616
+ }
617
+ declare function FontPicker({ value, onChange, fonts, disabled, className, placeholder, width, showPreview, }: FontPickerProps): react_jsx_runtime.JSX.Element;
618
+
619
+ /**
620
+ * Font Size Picker Component (Google Docs Style)
621
+ *
622
+ * A font size control with minus/plus buttons and editable input.
623
+ * Features:
624
+ * - Minus button to decrease font size
625
+ * - Plus button to increase font size
626
+ * - Editable input for custom sizes
627
+ * - Click input to show dropdown with preset sizes
628
+ */
629
+ interface FontSizePickerProps {
630
+ value?: number;
631
+ onChange?: (size: number) => void;
632
+ sizes?: number[];
633
+ disabled?: boolean;
634
+ className?: string;
635
+ placeholder?: string;
636
+ width?: number | string;
637
+ minSize?: number;
638
+ maxSize?: number;
639
+ }
640
+ declare function FontSizePicker({ value, onChange, sizes, disabled, className, placeholder, minSize, maxSize, }: FontSizePickerProps): react_jsx_runtime.JSX.Element;
641
+
642
+ /**
643
+ * Line Spacing Picker Component (Radix UI)
644
+ *
645
+ * A dropdown selector for choosing line spacing values using Radix Select.
646
+ * Styled like Google Docs with options: Single, 1.15, 1.5, Double
647
+ */
648
+ interface LineSpacingOption {
649
+ label: string;
650
+ value: number;
651
+ twipsValue: number;
652
+ }
653
+ interface LineSpacingPickerProps {
654
+ value?: number;
655
+ onChange?: (twipsValue: number) => void;
656
+ options?: LineSpacingOption[];
657
+ disabled?: boolean;
658
+ className?: string;
659
+ width?: number | string;
660
+ }
661
+ declare function LineSpacingPicker({ value, onChange, options, disabled, className, }: LineSpacingPickerProps): react_jsx_runtime.JSX.Element;
662
+
663
+ /**
664
+ * Color option for the color grid
665
+ */
666
+ interface ColorOption {
667
+ /** Display name for the color */
668
+ name: string;
669
+ /** Hex value (without #) */
670
+ hex: string;
671
+ /** Is this a theme color? */
672
+ isTheme?: boolean;
673
+ /** Theme color slot if applicable */
674
+ themeSlot?: string;
675
+ }
676
+ /**
677
+ * Props for the ColorPicker component
678
+ */
679
+ interface ColorPickerProps {
680
+ /** Current color value */
681
+ value?: string;
682
+ /** Callback when color is selected */
683
+ onChange?: (color: string) => void;
684
+ /** Type of color picker */
685
+ type?: 'text' | 'highlight';
686
+ /** Theme for resolving theme colors */
687
+ theme?: Theme | null;
688
+ /** Custom colors to display */
689
+ colors?: ColorOption[];
690
+ /** Whether the picker is disabled */
691
+ disabled?: boolean;
692
+ /** Additional CSS class name */
693
+ className?: string;
694
+ /** Additional inline styles */
695
+ style?: CSSProperties;
696
+ /** Placeholder/tooltip text */
697
+ title?: string;
698
+ /** Custom button content */
699
+ children?: ReactNode;
700
+ /** Width of the dropdown */
701
+ dropdownWidth?: number;
702
+ /** Show "No Color" option */
703
+ showNoColor?: boolean;
704
+ /** Show "More Colors" option for custom input */
705
+ showMoreColors?: boolean;
706
+ }
707
+ /**
708
+ * Color picker component with dropdown grid
709
+ */
710
+ declare function ColorPicker({ value, onChange, type, theme: _theme, colors, disabled, className, style, title, children, dropdownWidth, showNoColor, showMoreColors, }: ColorPickerProps): react_jsx_runtime.JSX.Element;
711
+
712
+ interface StyleOption {
713
+ styleId: string;
714
+ name: string;
715
+ type: StyleType;
716
+ isDefault?: boolean;
717
+ qFormat?: boolean;
718
+ priority?: number;
719
+ /** Font size in half-points for visual preview */
720
+ fontSize?: number;
721
+ /** Bold styling */
722
+ bold?: boolean;
723
+ /** Italic styling */
724
+ italic?: boolean;
725
+ /** Text color (RGB hex) */
726
+ color?: string;
727
+ }
728
+ interface StylePickerProps {
729
+ value?: string;
730
+ onChange?: (styleId: string) => void;
731
+ styles?: Style[];
732
+ theme?: Theme | null;
733
+ disabled?: boolean;
734
+ className?: string;
735
+ width?: number | string;
736
+ }
737
+ declare function StylePicker({ value, onChange, styles, disabled, className, width, }: StylePickerProps): react_jsx_runtime.JSX.Element;
738
+
739
+ /**
740
+ * Props for the AlignmentButtons component
741
+ */
742
+ interface AlignmentButtonsProps {
743
+ /** Current alignment value */
744
+ value?: ParagraphAlignment;
745
+ /** Callback when alignment is changed */
746
+ onChange?: (alignment: ParagraphAlignment) => void;
747
+ /** Whether the buttons are disabled */
748
+ disabled?: boolean;
749
+ /** Additional CSS class name */
750
+ className?: string;
751
+ /** Additional inline styles */
752
+ style?: CSSProperties;
753
+ /** Show labels next to icons */
754
+ showLabels?: boolean;
755
+ /** Compact mode (smaller buttons) */
756
+ compact?: boolean;
757
+ }
758
+ /**
759
+ * Alignment dropdown component — single button with popover panel
760
+ */
761
+ declare function AlignmentButtons({ value, onChange, disabled, }: AlignmentButtonsProps): react_jsx_runtime.JSX.Element;
762
+
763
+ /**
764
+ * HorizontalRuler Component — Google Docs style
765
+ *
766
+ * 3 handles only:
767
+ * - Left side: first-line indent (▼ down at top) + left indent (▲ up at bottom)
768
+ * - Right side: right indent (▼ down at top)
769
+ *
770
+ * Margins shown as gray zones on the ruler edges.
771
+ * Drag the boundary between gray/white to adjust page margins.
772
+ * Drag tooltip shows value during any drag.
773
+ */
774
+
775
+ interface HorizontalRulerProps {
776
+ sectionProps?: SectionProperties | null;
777
+ zoom?: number;
778
+ editable?: boolean;
779
+ onLeftMarginChange?: (marginTwips: number) => void;
780
+ onRightMarginChange?: (marginTwips: number) => void;
781
+ onFirstLineIndentChange?: (indentTwips: number) => void;
782
+ showFirstLineIndent?: boolean;
783
+ firstLineIndent?: number;
784
+ hangingIndent?: boolean;
785
+ indentLeft?: number;
786
+ indentRight?: number;
787
+ onIndentLeftChange?: (indentTwips: number) => void;
788
+ onIndentRightChange?: (indentTwips: number) => void;
789
+ unit?: 'inch' | 'cm';
790
+ className?: string;
791
+ style?: CSSProperties;
792
+ tabStops?: TabStop[] | null;
793
+ onTabStopRemove?: (positionTwips: number) => void;
794
+ }
795
+ declare function HorizontalRuler({ sectionProps, zoom, editable, onLeftMarginChange, onRightMarginChange, onFirstLineIndentChange, showFirstLineIndent, firstLineIndent, hangingIndent, indentLeft, indentRight, onIndentLeftChange, onIndentRightChange, unit, className, style, tabStops, onTabStopRemove, }: HorizontalRulerProps): React__default.ReactElement;
796
+ declare function positionToMargin(positionPx: number, side: 'left' | 'right', pageWidthPx: number, zoom: number): number;
797
+ declare function getRulerDimensions(sectionProps?: SectionProperties | null, zoom?: number): {
798
+ width: number;
799
+ leftMargin: number;
800
+ rightMargin: number;
801
+ contentWidth: number;
802
+ };
803
+ declare function getMarginInUnits(marginTwips: number, unit: 'inch' | 'cm'): string;
804
+ declare function parseMarginFromUnits(value: string, unit: 'inch' | 'cm'): number | null;
805
+
806
+ interface TableBorderPickerProps {
807
+ onAction: (action: TableAction) => void;
808
+ disabled?: boolean;
809
+ }
810
+ declare function TableBorderPicker({ onAction, disabled }: TableBorderPickerProps): react_jsx_runtime.JSX.Element;
811
+
812
+ interface TableBorderColorPickerProps {
813
+ onAction: (action: TableAction) => void;
814
+ disabled?: boolean;
815
+ }
816
+ declare function TableBorderColorPicker({ onAction, disabled, }: TableBorderColorPickerProps): react_jsx_runtime.JSX.Element;
817
+
818
+ interface TableBorderWidthPickerProps {
819
+ onAction: (action: TableAction) => void;
820
+ disabled?: boolean;
821
+ }
822
+ declare function TableBorderWidthPicker({ onAction, disabled, }: TableBorderWidthPickerProps): react_jsx_runtime.JSX.Element;
823
+
824
+ interface TableCellFillPickerProps {
825
+ onAction: (action: TableAction) => void;
826
+ disabled?: boolean;
827
+ }
828
+ declare function TableCellFillPicker({ onAction, disabled }: TableCellFillPickerProps): react_jsx_runtime.JSX.Element;
829
+
830
+ interface TableMergeButtonProps {
831
+ onAction: (action: TableAction) => void;
832
+ disabled?: boolean;
833
+ canMerge?: boolean;
834
+ canSplit?: boolean;
835
+ }
836
+ declare function TableMergeButton({ onAction, disabled, canMerge, canSplit, }: TableMergeButtonProps): react_jsx_runtime.JSX.Element;
837
+
838
+ interface TableInsertButtonsProps {
839
+ onAction: (action: TableAction) => void;
840
+ disabled?: boolean;
841
+ }
842
+ declare function TableInsertButtons({ onAction, disabled }: TableInsertButtonsProps): react_jsx_runtime.JSX.Element;
843
+
844
+ interface TableMoreDropdownProps {
845
+ onAction: (action: TableAction) => void;
846
+ disabled?: boolean;
847
+ tableContext?: {
848
+ isInTable: boolean;
849
+ rowCount?: number;
850
+ columnCount?: number;
851
+ canSplitCell?: boolean;
852
+ hasMultiCellSelection?: boolean;
853
+ table?: {
854
+ attrs?: {
855
+ justification?: string;
856
+ };
857
+ };
858
+ } | null;
859
+ }
860
+ declare function TableMoreDropdown({ onAction, disabled, tableContext, }: TableMoreDropdownProps): react_jsx_runtime.JSX.Element;
861
+
862
+ /**
863
+ * CellBackgroundPicker Component
864
+ *
865
+ * UI for changing table cell background/shading color.
866
+ * Provides a color grid similar to the text highlight picker but
867
+ * optimized for table cell backgrounds.
868
+ */
869
+
870
+ /**
871
+ * Color option for the picker
872
+ */
873
+ interface CellColorOption {
874
+ /** Hex color value */
875
+ hex: string;
876
+ /** Display name */
877
+ name: string;
878
+ }
879
+ /**
880
+ * Props for CellBackgroundPicker
881
+ */
882
+ interface CellBackgroundPickerProps {
883
+ /** Current background color (hex) */
884
+ value?: string | null;
885
+ /** Callback when color is selected */
886
+ onChange?: (color: string | null) => void;
887
+ /** Custom color options */
888
+ colors?: CellColorOption[];
889
+ /** Whether the picker is disabled */
890
+ disabled?: boolean;
891
+ /** Additional CSS class */
892
+ className?: string;
893
+ /** Additional inline styles */
894
+ style?: CSSProperties;
895
+ /** Show "No Fill" option (default: true) */
896
+ showNoFill?: boolean;
897
+ /** Show custom color input (default: true) */
898
+ showCustomColor?: boolean;
899
+ /** Compact mode for toolbar */
900
+ compact?: boolean;
901
+ }
902
+ /**
903
+ * Default cell background colors
904
+ * Common colors for table cell backgrounds
905
+ */
906
+ declare const DEFAULT_CELL_COLORS: CellColorOption[];
907
+ /**
908
+ * CellBackgroundPicker - Color picker for table cell backgrounds
909
+ */
910
+ declare function CellBackgroundPicker({ value, onChange, colors, disabled, className, style: additionalStyle, showNoFill, showCustomColor, compact, }: CellBackgroundPickerProps): React__default.ReactElement;
911
+ /**
912
+ * Get default cell colors
913
+ */
914
+ declare function getDefaultCellColors(): CellColorOption[];
915
+ /**
916
+ * Create a color option
917
+ */
918
+ declare function createCellColorOption(hex: string, name?: string): CellColorOption;
919
+ /**
920
+ * Check if color is in the default palette
921
+ */
922
+ declare function isDefaultCellColor(hex: string): boolean;
923
+ /**
924
+ * Get color name from hex
925
+ */
926
+ declare function getCellColorName(hex: string): string;
927
+ /**
928
+ * Create ShadingProperties from color
929
+ */
930
+ declare function createShadingFromColor(color: string | null): ShadingProperties | undefined;
931
+ /**
932
+ * Get color from ShadingProperties
933
+ */
934
+ declare function getColorFromShading(shading: ShadingProperties | undefined): string | null;
935
+ /**
936
+ * Get contrasting text color (black or white) for a background
937
+ */
938
+ declare function getContrastingTextColor(bgHex: string): string;
939
+
940
+ /**
941
+ * Unsaved Changes Indicator Component
942
+ *
943
+ * Visual indicator that shows when document has unsaved changes.
944
+ * Features:
945
+ * - Configurable appearance (dot, badge, text)
946
+ * - Pulse animation option for visibility
947
+ * - Hook for tracking changes
948
+ * - Browser beforeunload warning
949
+ */
950
+
951
+ /**
952
+ * Indicator variant type
953
+ */
954
+ type IndicatorVariant = 'dot' | 'badge' | 'text' | 'icon';
955
+ /**
956
+ * Indicator position type
957
+ */
958
+ type IndicatorPosition = 'inline' | 'absolute-top-right' | 'absolute-top-left';
959
+ /**
960
+ * Unsaved indicator props
961
+ */
962
+ interface UnsavedIndicatorProps {
963
+ /** Whether there are unsaved changes */
964
+ hasUnsavedChanges: boolean;
965
+ /** Variant of the indicator */
966
+ variant?: IndicatorVariant;
967
+ /** Position of the indicator */
968
+ position?: IndicatorPosition;
969
+ /** Whether to show pulse animation */
970
+ showPulse?: boolean;
971
+ /** Custom label for text variant */
972
+ label?: string;
973
+ /** Custom saved label for text variant */
974
+ savedLabel?: string;
975
+ /** Whether to show indicator when saved (always show) */
976
+ showWhenSaved?: boolean;
977
+ /** Custom color for unsaved state */
978
+ unsavedColor?: string;
979
+ /** Custom color for saved state */
980
+ savedColor?: string;
981
+ /** Size in pixels (for dot/icon) */
982
+ size?: number;
983
+ /** Additional className */
984
+ className?: string;
985
+ /** Additional inline styles */
986
+ style?: React__default.CSSProperties;
987
+ /** Click handler */
988
+ onClick?: () => void;
989
+ /** Title/tooltip text */
990
+ title?: string;
991
+ }
992
+ /**
993
+ * Hook options for tracking unsaved changes
994
+ */
995
+ interface UseUnsavedChangesOptions {
996
+ /** The document to track */
997
+ document?: Document | null;
998
+ /** Whether to warn before leaving page */
999
+ warnBeforeLeave?: boolean;
1000
+ /** Custom warning message */
1001
+ warningMessage?: string;
1002
+ /** Whether tracking is enabled */
1003
+ enabled?: boolean;
1004
+ /** Callback when changes status changes */
1005
+ onChangeStatusChange?: (hasChanges: boolean) => void;
1006
+ }
1007
+ /**
1008
+ * Hook return value
1009
+ */
1010
+ interface UseUnsavedChangesReturn {
1011
+ /** Whether there are unsaved changes */
1012
+ hasUnsavedChanges: boolean;
1013
+ /** Mark the document as saved (resets change tracking) */
1014
+ markAsSaved: () => void;
1015
+ /** Mark the document as changed */
1016
+ markAsChanged: () => void;
1017
+ /** Reset tracking (resets baseline) */
1018
+ resetTracking: (newDocument?: Document | null) => void;
1019
+ /** The last saved document snapshot */
1020
+ lastSavedDocument: Document | null;
1021
+ /** Number of changes since last save */
1022
+ changeCount: number;
1023
+ }
1024
+ declare const UnsavedIndicator: React__default.FC<UnsavedIndicatorProps>;
1025
+ /**
1026
+ * Hook to track unsaved changes in a document
1027
+ */
1028
+ declare function useUnsavedChanges(options?: UseUnsavedChangesOptions): UseUnsavedChangesReturn;
1029
+ /**
1030
+ * Get indicator variant label
1031
+ */
1032
+ declare function getVariantLabel(variant: IndicatorVariant): string;
1033
+ /**
1034
+ * Get all indicator variants
1035
+ */
1036
+ declare function getAllVariants(): IndicatorVariant[];
1037
+ /**
1038
+ * Get all indicator positions
1039
+ */
1040
+ declare function getAllPositions(): IndicatorPosition[];
1041
+ /**
1042
+ * Create a document change tracker
1043
+ * Simple utility for external change tracking
1044
+ */
1045
+ declare function createChangeTracker(): {
1046
+ markChanged: () => void;
1047
+ markSaved: () => void;
1048
+ getState: () => {
1049
+ changeCount: number;
1050
+ lastSaveTime: Date | null;
1051
+ hasUnsavedChanges: boolean;
1052
+ };
1053
+ reset: () => void;
1054
+ };
1055
+
1056
+ /**
1057
+ * Loading Indicator Component
1058
+ *
1059
+ * Displays loading states for operations with configurable appearance.
1060
+ * Features:
1061
+ * - Multiple spinner styles (spinner, dots, bar, pulse)
1062
+ * - Overlay mode for blocking UI during operations
1063
+ * - Inline mode for subtle loading indication
1064
+ * - Progress bar variant
1065
+ * - Hook for managing loading states
1066
+ */
1067
+
1068
+ /**
1069
+ * Loading indicator variant
1070
+ */
1071
+ type LoadingVariant = 'spinner' | 'dots' | 'bar' | 'pulse' | 'progress';
1072
+ /**
1073
+ * Loading indicator size
1074
+ */
1075
+ type LoadingSize = 'small' | 'medium' | 'large';
1076
+ /**
1077
+ * Loading indicator props
1078
+ */
1079
+ interface LoadingIndicatorProps {
1080
+ /** Whether loading is active */
1081
+ isLoading: boolean;
1082
+ /** Variant of the loading indicator */
1083
+ variant?: LoadingVariant;
1084
+ /** Size of the indicator */
1085
+ size?: LoadingSize;
1086
+ /** Loading message to display */
1087
+ message?: string;
1088
+ /** Whether to show as full-screen overlay */
1089
+ overlay?: boolean;
1090
+ /** Overlay background opacity (0-1) */
1091
+ overlayOpacity?: number;
1092
+ /** Progress percentage (0-100) for progress variant */
1093
+ progress?: number;
1094
+ /** Show progress percentage text */
1095
+ showProgressText?: boolean;
1096
+ /** Custom color */
1097
+ color?: string;
1098
+ /** Additional className */
1099
+ className?: string;
1100
+ /** Additional inline styles */
1101
+ style?: React__default.CSSProperties;
1102
+ }
1103
+ /**
1104
+ * Options for useLoading hook
1105
+ */
1106
+ interface UseLoadingOptions {
1107
+ /** Initial loading state */
1108
+ initialLoading?: boolean;
1109
+ /** Minimum loading duration in ms (prevents flash) */
1110
+ minDuration?: number;
1111
+ /** Callback when loading starts */
1112
+ onStart?: () => void;
1113
+ /** Callback when loading ends */
1114
+ onEnd?: () => void;
1115
+ }
1116
+ /**
1117
+ * Return value of useLoading hook
1118
+ */
1119
+ interface UseLoadingReturn {
1120
+ /** Current loading state */
1121
+ isLoading: boolean;
1122
+ /** Current message */
1123
+ message: string | null;
1124
+ /** Current progress (0-100) */
1125
+ progress: number;
1126
+ /** Start loading with optional message */
1127
+ startLoading: (message?: string) => void;
1128
+ /** Stop loading */
1129
+ stopLoading: () => void;
1130
+ /** Update progress (0-100) */
1131
+ setProgress: (progress: number) => void;
1132
+ /** Update message */
1133
+ setMessage: (message: string | null) => void;
1134
+ /** Wrap an async operation with loading state */
1135
+ withLoading: <T>(operation: () => Promise<T>, message?: string) => Promise<T>;
1136
+ }
1137
+ /**
1138
+ * Loading operation state
1139
+ */
1140
+ interface LoadingOperation {
1141
+ id: string;
1142
+ message?: string;
1143
+ progress?: number;
1144
+ startTime: number;
1145
+ }
1146
+ declare const LoadingIndicator: React__default.FC<LoadingIndicatorProps>;
1147
+ /**
1148
+ * Hook to manage loading states
1149
+ */
1150
+ declare function useLoading(options?: UseLoadingOptions): UseLoadingReturn;
1151
+ /**
1152
+ * Hook to manage multiple concurrent loading operations
1153
+ */
1154
+ declare function useLoadingOperations(): {
1155
+ operations: LoadingOperation[];
1156
+ isAnyLoading: boolean;
1157
+ startOperation: (id: string, message?: string) => void;
1158
+ updateOperation: (id: string, updates: Partial<LoadingOperation>) => void;
1159
+ endOperation: (id: string) => void;
1160
+ getOperation: (id: string) => LoadingOperation | undefined;
1161
+ };
1162
+ /**
1163
+ * Get loading variant label
1164
+ */
1165
+ declare function getLoadingVariantLabel(variant: LoadingVariant): string;
1166
+ /**
1167
+ * Get all loading variants
1168
+ */
1169
+ declare function getAllLoadingVariants(): LoadingVariant[];
1170
+ /**
1171
+ * Get all loading sizes
1172
+ */
1173
+ declare function getAllLoadingSizes(): LoadingSize[];
1174
+ /**
1175
+ * Create a delay promise for testing loading states
1176
+ */
1177
+ declare function delay(ms: number): Promise<void>;
1178
+
1179
+ /**
1180
+ * Responsive Toolbar Component
1181
+ *
1182
+ * A responsive toolbar wrapper that collapses items into an overflow menu
1183
+ * when the screen is narrow.
1184
+ *
1185
+ * Features:
1186
+ * - Automatically measures available space
1187
+ * - Moves items to overflow menu when they don't fit
1188
+ * - Priority-based item ordering
1189
+ * - Configurable breakpoints
1190
+ * - ResizeObserver for dynamic resizing
1191
+ */
1192
+
1193
+ /**
1194
+ * Priority level for toolbar items
1195
+ * Lower numbers = higher priority (shown first, hidden last)
1196
+ */
1197
+ type ToolbarItemPriority = 1 | 2 | 3 | 4 | 5;
1198
+ /**
1199
+ * Toolbar item configuration
1200
+ */
1201
+ interface ToolbarItem {
1202
+ /** Unique identifier */
1203
+ id: string;
1204
+ /** The content to render */
1205
+ content: ReactNode;
1206
+ /** Priority level (1 = highest, 5 = lowest) */
1207
+ priority?: ToolbarItemPriority;
1208
+ /** Minimum width in pixels (for measuring) */
1209
+ minWidth?: number;
1210
+ /** Whether this item should never be hidden */
1211
+ alwaysVisible?: boolean;
1212
+ /** Whether to show separator after this item */
1213
+ separatorAfter?: boolean;
1214
+ /** Group name for keeping items together */
1215
+ group?: string;
1216
+ }
1217
+ /**
1218
+ * Props for ResponsiveToolbar component
1219
+ */
1220
+ interface ResponsiveToolbarProps {
1221
+ /** Toolbar items */
1222
+ items: ToolbarItem[];
1223
+ /** Additional items for overflow menu only */
1224
+ overflowItems?: ToolbarItem[];
1225
+ /** Whether to show overflow button even when all items fit */
1226
+ alwaysShowOverflow?: boolean;
1227
+ /** Custom overflow button renderer */
1228
+ renderOverflowButton?: (itemCount: number, isOpen: boolean, onClick: () => void) => ReactNode;
1229
+ /** Custom overflow menu renderer */
1230
+ renderOverflowMenu?: (items: ToolbarItem[], onClose: () => void) => ReactNode;
1231
+ /** Gap between items in pixels */
1232
+ itemGap?: number;
1233
+ /** Padding for the toolbar */
1234
+ padding?: number | string;
1235
+ /** Minimum width for overflow button */
1236
+ overflowButtonWidth?: number;
1237
+ /** Additional className */
1238
+ className?: string;
1239
+ /** Additional styles */
1240
+ style?: CSSProperties;
1241
+ /** Height of the toolbar */
1242
+ height?: number | string;
1243
+ /** Background color */
1244
+ backgroundColor?: string;
1245
+ /** Border styles */
1246
+ borderBottom?: string;
1247
+ }
1248
+ /**
1249
+ * Options for useResponsiveToolbar hook
1250
+ */
1251
+ interface UseResponsiveToolbarOptions {
1252
+ /** Container ref */
1253
+ containerRef: React__default.RefObject<HTMLElement | null>;
1254
+ /** Total items */
1255
+ items: ToolbarItem[];
1256
+ /** Gap between items */
1257
+ itemGap?: number;
1258
+ /** Width reserved for overflow button */
1259
+ overflowButtonWidth?: number;
1260
+ }
1261
+ /**
1262
+ * Return value of useResponsiveToolbar hook
1263
+ */
1264
+ interface UseResponsiveToolbarReturn {
1265
+ /** Items that fit in visible area */
1266
+ visibleItems: ToolbarItem[];
1267
+ /** Items in overflow menu */
1268
+ overflowItems: ToolbarItem[];
1269
+ /** Whether overflow menu is needed */
1270
+ hasOverflow: boolean;
1271
+ /** Force a recalculation */
1272
+ recalculate: () => void;
1273
+ }
1274
+ /**
1275
+ * Hook to calculate which items fit in the toolbar
1276
+ */
1277
+ declare function useResponsiveToolbar(options: UseResponsiveToolbarOptions): UseResponsiveToolbarReturn;
1278
+ declare const ResponsiveToolbar: React__default.FC<ResponsiveToolbarProps>;
1279
+ interface ToolbarGroupProps {
1280
+ /** Group items */
1281
+ children: ReactNode;
1282
+ /** Gap between items */
1283
+ gap?: number;
1284
+ /** Whether to show separator after group */
1285
+ separatorAfter?: boolean;
1286
+ /** Additional className */
1287
+ className?: string;
1288
+ /** Additional styles */
1289
+ style?: CSSProperties;
1290
+ }
1291
+ declare const ToolbarGroup: React__default.FC<ToolbarGroupProps>;
1292
+ /**
1293
+ * Create a toolbar item
1294
+ */
1295
+ declare function createToolbarItem(id: string, content: ReactNode, options?: Partial<Omit<ToolbarItem, 'id' | 'content'>>): ToolbarItem;
1296
+ /**
1297
+ * Create toolbar items from an array of configs
1298
+ */
1299
+ declare function createToolbarItems(configs: Array<{
1300
+ id: string;
1301
+ content: ReactNode;
1302
+ priority?: ToolbarItemPriority;
1303
+ minWidth?: number;
1304
+ alwaysVisible?: boolean;
1305
+ separatorAfter?: boolean;
1306
+ group?: string;
1307
+ }>): ToolbarItem[];
1308
+ /**
1309
+ * Get recommended priority for common toolbar items
1310
+ */
1311
+ declare function getRecommendedPriority(itemType: string): ToolbarItemPriority;
1312
+
1313
+ /**
1314
+ * Find & Replace Utility Functions
1315
+ *
1316
+ * Pure utility functions for text search, pattern matching, and document search.
1317
+ * Extracted from FindReplaceDialog.tsx.
1318
+ */
1319
+ /**
1320
+ * A single match result in the document
1321
+ */
1322
+ interface FindMatch {
1323
+ /** Index of the paragraph containing the match */
1324
+ paragraphIndex: number;
1325
+ /** Index of the run/content within the paragraph */
1326
+ contentIndex: number;
1327
+ /** Character offset within the content */
1328
+ startOffset: number;
1329
+ /** Character offset for end of match */
1330
+ endOffset: number;
1331
+ /** The matched text */
1332
+ text: string;
1333
+ }
1334
+ /**
1335
+ * Find options for controlling search behavior
1336
+ */
1337
+ interface FindOptions {
1338
+ /** Whether to match case */
1339
+ matchCase: boolean;
1340
+ /** Whether to match whole words only */
1341
+ matchWholeWord: boolean;
1342
+ /** Whether to use regular expressions (future) */
1343
+ useRegex?: boolean;
1344
+ }
1345
+ /**
1346
+ * Find result with all matches
1347
+ */
1348
+ interface FindResult {
1349
+ /** All matches found */
1350
+ matches: FindMatch[];
1351
+ /** Total match count */
1352
+ totalCount: number;
1353
+ /** Current match index (0-based) */
1354
+ currentIndex: number;
1355
+ }
1356
+ /**
1357
+ * Highlight options for document rendering
1358
+ */
1359
+ interface HighlightOptions {
1360
+ /** Background color for current match */
1361
+ currentMatchColor: string;
1362
+ /** Background color for other matches */
1363
+ otherMatchColor: string;
1364
+ }
1365
+ /**
1366
+ * Create default find options
1367
+ */
1368
+ declare function createDefaultFindOptions(): FindOptions;
1369
+ /**
1370
+ * Escape string for use in regex pattern
1371
+ */
1372
+ declare function escapeRegexString(str: string): string;
1373
+ /**
1374
+ * Create a regex pattern from search text and options
1375
+ */
1376
+ declare function createSearchPattern(searchText: string, options: FindOptions): RegExp | null;
1377
+ /**
1378
+ * Find all matches of search text in content
1379
+ */
1380
+ declare function findAllMatches(content: string, searchText: string, options: FindOptions): Array<{
1381
+ start: number;
1382
+ end: number;
1383
+ }>;
1384
+ /**
1385
+ * Replace text in content
1386
+ */
1387
+ declare function replaceAllInContent(content: string, searchText: string, replaceText: string, options: FindOptions): string;
1388
+ /**
1389
+ * Replace first match in content
1390
+ */
1391
+ declare function replaceFirstInContent(content: string, searchText: string, replaceText: string, options: FindOptions, startIndex?: number): {
1392
+ content: string;
1393
+ replaced: boolean;
1394
+ matchStart: number;
1395
+ matchEnd: number;
1396
+ };
1397
+ /**
1398
+ * Get match count for status display
1399
+ */
1400
+ declare function getMatchCountText(result: FindResult | null): string;
1401
+ /**
1402
+ * Check if search text is empty or whitespace-only
1403
+ */
1404
+ declare function isEmptySearch(searchText: string): boolean;
1405
+ /**
1406
+ * Get default highlight options
1407
+ */
1408
+ declare function getDefaultHighlightOptions(): HighlightOptions;
1409
+ /**
1410
+ * Find all matches in a document
1411
+ */
1412
+ declare function findInDocument(document: any, searchText: string, options: FindOptions): FindMatch[];
1413
+ /**
1414
+ * Find matches in a single paragraph
1415
+ */
1416
+ declare function findInParagraph(paragraph: any, searchText: string, options: FindOptions, paragraphIndex: number): FindMatch[];
1417
+ /**
1418
+ * Scroll to a match in the document
1419
+ */
1420
+ declare function scrollToMatch(containerElement: HTMLElement | null, match: FindMatch): void;
1421
+
1422
+ /**
1423
+ * useFindReplace Hook
1424
+ *
1425
+ * React hook for managing find/replace dialog state.
1426
+ * Extracted from FindReplaceDialog.tsx.
1427
+ */
1428
+
1429
+ /**
1430
+ * Options for the useFindReplace hook
1431
+ */
1432
+ interface FindReplaceOptions {
1433
+ /** Whether to show replace functionality initially */
1434
+ initialReplaceMode?: boolean;
1435
+ /** Callback when matches change */
1436
+ onMatchesChange?: (matches: FindMatch[]) => void;
1437
+ /** Callback when current match changes */
1438
+ onCurrentMatchChange?: (match: FindMatch | null, index: number) => void;
1439
+ }
1440
+ /**
1441
+ * State for the find/replace hook
1442
+ */
1443
+ interface FindReplaceState {
1444
+ /** Whether the dialog is open */
1445
+ isOpen: boolean;
1446
+ /** Current search text */
1447
+ searchText: string;
1448
+ /** Current replace text */
1449
+ replaceText: string;
1450
+ /** Find options */
1451
+ options: FindOptions;
1452
+ /** All matches found */
1453
+ matches: FindMatch[];
1454
+ /** Current match index */
1455
+ currentIndex: number;
1456
+ /** Whether in replace mode */
1457
+ replaceMode: boolean;
1458
+ }
1459
+ /**
1460
+ * Return type for the useFindReplace hook
1461
+ */
1462
+ interface UseFindReplaceReturn {
1463
+ /** Current state */
1464
+ state: FindReplaceState;
1465
+ /** Open the find dialog */
1466
+ openFind: (selectedText?: string) => void;
1467
+ /** Open the replace dialog */
1468
+ openReplace: (selectedText?: string) => void;
1469
+ /** Close the dialog */
1470
+ close: () => void;
1471
+ /** Toggle dialog visibility */
1472
+ toggle: () => void;
1473
+ /** Update search text */
1474
+ setSearchText: (text: string) => void;
1475
+ /** Update replace text */
1476
+ setReplaceText: (text: string) => void;
1477
+ /** Update find options */
1478
+ setOptions: (options: Partial<FindOptions>) => void;
1479
+ /** Set search results */
1480
+ setMatches: (matches: FindMatch[], currentIndex?: number) => void;
1481
+ /** Go to next match */
1482
+ goToNextMatch: () => number;
1483
+ /** Go to previous match */
1484
+ goToPreviousMatch: () => number;
1485
+ /** Go to a specific match by index */
1486
+ goToMatch: (index: number) => void;
1487
+ /** Get current match */
1488
+ getCurrentMatch: () => FindMatch | null;
1489
+ /** Check if has matches */
1490
+ hasMatches: () => boolean;
1491
+ }
1492
+ /**
1493
+ * Hook for managing find/replace dialog state
1494
+ */
1495
+ declare function useFindReplace(hookOptions?: FindReplaceOptions): UseFindReplaceReturn;
1496
+
1497
+ /**
1498
+ * Find and Replace Dialog Component
1499
+ *
1500
+ * Modal dialog for searching and replacing text in the document.
1501
+ * Supports find, find next/previous, replace, and replace all operations.
1502
+ *
1503
+ * Logic and utilities are in separate files:
1504
+ * - findReplaceUtils.ts — Pure search/replace functions and types
1505
+ * - useFindReplace.ts — React hook for dialog state management
1506
+ */
1507
+
1508
+ /**
1509
+ * Props for the FindReplaceDialog component
1510
+ */
1511
+ interface FindReplaceDialogProps {
1512
+ /** Whether the dialog is open */
1513
+ isOpen: boolean;
1514
+ /** Callback when dialog is closed */
1515
+ onClose: () => void;
1516
+ /** Callback when searching for text */
1517
+ onFind: (searchText: string, options: FindOptions) => FindResult | null;
1518
+ /** Callback when navigating to next match */
1519
+ onFindNext: () => FindMatch | null;
1520
+ /** Callback when navigating to previous match */
1521
+ onFindPrevious: () => FindMatch | null;
1522
+ /** Callback when replacing current match */
1523
+ onReplace: (replaceText: string) => boolean;
1524
+ /** Callback when replacing all matches */
1525
+ onReplaceAll: (searchText: string, replaceText: string, options: FindOptions) => number;
1526
+ /** Callback to highlight matches in document */
1527
+ onHighlightMatches?: (matches: FindMatch[]) => void;
1528
+ /** Callback to clear highlights */
1529
+ onClearHighlights?: () => void;
1530
+ /** Initial search text (e.g., from selected text) */
1531
+ initialSearchText?: string;
1532
+ /** Whether to start in replace mode */
1533
+ replaceMode?: boolean;
1534
+ /** Current match result (from external state) */
1535
+ currentResult?: FindResult | null;
1536
+ /** Additional CSS class */
1537
+ className?: string;
1538
+ /** Additional inline styles */
1539
+ style?: CSSProperties;
1540
+ }
1541
+ /**
1542
+ * FindReplaceDialog component - Modal for finding and replacing text
1543
+ */
1544
+ declare function FindReplaceDialog({ isOpen, onClose, onFind, onFindNext, onFindPrevious, onReplace, onReplaceAll, onHighlightMatches, onClearHighlights, initialSearchText, replaceMode, currentResult, className, style, }: FindReplaceDialogProps): React__default.ReactElement | null;
1545
+
1546
+ /**
1547
+ * Hyperlink Dialog Component
1548
+ *
1549
+ * Modal dialog for inserting and editing hyperlinks in the document.
1550
+ * Supports both external URLs and internal bookmark links.
1551
+ *
1552
+ * Features:
1553
+ * - Input for URL (http, https, mailto, tel, etc.)
1554
+ * - Input for display text
1555
+ * - Edit existing hyperlinks
1556
+ * - Remove hyperlink option
1557
+ * - Internal bookmark selection
1558
+ * - Validation and error handling
1559
+ */
1560
+
1561
+ /**
1562
+ * Hyperlink data structure for dialog
1563
+ */
1564
+ interface HyperlinkData {
1565
+ /** URL for external link */
1566
+ url?: string;
1567
+ /** Display text for the link */
1568
+ displayText?: string;
1569
+ /** Internal bookmark name */
1570
+ bookmark?: string;
1571
+ /** Tooltip text */
1572
+ tooltip?: string;
1573
+ }
1574
+ /**
1575
+ * Bookmark option for internal link selection
1576
+ */
1577
+ interface BookmarkOption {
1578
+ /** Bookmark name/ID */
1579
+ name: string;
1580
+ /** Optional display label */
1581
+ label?: string;
1582
+ }
1583
+ /**
1584
+ * Props for the HyperlinkDialog component
1585
+ */
1586
+ interface HyperlinkDialogProps {
1587
+ /** Whether the dialog is open */
1588
+ isOpen: boolean;
1589
+ /** Callback when dialog is closed */
1590
+ onClose: () => void;
1591
+ /** Callback when hyperlink is inserted/updated */
1592
+ onSubmit: (data: HyperlinkData) => void;
1593
+ /** Callback when hyperlink is removed */
1594
+ onRemove?: () => void;
1595
+ /** Initial data for editing existing hyperlink */
1596
+ initialData?: HyperlinkData;
1597
+ /** Currently selected text (used as default display text) */
1598
+ selectedText?: string;
1599
+ /** Whether we're editing an existing hyperlink */
1600
+ isEditing?: boolean;
1601
+ /** Available bookmarks for internal links */
1602
+ bookmarks?: BookmarkOption[];
1603
+ /** Additional CSS class */
1604
+ className?: string;
1605
+ /** Additional inline styles */
1606
+ style?: CSSProperties;
1607
+ }
1608
+ /**
1609
+ * HyperlinkDialog component - Modal for inserting/editing hyperlinks
1610
+ */
1611
+ declare function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, initialData, selectedText, isEditing, bookmarks, className, style, }: HyperlinkDialogProps): React__default.ReactElement | null;
1612
+ /**
1613
+ * Hook state for the Hyperlink dialog
1614
+ */
1615
+ interface UseHyperlinkDialogState {
1616
+ /** Whether the dialog is open */
1617
+ isOpen: boolean;
1618
+ /** Initial data for the dialog (for editing) */
1619
+ initialData?: HyperlinkData;
1620
+ /** Currently selected text */
1621
+ selectedText?: string;
1622
+ /** Whether we're editing an existing hyperlink */
1623
+ isEditing: boolean;
1624
+ }
1625
+ /**
1626
+ * Hook return type for the Hyperlink dialog
1627
+ */
1628
+ interface UseHyperlinkDialogReturn {
1629
+ /** Current state */
1630
+ state: UseHyperlinkDialogState;
1631
+ /** Open dialog for inserting new hyperlink */
1632
+ openInsert: (selectedText?: string) => void;
1633
+ /** Open dialog for editing existing hyperlink */
1634
+ openEdit: (data: HyperlinkData) => void;
1635
+ /** Close the dialog */
1636
+ close: () => void;
1637
+ /** Toggle dialog open/closed */
1638
+ toggle: () => void;
1639
+ }
1640
+ /**
1641
+ * Hook for managing Hyperlink dialog state
1642
+ */
1643
+ declare function useHyperlinkDialog(): UseHyperlinkDialogReturn;
1644
+
1645
+ /**
1646
+ * Insert Table Dialog Component
1647
+ *
1648
+ * Modal dialog for inserting a new table into the document.
1649
+ * Provides a visual grid selector for choosing rows and columns.
1650
+ *
1651
+ * Features:
1652
+ * - Visual grid selector (hover to select dimensions)
1653
+ * - Manual row/column input
1654
+ * - Preview of table dimensions
1655
+ * - Quick insert with default sizes
1656
+ */
1657
+
1658
+ /**
1659
+ * Table configuration for insertion
1660
+ */
1661
+ interface TableConfig {
1662
+ /** Number of rows */
1663
+ rows: number;
1664
+ /** Number of columns */
1665
+ columns: number;
1666
+ }
1667
+ /**
1668
+ * Props for InsertTableDialog
1669
+ */
1670
+ interface InsertTableDialogProps {
1671
+ /** Whether the dialog is open */
1672
+ isOpen: boolean;
1673
+ /** Callback when dialog is closed */
1674
+ onClose: () => void;
1675
+ /** Callback when table is inserted */
1676
+ onInsert: (config: TableConfig) => void;
1677
+ /** Maximum rows in grid selector (default: 8) */
1678
+ maxGridRows?: number;
1679
+ /** Maximum columns in grid selector (default: 10) */
1680
+ maxGridColumns?: number;
1681
+ /** Maximum allowed rows (default: 100) */
1682
+ maxRows?: number;
1683
+ /** Maximum allowed columns (default: 20) */
1684
+ maxColumns?: number;
1685
+ /** Additional CSS class */
1686
+ className?: string;
1687
+ /** Additional inline styles */
1688
+ style?: CSSProperties;
1689
+ }
1690
+ /**
1691
+ * InsertTableDialog - Modal for inserting tables with visual grid selector
1692
+ */
1693
+ declare function InsertTableDialog({ isOpen, onClose, onInsert, maxGridRows, maxGridColumns, maxRows, maxColumns, className, style, }: InsertTableDialogProps): React__default.ReactElement | null;
1694
+ /**
1695
+ * Hook for managing Insert Table dialog state
1696
+ */
1697
+ declare function useInsertTableDialog(): {
1698
+ isOpen: boolean;
1699
+ open: () => void;
1700
+ close: () => void;
1701
+ toggle: () => void;
1702
+ };
1703
+ /**
1704
+ * Create a default TableConfig
1705
+ */
1706
+ declare function createDefaultTableConfig(rows?: number, columns?: number): TableConfig;
1707
+ /**
1708
+ * Validate TableConfig
1709
+ */
1710
+ declare function isValidTableConfig(config: TableConfig, maxRows?: number, maxColumns?: number): boolean;
1711
+ /**
1712
+ * Clamp TableConfig to valid range
1713
+ */
1714
+ declare function clampTableConfig(config: TableConfig, maxRows?: number, maxColumns?: number): TableConfig;
1715
+ /**
1716
+ * Format table dimensions for display
1717
+ */
1718
+ declare function formatTableDimensions(config: TableConfig): string;
1719
+ /**
1720
+ * Get common table presets
1721
+ */
1722
+ declare function getTablePresets(): {
1723
+ label: string;
1724
+ config: TableConfig;
1725
+ }[];
1726
+
1727
+ /**
1728
+ * Insert Image Dialog Component
1729
+ *
1730
+ * Modal dialog for inserting images into the document.
1731
+ * Supports file upload with preview and basic sizing options.
1732
+ *
1733
+ * Features:
1734
+ * - File input for image selection
1735
+ * - Drag and drop support
1736
+ * - Image preview
1737
+ * - Width/height controls with aspect ratio lock
1738
+ * - Alt text input
1739
+ */
1740
+
1741
+ /**
1742
+ * Image data for insertion
1743
+ */
1744
+ interface ImageData {
1745
+ /** Base64 data URL or external URL */
1746
+ src: string;
1747
+ /** Image width in pixels */
1748
+ width: number;
1749
+ /** Image height in pixels */
1750
+ height: number;
1751
+ /** Alt text for accessibility */
1752
+ alt?: string;
1753
+ /** Original file name */
1754
+ fileName?: string;
1755
+ /** MIME type */
1756
+ mimeType?: string;
1757
+ }
1758
+ /**
1759
+ * Props for InsertImageDialog
1760
+ */
1761
+ interface InsertImageDialogProps {
1762
+ /** Whether the dialog is open */
1763
+ isOpen: boolean;
1764
+ /** Callback when dialog is closed */
1765
+ onClose: () => void;
1766
+ /** Callback when image is inserted */
1767
+ onInsert: (data: ImageData) => void;
1768
+ /** Maximum width in pixels (default: 800) */
1769
+ maxWidth?: number;
1770
+ /** Maximum height in pixels (default: 600) */
1771
+ maxHeight?: number;
1772
+ /** Accepted file types (default: image/*) */
1773
+ accept?: string;
1774
+ /** Additional CSS class */
1775
+ className?: string;
1776
+ /** Additional inline styles */
1777
+ style?: CSSProperties;
1778
+ }
1779
+ /**
1780
+ * InsertImageDialog - Modal for inserting images with preview and sizing
1781
+ */
1782
+ declare function InsertImageDialog({ isOpen, onClose, onInsert, maxWidth, maxHeight, accept, className, style, }: InsertImageDialogProps): React__default.ReactElement | null;
1783
+ /**
1784
+ * Hook for managing Insert Image dialog state
1785
+ */
1786
+ declare function useInsertImageDialog(): {
1787
+ isOpen: boolean;
1788
+ open: () => void;
1789
+ close: () => void;
1790
+ toggle: () => void;
1791
+ };
1792
+ /**
1793
+ * Check if a file is a valid image
1794
+ */
1795
+ declare function isValidImageFile(file: File): boolean;
1796
+ /**
1797
+ * Get supported image extensions
1798
+ */
1799
+ declare function getSupportedImageExtensions(): string[];
1800
+ /**
1801
+ * Get accept string for file input
1802
+ */
1803
+ declare function getImageAcceptString(): string;
1804
+ /**
1805
+ * Calculate scaled dimensions to fit within bounds
1806
+ */
1807
+ declare function calculateFitDimensions(originalWidth: number, originalHeight: number, maxWidth: number, maxHeight: number): {
1808
+ width: number;
1809
+ height: number;
1810
+ };
1811
+ /**
1812
+ * Convert data URL to Blob
1813
+ */
1814
+ declare function dataUrlToBlob(dataUrl: string): Blob;
1815
+ /**
1816
+ * Get image dimensions from a data URL
1817
+ */
1818
+ declare function getImageDimensions(src: string): Promise<{
1819
+ width: number;
1820
+ height: number;
1821
+ }>;
1822
+ /**
1823
+ * Format file size for display
1824
+ */
1825
+ declare function formatFileSize(bytes: number): string;
1826
+
1827
+ /**
1828
+ * Insert Symbol Dialog Component
1829
+ *
1830
+ * Modal dialog for inserting special characters and symbols into the document.
1831
+ * Provides categorized symbol picker with search functionality.
1832
+ *
1833
+ * Features:
1834
+ * - Categorized symbol groups
1835
+ * - Recent symbols
1836
+ * - Search functionality
1837
+ * - Unicode character display
1838
+ */
1839
+
1840
+ /**
1841
+ * Symbol category
1842
+ */
1843
+ interface SymbolCategory {
1844
+ /** Category name */
1845
+ name: string;
1846
+ /** Display label */
1847
+ label: string;
1848
+ /** Symbols in this category */
1849
+ symbols: string[];
1850
+ }
1851
+ /**
1852
+ * Props for InsertSymbolDialog
1853
+ */
1854
+ interface InsertSymbolDialogProps {
1855
+ /** Whether the dialog is open */
1856
+ isOpen: boolean;
1857
+ /** Callback when dialog is closed */
1858
+ onClose: () => void;
1859
+ /** Callback when symbol is inserted */
1860
+ onInsert: (symbol: string) => void;
1861
+ /** Recently used symbols */
1862
+ recentSymbols?: string[];
1863
+ /** Additional CSS class */
1864
+ className?: string;
1865
+ /** Additional inline styles */
1866
+ style?: CSSProperties;
1867
+ }
1868
+ /**
1869
+ * Default symbol categories
1870
+ */
1871
+ declare const SYMBOL_CATEGORIES: SymbolCategory[];
1872
+ /**
1873
+ * InsertSymbolDialog - Modal for inserting special characters
1874
+ */
1875
+ declare function InsertSymbolDialog({ isOpen, onClose, onInsert, recentSymbols, className, style, }: InsertSymbolDialogProps): React__default.ReactElement | null;
1876
+ /**
1877
+ * Hook for managing Insert Symbol dialog state with recent symbols
1878
+ */
1879
+ declare function useInsertSymbolDialog(maxRecent?: number): {
1880
+ isOpen: boolean;
1881
+ recentSymbols: string[];
1882
+ open: () => void;
1883
+ close: () => void;
1884
+ toggle: () => void;
1885
+ addRecent: (symbol: string) => void;
1886
+ };
1887
+ /**
1888
+ * Get all symbol categories
1889
+ */
1890
+ declare function getSymbolCategories(): SymbolCategory[];
1891
+ /**
1892
+ * Get symbols by category name
1893
+ */
1894
+ declare function getSymbolsByCategory(categoryName: string): string[];
1895
+ /**
1896
+ * Get symbol Unicode info
1897
+ */
1898
+ declare function getSymbolInfo(symbol: string): {
1899
+ character: string;
1900
+ codePoint: string;
1901
+ decimal: number;
1902
+ hex: string;
1903
+ };
1904
+ /**
1905
+ * Search symbols by query
1906
+ */
1907
+ declare function searchSymbols(query: string): string[];
1908
+ /**
1909
+ * Get symbol from Unicode code point string
1910
+ */
1911
+ declare function symbolFromCodePoint(codePointStr: string): string | null;
1912
+
1913
+ /**
1914
+ * Paste Special Dialog Component
1915
+ *
1916
+ * Provides paste options for pasting content with or without formatting.
1917
+ * Features:
1918
+ * - Paste with formatting (default)
1919
+ * - Paste as plain text (unformatted)
1920
+ * - Keyboard shortcut: Ctrl+Shift+V opens dialog
1921
+ */
1922
+
1923
+ /**
1924
+ * Paste option type
1925
+ */
1926
+ type PasteOption = 'formatted' | 'plainText';
1927
+ /**
1928
+ * Paste special dialog props
1929
+ */
1930
+ interface PasteSpecialDialogProps {
1931
+ /** Whether the dialog is open */
1932
+ isOpen: boolean;
1933
+ /** Callback when dialog is closed */
1934
+ onClose: () => void;
1935
+ /** Callback when paste is confirmed */
1936
+ onPaste: (content: ParsedClipboardContent, asPlainText: boolean) => void;
1937
+ /** Optional custom position */
1938
+ position?: {
1939
+ x: number;
1940
+ y: number;
1941
+ };
1942
+ /** Additional className */
1943
+ className?: string;
1944
+ }
1945
+ /**
1946
+ * Paste option item
1947
+ */
1948
+ interface PasteOptionItem {
1949
+ id: PasteOption;
1950
+ label: string;
1951
+ description: string;
1952
+ shortcut: string;
1953
+ }
1954
+ /**
1955
+ * Hook return value for paste special
1956
+ */
1957
+ interface UsePasteSpecialReturn {
1958
+ /** Whether the dialog is open */
1959
+ isOpen: boolean;
1960
+ /** Open the paste special dialog */
1961
+ openDialog: () => void;
1962
+ /** Close the dialog */
1963
+ closeDialog: () => void;
1964
+ /** Handle keyboard shortcut (Ctrl+Shift+V) */
1965
+ handleKeyDown: (event: KeyboardEvent) => boolean;
1966
+ /** Paste as plain text directly */
1967
+ pasteAsPlainText: () => Promise<void>;
1968
+ }
1969
+ /**
1970
+ * Options for usePasteSpecial hook
1971
+ */
1972
+ interface UsePasteSpecialOptions {
1973
+ /** Callback when paste is confirmed */
1974
+ onPaste?: (content: ParsedClipboardContent, asPlainText: boolean) => void;
1975
+ /** Whether paste operations are enabled */
1976
+ enabled?: boolean;
1977
+ }
1978
+ declare const PasteSpecialDialog: React__default.FC<PasteSpecialDialogProps>;
1979
+ /**
1980
+ * Hook to manage paste special dialog
1981
+ */
1982
+ declare function usePasteSpecial(options?: UsePasteSpecialOptions): UsePasteSpecialReturn;
1983
+ /**
1984
+ * Get paste option by id
1985
+ */
1986
+ declare function getPasteOption(id: PasteOption): PasteOptionItem | undefined;
1987
+ /**
1988
+ * Get all paste options
1989
+ */
1990
+ declare function getAllPasteOptions(): PasteOptionItem[];
1991
+ /**
1992
+ * Get default paste option
1993
+ */
1994
+ declare function getDefaultPasteOption(): PasteOption;
1995
+ /**
1996
+ * Check if paste special shortcut
1997
+ */
1998
+ declare function isPasteSpecialShortcut(event: KeyboardEvent): boolean;
1999
+
2000
+ /**
2001
+ * Keyboard Shortcuts Dialog Component
2002
+ *
2003
+ * Displays all available keyboard shortcuts organized by category.
2004
+ * Features:
2005
+ * - Categorized shortcut list
2006
+ * - Search/filter functionality
2007
+ * - Platform-aware modifier keys (Ctrl/Cmd)
2008
+ * - Keyboard shortcut to open (Ctrl+/)
2009
+ */
2010
+
2011
+ /**
2012
+ * Keyboard shortcut definition
2013
+ */
2014
+ interface KeyboardShortcut {
2015
+ /** Unique identifier */
2016
+ id: string;
2017
+ /** Display name */
2018
+ name: string;
2019
+ /** Description of what the shortcut does */
2020
+ description: string;
2021
+ /** Primary key combination (e.g., 'Ctrl+C') */
2022
+ keys: string;
2023
+ /** Alternative key combination */
2024
+ altKeys?: string;
2025
+ /** Category for grouping */
2026
+ category: ShortcutCategory;
2027
+ /** Whether this is a common/frequently used shortcut */
2028
+ common?: boolean;
2029
+ }
2030
+ /**
2031
+ * Shortcut category
2032
+ */
2033
+ type ShortcutCategory = 'editing' | 'formatting' | 'navigation' | 'clipboard' | 'selection' | 'view' | 'file' | 'other';
2034
+ /**
2035
+ * Dialog props
2036
+ */
2037
+ interface KeyboardShortcutsDialogProps {
2038
+ /** Whether the dialog is open */
2039
+ isOpen: boolean;
2040
+ /** Close callback */
2041
+ onClose: () => void;
2042
+ /** Custom shortcuts (merged with defaults) */
2043
+ customShortcuts?: KeyboardShortcut[];
2044
+ /** Whether to show search */
2045
+ showSearch?: boolean;
2046
+ /** Additional className */
2047
+ className?: string;
2048
+ }
2049
+ /**
2050
+ * Hook options
2051
+ */
2052
+ interface UseKeyboardShortcutsDialogOptions {
2053
+ /** Whether the dialog can be opened with Ctrl+? or F1 */
2054
+ enabled?: boolean;
2055
+ /** Custom open shortcut (default: Ctrl+/) */
2056
+ openShortcut?: string;
2057
+ }
2058
+ /**
2059
+ * Hook return value
2060
+ */
2061
+ interface UseKeyboardShortcutsDialogReturn {
2062
+ /** Whether dialog is open */
2063
+ isOpen: boolean;
2064
+ /** Open the dialog */
2065
+ open: () => void;
2066
+ /** Close the dialog */
2067
+ close: () => void;
2068
+ /** Toggle the dialog */
2069
+ toggle: () => void;
2070
+ /** Keyboard event handler */
2071
+ handleKeyDown: (event: KeyboardEvent) => void;
2072
+ }
2073
+ declare const KeyboardShortcutsDialog: React__default.FC<KeyboardShortcutsDialogProps>;
2074
+ /**
2075
+ * Hook to manage keyboard shortcuts dialog
2076
+ */
2077
+ declare function useKeyboardShortcutsDialog(options?: UseKeyboardShortcutsDialogOptions): UseKeyboardShortcutsDialogReturn;
2078
+ /**
2079
+ * Get all default shortcuts
2080
+ */
2081
+ declare function getDefaultShortcuts(): KeyboardShortcut[];
2082
+ /**
2083
+ * Get shortcuts by category
2084
+ */
2085
+ declare function getShortcutsByCategory(category: ShortcutCategory): KeyboardShortcut[];
2086
+ /**
2087
+ * Get common/frequently used shortcuts
2088
+ */
2089
+ declare function getCommonShortcuts(): KeyboardShortcut[];
2090
+ /**
2091
+ * Get category label
2092
+ */
2093
+ declare function getCategoryLabel(category: ShortcutCategory): string;
2094
+ /**
2095
+ * Get all categories
2096
+ */
2097
+ declare function getAllCategories(): ShortcutCategory[];
2098
+ /**
2099
+ * Format shortcut keys for display
2100
+ */
2101
+ declare function formatShortcutKeys(keys: string): string;
2102
+
2103
+ export { AlignmentButtons, type AlignmentButtonsProps, CellBackgroundPicker, type CellBackgroundPickerProps, type CellColorOption, type ColorOption, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuProps, DEFAULT_CELL_COLORS, type KeyboardShortcut as DialogKeyboardShortcut, type FindMatch, type FindOptions, FindReplaceDialog, type FindReplaceDialogProps, type FindReplaceOptions, type FindReplaceState, type FindResult, type FontOption, FontPicker, type FontPickerProps, FontSizePicker, type FontSizePickerProps, type HighlightOptions, HorizontalRuler, type HorizontalRulerProps, type HyperlinkData, HyperlinkDialog, type HyperlinkDialogProps, type ImageData, type IndicatorPosition, type IndicatorVariant, InsertImageDialog, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogProps, KeyboardShortcutsDialog, type KeyboardShortcutsDialogProps, type LineSpacingOption, LineSpacingPicker, type LineSpacingPickerProps, ListButtons, type ListButtonsProps, type ListState, LoadingIndicator, type LoadingIndicatorProps, type LoadingOperation, type LoadingSize, type LoadingVariant, type PasteOption, PasteSpecialDialog, type PasteSpecialDialogProps, ResponsePreview, type ResponsePreviewProps, type ResponsePreviewState, ResponsiveToolbar, ToolbarGroup as ResponsiveToolbarGroup, type ToolbarGroupProps as ResponsiveToolbarGroupProps, type ResponsiveToolbarProps, SYMBOL_CATEGORIES, type ShortcutCategory, type StyleOption, StylePicker, type StylePickerProps, type SymbolCategory, TableAction, TableBorderColorPicker, type TableBorderColorPickerProps, TableBorderPicker, type TableBorderPickerProps, TableBorderWidthPicker, type TableBorderWidthPickerProps, TableCellFillPicker, type TableCellFillPickerProps, type TableConfig, TableInsertButtons, type TableInsertButtonsProps, TableMergeButton, type TableMergeButtonProps, TableMoreDropdown, type TableMoreDropdownProps, type TextContextAction, TextContextMenu, type TextContextMenuItem, type TextContextMenuProps, Toolbar, ToolbarButton, ToolbarGroup$1 as ToolbarGroup, type ToolbarItem, type ToolbarItemPriority, type ToolbarProps, ToolbarSeparator, UnsavedIndicator, type UnsavedIndicatorProps, type UseFindReplaceReturn, type UseKeyboardShortcutsDialogOptions, type UseKeyboardShortcutsDialogReturn, type UseLoadingOptions, type UseLoadingReturn, type UsePasteSpecialOptions, type UsePasteSpecialReturn, type UseResponsiveToolbarOptions, type UseResponsiveToolbarReturn, type UseTextContextMenuOptions, type UseTextContextMenuReturn, type UseUnsavedChangesOptions, type UseUnsavedChangesReturn, VariablePanel, type VariablePanelProps, ZoomControl, type ZoomControlProps, calculateFitDimensions, clampTableConfig, createCellColorOption, createChangeTracker, createDefaultFindOptions, createDefaultListState, createDefaultTableConfig, createErrorResponse, createMockResponse, createSearchPattern, createShadingFromColor, createToolbarItem, createToolbarItems, dataUrlToBlob, delay, escapeRegexString, findAllMatches, findInDocument, findInParagraph, formatFileSize, formatShortcutKeys, formatTableDimensions, getActionShortcut, getAllActions, getAllCategories, getAllPositions as getAllIndicatorPositions, getAllVariants as getAllIndicatorVariants, getAllLoadingSizes, getAllLoadingVariants, getAllPasteOptions, getCategoryLabel, getCellColorName, getColorFromShading, getCommonShortcuts, getContrastingTextColor, getDefaultActions, getDefaultCellColors, getDefaultHighlightOptions, getDefaultPasteOption, getDefaultShortcuts, getDefaultTextContextMenuItems, getImageAcceptString, getImageDimensions, getLoadingVariantLabel, getMarginInUnits, getMatchCountText, getPasteOption, getRecommendedPriority, getRulerDimensions, getShortcutsByCategory, getSupportedImageExtensions, getSymbolCategories, getSymbolInfo as getSymbolUnicodeInfo, getSymbolsByCategory, getTablePresets, getTextActionLabel, getTextActionShortcut, getVariantLabel, isActionAvailable, isDefaultCellColor, isEmptySearch, isPasteSpecialShortcut, isTextActionAvailable, isValidImageFile, isValidTableConfig, parseMarginFromUnits, positionToMargin, replaceAllInContent, replaceFirstInContent, scrollToMatch, searchSymbols, symbolFromCodePoint, useContextMenu, useFindReplace, useHyperlinkDialog, useInsertImageDialog, useInsertSymbolDialog, useInsertTableDialog, useKeyboardShortcutsDialog, useLoading, useLoadingOperations, usePasteSpecial, useResponsePreview, useResponsiveToolbar, useTextContextMenu, useUnsavedChanges };