@zeke-02/docx-editor 0.5.1 → 0.5.3

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 (211) hide show
  1. package/LICENSE +204 -0
  2. package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
  3. package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
  4. package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
  5. package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
  6. package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
  7. package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
  8. package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
  9. package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
  10. package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
  12. package/dist/KeyboardShortcutsDialog-5D_FoAp6.d.ts +395 -0
  13. package/dist/KeyboardShortcutsDialog-D7ihAj18.d.mts +395 -0
  14. package/dist/PageSetupDialog-642IAVG2.js +1 -0
  15. package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
  16. package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
  17. package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
  18. package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
  19. package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
  20. package/dist/agentApi-C41hiW-n.d.mts +486 -0
  21. package/dist/agentApi-D4AZmNfB.d.ts +486 -0
  22. package/dist/chunk-2XXILKEQ.js +1 -0
  23. package/dist/chunk-35DG3R42.js +2 -0
  24. package/dist/chunk-47VJOBJD.mjs +60 -0
  25. package/dist/chunk-5UX5CD4C.js +1 -0
  26. package/dist/chunk-7QQSDIWK.mjs +2 -0
  27. package/dist/chunk-AW5TISUL.js +3 -0
  28. package/dist/chunk-AYMGSTNG.js +1 -0
  29. package/dist/chunk-B45ECEGY.js +18 -0
  30. package/dist/chunk-B7CCL7SL.mjs +2 -0
  31. package/dist/chunk-BRMTZRLJ.js +2 -0
  32. package/dist/chunk-D47GTKGU.js +2 -0
  33. package/dist/chunk-E6MQXELR.js +1 -0
  34. package/dist/chunk-F5SERL7X.mjs +2 -0
  35. package/dist/chunk-FWPVBFKQ.mjs +1 -0
  36. package/dist/chunk-GGQK26JO.js +2 -0
  37. package/dist/chunk-GM2S2WMT.mjs +1 -0
  38. package/dist/chunk-ILYKDR3C.js +1 -0
  39. package/dist/chunk-IP5NAYHL.js +60 -0
  40. package/dist/chunk-JPF5R2ZM.mjs +1 -0
  41. package/dist/chunk-KOXCF3CL.mjs +1 -0
  42. package/dist/chunk-KRLNX56Y.mjs +2 -0
  43. package/dist/chunk-LUJ6HCMH.mjs +1 -0
  44. package/dist/chunk-MKNSJOCN.js +70 -0
  45. package/dist/chunk-NIBCC7WQ.js +1 -0
  46. package/dist/chunk-NLFXR2VH.js +2 -0
  47. package/dist/chunk-ONIYA2FU.mjs +2 -0
  48. package/dist/chunk-ONNHQWAX.mjs +1 -0
  49. package/dist/chunk-RCIZ7OM3.mjs +70 -0
  50. package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
  51. package/dist/chunk-SOTWG3KJ.mjs +1 -0
  52. package/dist/chunk-TYPGB4KF.js +1 -0
  53. package/dist/chunk-U7ZW2DOO.mjs +2 -0
  54. package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
  55. package/dist/chunk-XQZTWWRF.mjs +18 -0
  56. package/dist/chunk-ZVAFVHWR.mjs +3 -0
  57. package/dist/chunk-ZXPCJWVY.js +2 -0
  58. package/dist/{agentApi-DLt94vXk.d.mts → content-B2MzIMwA.d.mts} +8 -755
  59. package/dist/{agentApi-DLt94vXk.d.ts → content-B2MzIMwA.d.ts} +8 -755
  60. package/dist/dialogs.d.mts +25 -0
  61. package/dist/dialogs.d.ts +25 -0
  62. package/dist/dialogs.js +1 -0
  63. package/dist/dialogs.mjs +1 -0
  64. package/dist/document-DZ_ZeZEH.d.ts +294 -0
  65. package/dist/document-Di1qGqLS.d.mts +294 -0
  66. package/dist/executor-EPEB53SJ.js +1 -0
  67. package/dist/executor-TVJ6K6MW.mjs +1 -0
  68. package/dist/findReplace-CpIoILbP.d.mts +138 -0
  69. package/dist/findReplace-pkMskVJU.d.ts +138 -0
  70. package/dist/hooks.d.mts +598 -0
  71. package/dist/hooks.d.ts +598 -0
  72. package/dist/hooks.js +1 -0
  73. package/dist/hooks.mjs +1 -0
  74. package/dist/index.d.mts +1013 -483
  75. package/dist/index.d.ts +1013 -483
  76. package/dist/index.js +40 -120
  77. package/dist/index.mjs +40 -120
  78. package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
  79. package/dist/layout-bridge-QQDA7ELH.js +1 -0
  80. package/dist/plugin-api.d.mts +176 -0
  81. package/dist/plugin-api.d.ts +176 -0
  82. package/dist/plugin-api.js +260 -0
  83. package/dist/plugin-api.mjs +260 -0
  84. package/dist/processTemplate-BTBTR7AM.js +1 -0
  85. package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
  86. package/dist/styles.css +1 -1
  87. package/dist/styles.d.mts +18 -0
  88. package/dist/styles.d.ts +18 -0
  89. package/dist/styles.js +1 -0
  90. package/dist/styles.mjs +1 -0
  91. package/dist/types-Bd_YzkhG.d.mts +281 -0
  92. package/dist/types-Bd_YzkhG.d.ts +281 -0
  93. package/dist/types-CkfDgB0O.d.mts +39 -0
  94. package/dist/types-DZUhB7Ao.d.mts +18 -0
  95. package/dist/types-DZUhB7Ao.d.ts +18 -0
  96. package/dist/types-DcxHFUSc.d.ts +39 -0
  97. package/dist/ui.d.mts +111 -552
  98. package/dist/ui.d.ts +111 -552
  99. package/dist/ui.js +111 -1
  100. package/dist/ui.mjs +111 -1
  101. package/dist/useFindReplace-DDs533b-.d.mts +261 -0
  102. package/dist/useFindReplace-eyhMSZZf.d.ts +261 -0
  103. package/package.json +41 -43
  104. package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
  105. package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
  106. package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
  107. package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
  108. package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
  109. package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
  110. package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
  111. package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
  112. package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
  113. package/dist/PageSetupDialog-GALVJMUB.js +0 -1
  114. package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
  115. package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
  116. package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
  117. package/dist/chunk-23SXXIZS.js +0 -111
  118. package/dist/chunk-3F52AP2Q.js +0 -1
  119. package/dist/chunk-42O5GXM5.mjs +0 -82
  120. package/dist/chunk-54ULJEHM.mjs +0 -1
  121. package/dist/chunk-5XK326FI.mjs +0 -1
  122. package/dist/chunk-6WPRCJ5A.mjs +0 -1
  123. package/dist/chunk-76IYR7C7.mjs +0 -1
  124. package/dist/chunk-7BG7QY7I.js +0 -182
  125. package/dist/chunk-AGRIVA4G.js +0 -1
  126. package/dist/chunk-BTCQ2QI3.mjs +0 -3
  127. package/dist/chunk-BUEMG4NW.js +0 -1
  128. package/dist/chunk-BXRC4U3X.mjs +0 -2
  129. package/dist/chunk-CPAYKE6X.mjs +0 -1
  130. package/dist/chunk-DACWLFKI.mjs +0 -1
  131. package/dist/chunk-EPBFWE36.js +0 -2
  132. package/dist/chunk-FXES3YDB.js +0 -82
  133. package/dist/chunk-HI66BSGS.mjs +0 -9
  134. package/dist/chunk-INTPVEO6.mjs +0 -9
  135. package/dist/chunk-IOAGVW6Q.mjs +0 -2
  136. package/dist/chunk-JCEWC5QL.mjs +0 -4
  137. package/dist/chunk-JTIUFACT.js +0 -1
  138. package/dist/chunk-KUTCCI4X.mjs +0 -182
  139. package/dist/chunk-LUF7PWIC.js +0 -10
  140. package/dist/chunk-MGEN6GOE.mjs +0 -2
  141. package/dist/chunk-MOE2ZGUE.js +0 -18
  142. package/dist/chunk-MWLHJWB6.js +0 -9
  143. package/dist/chunk-OFYVDN3U.mjs +0 -2
  144. package/dist/chunk-P4VSHBGZ.js +0 -2
  145. package/dist/chunk-P5FQHIES.mjs +0 -1
  146. package/dist/chunk-PBC7XAYZ.js +0 -3
  147. package/dist/chunk-PEMB6SZT.js +0 -2
  148. package/dist/chunk-PQMSZTBB.js +0 -9
  149. package/dist/chunk-Q7UDQXAF.js +0 -1
  150. package/dist/chunk-QGTAIC5E.js +0 -1
  151. package/dist/chunk-QVPR2W5S.js +0 -1
  152. package/dist/chunk-R3QMYPL5.mjs +0 -59
  153. package/dist/chunk-RBUTXXQJ.mjs +0 -18
  154. package/dist/chunk-RRWYZ2TS.mjs +0 -111
  155. package/dist/chunk-SFUM35DH.js +0 -2
  156. package/dist/chunk-SNLC6EK2.js +0 -1
  157. package/dist/chunk-TMTLIGLZ.js +0 -59
  158. package/dist/chunk-TSE2PWFX.mjs +0 -10
  159. package/dist/chunk-UWYD42WV.js +0 -4
  160. package/dist/chunk-UXVACQCY.mjs +0 -1
  161. package/dist/chunk-W4EIKDM6.mjs +0 -2
  162. package/dist/chunk-W53SI3XW.mjs +0 -1
  163. package/dist/chunk-WNS2RBQD.js +0 -2
  164. package/dist/chunk-Z3KMSHUP.js +0 -1
  165. package/dist/core-plugins-reexport.d.mts +0 -31
  166. package/dist/core-plugins-reexport.d.ts +0 -31
  167. package/dist/core-plugins-reexport.js +0 -1
  168. package/dist/core-plugins-reexport.mjs +0 -1
  169. package/dist/core-reexport.d.mts +0 -340
  170. package/dist/core-reexport.d.ts +0 -340
  171. package/dist/core-reexport.js +0 -1
  172. package/dist/core-reexport.mjs +0 -1
  173. package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
  174. package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
  175. package/dist/executor-C3VXF7QA.mjs +0 -1
  176. package/dist/executor-GDBV3AGV.js +0 -1
  177. package/dist/headless-reexport.d.mts +0 -197
  178. package/dist/headless-reexport.d.ts +0 -197
  179. package/dist/headless-reexport.js +0 -1
  180. package/dist/headless-reexport.mjs +0 -1
  181. package/dist/insertOperations-BTH1Asas.d.mts +0 -176
  182. package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
  183. package/dist/layout-bridge-EA4DJ227.js +0 -1
  184. package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
  185. package/dist/mcp-reexport.d.mts +0 -156
  186. package/dist/mcp-reexport.d.ts +0 -156
  187. package/dist/mcp-reexport.js +0 -16
  188. package/dist/mcp-reexport.mjs +0 -16
  189. package/dist/processTemplate-MJ2PCSO5.js +0 -1
  190. package/dist/react-B0W16SV6.d.ts +0 -1330
  191. package/dist/react-D0Pn1nww.d.mts +0 -1330
  192. package/dist/react.css +0 -1
  193. package/dist/react.d.mts +0 -10
  194. package/dist/react.d.ts +0 -10
  195. package/dist/react.js +0 -1
  196. package/dist/react.mjs +0 -1
  197. package/dist/registry-CH9V-IX0.d.ts +0 -165
  198. package/dist/registry-CWBKYlNW.d.mts +0 -165
  199. package/dist/types-UDsUq8D3.d.mts +0 -310
  200. package/dist/types-jbivc9Lj.d.ts +0 -310
  201. package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
  202. package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
  203. package/i18n/de.json +0 -792
  204. package/i18n/en.json +0 -792
  205. package/i18n/he.json +0 -792
  206. package/i18n/pl.json +0 -792
  207. package/i18n/pt-BR.json +0 -792
  208. package/i18n/tr.json +0 -792
  209. package/i18n/zh-CN.json +0 -792
  210. /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
  211. /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
@@ -1,197 +0,0 @@
1
- import { d as DocumentBody, a as Paragraph, T as TextFormatting, H as Hyperlink, b as Run, e as Table, P as Position } from './agentApi-DLt94vXk.mjs';
2
- export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, k as ApplyVariablesCommand, l as BlockContent, C as Comment, m as CommentRangeEnd, n as CommentRangeStart, o as DEFAULT_AI_ACTIONS, p as DeleteTextCommand, q as Deletion, D as Document, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, y as Insertion, L as ListLevel, M as MoveFrom, z as MoveTo, N as NumberingDefinitions, G as ParagraphContent, J as ParagraphContext, K as ParagraphFormatting, O as ParagraphOutline, R as Range, Q as Relationship, S as ReplaceTextCommand, c as RunContent, U as SectionInfo, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, Y as Style, Z as StyleDefinitions, _ as StyleInfo, $ as SuggestedAction, a0 as TableCell, a1 as TableRow, a2 as TextContent, a3 as Theme, a4 as TrackedChangeInfo, a5 as TrackedRunChange, a6 as comparePositions, a7 as createCollapsedRange, a8 as createCommand, a9 as createRange, aa as getActionDescription, ab as getActionLabel, ac as isPositionInRange } from './agentApi-DLt94vXk.mjs';
3
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, F as FormattingSummary, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, T as TemplateError, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, f as buildSelectionContextFromContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, k as createTemplateProcessor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, v as getMissingVariables, w as getSelectionFormattingSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, L as previewTemplate, M as processTemplate, N as processTemplateAdvanced, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './documentSerializer-DtS_-oGA.mjs';
4
- export { b as CommandHandler, d as CommandResult, C as CorePlugin, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult, C as Plugin, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-UDsUq8D3.mjs';
5
- export { D as DocumentAgent, F as FormattedTextSegment, I as InsertHyperlinkOptions, a as InsertImageOptions, b as InsertTableOptions, c as InsertTextOptions, d as attemptSelectiveSave, e as createAgent, f as createAgentFromDocument } from './DocumentAgent-BWflKHpH.mjs';
6
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CWBKYlNW.mjs';
7
- export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-CdQ7ZTzA.mjs';
8
-
9
- /**
10
- * Shared Text Utilities for Agent Module
11
- *
12
- * Common text extraction and manipulation utilities used by
13
- * context.ts, selectionContext.ts, and other agent-related code.
14
- *
15
- * Consolidates duplicated helper functions into a single location.
16
- */
17
-
18
- /**
19
- * Get plain text from a paragraph
20
- */
21
- declare function getParagraphText(paragraph: Paragraph): string;
22
- /**
23
- * Get plain text from a run
24
- */
25
- declare function getRunText(run: Run): string;
26
- /**
27
- * Get plain text from a hyperlink
28
- */
29
- declare function getHyperlinkText(hyperlink: Hyperlink): string;
30
- /**
31
- * Get plain text from a table
32
- */
33
- declare function getTableText(table: Table): string;
34
- /**
35
- * Get plain text from document body
36
- */
37
- declare function getBodyText(body: DocumentBody): string;
38
- /**
39
- * Count words in text
40
- */
41
- declare function countWords(text: string): number;
42
- /**
43
- * Count characters in text
44
- */
45
- declare function countCharacters(text: string, includeSpaces?: boolean): number;
46
- /**
47
- * Get word count from document body
48
- */
49
- declare function getBodyWordCount(body: DocumentBody): number;
50
- /**
51
- * Get character count from document body
52
- */
53
- declare function getBodyCharacterCount(body: DocumentBody): number;
54
- /**
55
- * Get text before a position
56
- *
57
- * @param paragraphs - Array of paragraphs
58
- * @param position - Position to get text before
59
- * @param maxChars - Maximum characters to return
60
- * @returns Text before the position
61
- */
62
- declare function getTextBefore(paragraphs: Paragraph[], position: Position, maxChars: number): string;
63
- /**
64
- * Get text after a position
65
- *
66
- * @param paragraphs - Array of paragraphs
67
- * @param position - Position to get text after
68
- * @param maxChars - Maximum characters to return
69
- * @returns Text after the position
70
- */
71
- declare function getTextAfter(paragraphs: Paragraph[], position: Position, maxChars: number): string;
72
- /**
73
- * Get formatting at a specific position in a paragraph
74
- *
75
- * @param paragraph - The paragraph to check
76
- * @param offset - Character offset in the paragraph
77
- * @returns Formatting at that position
78
- */
79
- declare function getFormattingAtPosition(paragraph: Paragraph, offset: number): Partial<TextFormatting>;
80
- /**
81
- * Check if position is within a hyperlink
82
- *
83
- * @param paragraph - The paragraph to check
84
- * @param offset - Character offset in the paragraph
85
- * @returns True if position is in a hyperlink
86
- */
87
- declare function isPositionInHyperlink(paragraph: Paragraph, offset: number): boolean;
88
- /**
89
- * Get hyperlink at position
90
- *
91
- * @param paragraph - The paragraph to check
92
- * @param offset - Character offset in the paragraph
93
- * @returns The hyperlink at that position, or undefined
94
- */
95
- declare function getHyperlinkAtPosition(paragraph: Paragraph, offset: number): Hyperlink | undefined;
96
- /**
97
- * Check if style ID represents a heading
98
- *
99
- * @param styleId - Style ID to check
100
- * @returns True if it's a heading style
101
- */
102
- declare function isHeadingStyle(styleId?: string): boolean;
103
- /**
104
- * Parse heading level from style ID
105
- *
106
- * @param styleId - Style ID to parse
107
- * @returns Heading level (1-9) or undefined
108
- */
109
- declare function parseHeadingLevel(styleId?: string): number | undefined;
110
- /**
111
- * Check if document body has images
112
- *
113
- * @param body - Document body to check
114
- * @returns True if contains images
115
- */
116
- declare function hasImages(body: DocumentBody): boolean;
117
- /**
118
- * Check if document body has hyperlinks
119
- *
120
- * @param body - Document body to check
121
- * @returns True if contains hyperlinks
122
- */
123
- declare function hasHyperlinks(body: DocumentBody): boolean;
124
- /**
125
- * Check if document body has tables
126
- *
127
- * @param body - Document body to check
128
- * @returns True if contains tables
129
- */
130
- declare function hasTables(body: DocumentBody): boolean;
131
- /**
132
- * Get all paragraphs from document body
133
- *
134
- * @param body - Document body
135
- * @returns Array of paragraphs
136
- */
137
- declare function getParagraphs(body: DocumentBody): Paragraph[];
138
- /**
139
- * Get paragraph at index from document body
140
- *
141
- * @param body - Document body
142
- * @param index - Paragraph index (0-indexed)
143
- * @returns Paragraph or undefined
144
- */
145
- declare function getParagraphAtIndex(body: DocumentBody, index: number): Paragraph | undefined;
146
- /**
147
- * Get block index for a paragraph index
148
- *
149
- * @param body - Document body
150
- * @param paragraphIndex - Paragraph index
151
- * @returns Block index or -1 if not found
152
- */
153
- declare function getBlockIndexForParagraph(body: DocumentBody, paragraphIndex: number): number;
154
-
155
- /**
156
- * @eigenpal/docx-core/headless
157
- *
158
- * Headless aggregate for Node.js scripts, CLI tools, and server-side
159
- * processing. Same surface as the default `.` entry, named to make the
160
- * "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
161
- * `./agent`, `./utils`, etc.) for new code — they tree-shake better.
162
- *
163
- * @example
164
- * ```ts
165
- * import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-core/headless';
166
- * import { docxtemplaterPlugin } from '@eigenpal/docx-core/core-plugins';
167
- *
168
- * // Register plugins
169
- * pluginRegistry.register(docxtemplaterPlugin);
170
- *
171
- * // Load and manipulate document
172
- * const buffer = fs.readFileSync('template.docx');
173
- * const agent = await DocumentAgent.fromBuffer(buffer);
174
- *
175
- * // Get document info
176
- * console.log('Word count:', agent.getWordCount());
177
- * console.log('Variables:', agent.getVariables());
178
- *
179
- * // Edit document
180
- * const newAgent = agent
181
- * .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
182
- * .applyStyle(0, 'Heading1');
183
- *
184
- * // Apply template variables
185
- * const finalAgent = await newAgent.applyVariables({
186
- * customer_name: 'Jane Doe',
187
- * date: '2024-02-15',
188
- * });
189
- *
190
- * // Export
191
- * const output = await finalAgent.toBuffer();
192
- * fs.writeFileSync('output.docx', Buffer.from(output));
193
- * ```
194
- */
195
- declare const VERSION = "0.0.2";
196
-
197
- export { DocumentBody, Hyperlink, Paragraph, Position, Run, Table, TextFormatting, VERSION, countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel };
@@ -1,197 +0,0 @@
1
- import { d as DocumentBody, a as Paragraph, T as TextFormatting, H as Hyperlink, b as Run, e as Table, P as Position } from './agentApi-DLt94vXk.js';
2
- export { f as AIAction, g as AIActionRequest, A as AgentCommand, h as AgentContext, i as AgentResponse, j as ApplyStyleCommand, k as ApplyVariablesCommand, l as BlockContent, C as Comment, m as CommentRangeEnd, n as CommentRangeStart, o as DEFAULT_AI_ACTIONS, p as DeleteTextCommand, q as Deletion, D as Document, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, y as Insertion, L as ListLevel, M as MoveFrom, z as MoveTo, N as NumberingDefinitions, G as ParagraphContent, J as ParagraphContext, K as ParagraphFormatting, O as ParagraphOutline, R as Range, Q as Relationship, S as ReplaceTextCommand, c as RunContent, U as SectionInfo, V as SectionProperties, W as SelectionContext, X as SetVariableCommand, Y as Style, Z as StyleDefinitions, _ as StyleInfo, $ as SuggestedAction, a0 as TableCell, a1 as TableRow, a2 as TextContent, a3 as Theme, a4 as TrackedChangeInfo, a5 as TrackedRunChange, a6 as comparePositions, a7 as createCollapsedRange, a8 as createCommand, a9 as createRange, aa as getActionDescription, ab as getActionLabel, ac as isPositionInRange } from './agentApi-DLt94vXk.js';
3
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, E as ExtendedSelectionContext, F as FormattingSummary, P as ProcessTemplateOptions, a as ProcessTemplateResult, b as SelectionContextOptions, T as TemplateError, c as blendColors, d as buildExtendedSelectionContext, e as buildSelectionContext, f as buildSelectionContextFromContext, g as colorsEqual, h as createDocumentWithText, i as createEmptyDocument, j as createRgbColor, k as createTemplateProcessor, l as createThemeColor, m as darkenColor, n as emuToPixels, o as emuToTwips, p as executeCommand, q as executeCommands, r as formatPx, s as getAgentContext, t as getContrastingColor, u as getDocumentSummary, v as getMissingVariables, w as getSelectionFormattingSummary, x as getTemplateTags, y as halfPointsToPixels, z as isBlack, B as isWhite, D as lightenColor, G as parseColorString, H as parseDocx, I as pixelsToEmu, J as pixelsToTwips, K as pointsToPixels, L as previewTemplate, M as processTemplate, N as processTemplateAdvanced, O as processTemplateAsBlob, Q as processTemplateDetailed, R as resolveColor, U as resolveHighlightColor, V as resolveShadingColor, W as serializeDocumentBody, X as serializeDocx, Y as serializeSectionProperties, Z as twipsToEmu, _ as twipsToPixels, $ as validateTemplate } from './documentSerializer-Wj1p2ASa.js';
4
- export { b as CommandHandler, d as CommandResult, C as CorePlugin, J as JsonSchema, L as LoadedDocument, e as McpSession, f as McpToolAnnotations, g as McpToolContent, h as McpToolContext, M as McpToolDefinition, i as McpToolHandler, j as McpToolResult, C as Plugin, k as PluginCommand, b as PluginCommandHandler, l as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, i as ToolHandler, j as ToolResult, Z as ZodSchemaLike, m as isZodSchema } from './types-jbivc9Lj.js';
5
- export { D as DocumentAgent, F as FormattedTextSegment, I as InsertHyperlinkOptions, a as InsertImageOptions, b as InsertTableOptions, c as InsertTextOptions, d as attemptSelectiveSave, e as createAgent, f as createAgentFromDocument } from './DocumentAgent-DsdXtetF.js';
6
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CH9V-IX0.js';
7
- export { V as VariableDetectionResult, a as VariableOccurrence, b as buildPatchedDocumentXml, c as createDocx, d as detectVariables, e as detectVariablesDetailed, f as detectVariablesInBody, g as detectVariablesInParagraph, h as documentHasVariables, i as extractVariablesFromText, j as formatVariable, k as hasTemplateVariables, l as isValidVariableName, p as parseVariable, r as removeVariables, m as repackDocx, n as replaceVariables, s as sanitizeVariableName, u as updateMultipleFiles, v as validatePatchSafety } from './variableDetector-DsRV3A9z.js';
8
-
9
- /**
10
- * Shared Text Utilities for Agent Module
11
- *
12
- * Common text extraction and manipulation utilities used by
13
- * context.ts, selectionContext.ts, and other agent-related code.
14
- *
15
- * Consolidates duplicated helper functions into a single location.
16
- */
17
-
18
- /**
19
- * Get plain text from a paragraph
20
- */
21
- declare function getParagraphText(paragraph: Paragraph): string;
22
- /**
23
- * Get plain text from a run
24
- */
25
- declare function getRunText(run: Run): string;
26
- /**
27
- * Get plain text from a hyperlink
28
- */
29
- declare function getHyperlinkText(hyperlink: Hyperlink): string;
30
- /**
31
- * Get plain text from a table
32
- */
33
- declare function getTableText(table: Table): string;
34
- /**
35
- * Get plain text from document body
36
- */
37
- declare function getBodyText(body: DocumentBody): string;
38
- /**
39
- * Count words in text
40
- */
41
- declare function countWords(text: string): number;
42
- /**
43
- * Count characters in text
44
- */
45
- declare function countCharacters(text: string, includeSpaces?: boolean): number;
46
- /**
47
- * Get word count from document body
48
- */
49
- declare function getBodyWordCount(body: DocumentBody): number;
50
- /**
51
- * Get character count from document body
52
- */
53
- declare function getBodyCharacterCount(body: DocumentBody): number;
54
- /**
55
- * Get text before a position
56
- *
57
- * @param paragraphs - Array of paragraphs
58
- * @param position - Position to get text before
59
- * @param maxChars - Maximum characters to return
60
- * @returns Text before the position
61
- */
62
- declare function getTextBefore(paragraphs: Paragraph[], position: Position, maxChars: number): string;
63
- /**
64
- * Get text after a position
65
- *
66
- * @param paragraphs - Array of paragraphs
67
- * @param position - Position to get text after
68
- * @param maxChars - Maximum characters to return
69
- * @returns Text after the position
70
- */
71
- declare function getTextAfter(paragraphs: Paragraph[], position: Position, maxChars: number): string;
72
- /**
73
- * Get formatting at a specific position in a paragraph
74
- *
75
- * @param paragraph - The paragraph to check
76
- * @param offset - Character offset in the paragraph
77
- * @returns Formatting at that position
78
- */
79
- declare function getFormattingAtPosition(paragraph: Paragraph, offset: number): Partial<TextFormatting>;
80
- /**
81
- * Check if position is within a hyperlink
82
- *
83
- * @param paragraph - The paragraph to check
84
- * @param offset - Character offset in the paragraph
85
- * @returns True if position is in a hyperlink
86
- */
87
- declare function isPositionInHyperlink(paragraph: Paragraph, offset: number): boolean;
88
- /**
89
- * Get hyperlink at position
90
- *
91
- * @param paragraph - The paragraph to check
92
- * @param offset - Character offset in the paragraph
93
- * @returns The hyperlink at that position, or undefined
94
- */
95
- declare function getHyperlinkAtPosition(paragraph: Paragraph, offset: number): Hyperlink | undefined;
96
- /**
97
- * Check if style ID represents a heading
98
- *
99
- * @param styleId - Style ID to check
100
- * @returns True if it's a heading style
101
- */
102
- declare function isHeadingStyle(styleId?: string): boolean;
103
- /**
104
- * Parse heading level from style ID
105
- *
106
- * @param styleId - Style ID to parse
107
- * @returns Heading level (1-9) or undefined
108
- */
109
- declare function parseHeadingLevel(styleId?: string): number | undefined;
110
- /**
111
- * Check if document body has images
112
- *
113
- * @param body - Document body to check
114
- * @returns True if contains images
115
- */
116
- declare function hasImages(body: DocumentBody): boolean;
117
- /**
118
- * Check if document body has hyperlinks
119
- *
120
- * @param body - Document body to check
121
- * @returns True if contains hyperlinks
122
- */
123
- declare function hasHyperlinks(body: DocumentBody): boolean;
124
- /**
125
- * Check if document body has tables
126
- *
127
- * @param body - Document body to check
128
- * @returns True if contains tables
129
- */
130
- declare function hasTables(body: DocumentBody): boolean;
131
- /**
132
- * Get all paragraphs from document body
133
- *
134
- * @param body - Document body
135
- * @returns Array of paragraphs
136
- */
137
- declare function getParagraphs(body: DocumentBody): Paragraph[];
138
- /**
139
- * Get paragraph at index from document body
140
- *
141
- * @param body - Document body
142
- * @param index - Paragraph index (0-indexed)
143
- * @returns Paragraph or undefined
144
- */
145
- declare function getParagraphAtIndex(body: DocumentBody, index: number): Paragraph | undefined;
146
- /**
147
- * Get block index for a paragraph index
148
- *
149
- * @param body - Document body
150
- * @param paragraphIndex - Paragraph index
151
- * @returns Block index or -1 if not found
152
- */
153
- declare function getBlockIndexForParagraph(body: DocumentBody, paragraphIndex: number): number;
154
-
155
- /**
156
- * @eigenpal/docx-core/headless
157
- *
158
- * Headless aggregate for Node.js scripts, CLI tools, and server-side
159
- * processing. Same surface as the default `.` entry, named to make the
160
- * "no DOM" intent explicit. Prefer the smaller subpaths (`./docx`,
161
- * `./agent`, `./utils`, etc.) for new code — they tree-shake better.
162
- *
163
- * @example
164
- * ```ts
165
- * import { DocumentAgent, parseDocx, pluginRegistry } from '@eigenpal/docx-core/headless';
166
- * import { docxtemplaterPlugin } from '@eigenpal/docx-core/core-plugins';
167
- *
168
- * // Register plugins
169
- * pluginRegistry.register(docxtemplaterPlugin);
170
- *
171
- * // Load and manipulate document
172
- * const buffer = fs.readFileSync('template.docx');
173
- * const agent = await DocumentAgent.fromBuffer(buffer);
174
- *
175
- * // Get document info
176
- * console.log('Word count:', agent.getWordCount());
177
- * console.log('Variables:', agent.getVariables());
178
- *
179
- * // Edit document
180
- * const newAgent = agent
181
- * .insertText({ paragraphIndex: 0, offset: 0 }, 'Hello ')
182
- * .applyStyle(0, 'Heading1');
183
- *
184
- * // Apply template variables
185
- * const finalAgent = await newAgent.applyVariables({
186
- * customer_name: 'Jane Doe',
187
- * date: '2024-02-15',
188
- * });
189
- *
190
- * // Export
191
- * const output = await finalAgent.toBuffer();
192
- * fs.writeFileSync('output.docx', Buffer.from(output));
193
- * ```
194
- */
195
- declare const VERSION = "0.0.2";
196
-
197
- export { DocumentBody, Hyperlink, Paragraph, Position, Run, Table, TextFormatting, VERSION, countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel };
@@ -1 +0,0 @@
1
- 'use strict';var chunkUWYD42WV_js=require('./chunk-UWYD42WV.js'),chunkQVPR2W5S_js=require('./chunk-QVPR2W5S.js'),chunkPQMSZTBB_js=require('./chunk-PQMSZTBB.js'),chunk3F52AP2Q_js=require('./chunk-3F52AP2Q.js'),chunkSNLC6EK2_js=require('./chunk-SNLC6EK2.js'),chunkLUF7PWIC_js=require('./chunk-LUF7PWIC.js'),chunkTMTLIGLZ_js=require('./chunk-TMTLIGLZ.js'),chunkQGTAIC5E_js=require('./chunk-QGTAIC5E.js');require('./chunk-Z3KMSHUP.js');var chunkP4VSHBGZ_js=require('./chunk-P4VSHBGZ.js');require('./chunk-IFPN3NT3.js');var chunkBUEMG4NW_js=require('./chunk-BUEMG4NW.js');require('./chunk-MOE2ZGUE.js'),require('./chunk-MWLHJWB6.js');var chunkQ7UDQXAF_js=require('./chunk-Q7UDQXAF.js'),chunkYC5KZSYD_js=require('./chunk-YC5KZSYD.js');require('./chunk-H5NTJZO4.js');var je="0.0.2";Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkUWYD42WV_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkUWYD42WV_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkUWYD42WV_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkUWYD42WV_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkUWYD42WV_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkUWYD42WV_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkUWYD42WV_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkUWYD42WV_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkUWYD42WV_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkUWYD42WV_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkUWYD42WV_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkUWYD42WV_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkUWYD42WV_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkUWYD42WV_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkUWYD42WV_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkUWYD42WV_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkUWYD42WV_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkUWYD42WV_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkUWYD42WV_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkUWYD42WV_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkUWYD42WV_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkUWYD42WV_js.p}});Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkQVPR2W5S_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkQVPR2W5S_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkQVPR2W5S_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkQVPR2W5S_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkQVPR2W5S_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkQVPR2W5S_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkPQMSZTBB_js.d}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkPQMSZTBB_js.c}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkPQMSZTBB_js.k}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkPQMSZTBB_js.b}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkPQMSZTBB_js.j}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkPQMSZTBB_js.h}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkPQMSZTBB_js.e}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkPQMSZTBB_js.f}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkPQMSZTBB_js.g}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkPQMSZTBB_js.i}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkPQMSZTBB_js.l}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkPQMSZTBB_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunk3F52AP2Q_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunk3F52AP2Q_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkSNLC6EK2_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkSNLC6EK2_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.k}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.g}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkSNLC6EK2_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkSNLC6EK2_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkSNLC6EK2_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.c}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkSNLC6EK2_js.d}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkLUF7PWIC_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkLUF7PWIC_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkLUF7PWIC_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkLUF7PWIC_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkLUF7PWIC_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkLUF7PWIC_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkLUF7PWIC_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkLUF7PWIC_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkLUF7PWIC_js.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkLUF7PWIC_js.n}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkLUF7PWIC_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkLUF7PWIC_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkLUF7PWIC_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkLUF7PWIC_js.h}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.r}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.i}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.a}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkTMTLIGLZ_js.n}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkQGTAIC5E_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkQGTAIC5E_js.b}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkP4VSHBGZ_js.a}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkBUEMG4NW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkBUEMG4NW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkBUEMG4NW_js.c}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.c}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.e}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.k}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.h}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.d}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.b}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.g}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.f}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkQ7UDQXAF_js.a}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkYC5KZSYD_js.j}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkYC5KZSYD_js.g}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkYC5KZSYD_js.e}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkYC5KZSYD_js.h}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkYC5KZSYD_js.a}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkYC5KZSYD_js.i}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkYC5KZSYD_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkYC5KZSYD_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkYC5KZSYD_js.f}});exports.VERSION=je;
@@ -1 +0,0 @@
1
- export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,p as parseHeadingLevel}from'./chunk-JCEWC5QL.mjs';export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'./chunk-6WPRCJ5A.mjs';export{d as DocumentAgent,c as attemptSelectiveSave,k as buildExtendedSelectionContext,b as buildPatchedDocumentXml,j as buildSelectionContext,h as buildSelectionContextFromContext,e as createAgent,f as createAgentFromDocument,g as getAgentContext,i as getDocumentSummary,l as getSelectionFormattingSummary,a as validatePatchSafety}from'./chunk-HI66BSGS.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-UXVACQCY.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,g as getContrastingColor,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,d as resolveShadingColor}from'./chunk-CPAYKE6X.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,n as isZodSchema,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-TSE2PWFX.mjs';export{r as createDocx,i as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties,n as updateMultipleFiles}from'./chunk-R3QMYPL5.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-5XK326FI.mjs';import'./chunk-76IYR7C7.mjs';export{a as parseDocx}from'./chunk-IOAGVW6Q.mjs';import'./chunk-WOHFANC5.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-W53SI3XW.mjs';import'./chunk-RBUTXXQJ.mjs';import'./chunk-INTPVEO6.mjs';export{c as emuToPixels,e as emuToTwips,k as formatPx,h as halfPointsToPixels,d as pixelsToEmu,b as pixelsToTwips,g as pointsToPixels,f as twipsToEmu,a as twipsToPixels}from'./chunk-54ULJEHM.mjs';export{j as createTemplateProcessor,g as getMissingVariables,e as getTemplateTags,h as previewTemplate,a as processTemplate,i as processTemplateAdvanced,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-LVGJKS7Y.mjs';import'./chunk-TAUMSKRE.mjs';var je="0.0.2";export{je as VERSION};
@@ -1,176 +0,0 @@
1
- import { D as Document, B as BreakContent, a as Paragraph, b as Run, c as RunContent } from './agentApi-DLt94vXk.mjs';
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 };