@eigenpal/docx-js-editor 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/DocumentAgent-Ci6_T-XM.d.ts +412 -0
  2. package/dist/DocumentAgent-DEGFgYEN.d.cts +412 -0
  3. package/dist/FindReplaceDialog-BAACAU67.cjs +1 -0
  4. package/dist/FindReplaceDialog-RWYDRWHF.js +1 -0
  5. package/dist/FootnotePropertiesDialog-BC6JIPDA.cjs +1 -0
  6. package/dist/FootnotePropertiesDialog-CWQF5EBK.js +1 -0
  7. package/dist/HyperlinkDialog-EG2BSLPD.cjs +1 -0
  8. package/dist/HyperlinkDialog-YAVK64F4.js +1 -0
  9. package/dist/ImagePositionDialog-IGYS5KMK.cjs +1 -0
  10. package/dist/ImagePositionDialog-S6SMH7XH.js +1 -0
  11. package/dist/ImagePropertiesDialog-UO5QUIBS.js +1 -0
  12. package/dist/ImagePropertiesDialog-VGV4E4SN.cjs +1 -0
  13. package/dist/TablePropertiesDialog-VBOU4DID.js +1 -0
  14. package/dist/TablePropertiesDialog-WRM47JI6.cjs +1 -0
  15. package/dist/{types-BALm1KBi.d.cts → agentApi-CbVUCZRu.d.cts} +1 -308
  16. package/dist/{types-BALm1KBi.d.ts → agentApi-CbVUCZRu.d.ts} +1 -308
  17. package/dist/chunk-2ASOEN3V.js +1 -0
  18. package/dist/chunk-6MBDPZVD.js +111 -0
  19. package/dist/chunk-6YLNNCRZ.cjs +10 -0
  20. package/dist/chunk-BVQ2QRHA.cjs +4 -0
  21. package/dist/chunk-COP5BIBZ.js +10 -0
  22. package/dist/chunk-CZ7W7MCM.cjs +2 -0
  23. package/dist/chunk-E6XDMUAM.js +4 -0
  24. package/dist/chunk-EMKABJPH.js +1 -0
  25. package/dist/{chunk-GIZ5CTBD.cjs → chunk-EPCZ24TY.cjs} +5 -5
  26. package/dist/chunk-ESI4BSBF.js +1 -0
  27. package/dist/chunk-FLECKDK4.cjs +58 -0
  28. package/dist/chunk-ITWEFKGQ.cjs +1 -0
  29. package/dist/chunk-KESNGXGO.js +1 -0
  30. package/dist/chunk-KVAT5SVD.js +2 -0
  31. package/dist/chunk-L34XFLQZ.cjs +1 -0
  32. package/dist/chunk-M7F2CUUD.js +2 -0
  33. package/dist/chunk-MDPDH7KS.js +58 -0
  34. package/dist/chunk-MTX3EEBJ.js +258 -0
  35. package/dist/chunk-NT2REEAA.cjs +1 -0
  36. package/dist/{chunk-P332HWDE.js → chunk-OTG4NABM.js} +5 -5
  37. package/dist/chunk-OW5H5DNE.cjs +1 -0
  38. package/dist/chunk-PJVI53AH.js +2 -0
  39. package/dist/chunk-PNMZPPPI.cjs +2 -0
  40. package/dist/chunk-SF53KLDZ.cjs +1 -0
  41. package/dist/chunk-TOI5W3HK.js +8 -0
  42. package/dist/chunk-UAVOWAIF.cjs +8 -0
  43. package/dist/chunk-VN7XH644.cjs +258 -0
  44. package/dist/chunk-W4DUKACP.cjs +111 -0
  45. package/dist/chunk-XS2AQFMF.cjs +2 -0
  46. package/dist/chunk-ZDYHAYN6.js +1 -0
  47. package/dist/clipboard-BOocwmAM.d.ts +539 -0
  48. package/dist/clipboard-Cx7cb3kX.d.cts +539 -0
  49. package/dist/{colorResolver-BNj-uZ58.d.ts → colorResolver-CIDiSPWd.d.cts} +3 -411
  50. package/dist/{colorResolver-DiMquGWR.d.cts → colorResolver-KXbUgzWC.d.ts} +3 -411
  51. package/dist/core-plugins.cjs +1 -1
  52. package/dist/core-plugins.d.cts +4 -3
  53. package/dist/core-plugins.d.ts +4 -3
  54. package/dist/core-plugins.js +1 -1
  55. package/dist/core.cjs +1 -0
  56. package/dist/core.d.cts +23 -0
  57. package/dist/core.d.ts +23 -0
  58. package/dist/core.js +1 -0
  59. package/dist/headless.cjs +2 -2
  60. package/dist/headless.d.cts +8 -175
  61. package/dist/headless.d.ts +8 -175
  62. package/dist/headless.js +1 -1
  63. package/dist/index.cjs +9 -378
  64. package/dist/index.d.cts +17 -4161
  65. package/dist/index.d.ts +17 -4161
  66. package/dist/index.js +9 -378
  67. package/dist/insertOperations-CzB5b-Of.d.ts +176 -0
  68. package/dist/insertOperations-DKVmCV32.d.cts +176 -0
  69. package/dist/mcp-cli.js +21 -21
  70. package/dist/mcp.cjs +10 -10
  71. package/dist/mcp.d.cts +2 -1
  72. package/dist/mcp.d.ts +2 -1
  73. package/dist/mcp.js +9 -9
  74. package/dist/processTemplate-BHBTDAIC.js +1 -0
  75. package/dist/processTemplate-QOEAXCKA.cjs +1 -0
  76. package/dist/react-Be1YOl4z.d.ts +1356 -0
  77. package/dist/react-DPuSVbgY.d.cts +1356 -0
  78. package/dist/react.cjs +1 -0
  79. package/dist/react.css +1 -0
  80. package/dist/react.d.cts +9 -0
  81. package/dist/react.d.ts +9 -0
  82. package/dist/react.js +1 -0
  83. package/dist/{registry-CzqAPdui.d.ts → registry-D4tvj9f3.d.ts} +1 -1
  84. package/dist/{registry-BUTMLqSj.d.cts → registry-ngv6Bumt.d.cts} +1 -1
  85. package/dist/types-D96elyJF.d.cts +310 -0
  86. package/dist/types-xMzSPT4i.d.ts +310 -0
  87. package/dist/ui.cjs +1 -0
  88. package/dist/ui.d.cts +2103 -0
  89. package/dist/ui.d.ts +2103 -0
  90. package/dist/ui.js +1 -0
  91. package/dist/variableDetector-CPxKo9jP.d.cts +173 -0
  92. package/dist/variableDetector-DeM1N-_L.d.ts +173 -0
  93. package/package.json +85 -10
  94. package/dist/chunk-56AGRHVO.cjs +0 -58
  95. package/dist/chunk-E23CAQXT.js +0 -9
  96. package/dist/chunk-HIBC7HTU.cjs +0 -9
  97. package/dist/chunk-ICEPOA7G.js +0 -58
  98. package/dist/chunk-IZGUXSCC.js +0 -10
  99. package/dist/chunk-XF3IPO7C.cjs +0 -10
@@ -0,0 +1,176 @@
1
+ import { h as Document, ad as BreakContent, P as Paragraph, y as Run, z as RunContent } from './agentApi-CbVUCZRu.js';
2
+
3
+ /**
4
+ * Google Fonts Loader
5
+ *
6
+ * Dynamically loads fonts from Google Fonts API with:
7
+ * - Loading state tracking
8
+ * - Duplicate prevention
9
+ * - Callback notifications
10
+ * - Font availability detection
11
+ */
12
+ /**
13
+ * Load a font from Google Fonts
14
+ *
15
+ * @param fontFamily - The font family name to load
16
+ * @param options - Optional configuration
17
+ * @returns Promise resolving to true if font loaded successfully, false otherwise
18
+ */
19
+ declare function loadFont(fontFamily: string, options?: {
20
+ weights?: number[];
21
+ styles?: ('normal' | 'italic')[];
22
+ }): Promise<boolean>;
23
+ /**
24
+ * Load multiple fonts from Google Fonts
25
+ *
26
+ * @param families - Array of font family names to load
27
+ * @param options - Optional configuration
28
+ * @returns Promise resolving when all fonts are loaded (or failed)
29
+ */
30
+ declare function loadFonts(families: string[], options?: {
31
+ weights?: number[];
32
+ styles?: ('normal' | 'italic')[];
33
+ }): Promise<void>;
34
+ /**
35
+ * Check if a font is loaded
36
+ *
37
+ * @param fontFamily - The font family name to check
38
+ * @returns true if the font is loaded, false otherwise
39
+ */
40
+ declare function isFontLoaded(fontFamily: string): boolean;
41
+ /**
42
+ * Check if any fonts are currently loading
43
+ *
44
+ * @returns true if any fonts are loading, false otherwise
45
+ */
46
+ declare function isLoading(): boolean;
47
+ /**
48
+ * Get list of all loaded fonts
49
+ *
50
+ * @returns Array of loaded font family names
51
+ */
52
+ declare function getLoadedFonts(): string[];
53
+ /**
54
+ * Register a callback to be notified when fonts are loaded
55
+ *
56
+ * @param callback - Function to call when fonts are loaded
57
+ * @returns Cleanup function to remove the callback
58
+ */
59
+ declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
60
+ /**
61
+ * Check if a font is available on the system using canvas measurement
62
+ *
63
+ * This uses the technique of comparing text width with the target font
64
+ * vs a known fallback font. If they differ, the font is available.
65
+ *
66
+ * @param fontFamily - The font family name to check
67
+ * @param fallbackFont - Fallback font to compare against
68
+ * @returns true if font is available, false otherwise
69
+ */
70
+ declare function canRenderFont(fontFamily: string, fallbackFont?: string): boolean;
71
+ /**
72
+ * Load a font from a raw buffer (e.g., embedded in DOCX)
73
+ *
74
+ * @param fontFamily - The font family name
75
+ * @param buffer - Font file buffer (TTF, OTF, WOFF, WOFF2)
76
+ * @param options - Font options
77
+ * @returns Promise resolving when font is loaded
78
+ */
79
+ declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
80
+ weight?: number | string;
81
+ style?: 'normal' | 'italic';
82
+ }): Promise<boolean>;
83
+ /**
84
+ * Preload a list of common document fonts
85
+ *
86
+ * This preloads fonts commonly used in DOCX documents that have
87
+ * Google Fonts equivalents.
88
+ */
89
+ declare function preloadCommonFonts(): Promise<void>;
90
+
91
+ /**
92
+ * Insert Operations Utility
93
+ *
94
+ * Utility functions for inserting content into the document.
95
+ * Provides functions for inserting page breaks, horizontal rules, and other elements.
96
+ */
97
+
98
+ /**
99
+ * Insert position in the document
100
+ */
101
+ interface InsertPosition {
102
+ /** Paragraph index in the document body */
103
+ paragraphIndex: number;
104
+ /** Run index within the paragraph (optional) */
105
+ runIndex?: number;
106
+ /** Character offset within the run (optional) */
107
+ offset?: number;
108
+ }
109
+ /**
110
+ * Create a page break content element
111
+ */
112
+ declare function createPageBreak(): BreakContent;
113
+ /**
114
+ * Create a column break content element
115
+ */
116
+ declare function createColumnBreak(): BreakContent;
117
+ /**
118
+ * Create a text wrapping break (line break)
119
+ */
120
+ declare function createLineBreak(clear?: 'none' | 'left' | 'right' | 'all'): BreakContent;
121
+ /**
122
+ * Create a run containing a page break
123
+ */
124
+ declare function createPageBreakRun(): Run;
125
+ /**
126
+ * Create an empty paragraph with a page break before it
127
+ */
128
+ declare function createPageBreakParagraph(): Paragraph;
129
+ /**
130
+ * Insert a page break at a position in the document
131
+ * This inserts a new paragraph with pageBreakBefore: true
132
+ */
133
+ declare function insertPageBreak(doc: Document, position: InsertPosition): Document;
134
+ /**
135
+ * Create a horizontal rule paragraph
136
+ * Uses a paragraph with bottom border to simulate horizontal rule
137
+ */
138
+ declare function createHorizontalRule(): Paragraph;
139
+ /**
140
+ * Insert a horizontal rule at a position in the document
141
+ */
142
+ declare function insertHorizontalRule(doc: Document, position: InsertPosition): Document;
143
+ /**
144
+ * Check if content is a page break
145
+ */
146
+ declare function isPageBreak(content: RunContent): boolean;
147
+ /**
148
+ * Check if content is a column break
149
+ */
150
+ declare function isColumnBreak(content: RunContent): boolean;
151
+ /**
152
+ * Check if content is a line break
153
+ */
154
+ declare function isLineBreak(content: RunContent): boolean;
155
+ /**
156
+ * Check if content is any type of break
157
+ */
158
+ declare function isBreakContent(content: RunContent): content is BreakContent;
159
+ /**
160
+ * Check if a paragraph has pageBreakBefore
161
+ */
162
+ declare function hasPageBreakBefore(paragraph: Paragraph): boolean;
163
+ /**
164
+ * Count page breaks in a document
165
+ */
166
+ declare function countPageBreaks(doc: Document): number;
167
+ /**
168
+ * Find all page break positions in a document
169
+ */
170
+ declare function findPageBreaks(doc: Document): InsertPosition[];
171
+ /**
172
+ * Remove a page break at a specific position
173
+ */
174
+ declare function removePageBreak(doc: Document, position: InsertPosition): Document;
175
+
176
+ export { type InsertPosition as I, countPageBreaks as a, createColumnBreak as b, canRenderFont as c, createHorizontalRule as d, createLineBreak as e, createPageBreak as f, createPageBreakParagraph as g, createPageBreakRun as h, findPageBreaks as i, getLoadedFonts as j, hasPageBreakBefore as k, insertHorizontalRule as l, insertPageBreak as m, isBreakContent as n, isColumnBreak as o, isFontLoaded as p, isLoading as q, isLineBreak as r, isPageBreak as s, loadFont as t, loadFontFromBuffer as u, loadFonts as v, onFontsLoaded as w, preloadCommonFonts as x, removePageBreak as y };
@@ -0,0 +1,176 @@
1
+ import { h as Document, ad as BreakContent, P as Paragraph, y as Run, z as RunContent } from './agentApi-CbVUCZRu.cjs';
2
+
3
+ /**
4
+ * Google Fonts Loader
5
+ *
6
+ * Dynamically loads fonts from Google Fonts API with:
7
+ * - Loading state tracking
8
+ * - Duplicate prevention
9
+ * - Callback notifications
10
+ * - Font availability detection
11
+ */
12
+ /**
13
+ * Load a font from Google Fonts
14
+ *
15
+ * @param fontFamily - The font family name to load
16
+ * @param options - Optional configuration
17
+ * @returns Promise resolving to true if font loaded successfully, false otherwise
18
+ */
19
+ declare function loadFont(fontFamily: string, options?: {
20
+ weights?: number[];
21
+ styles?: ('normal' | 'italic')[];
22
+ }): Promise<boolean>;
23
+ /**
24
+ * Load multiple fonts from Google Fonts
25
+ *
26
+ * @param families - Array of font family names to load
27
+ * @param options - Optional configuration
28
+ * @returns Promise resolving when all fonts are loaded (or failed)
29
+ */
30
+ declare function loadFonts(families: string[], options?: {
31
+ weights?: number[];
32
+ styles?: ('normal' | 'italic')[];
33
+ }): Promise<void>;
34
+ /**
35
+ * Check if a font is loaded
36
+ *
37
+ * @param fontFamily - The font family name to check
38
+ * @returns true if the font is loaded, false otherwise
39
+ */
40
+ declare function isFontLoaded(fontFamily: string): boolean;
41
+ /**
42
+ * Check if any fonts are currently loading
43
+ *
44
+ * @returns true if any fonts are loading, false otherwise
45
+ */
46
+ declare function isLoading(): boolean;
47
+ /**
48
+ * Get list of all loaded fonts
49
+ *
50
+ * @returns Array of loaded font family names
51
+ */
52
+ declare function getLoadedFonts(): string[];
53
+ /**
54
+ * Register a callback to be notified when fonts are loaded
55
+ *
56
+ * @param callback - Function to call when fonts are loaded
57
+ * @returns Cleanup function to remove the callback
58
+ */
59
+ declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
60
+ /**
61
+ * Check if a font is available on the system using canvas measurement
62
+ *
63
+ * This uses the technique of comparing text width with the target font
64
+ * vs a known fallback font. If they differ, the font is available.
65
+ *
66
+ * @param fontFamily - The font family name to check
67
+ * @param fallbackFont - Fallback font to compare against
68
+ * @returns true if font is available, false otherwise
69
+ */
70
+ declare function canRenderFont(fontFamily: string, fallbackFont?: string): boolean;
71
+ /**
72
+ * Load a font from a raw buffer (e.g., embedded in DOCX)
73
+ *
74
+ * @param fontFamily - The font family name
75
+ * @param buffer - Font file buffer (TTF, OTF, WOFF, WOFF2)
76
+ * @param options - Font options
77
+ * @returns Promise resolving when font is loaded
78
+ */
79
+ declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
80
+ weight?: number | string;
81
+ style?: 'normal' | 'italic';
82
+ }): Promise<boolean>;
83
+ /**
84
+ * Preload a list of common document fonts
85
+ *
86
+ * This preloads fonts commonly used in DOCX documents that have
87
+ * Google Fonts equivalents.
88
+ */
89
+ declare function preloadCommonFonts(): Promise<void>;
90
+
91
+ /**
92
+ * Insert Operations Utility
93
+ *
94
+ * Utility functions for inserting content into the document.
95
+ * Provides functions for inserting page breaks, horizontal rules, and other elements.
96
+ */
97
+
98
+ /**
99
+ * Insert position in the document
100
+ */
101
+ interface InsertPosition {
102
+ /** Paragraph index in the document body */
103
+ paragraphIndex: number;
104
+ /** Run index within the paragraph (optional) */
105
+ runIndex?: number;
106
+ /** Character offset within the run (optional) */
107
+ offset?: number;
108
+ }
109
+ /**
110
+ * Create a page break content element
111
+ */
112
+ declare function createPageBreak(): BreakContent;
113
+ /**
114
+ * Create a column break content element
115
+ */
116
+ declare function createColumnBreak(): BreakContent;
117
+ /**
118
+ * Create a text wrapping break (line break)
119
+ */
120
+ declare function createLineBreak(clear?: 'none' | 'left' | 'right' | 'all'): BreakContent;
121
+ /**
122
+ * Create a run containing a page break
123
+ */
124
+ declare function createPageBreakRun(): Run;
125
+ /**
126
+ * Create an empty paragraph with a page break before it
127
+ */
128
+ declare function createPageBreakParagraph(): Paragraph;
129
+ /**
130
+ * Insert a page break at a position in the document
131
+ * This inserts a new paragraph with pageBreakBefore: true
132
+ */
133
+ declare function insertPageBreak(doc: Document, position: InsertPosition): Document;
134
+ /**
135
+ * Create a horizontal rule paragraph
136
+ * Uses a paragraph with bottom border to simulate horizontal rule
137
+ */
138
+ declare function createHorizontalRule(): Paragraph;
139
+ /**
140
+ * Insert a horizontal rule at a position in the document
141
+ */
142
+ declare function insertHorizontalRule(doc: Document, position: InsertPosition): Document;
143
+ /**
144
+ * Check if content is a page break
145
+ */
146
+ declare function isPageBreak(content: RunContent): boolean;
147
+ /**
148
+ * Check if content is a column break
149
+ */
150
+ declare function isColumnBreak(content: RunContent): boolean;
151
+ /**
152
+ * Check if content is a line break
153
+ */
154
+ declare function isLineBreak(content: RunContent): boolean;
155
+ /**
156
+ * Check if content is any type of break
157
+ */
158
+ declare function isBreakContent(content: RunContent): content is BreakContent;
159
+ /**
160
+ * Check if a paragraph has pageBreakBefore
161
+ */
162
+ declare function hasPageBreakBefore(paragraph: Paragraph): boolean;
163
+ /**
164
+ * Count page breaks in a document
165
+ */
166
+ declare function countPageBreaks(doc: Document): number;
167
+ /**
168
+ * Find all page break positions in a document
169
+ */
170
+ declare function findPageBreaks(doc: Document): InsertPosition[];
171
+ /**
172
+ * Remove a page break at a specific position
173
+ */
174
+ declare function removePageBreak(doc: Document, position: InsertPosition): Document;
175
+
176
+ export { type InsertPosition as I, countPageBreaks as a, createColumnBreak as b, canRenderFont as c, createHorizontalRule as d, createLineBreak as e, createPageBreak as f, createPageBreakParagraph as g, createPageBreakRun as h, findPageBreaks as i, getLoadedFonts as j, hasPageBreakBefore as k, insertHorizontalRule as l, insertPageBreak as m, isBreakContent as n, isColumnBreak as o, isFontLoaded as p, isLoading as q, isLineBreak as r, isPageBreak as s, loadFont as t, loadFontFromBuffer as u, loadFonts as v, onFontsLoaded as w, preloadCommonFonts as x, removePageBreak as y };