@eigenpal/docx-editor-core 1.0.2 → 1.1.0
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/LICENSE +13 -16
- package/README.md +1 -1
- package/dist/agent/index.d.mts +4 -5
- package/dist/agent/index.d.ts +4 -5
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/{chunk-NLTX7XVR.js → chunk-25KY5HLN.js} +1 -1
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/{chunk-4S5VOHQK.mjs → chunk-5CDBSK2R.mjs} +1 -1
- package/dist/chunk-6Y6LON6Y.mjs +1 -0
- package/dist/chunk-6ZXL3EIP.mjs +2 -0
- package/dist/chunk-73AZQWIE.js +1 -0
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/{chunk-AGNZEOVL.mjs → chunk-7Z2AGPNQ.mjs} +1 -1
- package/dist/chunk-BGE57OES.js +1 -0
- package/dist/chunk-BOOHU5EW.mjs +1 -0
- package/dist/chunk-CA2EYL6T.mjs +1 -0
- package/dist/chunk-CTHHUJAB.mjs +2 -0
- package/dist/chunk-DLCDDB66.mjs +3 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/chunk-E4JMCA5X.js +2 -0
- package/dist/chunk-F44ZLDZS.js +4 -0
- package/dist/chunk-FCJWLEKT.mjs +1 -0
- package/dist/chunk-FDEDN2RC.mjs +0 -0
- package/dist/chunk-FEWCI2E5.mjs +1 -0
- package/dist/chunk-GFDIPDJ6.mjs +1 -0
- package/dist/chunk-GM4USWKO.js +2 -0
- package/dist/chunk-GWBVJZVT.js +3 -0
- package/dist/chunk-GY5BWVM7.js +1 -0
- package/dist/{chunk-7SGC3CXJ.js → chunk-H42RXHT4.js} +1 -1
- package/dist/chunk-HMBVSDCH.mjs +1 -0
- package/dist/chunk-HQPWFUP5.js +2 -0
- package/dist/chunk-HV6HE6YR.js +59 -0
- package/dist/chunk-IF4C25FN.mjs +1 -0
- package/dist/chunk-IMKU4O3P.js +1 -0
- package/dist/chunk-IQG3KLWY.mjs +2 -0
- package/dist/{chunk-AFMMYLPX.js → chunk-J4J2Y6EU.js} +2 -2
- package/dist/chunk-KGDXHUYC.js +1 -0
- package/dist/chunk-KHF4JU7D.mjs +1 -0
- package/dist/chunk-LCICADWM.js +2 -0
- package/dist/{chunk-GFQM7PKY.js → chunk-LOCW6MR2.js} +1 -1
- package/dist/chunk-LTHT4A4S.js +1 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/chunk-MZ2XCZAN.mjs +1 -0
- package/dist/chunk-OAWTQ3IY.js +1 -0
- package/dist/chunk-OEXVWIHW.mjs +2 -0
- package/dist/chunk-ONRBRDIC.mjs +59 -0
- package/dist/{chunk-6PR4XHQ3.mjs → chunk-ONWOHAFW.mjs} +1 -1
- package/dist/{chunk-EXOP727C.mjs → chunk-OUEKNYX5.mjs} +1 -1
- package/dist/chunk-OX75Q5ZG.mjs +1 -0
- package/dist/chunk-QEACB5VG.js +1 -0
- package/dist/chunk-RFC2SXZ6.mjs +4 -0
- package/dist/chunk-RFVFX5WK.mjs +1 -0
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/chunk-U74VPTIU.js +1 -0
- package/dist/chunk-UOQT6A7P.js +1 -0
- package/dist/chunk-V5VDCQDN.mjs +1 -0
- package/dist/chunk-VHUVPHPI.mjs +1 -0
- package/dist/{chunk-XCMA7AY7.js → chunk-W7GLQ6DV.js} +1 -1
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-X6HFDXKB.js +1 -0
- package/dist/chunk-XPV6VILW.mjs +1 -0
- package/dist/chunk-Y3ZQQI4D.js +1 -0
- package/dist/chunk-YTDWMXNS.js +1 -0
- package/dist/chunk-ZUGNF5KU.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/{colorResolver-CVsPLsw1.d.ts → colorResolver-BZ_yScf4.d.ts} +1 -1
- package/dist/{colorResolver-C3q7MLLD.d.mts → colorResolver-C6DtsoFI.d.mts} +1 -1
- package/dist/content-5Mrz6w_b.d.mts +1360 -0
- package/dist/content-CmqAwdFL.d.ts +1360 -0
- package/dist/core-plugins.d.mts +3 -4
- package/dist/core-plugins.d.ts +3 -4
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +10 -11
- package/dist/core.d.ts +10 -11
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-BRaaXIHm.d.ts} +1 -1
- package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-DgO3A9av.d.mts} +1 -1
- package/dist/docx/index.d.mts +3 -4
- package/dist/docx/index.d.ts +3 -4
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +3 -4
- package/dist/docx/parser.d.ts +3 -4
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +3 -4
- package/dist/docx/rezip.d.ts +3 -4
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +4 -5
- package/dist/docx/serializer/index.d.ts +4 -5
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-8b4X-AIh.d.mts} +63 -3
- package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-CK2QLq68.d.ts} +63 -3
- package/dist/{formatting-D9I-lFS4.d.mts → formatting-BH4hcZiq.d.mts} +1 -1
- package/dist/{formatting-BwpZWdGi.d.ts → formatting-_OXU8gLB.d.ts} +1 -1
- package/dist/{headerFooterLayout-DkclHZ0Z.d.mts → headerFooterLayout-72Vz7yp3.d.mts} +94 -3
- package/dist/{headerFooterLayout-B3QVg556.d.ts → headerFooterLayout-Ca4ESDHF.d.ts} +94 -3
- package/dist/headless.d.mts +9 -9
- package/dist/headless.d.ts +9 -9
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +7 -7
- package/dist/layout-bridge/index.d.ts +7 -7
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +43 -2
- package/dist/layout-bridge/measuring/index.d.ts +43 -2
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.mts +11 -3
- package/dist/layout-bridge/toFlowBlocks.d.ts +11 -3
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +33 -3
- package/dist/layout-engine/index.d.ts +33 -3
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +53 -0
- package/dist/layout-engine/types.d.ts +53 -0
- package/dist/layout-painter/index.d.mts +4 -5
- package/dist/layout-painter/index.d.ts +4 -5
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +4 -5
- package/dist/layout-painter/renderPage.d.ts +4 -5
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +3 -4
- package/dist/managers/AutoSaveManager.d.ts +3 -4
- package/dist/managers/TableSelectionManager.d.mts +3 -4
- package/dist/managers/TableSelectionManager.d.ts +3 -4
- package/dist/managers/types.d.mts +3 -4
- package/dist/managers/types.d.ts +3 -4
- package/dist/{marks-CCPVlQzL.d.mts → marks-BY573yZn.d.mts} +1 -1
- package/dist/{marks-BujVxYP4.d.ts → marks-CjC9tF5k.d.ts} +1 -1
- package/dist/mcp-cli.mjs +24 -23
- package/dist/mcp.d.mts +3 -4
- package/dist/mcp.d.ts +3 -4
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-BXi1Uu3e.d.mts → nodes-7753Bgi_.d.mts} +66 -3
- package/dist/{nodes-DfKj9kUA.d.ts → nodes-CC_nwkT_.d.ts} +66 -3
- package/dist/prosemirror/commands/formatting.d.mts +2 -2
- package/dist/prosemirror/commands/formatting.d.ts +2 -2
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +82 -8
- package/dist/prosemirror/commands/index.d.ts +82 -8
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.d.mts +1 -1
- package/dist/prosemirror/commands/paragraph.d.ts +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +11 -4
- package/dist/prosemirror/conversion/index.d.ts +11 -4
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +155 -95
- package/dist/prosemirror/extensions/index.d.mts +1 -1
- package/dist/prosemirror/extensions/index.d.ts +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
- package/dist/prosemirror/index.d.mts +5 -6
- package/dist/prosemirror/index.d.ts +5 -6
- package/dist/prosemirror/index.js +1 -1
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/plugins/index.d.mts +122 -18
- package/dist/prosemirror/plugins/index.d.ts +122 -18
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.mts +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +1 -1
- package/dist/prosemirror/schema/index.d.mts +4 -5
- package/dist/prosemirror/schema/index.d.ts +4 -5
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/styles/index.d.mts +2 -2
- package/dist/prosemirror/styles/index.d.ts +2 -2
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +45 -23
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +45 -23
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
- package/dist/{selectionContext-85CE0f7a.d.ts → selectionContext-BPAqgNgk.d.ts} +1 -1
- package/dist/{selectionContext-Xq3AY7pn.d.mts → selectionContext-CoZat7QZ.d.mts} +1 -1
- package/dist/{styles-jqO45PSq.d.ts → styles-BBv7doYK.d.ts} +1 -1
- package/dist/{styles-BBoqh07F.d.mts → styles-EI2lxeEN.d.mts} +1 -1
- package/dist/types/agentApi.d.mts +1 -1
- package/dist/types/agentApi.d.ts +1 -1
- package/dist/types/content.d.mts +4 -1167
- package/dist/types/content.d.ts +4 -1167
- package/dist/types/document.d.mts +25 -8
- package/dist/types/document.d.ts +25 -8
- package/dist/utils/comments.d.mts +79 -6
- package/dist/utils/comments.d.ts +79 -6
- package/dist/utils/comments.js +1 -1
- package/dist/utils/comments.mjs +1 -1
- package/dist/utils/highlightColors.js +1 -1
- package/dist/utils/highlightColors.mjs +1 -1
- package/dist/utils/index.d.mts +5 -6
- package/dist/utils/index.d.ts +5 -6
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-DF3-nxUC.d.mts} +1 -1
- package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-sBkgVh3f.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-2D3UPAMA.mjs +0 -1
- package/dist/chunk-2RCMY2GE.mjs +0 -1
- package/dist/chunk-3GNIP6IX.mjs +0 -4
- package/dist/chunk-44RUAQA2.js +0 -1
- package/dist/chunk-5N5DBQJV.mjs +0 -1
- package/dist/chunk-5TNMVXDS.mjs +0 -1
- package/dist/chunk-6DK4UBGM.js +0 -1
- package/dist/chunk-6LOYA7G5.mjs +0 -2
- package/dist/chunk-7VCMJCBY.js +0 -2
- package/dist/chunk-APFTVA4F.mjs +0 -1
- package/dist/chunk-BKHQA6JJ.js +0 -1
- package/dist/chunk-BOYVCOLZ.mjs +0 -1
- package/dist/chunk-BS35CXMN.js +0 -1
- package/dist/chunk-BTOBVF4I.mjs +0 -1
- package/dist/chunk-C6GSFUV2.js +0 -2
- package/dist/chunk-CP5OSG5Z.mjs +0 -1
- package/dist/chunk-CP767TWV.js +0 -1
- package/dist/chunk-DV6IEOP5.js +0 -4
- package/dist/chunk-IBNUQL57.mjs +0 -2
- package/dist/chunk-KBU6QQFU.js +0 -9
- package/dist/chunk-LDKESXXK.mjs +0 -3
- package/dist/chunk-LTYW3NLX.js +0 -59
- package/dist/chunk-NERY274X.js +0 -1
- package/dist/chunk-NMSU4MWP.mjs +0 -1
- package/dist/chunk-NNQWQOC5.mjs +0 -1
- package/dist/chunk-OLKDLRJ4.js +0 -1
- package/dist/chunk-P3AXSRLG.mjs +0 -1
- package/dist/chunk-P6RNOYAG.mjs +0 -2
- package/dist/chunk-R7RR6M4A.mjs +0 -2
- package/dist/chunk-RCS6UNIJ.mjs +0 -1
- package/dist/chunk-T5RYEG2V.js +0 -1
- package/dist/chunk-TRJWRZZD.js +0 -1
- package/dist/chunk-TYYOBPNK.js +0 -1
- package/dist/chunk-UCZVMHB5.mjs +0 -59
- package/dist/chunk-V435QKZB.js +0 -3
- package/dist/chunk-VQ2QGHYS.js +0 -2
- package/dist/chunk-WZP6ZHBR.js +0 -1
- package/dist/chunk-XDH55WXX.mjs +0 -1
- package/dist/chunk-Y5HZAMND.mjs +0 -9
- package/dist/chunk-YE357WVA.js +0 -1
- package/dist/chunk-YGHHSCPR.js +0 -2
- package/dist/lists-CdiIk_c1.d.ts +0 -142
- package/dist/lists-JDB80qyP.d.mts +0 -142
package/dist/docx/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'../chunk-BOYVCOLZ.mjs';export{s as createDocx,h as repackDocx,l as updateMultipleFiles}from'../chunk-UCZVMHB5.mjs';import'../chunk-LDKESXXK.mjs';export{b as formatNumber,d as getBulletCharacter,e as isBulletLevel,f as parseDocx,a as parseNumbering,c as renderListMarker}from'../chunk-R7RR6M4A.mjs';import {z}from'../chunk-3GNIP6IX.mjs';export{w as getEndnoteText,v as getFootnoteText,G as getHyperlinkRuns,B as getHyperlinkText,E as getHyperlinkUrl,j as getTableColumnCount,k as getTableRowCount,F as hasContent,n as hasHeaderRow,l as isCellMergeContinuation,m as isCellMergeStart,C as isExternalLink,D as isInternalLink,y as isSeparatorEndnote,x as isSeparatorFootnote,d as parseBorderSpec,f as parseCellMargins,u as parseEndnoteProperties,s as parseEndnotes,i as parseFloatingTableProperties,t as parseFootnoteProperties,r as parseFootnotes,A as parseHyperlink,g as parseShading,e as parseTableBorders,h as parseTableLook,c as parseTableMeasurement,o as parseTableProperties,H as resolveHyperlinkUrl}from'../chunk-3GNIP6IX.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import {c,d,e as e$1,b,a}from'../chunk-IBNUQL57.mjs';export{f as extractTextBoxContentElements,F as getImageHeightPx,E as getImageWidthPx,k as getTextBoxContentElement,o as getTextBoxDimensionsPx,n as getTextBoxHeightPx,p as getTextBoxMarginsPx,x as getTextBoxOutlineWidthPx,u as getTextBoxText,m as getTextBoxWidthPx,H as getWrapDistancesPx,t as hasTextBoxContent,r as hasTextBoxFill,s as hasTextBoxOutline,C as isBehindText,G as isDecorativeImage,B as isFloatingImage,q as isFloatingTextBox,D as isInFrontOfText,A as isInlineImage,i as isShapeTextBox,h as isTextBoxDrawing,y as parseDrawing,z as parseImage,j as parseTextBox,g as parseTextBoxContent,l as parseTextBoxFromShape,v as resolveTextBoxFillColor,w as resolveTextBoxOutlineColor}from'../chunk-IBNUQL57.mjs';import {j,f,i,h,l,e as e$2,g}from'../chunk-6LOYA7G5.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VQWZHPWI.mjs';import {e}from'../chunk-VW22RZ6C.mjs';export{e as emuToPixels,f as pixelsToEmu}from'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function at(e){return M.includes(e)}function st(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function pt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ct(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function ut(e,t,n){let o=j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=f(e,"w","r");for(let u of l){let c=z(u,t,n);i.content.push(c);}return i}function dt(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function ft(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function mt(e){return e.fieldType==="PAGE"}function ht(e){return e.fieldType==="NUMPAGES"}function gt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function Tt(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function xt(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function yt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function St(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ft(e,t){let n=b(e);if(n){if(n.type==="gradient"&&e){let r=i(e).find(i=>i.name==="a:gradFill");if(r)return bt(r)}return n}if(e){let o=i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=h(t,"a:fillRef");if(o){if(j(o,null,"idx")==="0")return {type:"none"};let i=a(o);if(i)return {type:"solid",color:i}}}}function bt(e){let t=i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i$1=t.find(l=>l.name==="a:path");if(i$1){let l=j(i$1,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a$1=t.find(l=>l.name==="a:gsLst"),s=[];if(a$1){let l=g(a$1,"gs");for(let u of l){let c=j(u,null,"pos"),p=c?parseInt(c,10):0,m=a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function Et(e,t){let n=e?h(e,"a:ln"):null;if(!n){if(t){let f=h(t,"a:lnRef");if(f){if(j(f,null,"idx")==="0")return;let g=a(f);if(g)return {color:g,width:9525}}}return}let o=i(n);if(o.find(f=>f.name==="a:noFill"))return;let i$1={},a$1=j(n,null,"w");a$1&&(i$1.width=parseInt(a$1,10));let s=j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i$1.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i$1.join="bevel":c?i$1.join="round":u&&(i$1.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i$1.color=a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=j(m,null,"val");f&&(i$1.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i$1.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i$1.tailEnd=X(T)),i$1}function X(e){let t=j(e,null,"type")??"none",n=j(e,null,"w"),o=j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Ct(e){if(!e)return {size:{width:0,height:0}};let t=h(e,"a:ext"),n=l(t,null,"cx")??0,o=l(t,null,"cy")??0,r={width:n,height:o},i=h(e,"a:off"),a;if(i){let m=l(i,null,"x")??0,y=l(i,null,"y")??0;a={x:m,y};}let s=j(e,null,"rot"),l$1=j(e,null,"flipH")==="1",u=j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l$1||u)&&(p={},c!==void 0&&(p.rotation=c),l$1&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function wt(e){if(!e)return "rect";let t=h(e,"a:prstGeom");if(t){let o=j(t,null,"prst");if(o)return o}return h(e,"a:custGeom"),"rect"}function At(e){if(!e)return {};let t={},n=j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=j(e,null,"rot");o&&(t.rotation=H(o));let r=j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=h(e,"a:noAutofit"),a=h(e,"a:normAutofit"),s=h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l$1=l(e,null,"lIns"),u=l(e,null,"rIns"),c=l(e,null,"tIns"),p=l(e,null,"bIns");return (l$1!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l$1,right:u,top:c,bottom:p}),t}function Mt(e){if(!e)return [];let t=[],n=g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i$1=t.find(g=>g.name==="wps:txbx"),a=i$1?h(i$1,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=wt(o??null),u=o?h(o,"a:xfrm"):null,{size:c,transform:p}=Ct(u),m=Ft(o??null,r??null),y=Et(o??null,r??null),T,f;n&&(T=j(n,null,"id")??void 0,f=j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=At(s??null),P=Mt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function It(e){let n=i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=h(n,"a:graphic");if(!r)return null;let i$1=h(r,"a:graphicData");if(!i$1)return null;let a=h(i$1,"wps:wsp");if(!a)return null;let s=W(a),l$1=h(n,"wp:extent");if(l$1){let c=l(l$1,null,"cx")??0,p=l(l$1,null,"cy")??0;s.size={width:c,height:p};}if(o){let c$1=c(n);c$1&&(s.position=c$1);let p=d(n);p&&(s.wrap=p);}let u=h(n,"wp:docPr");if(u){let c=j(u,null,"id"),p=j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Rt(e){let n=i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=h(n,"a:graphic");if(!o)return false;let r=h(o,"a:graphicData");return r?h(r,"wps:wsp")!==null:false}function Lt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Dt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function Pt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Nt(e$1){return e(e$1.size.width)}function Bt(e$1){return e(e$1.size.height)}function vt(e$1){return {width:e(e$1.size.width),height:e(e$1.size.height)}}function Ot(e){return e.position!==void 0||e.wrap!==void 0}function kt(e){return e.fill!==void 0&&e.fill.type!=="none"}function Ut(e){return e.outline!==void 0}function Xt(e$1){return e$1.outline?.width?e(e$1.outline.width):0}function Ht(e){if(!(!e.fill||e.fill.type!=="solid"))return e$1(e.fill.color)}function Wt(e){if(e.outline?.color)return e$1(e.outline.color)}var R=720,L="left",Vt="none";function V(e){let t=l(e,"w","pos"),n=j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function Gt(e){if(!e)return;let t=e$2(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function _t(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function jt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function zt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Kt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function Yt(e){return e!==void 0&&e!=="none"}function Jt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function Zt(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}export{L as DEFAULT_TAB_ALIGNMENT,R as DEFAULT_TAB_INTERVAL_TWIPS,Vt as DEFAULT_TAB_LEADER,M as KNOWN_FIELD_TYPES,jt as calculateTabWidth,zt as calculateTabWidthWithAlignment,dt as createComplexFieldContext,ft as getFieldDisplayValue,pt as getFormatSwitch,Kt as getLeaderCharacter,D as getNextTabStop,Xt as getOutlineWidthPx,vt as getShapeDimensionsPx,Bt as getShapeHeightPx,Nt as getShapeWidthPx,kt as hasFill,ct as hasMergeFormat,Ut as hasOutline,Pt as hasTextContent,Yt as hasVisibleLeader,Jt as injectReplyRangeMarkers,Zt as injectTCReplyRangeMarkers,gt as isDateTimeField,Tt as isDocPropertyField,Ot as isFloatingShape,at as isKnownFieldType,Lt as isLineShape,yt as isMergeField,mt as isPageNumberField,xt as isReferenceField,Rt as isShapeDrawing,Dt as isTextBoxShape,St as isTocField,ht as isTotalPagesField,_t as mergeTabStops,st as parseFieldInstruction,I as parseFieldType,W as parseShape,It as parseShapeFromDrawing,ut as parseSimpleField,V as parseTabStop,G as parseTabStops,Gt as parseTabStopsFromParagraphProperties,Ht as resolveFillColor,Wt as resolveOutlineColor};
|
|
1
|
+
export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'../chunk-IF4C25FN.mjs';export{s as createDocx,h as repackDocx,l as updateMultipleFiles}from'../chunk-ONRBRDIC.mjs';import'../chunk-DLCDDB66.mjs';export{b as formatNumber,d as getBulletCharacter,e as isBulletLevel,f as parseDocx,a as parseNumbering,c as renderListMarker}from'../chunk-CTHHUJAB.mjs';import {E}from'../chunk-RFC2SXZ6.mjs';export{y as getEndnoteText,x as getFootnoteText,L as getHyperlinkRuns,G as getHyperlinkText,J as getHyperlinkUrl,j as getTableColumnCount,k as getTableRowCount,K as hasContent,n as hasHeaderRow,l as isCellMergeContinuation,m as isCellMergeStart,H as isExternalLink,I as isInternalLink,A as isSeparatorEndnote,z as isSeparatorFootnote,d as parseBorderSpec,f as parseCellMargins,w as parseEndnoteProperties,u as parseEndnotes,i as parseFloatingTableProperties,v as parseFootnoteProperties,t as parseFootnotes,F as parseHyperlink,g as parseShading,e as parseTableBorders,h as parseTableLook,c as parseTableMeasurement,o as parseTableProperties,M as resolveHyperlinkUrl}from'../chunk-RFC2SXZ6.mjs';import'../chunk-BOOHU5EW.mjs';import'../chunk-7LRR7RKE.mjs';import'../chunk-ILJUDEZ5.mjs';import {c,d,e as e$1,b,a}from'../chunk-6ZXL3EIP.mjs';export{f as extractTextBoxContentElements,F as getImageHeightPx,E as getImageWidthPx,k as getTextBoxContentElement,o as getTextBoxDimensionsPx,n as getTextBoxHeightPx,p as getTextBoxMarginsPx,x as getTextBoxOutlineWidthPx,u as getTextBoxText,m as getTextBoxWidthPx,H as getWrapDistancesPx,t as hasTextBoxContent,r as hasTextBoxFill,s as hasTextBoxOutline,C as isBehindText,G as isDecorativeImage,B as isFloatingImage,q as isFloatingTextBox,D as isInFrontOfText,A as isInlineImage,i as isShapeTextBox,h as isTextBoxDrawing,y as parseDrawing,z as parseImage,j as parseTextBox,g as parseTextBoxContent,l as parseTextBoxFromShape,v as resolveTextBoxFillColor,w as resolveTextBoxOutlineColor}from'../chunk-6ZXL3EIP.mjs';import'../chunk-OEXVWIHW.mjs';import {j,f,i,h,l,e as e$2,g}from'../chunk-WLHNIXWC.mjs';import'../chunk-LE67NTCN.mjs';import {e}from'../chunk-VW22RZ6C.mjs';export{e as emuToPixels,f as pixelsToEmu}from'../chunk-VW22RZ6C.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-QYUPLKLP.mjs';var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function at(e){return M.includes(e)}function st(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function pt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ct(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function ut(e,t,n){let o=j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=f(e,"w","r");for(let u of l){let c=E(u,t,n);i.content.push(c);}return i}function dt(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function ft(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function mt(e){return e.fieldType==="PAGE"}function ht(e){return e.fieldType==="NUMPAGES"}function gt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function Tt(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function xt(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function yt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function St(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ft(e,t){let n=b(e);if(n){if(n.type==="gradient"&&e){let r=i(e).find(i=>i.name==="a:gradFill");if(r)return bt(r)}return n}if(e){let o=i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=h(t,"a:fillRef");if(o){if(j(o,null,"idx")==="0")return {type:"none"};let i=a(o);if(i)return {type:"solid",color:i}}}}function bt(e){let t=i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i$1=t.find(l=>l.name==="a:path");if(i$1){let l=j(i$1,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a$1=t.find(l=>l.name==="a:gsLst"),s=[];if(a$1){let l=g(a$1,"gs");for(let u of l){let c=j(u,null,"pos"),p=c?parseInt(c,10):0,m=a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function Et(e,t){let n=e?h(e,"a:ln"):null;if(!n){if(t){let f=h(t,"a:lnRef");if(f){if(j(f,null,"idx")==="0")return;let g=a(f);if(g)return {color:g,width:9525}}}return}let o=i(n);if(o.find(f=>f.name==="a:noFill"))return;let i$1={},a$1=j(n,null,"w");a$1&&(i$1.width=parseInt(a$1,10));let s=j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i$1.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i$1.join="bevel":c?i$1.join="round":u&&(i$1.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i$1.color=a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=j(m,null,"val");f&&(i$1.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i$1.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i$1.tailEnd=X(T)),i$1}function X(e){let t=j(e,null,"type")??"none",n=j(e,null,"w"),o=j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Ct(e){if(!e)return {size:{width:0,height:0}};let t=h(e,"a:ext"),n=l(t,null,"cx")??0,o=l(t,null,"cy")??0,r={width:n,height:o},i=h(e,"a:off"),a;if(i){let m=l(i,null,"x")??0,y=l(i,null,"y")??0;a={x:m,y};}let s=j(e,null,"rot"),l$1=j(e,null,"flipH")==="1",u=j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l$1||u)&&(p={},c!==void 0&&(p.rotation=c),l$1&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function wt(e){if(!e)return "rect";let t=h(e,"a:prstGeom");if(t){let o=j(t,null,"prst");if(o)return o}return h(e,"a:custGeom"),"rect"}function At(e){if(!e)return {};let t={},n=j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=j(e,null,"rot");o&&(t.rotation=H(o));let r=j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=h(e,"a:noAutofit"),a=h(e,"a:normAutofit"),s=h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l$1=l(e,null,"lIns"),u=l(e,null,"rIns"),c=l(e,null,"tIns"),p=l(e,null,"bIns");return (l$1!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l$1,right:u,top:c,bottom:p}),t}function Mt(e){if(!e)return [];let t=[],n=g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i$1=t.find(g=>g.name==="wps:txbx"),a=i$1?h(i$1,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=wt(o??null),u=o?h(o,"a:xfrm"):null,{size:c,transform:p}=Ct(u),m=Ft(o??null,r??null),y=Et(o??null,r??null),T,f;n&&(T=j(n,null,"id")??void 0,f=j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=At(s??null),P=Mt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function It(e){let n=i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=h(n,"a:graphic");if(!r)return null;let i$1=h(r,"a:graphicData");if(!i$1)return null;let a=h(i$1,"wps:wsp");if(!a)return null;let s=W(a),l$1=h(n,"wp:extent");if(l$1){let c=l(l$1,null,"cx")??0,p=l(l$1,null,"cy")??0;s.size={width:c,height:p};}if(o){let c$1=c(n);c$1&&(s.position=c$1);let p=d(n);p&&(s.wrap=p);}let u=h(n,"wp:docPr");if(u){let c=j(u,null,"id"),p=j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Rt(e){let n=i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=h(n,"a:graphic");if(!o)return false;let r=h(o,"a:graphicData");return r?h(r,"wps:wsp")!==null:false}function Lt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Dt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function Pt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Nt(e$1){return e(e$1.size.width)}function Bt(e$1){return e(e$1.size.height)}function vt(e$1){return {width:e(e$1.size.width),height:e(e$1.size.height)}}function Ot(e){return e.position!==void 0||e.wrap!==void 0}function kt(e){return e.fill!==void 0&&e.fill.type!=="none"}function Ut(e){return e.outline!==void 0}function Xt(e$1){return e$1.outline?.width?e(e$1.outline.width):0}function Ht(e){if(!(!e.fill||e.fill.type!=="solid"))return e$1(e.fill.color)}function Wt(e){if(e.outline?.color)return e$1(e.outline.color)}var R=720,L="left",Vt="none";function V(e){let t=l(e,"w","pos"),n=j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function Gt(e){if(!e)return;let t=e$2(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function _t(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function jt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function zt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Kt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function Yt(e){return e!==void 0&&e!=="none"}function Jt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function Zt(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}export{L as DEFAULT_TAB_ALIGNMENT,R as DEFAULT_TAB_INTERVAL_TWIPS,Vt as DEFAULT_TAB_LEADER,M as KNOWN_FIELD_TYPES,jt as calculateTabWidth,zt as calculateTabWidthWithAlignment,dt as createComplexFieldContext,ft as getFieldDisplayValue,pt as getFormatSwitch,Kt as getLeaderCharacter,D as getNextTabStop,Xt as getOutlineWidthPx,vt as getShapeDimensionsPx,Bt as getShapeHeightPx,Nt as getShapeWidthPx,kt as hasFill,ct as hasMergeFormat,Ut as hasOutline,Pt as hasTextContent,Yt as hasVisibleLeader,Jt as injectReplyRangeMarkers,Zt as injectTCReplyRangeMarkers,gt as isDateTimeField,Tt as isDocPropertyField,Ot as isFloatingShape,at as isKnownFieldType,Lt as isLineShape,yt as isMergeField,mt as isPageNumberField,xt as isReferenceField,Rt as isShapeDrawing,Dt as isTextBoxShape,St as isTocField,ht as isTotalPagesField,_t as mergeTabStops,st as parseFieldInstruction,I as parseFieldType,W as parseShape,It as parseShapeFromDrawing,ut as parseSimpleField,V as parseTabStop,G as parseTabStops,Gt as parseTabStopsFromParagraphProperties,Ht as resolveFillColor,Wt as resolveOutlineColor};
|
package/dist/docx/parser.d.mts
CHANGED
|
@@ -22,11 +22,10 @@
|
|
|
22
22
|
import { Document } from '../types/document.mjs';
|
|
23
23
|
import { D as DocxInput } from '../docxInput-DTbCa48g.mjs';
|
|
24
24
|
import '../colors-C3vA7HUU.mjs';
|
|
25
|
-
import '../formatting-
|
|
26
|
-
import '../
|
|
27
|
-
import '../types/content.mjs';
|
|
25
|
+
import '../formatting-BH4hcZiq.mjs';
|
|
26
|
+
import '../content-5Mrz6w_b.mjs';
|
|
28
27
|
import './wrapTypes.mjs';
|
|
29
|
-
import '../styles-
|
|
28
|
+
import '../styles-EI2lxeEN.mjs';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Main Parser Orchestrator - Unified parseDocx function
|
package/dist/docx/parser.d.ts
CHANGED
|
@@ -22,11 +22,10 @@
|
|
|
22
22
|
import { Document } from '../types/document.js';
|
|
23
23
|
import { D as DocxInput } from '../docxInput-DTbCa48g.js';
|
|
24
24
|
import '../colors-C3vA7HUU.js';
|
|
25
|
-
import '../formatting-
|
|
26
|
-
import '../
|
|
27
|
-
import '../types/content.js';
|
|
25
|
+
import '../formatting-_OXU8gLB.js';
|
|
26
|
+
import '../content-CmqAwdFL.js';
|
|
28
27
|
import './wrapTypes.js';
|
|
29
|
-
import '../styles-
|
|
28
|
+
import '../styles-BBv7doYK.js';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Main Parser Orchestrator - Unified parseDocx function
|
package/dist/docx/parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkLCICADWM_js=require('../chunk-LCICADWM.js');require('../chunk-F44ZLDZS.js'),require('../chunk-44FHVKSI.js'),require('../chunk-MNOHUTKE.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-E4JMCA5X.js'),require('../chunk-HQPWFUP5.js'),require('../chunk-DV6GWBUJ.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"fullParseDocx",{enumerable:true,get:function(){return chunkLCICADWM_js.h}});Object.defineProperty(exports,"getDocxSummary",{enumerable:true,get:function(){return chunkLCICADWM_js.j}});Object.defineProperty(exports,"getDocxVariables",{enumerable:true,get:function(){return chunkLCICADWM_js.i}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkLCICADWM_js.f}});Object.defineProperty(exports,"quickParseDocx",{enumerable:true,get:function(){return chunkLCICADWM_js.g}});
|
package/dist/docx/parser.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{h as fullParseDocx,j as getDocxSummary,i as getDocxVariables,f as parseDocx,g as quickParseDocx}from'../chunk-
|
|
1
|
+
export{h as fullParseDocx,j as getDocxSummary,i as getDocxVariables,f as parseDocx,g as quickParseDocx}from'../chunk-CTHHUJAB.mjs';import'../chunk-RFC2SXZ6.mjs';import'../chunk-BOOHU5EW.mjs';import'../chunk-7LRR7RKE.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-6ZXL3EIP.mjs';import'../chunk-OEXVWIHW.mjs';import'../chunk-WLHNIXWC.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-QYUPLKLP.mjs';
|
package/dist/docx/rezip.d.mts
CHANGED
|
@@ -38,11 +38,10 @@
|
|
|
38
38
|
import JSZip from 'jszip';
|
|
39
39
|
import { Document } from '../types/document.mjs';
|
|
40
40
|
import '../colors-C3vA7HUU.mjs';
|
|
41
|
-
import '../formatting-
|
|
42
|
-
import '../
|
|
43
|
-
import '../types/content.mjs';
|
|
41
|
+
import '../formatting-BH4hcZiq.mjs';
|
|
42
|
+
import '../content-5Mrz6w_b.mjs';
|
|
44
43
|
import './wrapTypes.mjs';
|
|
45
|
-
import '../styles-
|
|
44
|
+
import '../styles-EI2lxeEN.mjs';
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* DOCX Unzipper
|
package/dist/docx/rezip.d.ts
CHANGED
|
@@ -38,11 +38,10 @@
|
|
|
38
38
|
import JSZip from 'jszip';
|
|
39
39
|
import { Document } from '../types/document.js';
|
|
40
40
|
import '../colors-C3vA7HUU.js';
|
|
41
|
-
import '../formatting-
|
|
42
|
-
import '../
|
|
43
|
-
import '../types/content.js';
|
|
41
|
+
import '../formatting-_OXU8gLB.js';
|
|
42
|
+
import '../content-CmqAwdFL.js';
|
|
44
43
|
import './wrapTypes.js';
|
|
45
|
-
import '../styles-
|
|
44
|
+
import '../styles-BBv7doYK.js';
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* DOCX Unzipper
|
package/dist/docx/rezip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkHV6HE6YR_js=require('../chunk-HV6HE6YR.js');require('../chunk-GWBVJZVT.js'),require('../chunk-HQPWFUP5.js'),require('../chunk-DV6GWBUJ.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"COMMENTS_CONTENT_TYPE",{enumerable:true,get:function(){return chunkHV6HE6YR_js.b}});Object.defineProperty(exports,"COMMENTS_EXTENDED_CONTENT_TYPE",{enumerable:true,get:function(){return chunkHV6HE6YR_js.c}});Object.defineProperty(exports,"COMMENTS_EXTENSIBLE_CONTENT_TYPE",{enumerable:true,get:function(){return chunkHV6HE6YR_js.e}});Object.defineProperty(exports,"COMMENTS_IDS_CONTENT_TYPE",{enumerable:true,get:function(){return chunkHV6HE6YR_js.d}});Object.defineProperty(exports,"addMedia",{enumerable:true,get:function(){return chunkHV6HE6YR_js.o}});Object.defineProperty(exports,"addRelationship",{enumerable:true,get:function(){return chunkHV6HE6YR_js.n}});Object.defineProperty(exports,"applyUpdatesToZip",{enumerable:true,get:function(){return chunkHV6HE6YR_js.m}});Object.defineProperty(exports,"collectHeaderFooterUpdates",{enumerable:true,get:function(){return chunkHV6HE6YR_js.f}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkHV6HE6YR_js.s}});Object.defineProperty(exports,"createEmptyDocx",{enumerable:true,get:function(){return chunkHV6HE6YR_js.g}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkHV6HE6YR_js.t}});Object.defineProperty(exports,"findMaxRId",{enumerable:true,get:function(){return chunkHV6HE6YR_js.a}});Object.defineProperty(exports,"isDocxBuffer",{enumerable:true,get:function(){return chunkHV6HE6YR_js.r}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkHV6HE6YR_js.h}});Object.defineProperty(exports,"repackDocxFromRaw",{enumerable:true,get:function(){return chunkHV6HE6YR_js.i}});Object.defineProperty(exports,"updateCoreProperties",{enumerable:true,get:function(){return chunkHV6HE6YR_js.p}});Object.defineProperty(exports,"updateDocumentXml",{enumerable:true,get:function(){return chunkHV6HE6YR_js.j}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkHV6HE6YR_js.l}});Object.defineProperty(exports,"updateXmlFile",{enumerable:true,get:function(){return chunkHV6HE6YR_js.k}});Object.defineProperty(exports,"validateDocx",{enumerable:true,get:function(){return chunkHV6HE6YR_js.q}});
|
package/dist/docx/rezip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as COMMENTS_CONTENT_TYPE,c as COMMENTS_EXTENDED_CONTENT_TYPE,e as COMMENTS_EXTENSIBLE_CONTENT_TYPE,d as COMMENTS_IDS_CONTENT_TYPE,o as addMedia,n as addRelationship,m as applyUpdatesToZip,f as collectHeaderFooterUpdates,s as createDocx,g as createEmptyDocx,t as default,a as findMaxRId,r as isDocxBuffer,h as repackDocx,i as repackDocxFromRaw,p as updateCoreProperties,j as updateDocumentXml,l as updateMultipleFiles,k as updateXmlFile,q as validateDocx}from'../chunk-
|
|
1
|
+
export{b as COMMENTS_CONTENT_TYPE,c as COMMENTS_EXTENDED_CONTENT_TYPE,e as COMMENTS_EXTENSIBLE_CONTENT_TYPE,d as COMMENTS_IDS_CONTENT_TYPE,o as addMedia,n as addRelationship,m as applyUpdatesToZip,f as collectHeaderFooterUpdates,s as createDocx,g as createEmptyDocx,t as default,a as findMaxRId,r as isDocxBuffer,h as repackDocx,i as repackDocxFromRaw,p as updateCoreProperties,j as updateDocumentXml,l as updateMultipleFiles,k as updateXmlFile,q as validateDocx}from'../chunk-ONRBRDIC.mjs';import'../chunk-DLCDDB66.mjs';import'../chunk-OEXVWIHW.mjs';import'../chunk-WLHNIXWC.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-QYUPLKLP.mjs';
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export { a as serializeDocument, s as serializeDocumentBody, b as serializeSectionProperties } from '../../documentSerializer-
|
|
10
|
-
import { Paragraph, Run, Table, HeaderFooter, Comment } from '../../
|
|
9
|
+
export { a as serializeDocument, s as serializeDocumentBody, b as serializeSectionProperties } from '../../documentSerializer-DgO3A9av.mjs';
|
|
10
|
+
import { P as Paragraph, R as Run, T as Table, u as HeaderFooter, C as Comment } from '../../content-5Mrz6w_b.mjs';
|
|
11
11
|
import '../../types/document.mjs';
|
|
12
12
|
import '../../colors-C3vA7HUU.mjs';
|
|
13
|
-
import '../../formatting-
|
|
14
|
-
import '../../
|
|
15
|
-
import '../../styles-BBoqh07F.mjs';
|
|
13
|
+
import '../../formatting-BH4hcZiq.mjs';
|
|
14
|
+
import '../../styles-EI2lxeEN.mjs';
|
|
16
15
|
import '../wrapTypes.mjs';
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export { a as serializeDocument, s as serializeDocumentBody, b as serializeSectionProperties } from '../../documentSerializer-
|
|
10
|
-
import { Paragraph, Run, Table, HeaderFooter, Comment } from '../../
|
|
9
|
+
export { a as serializeDocument, s as serializeDocumentBody, b as serializeSectionProperties } from '../../documentSerializer-BRaaXIHm.js';
|
|
10
|
+
import { P as Paragraph, R as Run, T as Table, u as HeaderFooter, C as Comment } from '../../content-CmqAwdFL.js';
|
|
11
11
|
import '../../types/document.js';
|
|
12
12
|
import '../../colors-C3vA7HUU.js';
|
|
13
|
-
import '../../formatting-
|
|
14
|
-
import '../../
|
|
15
|
-
import '../../styles-jqO45PSq.js';
|
|
13
|
+
import '../../formatting-_OXU8gLB.js';
|
|
14
|
+
import '../../styles-BBv7doYK.js';
|
|
16
15
|
import '../wrapTypes.js';
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkGWBVJZVT_js=require('../../chunk-GWBVJZVT.js');require('../../chunk-C2BAPYGJ.js'),require('../../chunk-DC7S76ZX.js');Object.defineProperty(exports,"serializeComments",{enumerable:true,get:function(){return chunkGWBVJZVT_js.j}});Object.defineProperty(exports,"serializeDocument",{enumerable:true,get:function(){return chunkGWBVJZVT_js.g}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkGWBVJZVT_js.f}});Object.defineProperty(exports,"serializeHeaderFooter",{enumerable:true,get:function(){return chunkGWBVJZVT_js.h}});Object.defineProperty(exports,"serializeParagraph",{enumerable:true,get:function(){return chunkGWBVJZVT_js.c}});Object.defineProperty(exports,"serializeRun",{enumerable:true,get:function(){return chunkGWBVJZVT_js.b}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkGWBVJZVT_js.e}});Object.defineProperty(exports,"serializeTable",{enumerable:true,get:function(){return chunkGWBVJZVT_js.d}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as serializeComments,g as serializeDocument,f as serializeDocumentBody,h as serializeHeaderFooter,c as serializeParagraph,b as serializeRun,e as serializeSectionProperties,d as serializeTable}from'../../chunk-
|
|
1
|
+
export{j as serializeComments,g as serializeDocument,f as serializeDocumentBody,h as serializeHeaderFooter,c as serializeParagraph,b as serializeRun,e as serializeSectionProperties,d as serializeTable}from'../../chunk-DLCDDB66.mjs';import'../../chunk-LE67NTCN.mjs';import'../../chunk-QYUPLKLP.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from './types/document.mjs';
|
|
2
|
-
import { BreakContent, Paragraph, Run, RunContent } from './
|
|
2
|
+
import { t as BreakContent, P as Paragraph, R as Run, g as RunContent } from './content-5Mrz6w_b.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Insert Operations Utility
|
|
@@ -143,6 +143,14 @@ declare function getLoadedFonts(): string[];
|
|
|
143
143
|
* @returns Cleanup function to remove the callback
|
|
144
144
|
*/
|
|
145
145
|
declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
|
|
146
|
+
/**
|
|
147
|
+
* Register a callback to be notified when a font fails to load.
|
|
148
|
+
*
|
|
149
|
+
* Adapters subscribe and forward to their `onError` prop. Returns the unsub.
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
153
|
+
declare function onFontError(callback: (error: Error) => void): () => void;
|
|
146
154
|
/**
|
|
147
155
|
* Check if a font is available on the system using canvas measurement
|
|
148
156
|
*
|
|
@@ -164,8 +172,60 @@ declare function canRenderFont(fontFamily: string, fallbackFont?: string): boole
|
|
|
164
172
|
*/
|
|
165
173
|
declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
|
|
166
174
|
weight?: number | string;
|
|
167
|
-
style?: 'normal' | 'italic';
|
|
168
175
|
}): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* Load a font face from a URL (woff2, woff, ttf, otf).
|
|
178
|
+
*
|
|
179
|
+
* Injects an `@font-face` rule pointing at the URL. Multiple weights of the
|
|
180
|
+
* same family can be registered independently.
|
|
181
|
+
*
|
|
182
|
+
* @param fontFamily - CSS font-family name to expose
|
|
183
|
+
* @param src - URL to the font file
|
|
184
|
+
* @param options - Optional weight
|
|
185
|
+
* @returns Promise resolving to true if the face became available
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
declare function loadFontFromUrl(fontFamily: string, src: string, options?: {
|
|
190
|
+
weight?: number | string;
|
|
191
|
+
}): Promise<boolean>;
|
|
192
|
+
/**
|
|
193
|
+
* Declarative description of a single font face to register with the editor.
|
|
194
|
+
*
|
|
195
|
+
* Each entry injects one `@font-face` rule pointing at a URL. Multiple
|
|
196
|
+
* entries can share `family` to register distinct weights as separate faces.
|
|
197
|
+
*
|
|
198
|
+
* For Google Fonts, call `loadFont(family)` directly — the `fonts` prop is
|
|
199
|
+
* for fonts the consumer hosts themselves. For raw bytes already in memory
|
|
200
|
+
* (DOCX-embedded fonts, user uploads), call `loadFontFromBuffer(family, buf)`.
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
interface FontDefinition {
|
|
205
|
+
/**
|
|
206
|
+
* CSS `font-family` name to expose. Match the family name your documents
|
|
207
|
+
* reference; the browser uses this to look up glyphs when text is rendered.
|
|
208
|
+
*/
|
|
209
|
+
family: string;
|
|
210
|
+
/**
|
|
211
|
+
* URL to the font file (woff2, woff, ttf, or otf). The loader injects an
|
|
212
|
+
* `@font-face` rule and lets the browser fetch on demand.
|
|
213
|
+
*/
|
|
214
|
+
src: string;
|
|
215
|
+
/**
|
|
216
|
+
* CSS `font-weight` for this face. Defaults to `'normal'` (≈400). Pass a
|
|
217
|
+
* number (`400`, `700`) or a CSS keyword (`'bold'`). Required when one
|
|
218
|
+
* `family` registers multiple weights as separate entries.
|
|
219
|
+
*/
|
|
220
|
+
weight?: number | string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Register a list of custom font faces. Used by the `fonts` prop on
|
|
224
|
+
* `<DocxEditor>` (React + Vue). Idempotent — safe to call on every render.
|
|
225
|
+
*
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
declare function loadFontDefinitions(defs: ReadonlyArray<FontDefinition> | undefined): Promise<void>;
|
|
169
229
|
/**
|
|
170
230
|
* Mapping from common Office/system fonts to Google Fonts equivalents
|
|
171
231
|
*
|
|
@@ -220,4 +280,4 @@ declare function extractFontsFromDocument(document: unknown): Set<string>;
|
|
|
220
280
|
*/
|
|
221
281
|
declare function loadDocumentFonts(document: unknown): Promise<void>;
|
|
222
282
|
|
|
223
|
-
export {
|
|
283
|
+
export { extractFontsFromDocument as A, getGoogleFontEquivalent as B, loadDocumentFonts as C, loadFontDefinitions as D, loadFontFromUrl as E, FONT_MAPPING as F, loadFontWithMapping as G, loadFontsWithMapping as H, type InsertPosition as I, onFontError as J, 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, type FontDefinition as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from './types/document.js';
|
|
2
|
-
import { BreakContent, Paragraph, Run, RunContent } from './
|
|
2
|
+
import { t as BreakContent, P as Paragraph, R as Run, g as RunContent } from './content-CmqAwdFL.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Insert Operations Utility
|
|
@@ -143,6 +143,14 @@ declare function getLoadedFonts(): string[];
|
|
|
143
143
|
* @returns Cleanup function to remove the callback
|
|
144
144
|
*/
|
|
145
145
|
declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
|
|
146
|
+
/**
|
|
147
|
+
* Register a callback to be notified when a font fails to load.
|
|
148
|
+
*
|
|
149
|
+
* Adapters subscribe and forward to their `onError` prop. Returns the unsub.
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
153
|
+
declare function onFontError(callback: (error: Error) => void): () => void;
|
|
146
154
|
/**
|
|
147
155
|
* Check if a font is available on the system using canvas measurement
|
|
148
156
|
*
|
|
@@ -164,8 +172,60 @@ declare function canRenderFont(fontFamily: string, fallbackFont?: string): boole
|
|
|
164
172
|
*/
|
|
165
173
|
declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
|
|
166
174
|
weight?: number | string;
|
|
167
|
-
style?: 'normal' | 'italic';
|
|
168
175
|
}): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* Load a font face from a URL (woff2, woff, ttf, otf).
|
|
178
|
+
*
|
|
179
|
+
* Injects an `@font-face` rule pointing at the URL. Multiple weights of the
|
|
180
|
+
* same family can be registered independently.
|
|
181
|
+
*
|
|
182
|
+
* @param fontFamily - CSS font-family name to expose
|
|
183
|
+
* @param src - URL to the font file
|
|
184
|
+
* @param options - Optional weight
|
|
185
|
+
* @returns Promise resolving to true if the face became available
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
declare function loadFontFromUrl(fontFamily: string, src: string, options?: {
|
|
190
|
+
weight?: number | string;
|
|
191
|
+
}): Promise<boolean>;
|
|
192
|
+
/**
|
|
193
|
+
* Declarative description of a single font face to register with the editor.
|
|
194
|
+
*
|
|
195
|
+
* Each entry injects one `@font-face` rule pointing at a URL. Multiple
|
|
196
|
+
* entries can share `family` to register distinct weights as separate faces.
|
|
197
|
+
*
|
|
198
|
+
* For Google Fonts, call `loadFont(family)` directly — the `fonts` prop is
|
|
199
|
+
* for fonts the consumer hosts themselves. For raw bytes already in memory
|
|
200
|
+
* (DOCX-embedded fonts, user uploads), call `loadFontFromBuffer(family, buf)`.
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
interface FontDefinition {
|
|
205
|
+
/**
|
|
206
|
+
* CSS `font-family` name to expose. Match the family name your documents
|
|
207
|
+
* reference; the browser uses this to look up glyphs when text is rendered.
|
|
208
|
+
*/
|
|
209
|
+
family: string;
|
|
210
|
+
/**
|
|
211
|
+
* URL to the font file (woff2, woff, ttf, or otf). The loader injects an
|
|
212
|
+
* `@font-face` rule and lets the browser fetch on demand.
|
|
213
|
+
*/
|
|
214
|
+
src: string;
|
|
215
|
+
/**
|
|
216
|
+
* CSS `font-weight` for this face. Defaults to `'normal'` (≈400). Pass a
|
|
217
|
+
* number (`400`, `700`) or a CSS keyword (`'bold'`). Required when one
|
|
218
|
+
* `family` registers multiple weights as separate entries.
|
|
219
|
+
*/
|
|
220
|
+
weight?: number | string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Register a list of custom font faces. Used by the `fonts` prop on
|
|
224
|
+
* `<DocxEditor>` (React + Vue). Idempotent — safe to call on every render.
|
|
225
|
+
*
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
declare function loadFontDefinitions(defs: ReadonlyArray<FontDefinition> | undefined): Promise<void>;
|
|
169
229
|
/**
|
|
170
230
|
* Mapping from common Office/system fonts to Google Fonts equivalents
|
|
171
231
|
*
|
|
@@ -220,4 +280,4 @@ declare function extractFontsFromDocument(document: unknown): Set<string>;
|
|
|
220
280
|
*/
|
|
221
281
|
declare function loadDocumentFonts(document: unknown): Promise<void>;
|
|
222
282
|
|
|
223
|
-
export {
|
|
283
|
+
export { extractFontsFromDocument as A, getGoogleFontEquivalent as B, loadDocumentFonts as C, loadFontDefinitions as D, loadFontFromUrl as E, FONT_MAPPING as F, loadFontWithMapping as G, loadFontsWithMapping as H, type InsertPosition as I, onFontError as J, 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, type FontDefinition as z };
|
|
@@ -407,4 +407,4 @@ interface TableCellFormatting {
|
|
|
407
407
|
conditionalFormat?: ConditionalFormatStyle;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
export type { CellMargins as C, EmphasisMark as E, FloatingTableProperties as F, LineSpacingRule as L, ParagraphFormatting as P, SpacingExplicit as S, TextFormatting as T, UnderlineStyle as U,
|
|
410
|
+
export type { CellMargins as C, EmphasisMark as E, FloatingTableProperties as F, LineSpacingRule as L, ParagraphFormatting as P, SpacingExplicit as S, TextFormatting as T, UnderlineStyle as U, TableFormatting as a, TableRowFormatting as b, TableCellFormatting as c, ParagraphAlignment as d, TabStop as e, TableLook as f, ConditionalFormatStyle as g, TabLeader as h, TabStopAlignment as i, TableBorders as j, TableMeasurement as k, TableWidthType as l, TextEffect as m };
|
|
@@ -407,4 +407,4 @@ interface TableCellFormatting {
|
|
|
407
407
|
conditionalFormat?: ConditionalFormatStyle;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
export type { CellMargins as C, EmphasisMark as E, FloatingTableProperties as F, LineSpacingRule as L, ParagraphFormatting as P, SpacingExplicit as S, TextFormatting as T, UnderlineStyle as U,
|
|
410
|
+
export type { CellMargins as C, EmphasisMark as E, FloatingTableProperties as F, LineSpacingRule as L, ParagraphFormatting as P, SpacingExplicit as S, TextFormatting as T, UnderlineStyle as U, TableFormatting as a, TableRowFormatting as b, TableCellFormatting as c, ParagraphAlignment as d, TabStop as e, TableLook as f, ConditionalFormatStyle as g, TabLeader as h, TabStopAlignment as i, TableBorders as j, TableMeasurement as k, TableWidthType as l, TextEffect as m };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
1
3
|
import { FlowBlock, Measure, LayoutOptions, FootnoteContent, Layout, Page, PageMargins, ImageRun } from './layout-engine/types.mjs';
|
|
2
|
-
import { Footnote, HeaderFooter } from './
|
|
3
|
-
import { a as StyleDefinitions, T as Theme } from './styles-
|
|
4
|
+
import { F as Footnote, u as HeaderFooter } from './content-5Mrz6w_b.mjs';
|
|
5
|
+
import { a as StyleDefinitions, T as Theme } from './styles-EI2lxeEN.mjs';
|
|
4
6
|
import { F as FootnoteRenderItem, H as HeaderFooterContent } from './footnotes-lCH_P3N3.mjs';
|
|
5
7
|
import { Document } from './types/document.mjs';
|
|
6
8
|
|
|
@@ -37,6 +39,13 @@ declare function footnoteReservedHeightsEqual(a: Map<number, number>, b: Map<num
|
|
|
37
39
|
/**
|
|
38
40
|
* Scan FlowBlocks for runs with footnoteRefId set.
|
|
39
41
|
* Returns a list of { footnoteId, pmPos } in document order.
|
|
42
|
+
*
|
|
43
|
+
* Recurses into container blocks (table cells, text boxes) so footnote
|
|
44
|
+
* references authored anywhere in the body reach the page-reservation
|
|
45
|
+
* pass. Without this, a `footnoteRefId` nested inside a table cell never
|
|
46
|
+
* gets mapped to a page and the per-page `.layout-footnote-area` silently
|
|
47
|
+
* drops that entry even though the body still renders the in-line ref
|
|
48
|
+
* marker.
|
|
40
49
|
*/
|
|
41
50
|
declare function collectFootnoteRefs(blocks: FlowBlock[]): Array<{
|
|
42
51
|
footnoteId: number;
|
|
@@ -84,6 +93,11 @@ type ConvertFootnoteOptions = {
|
|
|
84
93
|
theme?: Theme | null;
|
|
85
94
|
/** Measure callback supplied by the rendering adapter. */
|
|
86
95
|
measureBlocks: MeasureBlocksFn;
|
|
96
|
+
/**
|
|
97
|
+
* Doc-level `w:defaultTabStop` (twips) from the body so list markers
|
|
98
|
+
* inside footnotes honor the same tab grid.
|
|
99
|
+
*/
|
|
100
|
+
defaultTabStopTwips?: number | null;
|
|
87
101
|
};
|
|
88
102
|
/**
|
|
89
103
|
* Convert a Footnote to renderable FootnoteContent via the body pipeline:
|
|
@@ -187,6 +201,13 @@ type ConvertHeaderFooterOptions = {
|
|
|
187
201
|
styles?: StyleDefinitions | null;
|
|
188
202
|
theme?: Theme | null;
|
|
189
203
|
measureBlocks: MeasureBlocksFn;
|
|
204
|
+
/**
|
|
205
|
+
* `w:defaultTabStop` (twips) read from `state.doc.attrs.defaultTabStopTwips`
|
|
206
|
+
* on the body doc — HF content doesn't carry its own doc-level setting,
|
|
207
|
+
* so pass it through so list markers inside headers/footers honor the
|
|
208
|
+
* same tab grid as the body.
|
|
209
|
+
*/
|
|
210
|
+
defaultTabStopTwips?: number | null;
|
|
190
211
|
};
|
|
191
212
|
/**
|
|
192
213
|
* Convert HeaderFooter (document type) to HeaderFooterContent (render type).
|
|
@@ -197,5 +218,75 @@ type ConvertHeaderFooterOptions = {
|
|
|
197
218
|
* textBox, fields) and the inline editor's content stay in lockstep.
|
|
198
219
|
*/
|
|
199
220
|
declare function convertHeaderFooterToContent(headerFooter: HeaderFooter | null | undefined, contentWidth: number, metrics: HeaderFooterMetrics, options: ConvertHeaderFooterOptions): HeaderFooterContent | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Same pipeline as {@link convertHeaderFooterToContent}, but starts from an
|
|
223
|
+
* already-built ProseMirror document instead of `HeaderFooter.content`.
|
|
224
|
+
*
|
|
225
|
+
* The unified HF editing model (see `openspec/changes/unify-hf-editing/`)
|
|
226
|
+
* maintains one persistent hidden PM EditorView per HF `rId`. The painter
|
|
227
|
+
* reads from that EditorView's current `state.doc` rather than re-parsing
|
|
228
|
+
* the Document-model `HeaderFooter` every layout pass — this is what
|
|
229
|
+
* actually makes the painter and the editor stay in lockstep.
|
|
230
|
+
*
|
|
231
|
+
* `headerFooterToProseDoc` is still the right entry point when there is no
|
|
232
|
+
* mounted PM for the slot (cold load, or rId not yet projected).
|
|
233
|
+
*
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
|
+
declare function convertHeaderFooterPmDocToContent(pmDoc: Node, contentWidth: number, metrics: HeaderFooterMetrics, options: ConvertHeaderFooterOptions): HeaderFooterContent | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Drop the cached HF host + span lists. Hosts/painters call this after
|
|
239
|
+
* a repaint (or HF mode toggle) so the next caret / selection compute
|
|
240
|
+
* re-walks the DOM. Public so adapters can call it from their painter
|
|
241
|
+
* commit signal.
|
|
242
|
+
*
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
declare function invalidateHfDomCache(): void;
|
|
246
|
+
/**
|
|
247
|
+
* TODO(unify-hf-editing follow-up): this function duplicates the
|
|
248
|
+
* span-walking + Range/TreeWalker logic in
|
|
249
|
+
* `packages/react/src/components/DocxEditor/internals/domSelection.ts:getCaretFromDom`
|
|
250
|
+
* (body). The body's helper is scoped to `.layout-page-content` via
|
|
251
|
+
* `findBodyPmSpans`; we walk the same shape scoped to `.layout-page-header /
|
|
252
|
+
* .layout-page-footer` here. Unification path:
|
|
253
|
+
* 1. Add `findHfPmSpans` / `findHfEmptyRuns` mirrors next to the body
|
|
254
|
+
* ones in `packages/core/src/layout-bridge/findBodyPmSpans.ts`.
|
|
255
|
+
* 2. Add `scope: 'body' | 'hf'` param to `getCaretFromDom` +
|
|
256
|
+
* `computeSelectionRectsFromDom`; switch the helper internally.
|
|
257
|
+
* 3. Move the (now scope-aware) helpers into core so React + Vue both
|
|
258
|
+
* call them.
|
|
259
|
+
* 4. Delete this function and `computeHfSelectionRectsFromView` —
|
|
260
|
+
* `DocxEditorPagedArea` calls `getCaretFromDom(scope: 'hf', ...)`.
|
|
261
|
+
* Reviewer estimate: ~30 LOC net deletion + body↔HF parity for free
|
|
262
|
+
* (lineHeight from `.layout-line` ancestor, empty-paragraph fallback
|
|
263
|
+
* via `findBodyEmptyRuns`, etc.). Deferred because it's a multi-file
|
|
264
|
+
* shape change that doesn't affect observable behavior.
|
|
265
|
+
*
|
|
266
|
+
* @public
|
|
267
|
+
*/
|
|
268
|
+
declare function computeHfCaretRectFromView(view: EditorView, doc?: globalThis.Document): {
|
|
269
|
+
top: number;
|
|
270
|
+
left: number;
|
|
271
|
+
height: number;
|
|
272
|
+
} | null;
|
|
273
|
+
/**
|
|
274
|
+
* Selection-rect set for a non-empty HF selection, projected against the
|
|
275
|
+
* painted HF spans. Mirror of `computeSelectionRectsFromDom` but scoped to
|
|
276
|
+
* `.layout-page-header` / `.layout-page-footer` instead of the body. Used
|
|
277
|
+
* so the painter draws a visible highlight when the user drag-selects
|
|
278
|
+
* inside a header/footer in edit mode.
|
|
279
|
+
*
|
|
280
|
+
* Returns viewport-relative `{top, left, width, height}` rects. Empty
|
|
281
|
+
* array when selection is collapsed or no painted spans overlap the range.
|
|
282
|
+
*
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
declare function computeHfSelectionRectsFromView(view: EditorView, doc?: globalThis.Document): Array<{
|
|
286
|
+
top: number;
|
|
287
|
+
left: number;
|
|
288
|
+
width: number;
|
|
289
|
+
height: number;
|
|
290
|
+
}>;
|
|
200
291
|
|
|
201
|
-
export { type ConvertFootnoteOptions as C, FOOTNOTE_SEPARATOR_HEIGHT as F, type HeaderFooterMetrics as H, MAX_FOOTNOTE_LAYOUT_PASSES as M, type StabilizeFootnoteLayoutArgs as S, type ConvertHeaderFooterOptions as a, type MeasureBlocksFn as b, type StabilizeFootnoteLayoutResult as c, buildFootnoteContentMap as d, buildFootnoteRenderItems as e, calculateFootnoteReservedHeights as f, collectFootnoteRefs as g, convertHeaderFooterToContent as h, footnoteReservedHeightsEqual as i, applyFootnotePresentation as j, calculateHeaderFooterVisualBounds as k,
|
|
292
|
+
export { type ConvertFootnoteOptions as C, FOOTNOTE_SEPARATOR_HEIGHT as F, type HeaderFooterMetrics as H, MAX_FOOTNOTE_LAYOUT_PASSES as M, type StabilizeFootnoteLayoutArgs as S, type ConvertHeaderFooterOptions as a, type MeasureBlocksFn as b, type StabilizeFootnoteLayoutResult as c, buildFootnoteContentMap as d, buildFootnoteRenderItems as e, calculateFootnoteReservedHeights as f, collectFootnoteRefs as g, convertHeaderFooterToContent as h, footnoteReservedHeightsEqual as i, applyFootnotePresentation as j, calculateHeaderFooterVisualBounds as k, computeHfCaretRectFromView as l, mapFootnotesToPages as m, computeHfSelectionRectsFromView as n, convertFootnoteToContent as o, convertHeaderFooterPmDocToContent as p, invalidateHfDomCache as q, normalizeHeaderFooterMeasureBlocks as r, stabilizeFootnoteLayout as s, resolveHeaderFooterVisualTop as t };
|