@postnzt/docx-js-editor 0.0.33

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