@eigenpal/docx-js-editor 0.0.7 → 0.0.9

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 (52) hide show
  1. package/README.md +52 -14
  2. package/dist/{chunk-FOU7PS3K.cjs → chunk-A7VY2V4X.cjs} +1 -1
  3. package/dist/chunk-GQ4JYQWC.js +58 -0
  4. package/dist/{chunk-ZRXLWSRP.cjs → chunk-H3JNHCD7.cjs} +4 -4
  5. package/dist/{chunk-VFBM3YKJ.js → chunk-L2UUZRZI.js} +4 -4
  6. package/dist/{chunk-AQ35GWDV.js → chunk-MMJD2DLL.js} +1 -1
  7. package/dist/chunk-PM4Y7OFN.js +12 -0
  8. package/dist/{chunk-PYAIJMEG.cjs → chunk-QOIY4Y6N.cjs} +2 -2
  9. package/dist/chunk-QYKJKSKZ.cjs +58 -0
  10. package/dist/{chunk-NZ7XUW4I.cjs → chunk-S6FZ7HL6.js} +1 -1
  11. package/dist/{chunk-AEANV5BR.js → chunk-TPUJJJWA.js} +1 -1
  12. package/dist/chunk-TRAQI6RX.cjs +12 -0
  13. package/dist/chunk-Y37VT37I.cjs +1 -0
  14. package/dist/{colorResolver-CQcFBxHC.d.ts → colorResolver-BNj-uZ58.d.ts} +1 -1
  15. package/dist/{colorResolver-Di-JRsr9.d.cts → colorResolver-DiMquGWR.d.cts} +1 -1
  16. package/dist/core-plugins.cjs +1 -1
  17. package/dist/core-plugins.d.cts +3 -3
  18. package/dist/core-plugins.d.ts +3 -3
  19. package/dist/core-plugins.js +1 -1
  20. package/dist/executor-44OB3DFD.js +1 -0
  21. package/dist/executor-U3BZPPGN.cjs +1 -0
  22. package/dist/headless.cjs +2 -2
  23. package/dist/headless.d.cts +4 -4
  24. package/dist/headless.d.ts +4 -4
  25. package/dist/headless.js +2 -2
  26. package/dist/index.cjs +26 -27
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.cts +90 -152
  29. package/dist/index.d.ts +90 -152
  30. package/dist/index.js +26 -27
  31. package/dist/mcp-cli.js +21 -20
  32. package/dist/mcp.cjs +12 -12
  33. package/dist/mcp.d.cts +2 -2
  34. package/dist/mcp.d.ts +2 -2
  35. package/dist/mcp.js +12 -12
  36. package/dist/{registry-CrAzNdUO.d.cts → registry-BUTMLqSj.d.cts} +1 -1
  37. package/dist/{registry-aux2uuQs.d.ts → registry-CzqAPdui.d.ts} +1 -1
  38. package/dist/selectionRects-I5JVL73G.cjs +1 -0
  39. package/dist/selectionRects-LO3FJT47.js +1 -0
  40. package/dist/styles.css +1 -1
  41. package/dist/{types-BnShY2aQ.d.ts → types-BALm1KBi.d.cts} +3 -1
  42. package/dist/{types-BnShY2aQ.d.cts → types-BALm1KBi.d.ts} +3 -1
  43. package/package.json +10 -5
  44. package/dist/chunk-2CFVFSUH.js +0 -57
  45. package/dist/chunk-CDSUWDYP.cjs +0 -11
  46. package/dist/chunk-TL3YTVN2.cjs +0 -57
  47. package/dist/chunk-W2TDS3UO.js +0 -1
  48. package/dist/chunk-ZZNWTYMW.js +0 -11
  49. package/dist/executor-7DZMHPUF.js +0 -1
  50. package/dist/executor-FSMRGT73.cjs +0 -1
  51. package/dist/selectionRects-5TGQE33Q.cjs +0 -1
  52. package/dist/selectionRects-JSPKYXPU.js +0 -1
@@ -1,7 +1,7 @@
1
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-CQcFBxHC.js';
2
- import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-BnShY2aQ.js';
3
- export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, 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, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-BnShY2aQ.js';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-aux2uuQs.js';
1
+ export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-BNj-uZ58.js';
2
+ import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-BALm1KBi.js';
3
+ export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, 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, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-BALm1KBi.js';
4
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CzqAPdui.js';
5
5
 
6
6
  /**
7
7
  * Shared Text Utilities for Agent Module
package/dist/headless.js CHANGED
@@ -1,4 +1,4 @@
1
- export{P as DEFAULT_AI_ACTIONS,y as DocumentAgent,l as blendColors,F as buildExtendedSelectionContext,E as buildSelectionContext,C as buildSelectionContextFromContext,m as colorsEqual,M as comparePositions,z as createAgent,A as createAgentFromDocument,J as createCollapsedRange,Q as createCommand,I as createDocumentWithText,H as createEmptyDocument,K as createRange,i as createRgbColor,h as createThemeColor,j as darkenColor,y as default,p as emuToPixels,r as emuToTwips,x as formatPx,O as getActionDescription,N as getActionLabel,B as getAgentContext,f as getContrastingColor,D as getDocumentSummary,G as getSelectionFormattingSummary,u as halfPointsToPixels,d as isBlack,L as isPositionInRange,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-AEANV5BR.js';export{v as createTemplateProcessor,a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,s as getMissingVariables,q as getTemplateTags,f as hasTemplateVariables,g as isValidVariableName,w as isZodSchema,j as parseVariable,t as previewTemplate,n as processTemplate,u as processTemplateAdvanced,p as processTemplateAsBlob,o as processTemplateDetailed,l as removeVariables,k as replaceVariables,h as sanitizeVariableName,r as validateTemplate}from'./chunk-VFBM3YKJ.js';export{e as createDocx,d as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-2CFVFSUH.js';export{m as parseDocx}from'./chunk-ZZNWTYMW.js';export{a as executeCommand,b as executeCommands}from'./chunk-AQ35GWDV.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
1
+ export{P as DEFAULT_AI_ACTIONS,y as DocumentAgent,l as blendColors,F as buildExtendedSelectionContext,E as buildSelectionContext,C as buildSelectionContextFromContext,m as colorsEqual,M as comparePositions,z as createAgent,A as createAgentFromDocument,J as createCollapsedRange,Q as createCommand,I as createDocumentWithText,H as createEmptyDocument,K as createRange,i as createRgbColor,h as createThemeColor,j as darkenColor,p as emuToPixels,r as emuToTwips,x as formatPx,O as getActionDescription,N as getActionLabel,B as getAgentContext,f as getContrastingColor,D as getDocumentSummary,G as getSelectionFormattingSummary,u as halfPointsToPixels,d as isBlack,L as isPositionInRange,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-TPUJJJWA.js';export{v as createTemplateProcessor,a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,s as getMissingVariables,q as getTemplateTags,f as hasTemplateVariables,g as isValidVariableName,w as isZodSchema,j as parseVariable,t as previewTemplate,n as processTemplate,u as processTemplateAdvanced,p as processTemplateAsBlob,o as processTemplateDetailed,l as removeVariables,k as replaceVariables,h as sanitizeVariableName,r as validateTemplate}from'./chunk-L2UUZRZI.js';export{e as createDocx,d as repackDocx,b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-GQ4JYQWC.js';export{o as parseDocx}from'./chunk-PM4Y7OFN.js';export{a as executeCommand,b as executeCommands}from'./chunk-MMJD2DLL.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function m(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(m(t));return e.join(`
2
2
  `)}function f(n){return n.split(/\s+/).filter(t=>t.length>0).length}function je(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function We(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=f(p(t)):t.type==="table"&&(e+=ze(t));return e}function ze(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=f(p(r)));return e}function Ne(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=p(t).length:t.type==="table"&&(e+=qe(t));return e}function qe(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=p(r).length);return e}function Ze(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let l=e.paragraphIndex-1;l>=0&&r<t;l--){let s=n[l];if(!s)continue;let u=p(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
3
  `);return a.length>t?"..."+a.slice(-t):a}function _e(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(e.offset);o.push(s),r+=s.length;}for(let l=e.paragraphIndex+1;l<n.length&&r<t;l++){let s=n[l];if(!s)continue;let u=p(s);o.push(u),r+=u.length;}let a=o.join(`
4
- `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function y(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return y(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";export{ot as VERSION,je as countCharacters,f as countWords,tt as getBlockIndexForParagraph,Ne as getBodyCharacterCount,Me as getBodyText,We as getBodyWordCount,Je as getFormattingAtPosition,Ge as getHyperlinkAtPosition,g as getHyperlinkText,et as getParagraphAtIndex,p as getParagraphText,y as getParagraphs,c as getRunText,x as getTableText,_e as getTextAfter,Ze as getTextBefore,Ye as hasHyperlinks,Xe as hasImages,$e as hasTables,Ke as isHeadingStyle,Ue as isPositionInHyperlink,Qe as parseHeadingLevel};
4
+ `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function x(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return x(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";export{ot as VERSION,je as countCharacters,f as countWords,tt as getBlockIndexForParagraph,Ne as getBodyCharacterCount,Me as getBodyText,We as getBodyWordCount,Je as getFormattingAtPosition,Ge as getHyperlinkAtPosition,g as getHyperlinkText,et as getParagraphAtIndex,p as getParagraphText,x as getParagraphs,c as getRunText,m as getTableText,_e as getTextAfter,Ze as getTextBefore,Ye as hasHyperlinks,Xe as hasImages,$e as hasTables,Ke as isHeadingStyle,Ue as isPositionInHyperlink,Qe as parseHeadingLevel};