@eigenpal/docx-js-editor 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -19
- package/dist/{chunk-FOU7PS3K.cjs → chunk-A7VY2V4X.cjs} +1 -1
- package/dist/{chunk-AZFSFU4G.js → chunk-GQ4JYQWC.js} +1 -1
- package/dist/{chunk-EKU3VR4Y.cjs → chunk-H3JNHCD7.cjs} +4 -4
- package/dist/{chunk-B2GPMRIP.js → chunk-L2UUZRZI.js} +4 -4
- package/dist/{chunk-AQ35GWDV.js → chunk-MMJD2DLL.js} +1 -1
- package/dist/{chunk-CEBRVCHO.js → chunk-PM4Y7OFN.js} +4 -3
- package/dist/{chunk-7O7MPYI7.cjs → chunk-QOIY4Y6N.cjs} +2 -2
- package/dist/{chunk-WWGV3HB2.cjs → chunk-QYKJKSKZ.cjs} +2 -2
- package/dist/{chunk-NZ7XUW4I.cjs → chunk-S6FZ7HL6.js} +1 -1
- package/dist/{chunk-VMT4DN2Q.js → chunk-TPUJJJWA.js} +1 -1
- package/dist/{chunk-CWWSDDRF.cjs → chunk-TRAQI6RX.cjs} +4 -3
- package/dist/chunk-Y37VT37I.cjs +1 -0
- package/dist/{colorResolver-DGxlMbv2.d.ts → colorResolver-BNj-uZ58.d.ts} +1 -1
- package/dist/{colorResolver-CTmPdBGz.d.cts → colorResolver-DiMquGWR.d.cts} +1 -1
- package/dist/core-plugins.cjs +1 -1
- package/dist/core-plugins.d.cts +3 -3
- package/dist/core-plugins.d.ts +3 -3
- package/dist/core-plugins.js +1 -1
- package/dist/executor-44OB3DFD.js +1 -0
- package/dist/executor-U3BZPPGN.cjs +1 -0
- package/dist/headless.cjs +2 -2
- package/dist/headless.d.cts +4 -4
- package/dist/headless.d.ts +4 -4
- package/dist/headless.js +2 -2
- package/dist/index.cjs +25 -25
- package/dist/index.d.cts +32 -51
- package/dist/index.d.ts +32 -51
- package/dist/index.js +25 -25
- package/dist/mcp-cli.js +19 -19
- package/dist/mcp.cjs +12 -12
- package/dist/mcp.d.cts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +12 -12
- package/dist/{registry-C73dM_1E.d.cts → registry-BUTMLqSj.d.cts} +1 -1
- package/dist/{registry-Djkwny4j.d.ts → registry-CzqAPdui.d.ts} +1 -1
- package/dist/selectionRects-I5JVL73G.cjs +1 -0
- package/dist/selectionRects-LO3FJT47.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/{types-Do_Q8vaT.d.cts → types-BALm1KBi.d.cts} +1 -1
- package/dist/{types-Do_Q8vaT.d.ts → types-BALm1KBi.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-W2TDS3UO.js +0 -1
- package/dist/executor-7DZMHPUF.js +0 -1
- package/dist/executor-FSMRGT73.cjs +0 -1
- package/dist/selectionRects-5TGQE33Q.cjs +0 -1
- package/dist/selectionRects-JSPKYXPU.js +0 -1
package/dist/core-plugins.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CorePlugin } from './types-
|
|
2
|
-
export { b as CommandHandler, o as CommandResult,
|
|
3
|
-
export { P as PluginRegistry, c as createPluginRegistrar, p as
|
|
1
|
+
import { C as CorePlugin } from './types-BALm1KBi.cjs';
|
|
2
|
+
export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BALm1KBi.cjs';
|
|
3
|
+
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-BUTMLqSj.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Docxtemplater Plugin
|
package/dist/core-plugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CorePlugin } from './types-
|
|
2
|
-
export { b as CommandHandler, o as CommandResult,
|
|
3
|
-
export { P as PluginRegistry, c as createPluginRegistrar, p as
|
|
1
|
+
import { C as CorePlugin } from './types-BALm1KBi.js';
|
|
2
|
+
export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BALm1KBi.js';
|
|
3
|
+
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CzqAPdui.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Docxtemplater Plugin
|
package/dist/core-plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-
|
|
1
|
+
export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-L2UUZRZI.js';import'./chunk-PM4Y7OFN.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as executeCommand,b as executeCommands}from'./chunk-MMJD2DLL.js';import'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkA7VY2V4X_cjs=require('./chunk-A7VY2V4X.cjs');require('./chunk-XVFMG77A.cjs'),require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.b}});
|
package/dist/headless.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var chunkQOIY4Y6N_cjs=require('./chunk-QOIY4Y6N.cjs'),chunkH3JNHCD7_cjs=require('./chunk-H3JNHCD7.cjs'),chunkQYKJKSKZ_cjs=require('./chunk-QYKJKSKZ.cjs'),chunkTRAQI6RX_cjs=require('./chunk-TRAQI6RX.cjs'),chunkA7VY2V4X_cjs=require('./chunk-A7VY2V4X.cjs'),chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');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";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.y}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunk7O7MPYI7_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkEKU3VR4Y_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkWWGV3HB2_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkCWWSDDRF_cjs.n}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=y;exports.getRunText=c;exports.getTableText=x;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
|
|
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";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.j}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkTRAQI6RX_cjs.o}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=x;exports.getRunText=c;exports.getTableText=m;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
|
package/dist/headless.d.cts
CHANGED
|
@@ -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,
|
|
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-
|
|
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-
|
|
4
|
-
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-
|
|
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-DiMquGWR.cjs';
|
|
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.cjs';
|
|
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.cjs';
|
|
4
|
+
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-BUTMLqSj.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared Text Utilities for Agent Module
|
package/dist/headless.d.ts
CHANGED
|
@@ -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,
|
|
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-
|
|
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-
|
|
4
|
-
export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-
|
|
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,
|
|
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
|
|
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};
|