@eigenpal/docx-js-editor 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DocumentAgent-Ci6_T-XM.d.ts +412 -0
- package/dist/DocumentAgent-DEGFgYEN.d.cts +412 -0
- package/dist/FindReplaceDialog-BAACAU67.cjs +1 -0
- package/dist/FindReplaceDialog-RWYDRWHF.js +1 -0
- package/dist/FootnotePropertiesDialog-BC6JIPDA.cjs +1 -0
- package/dist/FootnotePropertiesDialog-CWQF5EBK.js +1 -0
- package/dist/HyperlinkDialog-EG2BSLPD.cjs +1 -0
- package/dist/HyperlinkDialog-YAVK64F4.js +1 -0
- package/dist/ImagePositionDialog-IGYS5KMK.cjs +1 -0
- package/dist/ImagePositionDialog-S6SMH7XH.js +1 -0
- package/dist/ImagePropertiesDialog-UO5QUIBS.js +1 -0
- package/dist/ImagePropertiesDialog-VGV4E4SN.cjs +1 -0
- package/dist/TablePropertiesDialog-VBOU4DID.js +1 -0
- package/dist/TablePropertiesDialog-WRM47JI6.cjs +1 -0
- package/dist/{types-BALm1KBi.d.cts → agentApi-CbVUCZRu.d.cts} +1 -308
- package/dist/{types-BALm1KBi.d.ts → agentApi-CbVUCZRu.d.ts} +1 -308
- package/dist/chunk-2ASOEN3V.js +1 -0
- package/dist/chunk-6MBDPZVD.js +111 -0
- package/dist/chunk-6YLNNCRZ.cjs +10 -0
- package/dist/chunk-BVQ2QRHA.cjs +4 -0
- package/dist/chunk-COP5BIBZ.js +10 -0
- package/dist/chunk-CZ7W7MCM.cjs +2 -0
- package/dist/chunk-E6XDMUAM.js +4 -0
- package/dist/chunk-EMKABJPH.js +1 -0
- package/dist/{chunk-GIZ5CTBD.cjs → chunk-EPCZ24TY.cjs} +5 -5
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-FLECKDK4.cjs +58 -0
- package/dist/chunk-ITWEFKGQ.cjs +1 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KVAT5SVD.js +2 -0
- package/dist/chunk-L34XFLQZ.cjs +1 -0
- package/dist/chunk-M7F2CUUD.js +2 -0
- package/dist/chunk-MDPDH7KS.js +58 -0
- package/dist/chunk-MTX3EEBJ.js +258 -0
- package/dist/chunk-NT2REEAA.cjs +1 -0
- package/dist/{chunk-P332HWDE.js → chunk-OTG4NABM.js} +5 -5
- package/dist/chunk-OW5H5DNE.cjs +1 -0
- package/dist/chunk-PJVI53AH.js +2 -0
- package/dist/chunk-PNMZPPPI.cjs +2 -0
- package/dist/chunk-SF53KLDZ.cjs +1 -0
- package/dist/chunk-TOI5W3HK.js +8 -0
- package/dist/chunk-UAVOWAIF.cjs +8 -0
- package/dist/chunk-VN7XH644.cjs +258 -0
- package/dist/chunk-W4DUKACP.cjs +111 -0
- package/dist/chunk-XS2AQFMF.cjs +2 -0
- package/dist/chunk-ZDYHAYN6.js +1 -0
- package/dist/clipboard-BOocwmAM.d.ts +539 -0
- package/dist/clipboard-Cx7cb3kX.d.cts +539 -0
- package/dist/{colorResolver-BNj-uZ58.d.ts → colorResolver-CIDiSPWd.d.cts} +3 -411
- package/dist/{colorResolver-DiMquGWR.d.cts → colorResolver-KXbUgzWC.d.ts} +3 -411
- package/dist/core-plugins.cjs +1 -1
- package/dist/core-plugins.d.cts +4 -3
- package/dist/core-plugins.d.ts +4 -3
- package/dist/core-plugins.js +1 -1
- package/dist/core.cjs +1 -0
- package/dist/core.d.cts +23 -0
- package/dist/core.d.ts +23 -0
- package/dist/core.js +1 -0
- package/dist/headless.cjs +2 -2
- package/dist/headless.d.cts +8 -175
- package/dist/headless.d.ts +8 -175
- package/dist/headless.js +1 -1
- package/dist/index.cjs +9 -378
- package/dist/index.d.cts +17 -4161
- package/dist/index.d.ts +17 -4161
- package/dist/index.js +9 -378
- package/dist/insertOperations-CzB5b-Of.d.ts +176 -0
- package/dist/insertOperations-DKVmCV32.d.cts +176 -0
- package/dist/mcp-cli.js +21 -21
- package/dist/mcp.cjs +10 -10
- package/dist/mcp.d.cts +2 -1
- package/dist/mcp.d.ts +2 -1
- package/dist/mcp.js +9 -9
- package/dist/processTemplate-BHBTDAIC.js +1 -0
- package/dist/processTemplate-QOEAXCKA.cjs +1 -0
- package/dist/react-Be1YOl4z.d.ts +1356 -0
- package/dist/react-DPuSVbgY.d.cts +1356 -0
- package/dist/react.cjs +1 -0
- package/dist/react.css +1 -0
- package/dist/react.d.cts +9 -0
- package/dist/react.d.ts +9 -0
- package/dist/react.js +1 -0
- package/dist/{registry-CzqAPdui.d.ts → registry-D4tvj9f3.d.ts} +1 -1
- package/dist/{registry-BUTMLqSj.d.cts → registry-ngv6Bumt.d.cts} +1 -1
- package/dist/types-D96elyJF.d.cts +310 -0
- package/dist/types-xMzSPT4i.d.ts +310 -0
- package/dist/ui.cjs +1 -0
- package/dist/ui.d.cts +2103 -0
- package/dist/ui.d.ts +2103 -0
- package/dist/ui.js +1 -0
- package/dist/variableDetector-CPxKo9jP.d.cts +173 -0
- package/dist/variableDetector-DeM1N-_L.d.ts +173 -0
- package/package.json +85 -10
- package/dist/chunk-56AGRHVO.cjs +0 -58
- package/dist/chunk-E23CAQXT.js +0 -9
- package/dist/chunk-HIBC7HTU.cjs +0 -9
- package/dist/chunk-ICEPOA7G.js +0 -58
- package/dist/chunk-IZGUXSCC.js +0 -10
- package/dist/chunk-XF3IPO7C.cjs +0 -10
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { T as Table, Q as TableCell, y as Run, P as Paragraph } from './agentApi-CbVUCZRu.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* PageNumberIndicator Component
|
|
6
|
+
*
|
|
7
|
+
* Displays the current page number and total page count.
|
|
8
|
+
* Can be used as a floating indicator or status bar element.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Position options for the indicator
|
|
13
|
+
*/
|
|
14
|
+
type PageIndicatorPosition = 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right';
|
|
15
|
+
/**
|
|
16
|
+
* Style variant for the indicator
|
|
17
|
+
*/
|
|
18
|
+
type PageIndicatorVariant = 'default' | 'minimal' | 'badge' | 'pill';
|
|
19
|
+
/**
|
|
20
|
+
* Props for PageNumberIndicator
|
|
21
|
+
*/
|
|
22
|
+
interface PageNumberIndicatorProps {
|
|
23
|
+
/** Current page number (1-indexed) */
|
|
24
|
+
currentPage: number;
|
|
25
|
+
/** Total number of pages */
|
|
26
|
+
totalPages: number;
|
|
27
|
+
/** Position of the indicator (default: 'bottom-center') */
|
|
28
|
+
position?: PageIndicatorPosition;
|
|
29
|
+
/** Style variant (default: 'default') */
|
|
30
|
+
variant?: PageIndicatorVariant;
|
|
31
|
+
/** Whether to show as floating overlay (default: true) */
|
|
32
|
+
floating?: boolean;
|
|
33
|
+
/** Whether to show "Page" prefix (default: true) */
|
|
34
|
+
showPrefix?: boolean;
|
|
35
|
+
/** Custom format function for the display text */
|
|
36
|
+
formatText?: (current: number, total: number) => string;
|
|
37
|
+
/** Callback when page number is clicked (for navigation) */
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
/** Whether the indicator is disabled */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** Additional CSS class name */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Additional inline styles */
|
|
44
|
+
style?: CSSProperties;
|
|
45
|
+
/** Custom content (overrides default display) */
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* PageNumberIndicator - Displays current page and total pages
|
|
50
|
+
*/
|
|
51
|
+
declare function PageNumberIndicator({ currentPage, totalPages, position, variant, floating, showPrefix, formatText, onClick, disabled, className, style, children, }: PageNumberIndicatorProps): React__default.ReactElement;
|
|
52
|
+
/**
|
|
53
|
+
* Format page number with ordinal suffix (1st, 2nd, 3rd, etc.)
|
|
54
|
+
*/
|
|
55
|
+
declare function formatPageOrdinal(page: number): string;
|
|
56
|
+
/**
|
|
57
|
+
* Create a custom format function
|
|
58
|
+
*/
|
|
59
|
+
declare function createPageFormat(template: string): (current: number, total: number) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Get percentage progress through document
|
|
62
|
+
*/
|
|
63
|
+
declare function getPageProgress(current: number, total: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* Check if at first page
|
|
66
|
+
*/
|
|
67
|
+
declare function isFirstPage(current: number): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Check if at last page
|
|
70
|
+
*/
|
|
71
|
+
declare function isLastPage(current: number, total: number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Calculate which page is visible given scroll position
|
|
74
|
+
*/
|
|
75
|
+
declare function calculateVisiblePage(scrollTop: number, pageHeights: number[], pageGap?: number): number;
|
|
76
|
+
/**
|
|
77
|
+
* Calculate scroll position to center a page
|
|
78
|
+
*/
|
|
79
|
+
declare function calculateScrollToPage(pageNumber: number, pageHeights: number[], containerHeight: number, pageGap?: number): number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* PageNavigator Component
|
|
83
|
+
*
|
|
84
|
+
* Provides UI for navigating between pages in a paginated document.
|
|
85
|
+
* Includes:
|
|
86
|
+
* - Previous/Next page buttons
|
|
87
|
+
* - Current page display (clickable to show input)
|
|
88
|
+
* - Page number input for direct navigation
|
|
89
|
+
* - Keyboard navigation support
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Position options for the navigator
|
|
94
|
+
*/
|
|
95
|
+
type PageNavigatorPosition = 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right';
|
|
96
|
+
/**
|
|
97
|
+
* Style variant for the navigator
|
|
98
|
+
*/
|
|
99
|
+
type PageNavigatorVariant = 'default' | 'compact' | 'minimal';
|
|
100
|
+
/**
|
|
101
|
+
* Props for PageNavigator
|
|
102
|
+
*/
|
|
103
|
+
interface PageNavigatorProps {
|
|
104
|
+
/** Current page number (1-indexed) */
|
|
105
|
+
currentPage: number;
|
|
106
|
+
/** Total number of pages */
|
|
107
|
+
totalPages: number;
|
|
108
|
+
/** Callback when page navigation is requested */
|
|
109
|
+
onNavigate: (pageNumber: number) => void;
|
|
110
|
+
/** Position of the navigator (default: 'bottom-center') */
|
|
111
|
+
position?: PageNavigatorPosition;
|
|
112
|
+
/** Style variant (default: 'default') */
|
|
113
|
+
variant?: PageNavigatorVariant;
|
|
114
|
+
/** Whether to show as floating overlay (default: true) */
|
|
115
|
+
floating?: boolean;
|
|
116
|
+
/** Whether to show previous/next buttons (default: true) */
|
|
117
|
+
showButtons?: boolean;
|
|
118
|
+
/** Whether the navigator is disabled */
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
/** Additional CSS class name */
|
|
121
|
+
className?: string;
|
|
122
|
+
/** Additional inline styles */
|
|
123
|
+
style?: CSSProperties;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* PageNavigator - Navigation controls for paginated documents
|
|
127
|
+
*/
|
|
128
|
+
declare function PageNavigator({ currentPage, totalPages, onNavigate, position, variant, floating, showButtons, disabled, className, style, }: PageNavigatorProps): React__default.ReactElement;
|
|
129
|
+
/**
|
|
130
|
+
* Calculate page number from keyboard input
|
|
131
|
+
*/
|
|
132
|
+
declare function parsePageInput(input: string): number | null;
|
|
133
|
+
/**
|
|
134
|
+
* Validate page number
|
|
135
|
+
*/
|
|
136
|
+
declare function isValidPageNumber(page: number, totalPages: number): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Clamp page number to valid range
|
|
139
|
+
*/
|
|
140
|
+
declare function clampPageNumber(page: number, totalPages: number): number;
|
|
141
|
+
/**
|
|
142
|
+
* Get navigation info for keyboard shortcuts
|
|
143
|
+
*/
|
|
144
|
+
declare function getNavigationShortcuts(): Array<{
|
|
145
|
+
key: string;
|
|
146
|
+
description: string;
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* Format page range for display
|
|
150
|
+
*/
|
|
151
|
+
declare function formatPageRange$1(start: number, end: number, total: number): string;
|
|
152
|
+
/**
|
|
153
|
+
* Calculate progress percentage
|
|
154
|
+
*/
|
|
155
|
+
declare function calculateProgress(current: number, total: number): number;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Print Utilities
|
|
159
|
+
*
|
|
160
|
+
* Provides print functionality with:
|
|
161
|
+
* - Print button component for toolbar
|
|
162
|
+
* - Print-specific CSS styles
|
|
163
|
+
* - Browser print dialog trigger
|
|
164
|
+
* - Page range utilities
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Print options
|
|
169
|
+
*/
|
|
170
|
+
interface PrintOptions {
|
|
171
|
+
/** Whether to include headers */
|
|
172
|
+
includeHeaders?: boolean;
|
|
173
|
+
/** Whether to include footers */
|
|
174
|
+
includeFooters?: boolean;
|
|
175
|
+
/** Whether to include page numbers */
|
|
176
|
+
includePageNumbers?: boolean;
|
|
177
|
+
/** Page range to print (null = all) */
|
|
178
|
+
pageRange?: {
|
|
179
|
+
start: number;
|
|
180
|
+
end: number;
|
|
181
|
+
} | null;
|
|
182
|
+
/** Scale factor for printing (1.0 = 100%) */
|
|
183
|
+
scale?: number;
|
|
184
|
+
/** Whether to show background colors */
|
|
185
|
+
printBackground?: boolean;
|
|
186
|
+
/** Margins mode */
|
|
187
|
+
margins?: 'default' | 'none' | 'minimum';
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* PrintButton props
|
|
191
|
+
*/
|
|
192
|
+
interface PrintButtonProps {
|
|
193
|
+
/** Callback when print is triggered */
|
|
194
|
+
onPrint: () => void;
|
|
195
|
+
/** Whether the button is disabled */
|
|
196
|
+
disabled?: boolean;
|
|
197
|
+
/** Button label */
|
|
198
|
+
label?: string;
|
|
199
|
+
/** Additional CSS class */
|
|
200
|
+
className?: string;
|
|
201
|
+
/** Additional inline styles */
|
|
202
|
+
style?: CSSProperties;
|
|
203
|
+
/** Show icon */
|
|
204
|
+
showIcon?: boolean;
|
|
205
|
+
/** Compact mode */
|
|
206
|
+
compact?: boolean;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* PrintButton - Standalone print button for toolbar
|
|
210
|
+
*/
|
|
211
|
+
declare function PrintButton({ onPrint, disabled, label, className, style, showIcon, compact, }: PrintButtonProps): React__default.ReactElement;
|
|
212
|
+
/**
|
|
213
|
+
* PrintStyles - Injects print-specific CSS
|
|
214
|
+
*/
|
|
215
|
+
declare function PrintStyles(): React__default.ReactElement;
|
|
216
|
+
/**
|
|
217
|
+
* Trigger browser print dialog for the current document
|
|
218
|
+
*/
|
|
219
|
+
declare function triggerPrint(): void;
|
|
220
|
+
/**
|
|
221
|
+
* Create print-optimized document view in a new window
|
|
222
|
+
*/
|
|
223
|
+
declare function openPrintWindow(title: string | undefined, content: string): Window | null;
|
|
224
|
+
/**
|
|
225
|
+
* Get default print options
|
|
226
|
+
*/
|
|
227
|
+
declare function getDefaultPrintOptions(): PrintOptions;
|
|
228
|
+
/**
|
|
229
|
+
* Create page range from string (e.g., "1-5", "3", "1,3,5")
|
|
230
|
+
*/
|
|
231
|
+
declare function parsePageRange(input: string, maxPages: number): {
|
|
232
|
+
start: number;
|
|
233
|
+
end: number;
|
|
234
|
+
} | null;
|
|
235
|
+
/**
|
|
236
|
+
* Format page range for display
|
|
237
|
+
*/
|
|
238
|
+
declare function formatPageRange(range: {
|
|
239
|
+
start: number;
|
|
240
|
+
end: number;
|
|
241
|
+
} | null, totalPages: number): string;
|
|
242
|
+
/**
|
|
243
|
+
* Check if browser supports good print functionality
|
|
244
|
+
*/
|
|
245
|
+
declare function isPrintSupported(): boolean;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* TableToolbar Component
|
|
249
|
+
*
|
|
250
|
+
* Provides controls for editing tables:
|
|
251
|
+
* - Add row above/below
|
|
252
|
+
* - Add column left/right
|
|
253
|
+
* - Delete row/column
|
|
254
|
+
* - Merge cells
|
|
255
|
+
* - Split cell
|
|
256
|
+
*
|
|
257
|
+
* Shows when cursor is in a table.
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Table editing action types
|
|
262
|
+
*/
|
|
263
|
+
type TableAction = 'addRowAbove' | 'addRowBelow' | 'addColumnLeft' | 'addColumnRight' | 'deleteRow' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'deleteTable' | 'selectTable' | 'selectRow' | 'selectColumn' | 'borderAll' | 'borderOutside' | 'borderInside' | 'borderNone' | 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight' | {
|
|
264
|
+
type: 'cellFillColor';
|
|
265
|
+
color: string | null;
|
|
266
|
+
} | {
|
|
267
|
+
type: 'borderColor';
|
|
268
|
+
color: string;
|
|
269
|
+
} | {
|
|
270
|
+
type: 'borderWidth';
|
|
271
|
+
size: number;
|
|
272
|
+
} | {
|
|
273
|
+
type: 'cellBorder';
|
|
274
|
+
side: 'top' | 'bottom' | 'left' | 'right' | 'all';
|
|
275
|
+
style: string;
|
|
276
|
+
size: number;
|
|
277
|
+
color: string;
|
|
278
|
+
} | {
|
|
279
|
+
type: 'cellVerticalAlign';
|
|
280
|
+
align: 'top' | 'center' | 'bottom';
|
|
281
|
+
} | {
|
|
282
|
+
type: 'cellMargins';
|
|
283
|
+
margins: {
|
|
284
|
+
top?: number;
|
|
285
|
+
bottom?: number;
|
|
286
|
+
left?: number;
|
|
287
|
+
right?: number;
|
|
288
|
+
};
|
|
289
|
+
} | {
|
|
290
|
+
type: 'cellTextDirection';
|
|
291
|
+
direction: string | null;
|
|
292
|
+
} | {
|
|
293
|
+
type: 'toggleNoWrap';
|
|
294
|
+
} | {
|
|
295
|
+
type: 'rowHeight';
|
|
296
|
+
height: number | null;
|
|
297
|
+
rule?: 'auto' | 'atLeast' | 'exact';
|
|
298
|
+
} | {
|
|
299
|
+
type: 'toggleHeaderRow';
|
|
300
|
+
} | {
|
|
301
|
+
type: 'distributeColumns';
|
|
302
|
+
} | {
|
|
303
|
+
type: 'autoFitContents';
|
|
304
|
+
} | {
|
|
305
|
+
type: 'tableProperties';
|
|
306
|
+
props: {
|
|
307
|
+
width?: number | null;
|
|
308
|
+
widthType?: string | null;
|
|
309
|
+
justification?: 'left' | 'center' | 'right' | null;
|
|
310
|
+
};
|
|
311
|
+
} | {
|
|
312
|
+
type: 'openTableProperties';
|
|
313
|
+
} | {
|
|
314
|
+
type: 'applyTableStyle';
|
|
315
|
+
styleId: string;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Selection within a table
|
|
319
|
+
*/
|
|
320
|
+
interface TableSelection {
|
|
321
|
+
/** Index of the table in the document */
|
|
322
|
+
tableIndex: number;
|
|
323
|
+
/** Row index (0-indexed) */
|
|
324
|
+
rowIndex: number;
|
|
325
|
+
/** Column index (0-indexed) */
|
|
326
|
+
columnIndex: number;
|
|
327
|
+
/** Selected cell range for multi-cell selection */
|
|
328
|
+
selectedCells?: {
|
|
329
|
+
startRow: number;
|
|
330
|
+
startCol: number;
|
|
331
|
+
endRow: number;
|
|
332
|
+
endCol: number;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Context for table operations
|
|
337
|
+
*/
|
|
338
|
+
interface TableContext {
|
|
339
|
+
/** The table being edited */
|
|
340
|
+
table: Table;
|
|
341
|
+
/** Current selection within the table */
|
|
342
|
+
selection: TableSelection;
|
|
343
|
+
/** Whether multiple cells are selected (for merge) */
|
|
344
|
+
hasMultiCellSelection: boolean;
|
|
345
|
+
/** Whether current cell can be split */
|
|
346
|
+
canSplitCell: boolean;
|
|
347
|
+
/** Total number of rows */
|
|
348
|
+
rowCount: number;
|
|
349
|
+
/** Total number of columns */
|
|
350
|
+
columnCount: number;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Props for TableToolbar component
|
|
354
|
+
*/
|
|
355
|
+
interface TableToolbarProps {
|
|
356
|
+
/** Current table context (null if cursor not in table) */
|
|
357
|
+
context: TableContext | null;
|
|
358
|
+
/** Callback when a table action is triggered */
|
|
359
|
+
onAction?: (action: TableAction, context: TableContext) => void;
|
|
360
|
+
/** Whether the toolbar is disabled */
|
|
361
|
+
disabled?: boolean;
|
|
362
|
+
/** Additional CSS class name */
|
|
363
|
+
className?: string;
|
|
364
|
+
/** Additional inline styles */
|
|
365
|
+
style?: CSSProperties;
|
|
366
|
+
/** Show labels next to icons */
|
|
367
|
+
showLabels?: boolean;
|
|
368
|
+
/** Compact mode */
|
|
369
|
+
compact?: boolean;
|
|
370
|
+
/** Position of the toolbar */
|
|
371
|
+
position?: 'top' | 'floating';
|
|
372
|
+
/** Custom render for additional buttons */
|
|
373
|
+
children?: ReactNode;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* TableToolbar - Shows table manipulation controls when cursor is in a table
|
|
377
|
+
*/
|
|
378
|
+
declare function TableToolbar({ context, onAction, disabled, className, style, showLabels, compact, position, children, }: TableToolbarProps): React__default.ReactElement | null;
|
|
379
|
+
/**
|
|
380
|
+
* Create a table context from a table and selection
|
|
381
|
+
*/
|
|
382
|
+
declare function createTableContext(table: Table, selection: TableSelection): TableContext;
|
|
383
|
+
/**
|
|
384
|
+
* Get column count from a table
|
|
385
|
+
*/
|
|
386
|
+
declare function getColumnCount(table: Table): number;
|
|
387
|
+
/**
|
|
388
|
+
* Get cell at specific row and column index
|
|
389
|
+
*/
|
|
390
|
+
declare function getCellAt(table: Table, rowIndex: number, columnIndex: number): TableCell | null;
|
|
391
|
+
/**
|
|
392
|
+
* Add a row to a table at the specified index
|
|
393
|
+
*/
|
|
394
|
+
declare function addRow(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
395
|
+
/**
|
|
396
|
+
* Delete a row from a table
|
|
397
|
+
*/
|
|
398
|
+
declare function deleteRow(table: Table, rowIndex: number): Table;
|
|
399
|
+
/**
|
|
400
|
+
* Add a column to a table at the specified index
|
|
401
|
+
*/
|
|
402
|
+
declare function addColumn(table: Table, atIndex: number, position?: 'before' | 'after'): Table;
|
|
403
|
+
/**
|
|
404
|
+
* Delete a column from a table
|
|
405
|
+
*/
|
|
406
|
+
declare function deleteColumn(table: Table, columnIndex: number): Table;
|
|
407
|
+
/**
|
|
408
|
+
* Merge cells in a selection
|
|
409
|
+
*/
|
|
410
|
+
declare function mergeCells(table: Table, selection: TableSelection): Table;
|
|
411
|
+
/**
|
|
412
|
+
* Split a merged cell
|
|
413
|
+
*/
|
|
414
|
+
declare function splitCell(table: Table, rowIndex: number, columnIndex: number): Table;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Clipboard utilities for copy/paste with formatting
|
|
418
|
+
*
|
|
419
|
+
* Handles:
|
|
420
|
+
* - Copy: puts formatted HTML and plain text on clipboard
|
|
421
|
+
* - Paste: reads HTML clipboard, converts to runs with formatting
|
|
422
|
+
* - Handles paste from Word (cleans up Word HTML)
|
|
423
|
+
* - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
|
|
424
|
+
*/
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Clipboard content format
|
|
428
|
+
*/
|
|
429
|
+
interface ClipboardContent {
|
|
430
|
+
/** Plain text representation */
|
|
431
|
+
plainText: string;
|
|
432
|
+
/** HTML representation */
|
|
433
|
+
html: string;
|
|
434
|
+
/** Internal format (JSON) for preserving full formatting */
|
|
435
|
+
internal?: string;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Parsed clipboard content
|
|
439
|
+
*/
|
|
440
|
+
interface ParsedClipboardContent {
|
|
441
|
+
/** Runs parsed from clipboard */
|
|
442
|
+
runs: Run[];
|
|
443
|
+
/** Whether content came from Word */
|
|
444
|
+
fromWord: boolean;
|
|
445
|
+
/** Whether content came from our editor */
|
|
446
|
+
fromEditor: boolean;
|
|
447
|
+
/** Original plain text */
|
|
448
|
+
plainText: string;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Options for clipboard operations
|
|
452
|
+
*/
|
|
453
|
+
interface ClipboardOptions {
|
|
454
|
+
/** Whether to include formatting in copy */
|
|
455
|
+
includeFormatting?: boolean;
|
|
456
|
+
/** Whether to clean Word-specific formatting */
|
|
457
|
+
cleanWordFormatting?: boolean;
|
|
458
|
+
/** Callback for handling errors */
|
|
459
|
+
onError?: (error: Error) => void;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Custom MIME type for internal clipboard format
|
|
463
|
+
*/
|
|
464
|
+
declare const INTERNAL_CLIPBOARD_TYPE = "application/x-docx-editor";
|
|
465
|
+
/**
|
|
466
|
+
* Standard clipboard MIME types
|
|
467
|
+
*/
|
|
468
|
+
declare const CLIPBOARD_TYPES: {
|
|
469
|
+
readonly HTML: "text/html";
|
|
470
|
+
readonly PLAIN: "text/plain";
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* Copy runs to clipboard with formatting
|
|
474
|
+
*/
|
|
475
|
+
declare function copyRuns(runs: Run[], options?: ClipboardOptions): Promise<boolean>;
|
|
476
|
+
/**
|
|
477
|
+
* Copy paragraphs to clipboard with formatting
|
|
478
|
+
*/
|
|
479
|
+
declare function copyParagraphs(paragraphs: Paragraph[], options?: ClipboardOptions): Promise<boolean>;
|
|
480
|
+
/**
|
|
481
|
+
* Convert runs to clipboard content (HTML and plain text)
|
|
482
|
+
*/
|
|
483
|
+
declare function runsToClipboardContent(runs: Run[], includeFormatting?: boolean): ClipboardContent;
|
|
484
|
+
/**
|
|
485
|
+
* Convert paragraphs to clipboard content
|
|
486
|
+
*/
|
|
487
|
+
declare function paragraphsToClipboardContent(paragraphs: Paragraph[], includeFormatting?: boolean): ClipboardContent;
|
|
488
|
+
/**
|
|
489
|
+
* Write content to clipboard
|
|
490
|
+
*/
|
|
491
|
+
declare function writeToClipboard(content: ClipboardContent): Promise<boolean>;
|
|
492
|
+
/**
|
|
493
|
+
* Read content from clipboard
|
|
494
|
+
*/
|
|
495
|
+
declare function readFromClipboard(options?: ClipboardOptions): Promise<ParsedClipboardContent | null>;
|
|
496
|
+
/**
|
|
497
|
+
* Handle paste event
|
|
498
|
+
*/
|
|
499
|
+
declare function handlePasteEvent(event: ClipboardEvent, options?: ClipboardOptions): ParsedClipboardContent | null;
|
|
500
|
+
/**
|
|
501
|
+
* Parse HTML from clipboard
|
|
502
|
+
*/
|
|
503
|
+
declare function parseClipboardHtml(html: string, plainText: string, cleanWordFormatting?: boolean): ParsedClipboardContent;
|
|
504
|
+
/**
|
|
505
|
+
* Check if HTML is from Microsoft Word
|
|
506
|
+
*/
|
|
507
|
+
declare function isWordHtml(html: string): boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Check if HTML is from our editor
|
|
510
|
+
*/
|
|
511
|
+
declare function isEditorHtml(html: string): boolean;
|
|
512
|
+
/**
|
|
513
|
+
* Clean Microsoft Word HTML
|
|
514
|
+
*/
|
|
515
|
+
declare function cleanWordHtml(html: string): string;
|
|
516
|
+
/**
|
|
517
|
+
* Convert HTML to runs
|
|
518
|
+
*/
|
|
519
|
+
declare function htmlToRuns(html: string, plainTextFallback: string): Run[];
|
|
520
|
+
/**
|
|
521
|
+
* Create clipboard keyboard handlers for an editor
|
|
522
|
+
*/
|
|
523
|
+
declare function createClipboardHandlers(options: {
|
|
524
|
+
onCopy?: () => {
|
|
525
|
+
runs: Run[];
|
|
526
|
+
} | null;
|
|
527
|
+
onCut?: () => {
|
|
528
|
+
runs: Run[];
|
|
529
|
+
} | null;
|
|
530
|
+
onPaste?: (content: ParsedClipboardContent) => void;
|
|
531
|
+
clipboardOptions?: ClipboardOptions;
|
|
532
|
+
}): {
|
|
533
|
+
handleCopy: (event: ClipboardEvent) => Promise<void>;
|
|
534
|
+
handleCut: (event: ClipboardEvent) => Promise<void>;
|
|
535
|
+
handlePaste: (event: ClipboardEvent) => void;
|
|
536
|
+
handleKeyDown: (event: KeyboardEvent) => Promise<void>;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
export { openPrintWindow as $, copyRuns as A, createClipboardHandlers as B, CLIPBOARD_TYPES as C, createPageFormat as D, createTableContext as E, deleteColumn as F, deleteRow as G, formatPageOrdinal as H, INTERNAL_CLIPBOARD_TYPE as I, formatPageRange$1 as J, formatPageRange as K, getCellAt as L, getColumnCount as M, getDefaultPrintOptions as N, getNavigationShortcuts as O, type PageIndicatorPosition as P, getPageProgress as Q, handlePasteEvent as R, htmlToRuns as S, type TableAction as T, isEditorHtml as U, isFirstPage as V, isLastPage as W, isPrintSupported as X, isValidPageNumber as Y, isWordHtml as Z, mergeCells as _, type ClipboardContent as a, paragraphsToClipboardContent as a0, parseClipboardHtml as a1, parsePageInput as a2, parsePageRange as a3, readFromClipboard as a4, runsToClipboardContent as a5, splitCell as a6, triggerPrint as a7, writeToClipboard as a8, type ClipboardOptions as b, type PageIndicatorVariant as c, PageNavigator as d, type PageNavigatorPosition as e, type PageNavigatorProps as f, type PageNavigatorVariant as g, PageNumberIndicator as h, type PageNumberIndicatorProps as i, type ParsedClipboardContent as j, PrintButton as k, type PrintButtonProps as l, type PrintOptions as m, PrintStyles as n, type TableContext as o, type TableSelection as p, TableToolbar as q, type TableToolbarProps as r, addColumn as s, addRow as t, calculateProgress as u, calculateScrollToPage as v, calculateVisiblePage as w, clampPageNumber as x, cleanWordHtml as y, copyParagraphs as z };
|