@eigenpal/docx-js-editor 0.0.11 → 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-TRAQI6RX.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-PM4Y7OFN.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-GQ4JYQWC.js +0 -58
- package/dist/chunk-H3JNHCD7.cjs +0 -10
- package/dist/chunk-L2UUZRZI.js +0 -10
- package/dist/chunk-QOIY4Y6N.cjs +0 -9
- package/dist/chunk-QYKJKSKZ.cjs +0 -58
- package/dist/chunk-TPUJJJWA.js +0 -9
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { h as Document, X as TextFormatting, a5 as StyleInfo, c as AgentContext, v as Position, R as Range, u as ParagraphFormatting, b as AgentCommand } from './agentApi-CbVUCZRu.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Flexible input types for DOCX documents.
|
|
5
|
+
*
|
|
6
|
+
* Accepts any common binary format so consumers don't need to manually
|
|
7
|
+
* convert before passing data to the editor or parser.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Any binary representation of a DOCX file that the editor can consume.
|
|
11
|
+
*
|
|
12
|
+
* - `ArrayBuffer` — from `FileReader.readAsArrayBuffer()` or `fetch().arrayBuffer()`
|
|
13
|
+
* - `Uint8Array` — from Node.js `fs.readFile()` or streaming APIs
|
|
14
|
+
* - `Blob` — from drag-and-drop or `<input type="file">`
|
|
15
|
+
* - `File` — subclass of Blob, from `<input type="file">`
|
|
16
|
+
*/
|
|
17
|
+
type DocxInput = ArrayBuffer | Uint8Array | Blob | File;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize any {@link DocxInput} into an `ArrayBuffer` for internal use.
|
|
20
|
+
*/
|
|
21
|
+
declare function toArrayBuffer(input: DocxInput): Promise<ArrayBuffer>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* DocumentAgent - High-level fluent API for programmatic document manipulation
|
|
25
|
+
*
|
|
26
|
+
* Provides a convenient interface for:
|
|
27
|
+
* - Reading document content and metadata
|
|
28
|
+
* - Editing text with formatting
|
|
29
|
+
* - Inserting tables, images, and hyperlinks
|
|
30
|
+
* - Managing template variables
|
|
31
|
+
* - Exporting to DOCX buffer
|
|
32
|
+
*
|
|
33
|
+
* All operations are immutable - they return a new DocumentAgent instance
|
|
34
|
+
* or don't modify the underlying document.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Options for inserting text
|
|
39
|
+
*/
|
|
40
|
+
interface InsertTextOptions {
|
|
41
|
+
/** Text formatting */
|
|
42
|
+
formatting?: TextFormatting;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Options for inserting table
|
|
46
|
+
*/
|
|
47
|
+
interface InsertTableOptions {
|
|
48
|
+
/** Table data (2D array of strings) */
|
|
49
|
+
data?: string[][];
|
|
50
|
+
/** Whether first row is a header */
|
|
51
|
+
hasHeader?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options for inserting image
|
|
55
|
+
*/
|
|
56
|
+
interface InsertImageOptions {
|
|
57
|
+
/** Image width in pixels */
|
|
58
|
+
width?: number;
|
|
59
|
+
/** Image height in pixels */
|
|
60
|
+
height?: number;
|
|
61
|
+
/** Alt text for accessibility */
|
|
62
|
+
alt?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Options for inserting hyperlink
|
|
66
|
+
*/
|
|
67
|
+
interface InsertHyperlinkOptions {
|
|
68
|
+
/** Display text (overrides selected text) */
|
|
69
|
+
displayText?: string;
|
|
70
|
+
/** Tooltip on hover */
|
|
71
|
+
tooltip?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Formatted text segment
|
|
75
|
+
*/
|
|
76
|
+
interface FormattedTextSegment {
|
|
77
|
+
/** Text content */
|
|
78
|
+
text: string;
|
|
79
|
+
/** Applied formatting */
|
|
80
|
+
formatting?: TextFormatting;
|
|
81
|
+
/** Is part of a hyperlink */
|
|
82
|
+
isHyperlink?: boolean;
|
|
83
|
+
/** Hyperlink URL if applicable */
|
|
84
|
+
hyperlinkUrl?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* DocumentAgent provides a fluent API for document manipulation
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const agent = new DocumentAgent(buffer);
|
|
92
|
+
*
|
|
93
|
+
* // Read operations
|
|
94
|
+
* const text = agent.getText();
|
|
95
|
+
* const wordCount = agent.getWordCount();
|
|
96
|
+
* const variables = agent.getVariables();
|
|
97
|
+
*
|
|
98
|
+
* // Write operations (returns new agent)
|
|
99
|
+
* const newAgent = agent
|
|
100
|
+
* .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ', { formatting: { bold: true } })
|
|
101
|
+
* .applyStyle({ paragraphIndex: 0, offset: 0 }, { paragraphIndex: 0, offset: 5 }, 'Heading1');
|
|
102
|
+
*
|
|
103
|
+
* // Export
|
|
104
|
+
* const newBuffer = await newAgent.toBuffer();
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
declare class DocumentAgent {
|
|
108
|
+
private _document;
|
|
109
|
+
private _pendingVariables;
|
|
110
|
+
/**
|
|
111
|
+
* Create a new DocumentAgent
|
|
112
|
+
*
|
|
113
|
+
* @param source - Document object or ArrayBuffer to parse
|
|
114
|
+
*/
|
|
115
|
+
constructor(source: Document | ArrayBuffer);
|
|
116
|
+
/**
|
|
117
|
+
* Create a DocumentAgent from a DOCX buffer (async)
|
|
118
|
+
*
|
|
119
|
+
* @param buffer - DOCX file as ArrayBuffer, Uint8Array, Blob, or File
|
|
120
|
+
* @returns Promise resolving to DocumentAgent
|
|
121
|
+
*/
|
|
122
|
+
static fromBuffer(buffer: DocxInput): Promise<DocumentAgent>;
|
|
123
|
+
/**
|
|
124
|
+
* Create a DocumentAgent from a Document object
|
|
125
|
+
*
|
|
126
|
+
* @param document - Parsed Document
|
|
127
|
+
* @returns DocumentAgent
|
|
128
|
+
*/
|
|
129
|
+
static fromDocument(document: Document): DocumentAgent;
|
|
130
|
+
/**
|
|
131
|
+
* Get the underlying document
|
|
132
|
+
*/
|
|
133
|
+
getDocument(): Document;
|
|
134
|
+
/**
|
|
135
|
+
* Get plain text content of the document
|
|
136
|
+
*
|
|
137
|
+
* @returns All document text concatenated
|
|
138
|
+
*/
|
|
139
|
+
getText(): string;
|
|
140
|
+
/**
|
|
141
|
+
* Get formatted text segments
|
|
142
|
+
*
|
|
143
|
+
* @returns Array of text segments with formatting info
|
|
144
|
+
*/
|
|
145
|
+
getFormattedText(): FormattedTextSegment[];
|
|
146
|
+
/**
|
|
147
|
+
* Get detected template variables
|
|
148
|
+
*
|
|
149
|
+
* @returns Array of variable names (without braces)
|
|
150
|
+
*/
|
|
151
|
+
getVariables(): string[];
|
|
152
|
+
/**
|
|
153
|
+
* Get available styles from the document
|
|
154
|
+
*
|
|
155
|
+
* @returns Array of style info
|
|
156
|
+
*/
|
|
157
|
+
getStyles(): StyleInfo[];
|
|
158
|
+
/**
|
|
159
|
+
* Get approximate page count
|
|
160
|
+
*
|
|
161
|
+
* Note: This is an estimate based on content length.
|
|
162
|
+
* Actual page count requires full layout computation.
|
|
163
|
+
*
|
|
164
|
+
* @returns Estimated page count
|
|
165
|
+
*/
|
|
166
|
+
getPageCount(): number;
|
|
167
|
+
/**
|
|
168
|
+
* Get word count
|
|
169
|
+
*
|
|
170
|
+
* @returns Number of words in the document
|
|
171
|
+
*/
|
|
172
|
+
getWordCount(): number;
|
|
173
|
+
/**
|
|
174
|
+
* Get character count
|
|
175
|
+
*
|
|
176
|
+
* @param includeSpaces - Whether to include whitespace
|
|
177
|
+
* @returns Number of characters
|
|
178
|
+
*/
|
|
179
|
+
getCharacterCount(includeSpaces?: boolean): number;
|
|
180
|
+
/**
|
|
181
|
+
* Get paragraph count
|
|
182
|
+
*
|
|
183
|
+
* @returns Number of paragraphs
|
|
184
|
+
*/
|
|
185
|
+
getParagraphCount(): number;
|
|
186
|
+
/**
|
|
187
|
+
* Get table count
|
|
188
|
+
*
|
|
189
|
+
* @returns Number of tables
|
|
190
|
+
*/
|
|
191
|
+
getTableCount(): number;
|
|
192
|
+
/**
|
|
193
|
+
* Get document context for AI agents
|
|
194
|
+
*
|
|
195
|
+
* @param outlineMaxChars - Max characters per paragraph in outline
|
|
196
|
+
* @returns Agent context
|
|
197
|
+
*/
|
|
198
|
+
getAgentContext(outlineMaxChars?: number): AgentContext;
|
|
199
|
+
/**
|
|
200
|
+
* Insert text at a position
|
|
201
|
+
*
|
|
202
|
+
* @param position - Where to insert
|
|
203
|
+
* @param text - Text to insert
|
|
204
|
+
* @param options - Insert options
|
|
205
|
+
* @returns New DocumentAgent with text inserted
|
|
206
|
+
*/
|
|
207
|
+
insertText(position: Position, text: string, options?: InsertTextOptions): DocumentAgent;
|
|
208
|
+
/**
|
|
209
|
+
* Replace text in a range
|
|
210
|
+
*
|
|
211
|
+
* @param range - Range to replace
|
|
212
|
+
* @param text - Replacement text
|
|
213
|
+
* @param options - Replace options
|
|
214
|
+
* @returns New DocumentAgent with text replaced
|
|
215
|
+
*/
|
|
216
|
+
replaceRange(range: Range, text: string, options?: InsertTextOptions): DocumentAgent;
|
|
217
|
+
/**
|
|
218
|
+
* Delete text in a range
|
|
219
|
+
*
|
|
220
|
+
* @param range - Range to delete
|
|
221
|
+
* @returns New DocumentAgent with text deleted
|
|
222
|
+
*/
|
|
223
|
+
deleteRange(range: Range): DocumentAgent;
|
|
224
|
+
/**
|
|
225
|
+
* Apply text formatting to a range
|
|
226
|
+
*
|
|
227
|
+
* @param range - Range to format
|
|
228
|
+
* @param formatting - Formatting to apply
|
|
229
|
+
* @returns New DocumentAgent with formatting applied
|
|
230
|
+
*/
|
|
231
|
+
applyFormatting(range: Range, formatting: Partial<TextFormatting>): DocumentAgent;
|
|
232
|
+
/**
|
|
233
|
+
* Apply a named style to a paragraph
|
|
234
|
+
*
|
|
235
|
+
* @param paragraphIndex - Index of the paragraph
|
|
236
|
+
* @param styleId - Style ID to apply
|
|
237
|
+
* @returns New DocumentAgent with style applied
|
|
238
|
+
*/
|
|
239
|
+
applyStyle(paragraphIndex: number, styleId: string): DocumentAgent;
|
|
240
|
+
/**
|
|
241
|
+
* Apply paragraph formatting
|
|
242
|
+
*
|
|
243
|
+
* @param paragraphIndex - Index of the paragraph
|
|
244
|
+
* @param formatting - Formatting to apply
|
|
245
|
+
* @returns New DocumentAgent with formatting applied
|
|
246
|
+
*/
|
|
247
|
+
applyParagraphFormatting(paragraphIndex: number, formatting: Partial<ParagraphFormatting>): DocumentAgent;
|
|
248
|
+
/**
|
|
249
|
+
* Insert a table at a position
|
|
250
|
+
*
|
|
251
|
+
* @param position - Where to insert the table
|
|
252
|
+
* @param rows - Number of rows
|
|
253
|
+
* @param cols - Number of columns
|
|
254
|
+
* @param options - Table options
|
|
255
|
+
* @returns New DocumentAgent with table inserted
|
|
256
|
+
*/
|
|
257
|
+
insertTable(position: Position, rows: number, cols: number, options?: InsertTableOptions): DocumentAgent;
|
|
258
|
+
/**
|
|
259
|
+
* Insert an image at a position
|
|
260
|
+
*
|
|
261
|
+
* @param position - Where to insert the image
|
|
262
|
+
* @param src - Image source (base64 data URL or URL)
|
|
263
|
+
* @param options - Image options
|
|
264
|
+
* @returns New DocumentAgent with image inserted
|
|
265
|
+
*/
|
|
266
|
+
insertImage(position: Position, src: string, options?: InsertImageOptions): DocumentAgent;
|
|
267
|
+
/**
|
|
268
|
+
* Insert a hyperlink
|
|
269
|
+
*
|
|
270
|
+
* @param range - Range to make into a hyperlink
|
|
271
|
+
* @param url - URL of the hyperlink
|
|
272
|
+
* @param options - Hyperlink options
|
|
273
|
+
* @returns New DocumentAgent with hyperlink inserted
|
|
274
|
+
*/
|
|
275
|
+
insertHyperlink(range: Range, url: string, options?: InsertHyperlinkOptions): DocumentAgent;
|
|
276
|
+
/**
|
|
277
|
+
* Remove a hyperlink but keep the text
|
|
278
|
+
*
|
|
279
|
+
* @param range - Range containing the hyperlink
|
|
280
|
+
* @returns New DocumentAgent with hyperlink removed
|
|
281
|
+
*/
|
|
282
|
+
removeHyperlink(range: Range): DocumentAgent;
|
|
283
|
+
/**
|
|
284
|
+
* Insert a paragraph break
|
|
285
|
+
*
|
|
286
|
+
* @param position - Where to break the paragraph
|
|
287
|
+
* @returns New DocumentAgent with paragraph broken
|
|
288
|
+
*/
|
|
289
|
+
insertParagraphBreak(position: Position): DocumentAgent;
|
|
290
|
+
/**
|
|
291
|
+
* Merge consecutive paragraphs
|
|
292
|
+
*
|
|
293
|
+
* @param startParagraphIndex - First paragraph index
|
|
294
|
+
* @param count - Number of paragraphs to merge with the first
|
|
295
|
+
* @returns New DocumentAgent with paragraphs merged
|
|
296
|
+
*/
|
|
297
|
+
mergeParagraphs(startParagraphIndex: number, count: number): DocumentAgent;
|
|
298
|
+
/**
|
|
299
|
+
* Set a template variable value
|
|
300
|
+
*
|
|
301
|
+
* Note: Variables are not applied until `applyVariables()` is called
|
|
302
|
+
*
|
|
303
|
+
* @param name - Variable name (without braces)
|
|
304
|
+
* @param value - Variable value
|
|
305
|
+
* @returns This DocumentAgent (for chaining)
|
|
306
|
+
*/
|
|
307
|
+
setVariable(name: string, value: string): DocumentAgent;
|
|
308
|
+
/**
|
|
309
|
+
* Set multiple template variables
|
|
310
|
+
*
|
|
311
|
+
* @param variables - Map of variable names to values
|
|
312
|
+
* @returns This DocumentAgent (for chaining)
|
|
313
|
+
*/
|
|
314
|
+
setVariables(variables: Record<string, string>): DocumentAgent;
|
|
315
|
+
/**
|
|
316
|
+
* Get pending variable values
|
|
317
|
+
*
|
|
318
|
+
* @returns Map of pending variable values
|
|
319
|
+
*/
|
|
320
|
+
getPendingVariables(): Record<string, string>;
|
|
321
|
+
/**
|
|
322
|
+
* Clear pending variables
|
|
323
|
+
*
|
|
324
|
+
* @returns This DocumentAgent (for chaining)
|
|
325
|
+
*/
|
|
326
|
+
clearPendingVariables(): DocumentAgent;
|
|
327
|
+
/**
|
|
328
|
+
* Apply all pending template variables
|
|
329
|
+
*
|
|
330
|
+
* Uses docxtemplater to substitute variables while preserving formatting.
|
|
331
|
+
*
|
|
332
|
+
* @param variables - Optional additional variables (merged with pending)
|
|
333
|
+
* @returns New DocumentAgent with variables applied
|
|
334
|
+
*/
|
|
335
|
+
applyVariables(variables?: Record<string, string>): Promise<DocumentAgent>;
|
|
336
|
+
/**
|
|
337
|
+
* Export document to DOCX ArrayBuffer
|
|
338
|
+
*
|
|
339
|
+
* @returns Promise resolving to DOCX file as ArrayBuffer
|
|
340
|
+
*/
|
|
341
|
+
toBuffer(): Promise<ArrayBuffer>;
|
|
342
|
+
/**
|
|
343
|
+
* Export document to Blob
|
|
344
|
+
*
|
|
345
|
+
* @param mimeType - MIME type for the blob
|
|
346
|
+
* @returns Promise resolving to DOCX file as Blob
|
|
347
|
+
*/
|
|
348
|
+
toBlob(mimeType?: string): Promise<Blob>;
|
|
349
|
+
/**
|
|
350
|
+
* Execute multiple commands in sequence
|
|
351
|
+
*
|
|
352
|
+
* @param commands - Commands to execute
|
|
353
|
+
* @returns New DocumentAgent with all commands applied
|
|
354
|
+
*/
|
|
355
|
+
executeCommands(commands: AgentCommand[]): DocumentAgent;
|
|
356
|
+
/**
|
|
357
|
+
* Execute a single command and return new agent
|
|
358
|
+
*/
|
|
359
|
+
private _executeCommand;
|
|
360
|
+
/**
|
|
361
|
+
* Get plain text from document body
|
|
362
|
+
*/
|
|
363
|
+
private _getBodyText;
|
|
364
|
+
/**
|
|
365
|
+
* Get plain text from a paragraph
|
|
366
|
+
*/
|
|
367
|
+
private _getParagraphText;
|
|
368
|
+
/**
|
|
369
|
+
* Get plain text from a run
|
|
370
|
+
*/
|
|
371
|
+
private _getRunText;
|
|
372
|
+
/**
|
|
373
|
+
* Get plain text from a hyperlink
|
|
374
|
+
*/
|
|
375
|
+
private _getHyperlinkText;
|
|
376
|
+
/**
|
|
377
|
+
* Get plain text from a table
|
|
378
|
+
*/
|
|
379
|
+
private _getTableText;
|
|
380
|
+
/**
|
|
381
|
+
* Extract formatted text segments from a paragraph
|
|
382
|
+
*/
|
|
383
|
+
private _extractParagraphSegments;
|
|
384
|
+
/**
|
|
385
|
+
* Parse heading level from style ID
|
|
386
|
+
*/
|
|
387
|
+
private _parseHeadingLevel;
|
|
388
|
+
/**
|
|
389
|
+
* Check if document has images
|
|
390
|
+
*/
|
|
391
|
+
private _hasImages;
|
|
392
|
+
/**
|
|
393
|
+
* Check if document has hyperlinks
|
|
394
|
+
*/
|
|
395
|
+
private _hasHyperlinks;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Create a DocumentAgent from a DOCX buffer
|
|
399
|
+
*
|
|
400
|
+
* @param buffer - DOCX file as ArrayBuffer
|
|
401
|
+
* @returns Promise resolving to DocumentAgent
|
|
402
|
+
*/
|
|
403
|
+
declare function createAgent(buffer: ArrayBuffer): Promise<DocumentAgent>;
|
|
404
|
+
/**
|
|
405
|
+
* Create a DocumentAgent from a parsed Document
|
|
406
|
+
*
|
|
407
|
+
* @param document - Parsed Document
|
|
408
|
+
* @returns DocumentAgent
|
|
409
|
+
*/
|
|
410
|
+
declare function createAgentFromDocument(document: Document): DocumentAgent;
|
|
411
|
+
|
|
412
|
+
export { DocumentAgent as D, type FormattedTextSegment as F, type InsertHyperlinkOptions as I, type DocxInput as a, type InsertImageOptions as b, type InsertTableOptions as c, type InsertTextOptions as d, createAgent as e, createAgentFromDocument as f, toArrayBuffer as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkCZ7W7MCM_cjs=require('./chunk-CZ7W7MCM.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"FindReplaceDialog",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.n}});Object.defineProperty(exports,"createDefaultFindOptions",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.a}});Object.defineProperty(exports,"createSearchPattern",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.c}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.o}});Object.defineProperty(exports,"escapeRegexString",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.b}});Object.defineProperty(exports,"findAllMatches",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.d}});Object.defineProperty(exports,"findInDocument",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.j}});Object.defineProperty(exports,"findInParagraph",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.k}});Object.defineProperty(exports,"getDefaultHighlightOptions",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.i}});Object.defineProperty(exports,"getMatchCountText",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.g}});Object.defineProperty(exports,"isEmptySearch",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.h}});Object.defineProperty(exports,"replaceAllInContent",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.e}});Object.defineProperty(exports,"replaceFirstInContent",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.f}});Object.defineProperty(exports,"scrollToMatch",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.l}});Object.defineProperty(exports,"useFindReplace",{enumerable:true,get:function(){return chunkCZ7W7MCM_cjs.m}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,o as default,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-KVAT5SVD.js';import'./chunk-3IYNTJO5.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('./chunk-RTESADL3.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},D={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},a={display:"block",fontSize:12,color:"#666",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},P={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},L={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},h={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},O={...h,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},f=[{value:"decimal",label:"1, 2, 3, ..."},{value:"lowerRoman",label:"i, ii, iii, ..."},{value:"upperRoman",label:"I, II, III, ..."},{value:"lowerLetter",label:"a, b, c, ..."},{value:"upperLetter",label:"A, B, C, ..."},{value:"chicago",label:"*, \u2020, \u2021, ..."}];function j({isOpen:C,onClose:l,onApply:g,footnotePr:r,endnotePr:s}){let[u,x]=react.useState(r?.position??"pageBottom"),[p,F]=react.useState(r?.numFmt??"decimal"),[m,N]=react.useState(r?.numStart??1),[d,R]=react.useState(r?.numRestart??"continuous"),[c,E]=react.useState(s?.position??"docEnd"),[b,k]=react.useState(s?.numFmt??"lowerRoman"),[v,I]=react.useState(s?.numStart??1),[y,w]=react.useState(s?.numRestart??"continuous"),B=react.useCallback(()=>{g({position:u,numFmt:p,numStart:m,numRestart:d},{position:c,numFmt:b,numStart:v,numRestart:y}),l();},[u,p,m,d,c,b,v,y,g,l]);return C?jsxRuntime.jsx("div",{style:A,onClick:l,children:jsxRuntime.jsxs("div",{style:D,onClick:e=>e.stopPropagation(),children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Footnote & Endnote Properties"}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Footnotes"}),jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:i,value:u,onChange:e=>x(e.target.value),children:[jsxRuntime.jsx("option",{value:"pageBottom",children:"Bottom of page"}),jsxRuntime.jsx("option",{value:"beneathText",children:"Below text"})]}),jsxRuntime.jsx("label",{style:a,children:"Number format"}),jsxRuntime.jsx("select",{style:i,value:p,onChange:e=>F(e.target.value),children:f.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:a,children:"Start at"}),jsxRuntime.jsx("input",{type:"number",min:1,style:P,value:m,onChange:e=>N(parseInt(e.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:a,children:"Numbering"}),jsxRuntime.jsxs("select",{style:i,value:d,onChange:e=>R(e.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:"Continuous"}),jsxRuntime.jsx("option",{value:"eachSect",children:"Restart each section"}),jsxRuntime.jsx("option",{value:"eachPage",children:"Restart each page"})]})]})]})]}),jsxRuntime.jsxs("div",{style:S,children:[jsxRuntime.jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Endnotes"}),jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:i,value:c,onChange:e=>E(e.target.value),children:[jsxRuntime.jsx("option",{value:"docEnd",children:"End of document"}),jsxRuntime.jsx("option",{value:"sectEnd",children:"End of section"})]}),jsxRuntime.jsx("label",{style:a,children:"Number format"}),jsxRuntime.jsx("select",{style:i,value:b,onChange:e=>k(e.target.value),children:f.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{style:a,children:"Start at"}),jsxRuntime.jsx("input",{type:"number",min:1,style:P,value:v,onChange:e=>I(parseInt(e.target.value,10)||1)})]}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("label",{style:a,children:"Numbering"}),jsxRuntime.jsxs("select",{style:i,value:y,onChange:e=>w(e.target.value),children:[jsxRuntime.jsx("option",{value:"continuous",children:"Continuous"}),jsxRuntime.jsx("option",{value:"eachSect",children:"Restart each section"})]})]})]})]}),jsxRuntime.jsxs("div",{style:L,children:[jsxRuntime.jsx("button",{style:h,onClick:l,children:"Cancel"}),jsxRuntime.jsx("button",{style:O,onClick:B,children:"Apply"})]})]})}):null}exports.FootnotePropertiesDialog=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-3IYNTJO5.js';import {useState,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var A={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},D={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",padding:24,minWidth:400,maxWidth:500},S={marginBottom:16,padding:12,border:"1px solid #e0e0e0",borderRadius:4},a={display:"block",fontSize:12,color:"#666",marginBottom:4},i={width:"100%",padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},P={width:60,padding:"4px 8px",border:"1px solid #ccc",borderRadius:4,fontSize:13,marginBottom:8},L={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},h={padding:"6px 16px",border:"1px solid #ccc",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"white"},O={...h,backgroundColor:"#2563eb",color:"white",border:"1px solid #2563eb"},f=[{value:"decimal",label:"1, 2, 3, ..."},{value:"lowerRoman",label:"i, ii, iii, ..."},{value:"upperRoman",label:"I, II, III, ..."},{value:"lowerLetter",label:"a, b, c, ..."},{value:"upperLetter",label:"A, B, C, ..."},{value:"chicago",label:"*, \u2020, \u2021, ..."}];function j({isOpen:C,onClose:l,onApply:g,footnotePr:r,endnotePr:s}){let[u,x]=useState(r?.position??"pageBottom"),[p,F]=useState(r?.numFmt??"decimal"),[m,N]=useState(r?.numStart??1),[d,R]=useState(r?.numRestart??"continuous"),[c,E]=useState(s?.position??"docEnd"),[b,k]=useState(s?.numFmt??"lowerRoman"),[v,I]=useState(s?.numStart??1),[y,w]=useState(s?.numRestart??"continuous"),B=useCallback(()=>{g({position:u,numFmt:p,numStart:m,numRestart:d},{position:c,numFmt:b,numStart:v,numRestart:y}),l();},[u,p,m,d,c,b,v,y,g,l]);return C?jsx("div",{style:A,onClick:l,children:jsxs("div",{style:D,onClick:e=>e.stopPropagation(),children:[jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Footnote & Endnote Properties"}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Footnotes"}),jsx("label",{style:a,children:"Position"}),jsxs("select",{style:i,value:u,onChange:e=>x(e.target.value),children:[jsx("option",{value:"pageBottom",children:"Bottom of page"}),jsx("option",{value:"beneathText",children:"Below text"})]}),jsx("label",{style:a,children:"Number format"}),jsx("select",{style:i,value:p,onChange:e=>F(e.target.value),children:f.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:a,children:"Start at"}),jsx("input",{type:"number",min:1,style:P,value:m,onChange:e=>N(parseInt(e.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:a,children:"Numbering"}),jsxs("select",{style:i,value:d,onChange:e=>R(e.target.value),children:[jsx("option",{value:"continuous",children:"Continuous"}),jsx("option",{value:"eachSect",children:"Restart each section"}),jsx("option",{value:"eachPage",children:"Restart each page"})]})]})]})]}),jsxs("div",{style:S,children:[jsx("h4",{style:{margin:"0 0 8px",fontSize:14},children:"Endnotes"}),jsx("label",{style:a,children:"Position"}),jsxs("select",{style:i,value:c,onChange:e=>E(e.target.value),children:[jsx("option",{value:"docEnd",children:"End of document"}),jsx("option",{value:"sectEnd",children:"End of section"})]}),jsx("label",{style:a,children:"Number format"}),jsx("select",{style:i,value:b,onChange:e=>k(e.target.value),children:f.map(e=>jsx("option",{value:e.value,children:e.label},e.value))}),jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[jsxs("div",{children:[jsx("label",{style:a,children:"Start at"}),jsx("input",{type:"number",min:1,style:P,value:v,onChange:e=>I(parseInt(e.target.value,10)||1)})]}),jsxs("div",{style:{flex:1},children:[jsx("label",{style:a,children:"Numbering"}),jsxs("select",{style:i,value:y,onChange:e=>w(e.target.value),children:[jsx("option",{value:"continuous",children:"Continuous"}),jsx("option",{value:"eachSect",children:"Restart each section"})]})]})]})]}),jsxs("div",{style:L,children:[jsx("button",{style:h,onClick:l,children:"Cancel"}),jsx("button",{style:O,onClick:B,children:"Apply"})]})]})}):null}export{j as FootnotePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkXS2AQFMF_cjs=require('./chunk-XS2AQFMF.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"HyperlinkDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.d}});Object.defineProperty(exports,"createBookmarkLinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.f}});Object.defineProperty(exports,"createHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.e}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.n}});Object.defineProperty(exports,"emailToMailto",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.j}});Object.defineProperty(exports,"extractBookmarksForDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.l}});Object.defineProperty(exports,"getDisplayText",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.i}});Object.defineProperty(exports,"getUrlType",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.c}});Object.defineProperty(exports,"isBookmarkHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.h}});Object.defineProperty(exports,"isExternalHyperlinkData",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.g}});Object.defineProperty(exports,"isValidUrl",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.a}});Object.defineProperty(exports,"normalizeUrl",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.b}});Object.defineProperty(exports,"phoneToTel",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.k}});Object.defineProperty(exports,"useHyperlinkDialog",{enumerable:true,get:function(){return chunkXS2AQFMF_cjs.m}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,n as default,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel,m as useHyperlinkDialog}from'./chunk-PJVI53AH.js';import'./chunk-3IYNTJO5.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('./chunk-RTESADL3.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=react.useState("align"),[y,k]=react.useState("center"),[c,z]=react.useState("column"),[b,A]=react.useState(0),[g,m]=react.useState("align"),[h,L]=react.useState("top"),[S,B]=react.useState("paragraph"),[x,M]=react.useState(0),[C,N]=react.useState(0),[P,E]=react.useState(0),[T,H]=react.useState(0),[R,V]=react.useState(0);react.useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=react.useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=react.useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsxRuntime.jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxRuntime.jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsxRuntime.jsx("div",{style:J,children:"Image Position"}),jsxRuntime.jsxs("div",{style:Q,children:[jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Horizontal"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"column",children:"Column"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"character",children:"Character"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Vertical"}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Position"}),jsxRuntime.jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsxRuntime.jsx("option",{value:"align",children:"Alignment"}),jsxRuntime.jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Align"}),jsxRuntime.jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsxRuntime.jsx("option",{value:"top",children:"Top"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Offset (px)"}),jsxRuntime.jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:a,children:"Relative to"}),jsxRuntime.jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsxRuntime.jsx("option",{value:"page",children:"Page"}),jsxRuntime.jsx("option",{value:"margin",children:"Margin"}),jsxRuntime.jsx("option",{value:"paragraph",children:"Paragraph"}),jsxRuntime.jsx("option",{value:"line",children:"Line"})]})]})]}),jsxRuntime.jsxs("div",{style:w,children:[jsxRuntime.jsx("div",{style:I,children:"Distance from text (px)"}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Top"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Bottom"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Left"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxRuntime.jsxs("div",{style:l,children:[jsxRuntime.jsx("label",{style:{...a,width:45},children:"Right"}),jsxRuntime.jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxRuntime.jsxs("div",{style:U,children:[jsxRuntime.jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}exports.ImagePositionDialog=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-3IYNTJO5.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var F={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},G={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:400,maxWidth:480,width:"100%",margin:20},J={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},Q={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},w={display:"flex",flexDirection:"column",gap:8},I={fontSize:13,fontWeight:600,color:"var(--doc-text)"},l={display:"flex",alignItems:"center",gap:8},a={width:75,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},d={...s},U={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},K={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function Z({isOpen:f,onClose:r,onApply:D,currentData:n}){let[v,u]=useState("align"),[y,k]=useState("center"),[c,z]=useState("column"),[b,A]=useState(0),[g,m]=useState("align"),[h,L]=useState("top"),[S,B]=useState("paragraph"),[x,M]=useState(0),[C,N]=useState(0),[P,E]=useState(0),[T,H]=useState(0),[R,V]=useState(0);useEffect(()=>{if(!f)return;let e=n?.horizontal,p=n?.vertical;e?.align?(u("align"),k(e.align)):e?.posOffset!=null&&(u("offset"),A(e.posOffset)),e?.relativeTo&&z(e.relativeTo),p?.align?(m("align"),L(p.align)):p?.posOffset!=null&&(m("offset"),M(p.posOffset)),p?.relativeTo&&B(p.relativeTo),N(n?.distTop??0),E(n?.distBottom??0),H(n?.distLeft??0),V(n?.distRight??0);},[f,n]);let O=useCallback(()=>{let e={};e.horizontal={relativeTo:c,...v==="align"?{align:y}:{posOffset:b}},e.vertical={relativeTo:S,...g==="align"?{align:h}:{posOffset:x}},e.distTop=C,e.distBottom=P,e.distLeft=T,e.distRight=R,D(e),r();},[v,y,c,b,g,h,S,x,C,P,T,R,D,r]),j=useCallback(e=>{e.key==="Escape"&&r(),e.key==="Enter"&&O();},[r,O]);return f?jsx("div",{style:F,onClick:r,onKeyDown:j,children:jsxs("div",{style:G,onClick:e=>e.stopPropagation(),role:"dialog","aria-label":"Image position",children:[jsx("div",{style:J,children:"Image Position"}),jsxs("div",{style:Q,children:[jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Horizontal"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:v,onChange:e=>u(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),v==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:y,onChange:e=>k(e.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:b,onChange:e=>A(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:c,onChange:e=>z(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"column",children:"Column"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"character",children:"Character"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Vertical"}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Position"}),jsxs("select",{style:d,value:g,onChange:e=>m(e.target.value),children:[jsx("option",{value:"align",children:"Alignment"}),jsx("option",{value:"offset",children:"Offset"})]})]}),g==="align"?jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Align"}),jsxs("select",{style:d,value:h,onChange:e=>L(e.target.value),children:[jsx("option",{value:"top",children:"Top"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"bottom",children:"Bottom"})]})]}):jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Offset (px)"}),jsx("input",{type:"number",style:s,value:x,onChange:e=>M(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:a,children:"Relative to"}),jsxs("select",{style:d,value:S,onChange:e=>B(e.target.value),children:[jsx("option",{value:"page",children:"Page"}),jsx("option",{value:"margin",children:"Margin"}),jsx("option",{value:"paragraph",children:"Paragraph"}),jsx("option",{value:"line",children:"Line"})]})]})]}),jsxs("div",{style:w,children:[jsx("div",{style:I,children:"Distance from text (px)"}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Top"}),jsx("input",{type:"number",style:s,min:0,value:C,onChange:e=>N(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Bottom"}),jsx("input",{type:"number",style:s,min:0,value:P,onChange:e=>E(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Left"}),jsx("input",{type:"number",style:s,min:0,value:T,onChange:e=>H(Number(e.target.value)||0)})]}),jsxs("div",{style:l,children:[jsx("label",{style:{...a,width:45},children:"Right"}),jsx("input",{type:"number",style:s,min:0,value:R,onChange:e=>V(Number(e.target.value)||0)})]})]})]})]}),jsxs("div",{style:U,children:[jsx("button",{type:"button",style:K,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...K,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:O,children:"Apply"})]})]})}):null}export{Z as ImagePositionDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-3IYNTJO5.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=useState(""),[r,x]=useState(0),[d,y]=useState("#000000"),[a,f]=useState("solid");useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsx("div",{style:w,children:"Image Properties"}),jsxs("div",{style:R,children:[jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Alt Text"}),jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxs("div",{style:h,children:[jsx("div",{style:C,children:"Border"}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Style"}),jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsx("option",{value:"solid",children:"Solid"}),jsx("option",{value:"dashed",children:"Dashed"}),jsx("option",{value:"dotted",children:"Dotted"}),jsx("option",{value:"double",children:"Double"}),jsx("option",{value:"groove",children:"Groove"}),jsx("option",{value:"ridge",children:"Ridge"}),jsx("option",{value:"inset",children:"Inset"}),jsx("option",{value:"outset",children:"Outset"})]})]}),jsxs("div",{style:v,children:[jsx("label",{style:u,children:"Color"}),jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxs("div",{style:B,children:[jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}export{T as ImagePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('./chunk-RTESADL3.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},k={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:380,maxWidth:440,width:"100%",margin:20},w={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},R={padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},h={display:"flex",flexDirection:"column",gap:8},C={fontSize:13,fontWeight:600,color:"var(--doc-text)"},v={display:"flex",alignItems:"center",gap:8},u={width:60,fontSize:12,color:"var(--doc-text-muted)"},s={flex:1,padding:"4px 6px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:12},z={...s},A={...s,minHeight:60,resize:"vertical",fontFamily:"inherit"},B={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},P={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function T({isOpen:p,onClose:i,onApply:g,currentData:l}){let[c,S]=react.useState(""),[r,x]=react.useState(0),[d,y]=react.useState("#000000"),[a,f]=react.useState("solid");react.useEffect(()=>{p&&(S(l?.alt??""),x(l?.borderWidth??0),y(l?.borderColor??"#000000"),f(l?.borderStyle??"solid"));},[p,l]);let b=react.useCallback(()=>{g({alt:c||void 0,borderWidth:r>0?r:void 0,borderColor:r>0?d:void 0,borderStyle:r>0?a:void 0}),i();},[c,r,d,a,g,i]),I=react.useCallback(t=>{t.key==="Escape"&&i(),t.key==="Enter"&&!t.shiftKey&&b();},[i,b]);return p?jsxRuntime.jsx("div",{style:D,onClick:i,onKeyDown:I,children:jsxRuntime.jsxs("div",{style:k,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Image properties",children:[jsxRuntime.jsx("div",{style:w,children:"Image Properties"}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Alt Text"}),jsxRuntime.jsx("textarea",{style:A,value:c,onChange:t=>S(t.target.value),placeholder:"Describe this image for accessibility..."})]}),jsxRuntime.jsxs("div",{style:h,children:[jsxRuntime.jsx("div",{style:C,children:"Border"}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:{...s,maxWidth:80},min:0,max:20,step:.5,value:r,onChange:t=>x(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:12,color:"var(--doc-text-muted)"},children:"px"})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Style"}),jsxRuntime.jsxs("select",{style:z,value:a,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"solid",children:"Solid"}),jsxRuntime.jsx("option",{value:"dashed",children:"Dashed"}),jsxRuntime.jsx("option",{value:"dotted",children:"Dotted"}),jsxRuntime.jsx("option",{value:"double",children:"Double"}),jsxRuntime.jsx("option",{value:"groove",children:"Groove"}),jsxRuntime.jsx("option",{value:"ridge",children:"Ridge"}),jsxRuntime.jsx("option",{value:"inset",children:"Inset"}),jsxRuntime.jsx("option",{value:"outset",children:"Outset"})]})]}),jsxRuntime.jsxs("div",{style:v,children:[jsxRuntime.jsx("label",{style:u,children:"Color"}),jsxRuntime.jsx("input",{type:"color",value:d,onChange:t=>y(t.target.value),style:{width:32,height:24,padding:0,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"}}),jsxRuntime.jsx("input",{type:"text",style:{...s,maxWidth:90},value:d,onChange:t=>y(t.target.value)})]}),r>0&&jsxRuntime.jsx("div",{style:{marginTop:4,padding:8,border:`${r}px ${a} ${d}`,borderRadius:4,fontSize:11,color:"var(--doc-text-muted)",textAlign:"center"},children:"Preview"})]})]}),jsxRuntime.jsxs("div",{style:B,children:[jsxRuntime.jsx("button",{type:"button",style:P,onClick:i,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...P,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:b,children:"Apply"})]})]})}):null}exports.ImagePropertiesDialog=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-3IYNTJO5.js';import {useState,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=useState(i?.width||0),[l,f]=useState(i?.widthType||"auto"),[p,g]=useState(i?.justification||"left");useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsx("div",{style:T,children:"Table Properties"}),jsxs("div",{style:k,children:[jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width type"}),jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsx("option",{value:"auto",children:"Auto"}),jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Width"}),jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxs("div",{style:c,children:[jsx("label",{style:u,children:"Alignment"}),jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsx("option",{value:"left",children:"Left"}),jsx("option",{value:"center",children:"Center"}),jsx("option",{value:"right",children:"Right"})]})]})]}),jsxs("div",{style:R,children:[jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}export{z as TablePropertiesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('./chunk-RTESADL3.cjs');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var C={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},P={backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:360,maxWidth:440,width:"100%",margin:20},T={padding:"16px 20px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:16,fontWeight:600},k={padding:"16px 20px",display:"flex",flexDirection:"column",gap:12},c={display:"flex",alignItems:"center",gap:12},u={width:80,fontSize:13,color:"var(--doc-text-muted)"},x={flex:1,padding:"6px 8px",border:"1px solid var(--doc-border)",borderRadius:4,fontSize:13},S={...x},R={padding:"12px 20px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"flex-end",gap:8},h={padding:"6px 16px",fontSize:13,border:"1px solid var(--doc-border)",borderRadius:4,cursor:"pointer"};function z({isOpen:n,onClose:r,onApply:y,currentProps:i}){let[a,b]=react.useState(i?.width||0),[l,f]=react.useState(i?.widthType||"auto"),[p,g]=react.useState(i?.justification||"left");react.useEffect(()=>{n&&(b(i?.width||0),f(i?.widthType||"auto"),g(i?.justification||"left"));},[n,i]);let d=react.useCallback(()=>{let t={};l==="auto"?(t.width=null,t.widthType="auto"):(t.width=a,t.widthType=l),t.justification=p,y(t),r();},[a,l,p,y,r]),w=react.useCallback(t=>{t.key==="Escape"&&r(),t.key==="Enter"&&d();},[r,d]);return n?jsxRuntime.jsx("div",{style:C,onClick:r,onKeyDown:w,children:jsxRuntime.jsxs("div",{style:P,onClick:t=>t.stopPropagation(),role:"dialog","aria-label":"Table properties",children:[jsxRuntime.jsx("div",{style:T,children:"Table Properties"}),jsxRuntime.jsxs("div",{style:k,children:[jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width type"}),jsxRuntime.jsxs("select",{style:S,value:l,onChange:t=>f(t.target.value),children:[jsxRuntime.jsx("option",{value:"auto",children:"Auto"}),jsxRuntime.jsx("option",{value:"dxa",children:"Fixed (twips)"}),jsxRuntime.jsx("option",{value:"pct",children:"Percentage"})]})]}),l!=="auto"&&jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Width"}),jsxRuntime.jsx("input",{type:"number",style:x,min:0,step:l==="pct"?5:100,value:a,onChange:t=>b(Number(t.target.value)||0)}),jsxRuntime.jsx("span",{style:{fontSize:11,color:"var(--doc-text-muted)"},children:l==="pct"?"(50ths of %)":"tw"})]}),jsxRuntime.jsxs("div",{style:c,children:[jsxRuntime.jsx("label",{style:u,children:"Alignment"}),jsxRuntime.jsxs("select",{style:S,value:p,onChange:t=>g(t.target.value),children:[jsxRuntime.jsx("option",{value:"left",children:"Left"}),jsxRuntime.jsx("option",{value:"center",children:"Center"}),jsxRuntime.jsx("option",{value:"right",children:"Right"})]})]})]}),jsxRuntime.jsxs("div",{style:R,children:[jsxRuntime.jsx("button",{type:"button",style:h,onClick:r,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",style:{...h,backgroundColor:"var(--doc-primary)",color:"white",borderColor:"var(--doc-primary)"},onClick:d,children:"Apply"})]})]})}):null}exports.TablePropertiesDialog=z;
|