@eigenpal/docx-js-editor 0.0.12 → 0.0.14

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