@docx-editor.dev/core 2.21.1 → 2.22.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/README.md +11 -5
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +10 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/{chunk-BF2TOG2V.js → chunk-5RKCJ5DF.js} +1 -1
- package/dist/chunk-65GJRSZ5.cjs +18 -0
- package/dist/chunk-6TBRG6SA.cjs +20 -0
- package/dist/chunk-A72MJGY7.cjs +4 -0
- package/dist/chunk-AZ7QSAXH.js +4 -0
- package/dist/chunk-BL57VQ7E.js +1 -0
- package/dist/chunk-CB6RQ3GD.cjs +11 -0
- package/dist/chunk-GG4IAKFI.js +5 -0
- package/dist/chunk-HJYLFMLX.js +2 -0
- package/dist/chunk-HL6NO7IH.cjs +2 -0
- package/dist/chunk-HZQFGB2X.cjs +5 -0
- package/dist/{chunk-FPDIJ4RF.js → chunk-IWAUA732.js} +1 -1
- package/dist/chunk-OZXBAEWW.js +2 -0
- package/dist/{chunk-4TYA4RLP.cjs → chunk-P5PWSRNW.cjs} +1 -1
- package/dist/{chunk-DZYKU2HG.js → chunk-PD5XKBJA.js} +1 -1
- package/dist/{chunk-7N77EN2Z.cjs → chunk-REMFTPDL.cjs} +1 -1
- package/dist/{chunk-T5B4NMKF.cjs → chunk-RLKX7BIP.cjs} +1 -1
- package/dist/chunk-UGLO2GA5.cjs +1 -0
- package/dist/chunk-UOQONZVQ.js +11 -0
- package/dist/chunk-VD2MWTR6.js +20 -0
- package/dist/chunk-VIXH2OVP.js +1 -0
- package/dist/chunk-W2JIZ5JH.js +18 -0
- package/dist/chunk-W5H62AWM.cjs +1 -0
- package/dist/{chunk-E5OUYRNM.cjs → chunk-X2LJDR53.cjs} +5 -5
- package/dist/chunk-YQXY6TQ3.js +5 -0
- package/dist/{chunk-RA2TDTEQ.cjs → chunk-YYFBYVW4.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +6 -6
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-CncR6KfC.d.ts → custom-node-writes-Ck6eOiJ3.d.ts} +2 -2
- package/dist/{document-protection-DM6mA8Rf.d.ts → document-protection-CMPEonQc.d.ts} +1 -1
- package/dist/{editor-BRh7GuZF.d.ts → editor-BKDVqXyk.d.ts} +70 -49
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +188 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +31 -14
- package/dist/export.js +2 -2
- package/dist/{font-resolver-DwuQYj3P.d.ts → font-resolver-PBc8Vuxs.d.ts} +1 -1
- package/dist/{headless-document-view-C3fc_jV0.d.ts → headless-document-view-9wjJT20Y.d.ts} +2 -2
- package/dist/{image-resources-DxF-SN_8.d.ts → image-resources-B0v-XaTM.d.ts} +2 -2
- package/dist/{index-3pNnG4z4.d.ts → index-DQA53aR1.d.ts} +134 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-_GGjhhVc.d.ts → layout-shaping-Dyr0ZSOI.d.ts} +5 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +376 -33
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CjT31AuP.d.ts → note-properties-D_lmG9xx.d.ts} +1 -1
- package/dist/{omml-equation-Bk3OP1fv.d.ts → omml-equation-CfTm3jOK.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +7 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-CrbTIW2Z.d.ts → protocol-CkVDxyQ3.d.ts} +2 -2
- package/dist/{review-paragraph-order-D3KZohIL.d.ts → review-paragraph-order-BjUs-tDd.d.ts} +1 -1
- package/dist/{revision-projection-kVd7p6Wd.d.ts → revision-projection-DDVBYTIG.d.ts} +1 -1
- package/dist/{semantic-cell-selection-CkSsZHDL.d.ts → semantic-cell-selection-DW6qsmoC.d.ts} +4 -4
- package/dist/{semantic-interaction-Z2Xa68U5.d.ts → semantic-interaction-BNiYSBcB.d.ts} +1 -1
- package/dist/{semantic-paint-BHKprI9P.d.ts → semantic-paint-DE236npp.d.ts} +2 -2
- package/dist/{semantic-records-StH-AnHK.d.ts → semantic-records-C5OeXnaL.d.ts} +545 -569
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +13 -13
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CpEV1gl3.d.ts → tree-package-fragment-DBb97w3F.d.ts} +2 -2
- package/dist/{tree-session-contract-CTT9nM7Z.d.ts → tree-session-contract-BYat3RKx.d.ts} +5 -5
- package/dist/{types-barrel-PwcfEkaX.d.ts → types-barrel-ChGvWjkO.d.ts} +3 -1
- package/package.json +2 -2
- package/dist/chunk-25OQBAKA.js +0 -2
- package/dist/chunk-3B3DQMSL.js +0 -11
- package/dist/chunk-3P3DNJYM.js +0 -5
- package/dist/chunk-3PA64KPK.js +0 -5
- package/dist/chunk-AGWWNVIJ.cjs +0 -1
- package/dist/chunk-DFTVN25X.cjs +0 -5
- package/dist/chunk-DGONGMAV.js +0 -2
- package/dist/chunk-F4H3LC6M.cjs +0 -2
- package/dist/chunk-IUTTOBQW.cjs +0 -20
- package/dist/chunk-IYCXQAFT.cjs +0 -4
- package/dist/chunk-JL3SI5SZ.js +0 -18
- package/dist/chunk-OFWUHH52.js +0 -20
- package/dist/chunk-OKY6JRJL.js +0 -4
- package/dist/chunk-P24FHMQW.cjs +0 -1
- package/dist/chunk-QBKAOSVF.cjs +0 -18
- package/dist/chunk-U5GUJKTS.js +0 -1
- package/dist/chunk-XRYSPKKC.js +0 -1
- package/dist/chunk-ZZRCVDQU.cjs +0 -11
package/dist/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-U5GUJKTS.js';import {z as z$1,B as B$1,A as A$1,c,G as G$1,x,D,r,w,ma,la,oa,g,a as a$1,d as d$3,b as b$2,h}from'./chunk-OKY6JRJL.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-XRYSPKKC.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-XRYSPKKC.js';import {a,z as z$2,j as j$1,b,kc,ia,qc,la as la$2,na,ka,pc,oa as oa$1,ma as ma$1,pa,ja,yb}from'./chunk-JL3SI5SZ.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-FPDIJ4RF.js';import'./chunk-VP7SDFCM.js';import {$a}from'./chunk-3P3DNJYM.js';import {Wf,Xf,jd,id,da,E,Td,la as la$1,le,ma as ma$2}from'./chunk-3B3DQMSL.js';var B=b$2;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof d$3||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof d$3?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=z$2(n.style,n.fontSlot),i=j$1(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!ma(e.shaper,e.environment,l,r,t))return null;let u=la(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=c;function Ye(){if(T)return T;let e=(async()=>(await r(),w(x)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return oa(e,{resolveFont(t){return Xe(e,o,t)},fallback:b()})}async function Ze(e,o){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await G$1(e,t,x,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!z$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=B$1(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=A$1(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await G$1(e,s,x,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a$1=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:i}));return I.set(e,a$1),a$1.catch(()=>{I.get(e)===a$1&&I.delete(e);}),a$1}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),Td(o,n)}function Qe(e,o$1){let t=bt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>g(a))),i=o(t,{maxFontBytes:a$1,aggregateBudget:Rt(n),shadowedRequests:r});if(o$1)for(let a of i.dropped){if(o$1.dropped.length>=B)break;o$1.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===da||t.namespaceUri===""))?.value}async function vt(e$1,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=$a(e$1);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d$1=p.session,m=s,f="active",x=()=>f==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d$1.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d$1.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d$1.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d$1.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l$1=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,c$1),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await l(f,{families:s,defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=e$1(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(D(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l$1,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s$1,p)=>{let d=d$2(s$1,e.stylesRoot(),l,It(s$1,p)),m=v(s$1,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s$1),...m,...s(s$1,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=Wf(e.currentPackage(),o);if(!t)return [];let n=new Set(Xf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=jd(i),l=id(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=ia(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=la$1||d.namespaceUri===da&&d.localName==="p")continue;let F=d.namespaceUri===da&&d.localName==="r"?d.id:m;if(d.namespaceUri===da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";qc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")la$2(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=le(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(na(n),y){let E=ka(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=ka(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&pc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}oa$1(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){ma$1(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&pa(n)&&d.namespaceUri===da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:ma$2(d,x)});}}ja(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===da&&n.localName==="p")){if(n.namespaceUri===da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=a$2(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(yb),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(kc(a??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let a of u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a$1)throw new TypeError(`maxBytes must not exceed ${a$1}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
|
|
2
|
-
export{
|
|
1
|
+
import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-VIXH2OVP.js';import {z as z$1,B,A,c,G,x,D as D$1,r,w as w$1,na,ma,pa,g,a,d as d$3,b as b$1,h,l as l$1,o as o$1,k}from'./chunk-AZ7QSAXH.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-BL57VQ7E.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-BL57VQ7E.js';import {M,_ as _$1,H as H$1,N as N$1,qc,La,wc,Oa,Qa,Na,vc,Ra,Pa,Sa,Ma,Eb}from'./chunk-W2JIZ5JH.js';import {d as d$2,b,a as a$1}from'./chunk-IWAUA732.js';import'./chunk-VP7SDFCM.js';import {ab}from'./chunk-GG4IAKFI.js';import {$f,ag,od,nd,da,E,Yd,la,qe,ma as ma$1}from'./chunk-UOQONZVQ.js';function I(e,t,o){if(t.environment.features.smcp!==1||!/\p{Ll}/u.test(t.text))return o;let n={...t,environment:{...t.environment,features:{...t.environment.features,smcp:0}}},i=e.shape(n);if(o.glyphs.length!==i.glyphs.length||o.glyphs.some((d,f)=>d.id!==i.glyphs[f]?.id))return o;let r=[],s=0;for(let d of t.text){let f=d.toUpperCase()!==d,y=r.at(-1);y&&(y.lower===f||/\p{M}/u.test(d))?y.text+=d:r.push({text:d,start:s,lower:f}),s+=d.length;}let a=[],u=[],p=[],l=true,x=0;for(let d of t.environment.direction==="rtl"?r.reverse():r){let f=d.lower?.8:1,y=[],b=[],E="",c=d.start;for(let R of d.text){let h=d.lower?R.toUpperCase():R;for(let F=0;F<h.length;F++)y.push(c),b.push(c+R.length);E+=h,c+=R.length;}let m=e.shape({...n,text:E}),g=a.length;for(let[R,h]of m.glyphs.entries()){let F=m.exactAdvancesX?.[R];F===void 0?l=false:p.push(F*f),a.push({...h,cluster:y[h.cluster]??d.start,originX:k(x+Math.round(h.originX*f)),originY:k(Math.round(h.originY*f)),offsetX:k(Math.round(h.offsetX*f)),offsetY:k(Math.round(h.offsetY*f)),advanceX:k(Math.round(h.advanceX*f)),advanceY:k(Math.round(h.advanceY*f)),drawScale:f});}for(let R of m.clusters){let h=y[R.textStart]??d.start,F=b[R.textEnd-1]??c,L=k(Math.round(R.advance*f)),A=u.at(-1);A&&A.textStart===h&&A.textEnd===F?u[u.length-1]={...A,glyphEnd:g+R.glyphEnd,advance:k(A.advance+L),caretEdges:[k(0),k(A.advance+L)]}:u.push({...R,textStart:h,textEnd:F,glyphStart:g+R.glyphStart,glyphEnd:g+R.glyphEnd,advance:L,caretEdges:R.caretEdges.map(V=>k(Math.round(V*f))),fontSpan:0});}x+=m.glyphs.reduce((R,h)=>R+Math.round(h.advanceX*f),0);}return {...o,glyphs:a,clusters:u,fontSpans:[{...o.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function kt(e){let t=nt.get(e);return t===void 0&&(t=_t(e.bytes,e.faceIndex),nt.set(e,t)),t}var It=new Set(["COLR","CBDT","sbix"]),Nt=512;function _t(e,t){let o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let r=o.getUint32(8);if(t<0||t>=r||12+4*t+4>e.byteLength||(n=o.getUint32(12+4*t),n+12>e.byteLength))return false}let i=Math.min(o.getUint16(n+4),Nt);for(let r=0;r<i;r++){let s=n+12+r*16;if(s+4>e.byteLength)return false;if(It.has(rt(e,s)))return true}return false}function rt(e,t){return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])}var Mt=/\p{Emoji_Presentation}|️/u;function Ct(e){return Mt.test(e)}function q(e,t){if(e.length<2)return e;let o=e.filter(kt);if(o.length===0||o.length===e.length)return e;let n=e.filter(i=>!o.includes(i));return Ct(t)?[...o,...n]:[...n,...o]}var Ut=2048;function it(e,t,o,n){if(!o.clusters.length||o.clusters.length>Ut)return null;let i=(c,m)=>{let g={...t,text:m,environment:l$1({...t.environment,font:c})};return I(e,g,e.shape(g))},r=[],s=new Map;for(let c of [...o.clusters].sort((m,g)=>m.textStart-g.textStart)){let m=t.environment.font,g=t.text.slice(c.textStart,c.textEnd),R=r.at(-1);if(/^[\uFE0E\uFE0F]$/.test(g)&&R&&R.end===c.textStart){R.end=c.textEnd;continue}if(o.glyphs.slice(c.glyphStart,c.glyphEnd).some(F=>F.id===0)){let F=t.text.slice(c.textStart,c.textEnd+1),L=s.get(g)??q(n,F).find(A=>{try{return !i(A,g).glyphs.some(V=>V.id===0)}catch{return false}});if(!L)return null;s.set(g,L),m=L;}let h=r.at(-1);h&&h.font===m&&h.end===c.textStart?h.end=c.textEnd:r.push({start:c.textStart,end:c.textEnd,font:m});}let a=[],u=[],p=[],l=[],x=true,d=0,f=0,y=0,b=0,E=0;for(let c of t.environment.direction==="rtl"?r.reverse():r){let m=i(c.font,t.text.slice(c.start,c.end));if(m.glyphs.some(h=>h.id===0))return null;let g=a.length,R=p.length;for(let h of m.glyphs)a.push({...h,cluster:c.start+h.cluster,originX:k(d+h.originX),originY:k(f+h.originY)});if(m.exactAdvancesX===void 0)x=false;else for(let h of m.exactAdvancesX)l.push(h);for(let h of m.clusters)u.push({...h,textStart:c.start+h.textStart,textEnd:c.start+h.textEnd,glyphStart:g+h.glyphStart,glyphEnd:g+h.glyphEnd,fontSpan:R});m.glyphs.length&&p.push({font:c.font,glyphStart:g,glyphEnd:a.length,fallbackIndex:c.font===t.environment.font?null:n.indexOf(c.font)}),d+=m.glyphs.reduce((h,F)=>h+F.advanceX,0),f+=m.glyphs.reduce((h,F)=>h+F.advanceY,0),y=Math.max(y,m.metrics.ascent),b=Math.max(b,m.metrics.descent),E=Math.max(E,m.metrics.lineGap);}return o$1({...o,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:x&&l.length===a.length?l:void 0,metrics:{ascent:k(y),descent:k(b),lineGap:k(E)}},{...t.environment,fallbackOrder:n})}function J(e,t,o){if(!t.text.includes("\u2011"))return o;let n=new Set(o.glyphs.filter(r=>r.id===0).map(r=>r.cluster));if(!n.size)return o;let i=t.text.replace(/\u2011/g,(r,s)=>n.has(s)?"-":r);if(i===t.text)return o;try{let r=e.shape({...t,text:i});return o$1({...r,text:t.text},t.environment)}catch{return o}}function at(e,t){if(t.length===0)return e;if(t.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let o=t.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$3)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},i=new WeakMap,r={shape(a){let u=e.shaper.shape(a),p=i.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return i.set(u,{input:a,run:l}),l}},s=(a,u)=>{let p=I(n,a,u);if(!p.glyphs.some(l=>l.id===0)||/^[\t\n\r\f]*$/.test(a.text))return p;if(/^(Latn|Cyrl|Grek|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,o);if(l)return l}for(let l of q(o,a.text))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let x={...a,environment:l$1({...a.environment,font:l})},d=I(n,x,n.shape(x));if(!d.glyphs.some(f=>f.id===0))return d}catch{}return p};return {...e,shaper:r}}var Q=b$1;function ee(e){return typeof e.admittedFontFace=="function"}var Bt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var st=new WeakMap;function j(e){let t=st.get(e);return t||st.set(e,t=qt(e)),t}function qt(e){let t=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:t?Object.freeze({requested:z(t.requested),resolved:z(t.resolved),...t.lineMetrics?{lineMetrics:Object.freeze({...t.lineMetrics})}:{}}):null})}function zt(e){return Object.freeze({...j(e),bytes:h(e)})}function jt(e,t){if(!e)return null;try{let o=e(t);return !o||o instanceof d$3?null:zt(o)}catch{return null}}function lt(e){return t=>{if(e.status()!=="active")throw e.unavailable();return jt(e.resolve(),t)}}function Ht(e){return Object.freeze(e.slice(0,Q).map(t=>Object.freeze({request:z(t.request),partName:t.partName,reason:t.reason})))}function te(e,t,o,n,i=[]){let r=new Map;for(let a of [...e,t]){let u=a.toLowerCase();r.has(u)||r.set(u,a);}let s=[...r.values()].map(a=>{let u=[];for(let p of Bt){let l=n?.({family:a,...p});!l||l instanceof d$3||u.push(Object.freeze({...p,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:a,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:t,families:Object.freeze(s),originFailures:Object.freeze([...o]),droppedEmbeddedFonts:Ht(i)})}function oe(e,t){if(t.onFontResolution){try{let o=t.onFontResolution(e);Promise.resolve(o).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(o){console.warn("[fonts] font-resolution diagnostics callback failed",o);}return}for(let o of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",o);for(let o of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",o);}function ne(e,t){if(t.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let o=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${o?`; incomplete families: ${o}`:"; a font origin failed"}`)}function H(){return new Map}function re(e,t,o,n){if(o.trim().length===0)return null;let i={family:o,weight:n.bold?700:400,style:n.italic?"italic":"normal"},r=g(i),s=t.get(r);if(!s){try{s=e.fonts.resolve(i);}catch{return null}t.set(r,s);}return s instanceof d$3?null:s}function dt(e,t,o){let n=o.fontFamily??e.defaultFont.family;return re(e,t,n,o)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let t=H(),o=new WeakMap;return n=>{let i=_$1(n.style,n.fontSlot),r=H$1(n.text,i);if(r.length===0)return null;let s=i.fontFamily??e.defaultFont.family,a=re(e,t,s,i);if(!a)return null;try{if(i.smallCaps&&!na(e.shaper,e.environment,a,i,o))return null;let u=ma(e.shaper,e.environment,a,i,r);return Object.freeze({run:u,font:j(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>j(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function ut(e){return t=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(t)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ct=c;function pt(){if(_)return _;let e=(async()=>(await r(),w$1(x)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function ft(e){let t=H();return pa(e,{resolveFont(o){return dt(e,t,o)},fallback:N$1()})}async function mt(e,t,o=[],n=false){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let i=await pt(),r=at(await G(e,i,x,t,n),o);return Object.freeze({createMeasurer:()=>ft(r),resolveFont:s=>r.fonts.resolve(s),shapeLaidOutText:ae(r),producer:["node-export-session",JSON.stringify(o),e.fingerprint,r.operation.shapingHash,`producer:${r.operation.producerVersion}`,`fallback:${M}`].join("|"),extensionFingerprint:e.fingerprint})}function Xt(e,t){if(!z$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let o=X.get(e);if(o)return o;let n=B(e),i=N.get(n);if(!i){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));i=(async()=>{let u=A(e).sources.reduce((l,x)=>l+(x.availability==="forbidden"?0:x.bytes.byteLength),0);if(se+u>ct)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ct} process-wide`);se+=u;let p;try{let l=await pt();p=await G(e,l,x,t);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>ft(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,i),i.catch(()=>{N.get(n)===i&&N.delete(n);});}let r=e.fingerprint,s=i.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",r,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${M}`].join("|"),extensionFingerprint:r}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Vt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Gt(e){let t=e.currentPackage(),o=(t.relationships.get(t.mainDocumentPart)??[]).find(i=>i.type===Vt),n;if(o){let i=E(o);i.mode==="Internal"&&i.target.ok&&(n=t.parts.get(i.target.partName));}return n??=t.parts.get("/word/fontTable.xml"),Yd(t,n)}function ht(e,t){let o$1=Gt(e);if(o$1.length!==0)return i(n=>{let i=new Set((n.resolvedFaces??[]).map(s=>g(s))),r=o(o$1,{maxFontBytes:a,aggregateBudget:Wt(n),shadowedRequests:i});if(t)for(let s of r.dropped){if(t.dropped.length>=Q)break;t.dropped.push(s);}return {sources:r.sources}})}function Wt(e){let t=e.committedSourceBytes;return t===void 0||!Number.isSafeInteger(t)||t<=0?c:Math.max(0,c-t)}function Yt(e){return ee(e)&&ie(e)}var w=0,yt=Symbol("font-resolution-timeout");function $t(e){let t=0,o=false;return e?.(w),{reserve:i=>{if(o)throw new Error("Document font-byte lease is already released");if(w+i>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${i} bytes with ${w} bytes already active`);w+=i,t+=i,e?.(w);let r=false;return ()=>{r||o||(r=true,w-=i,t-=i,e?.(w));}},release:()=>{o||(o=true,w-=t,t=0,e?.(w));}}}function ue(e,t){return e.attributes.find(o=>o.localName===t)?.value}function Kt(e,t){return e.attributes.find(o=>o.localName===t&&(o.namespaceUri===da||o.namespaceUri===""))?.value}async function Zt(e$1,t){if(t.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(t.signal?.aborted)return {ok:false,reason:"aborted"};let o=ab(e$1);if(!o.ok)return o;let{fonts:n,lastResortFonts:i,fontResolutionTimeoutMs:r,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=t,x=Array.isArray(n)?n:[n],d$1=i===void 0?[]:Array.isArray(i)?i:[i],f,y;try{y=await Jt(o.view,x,{signal:t.signal,timeoutMs:r??t.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d$1,onFontResolution:F=>(f=F,a?.(F))});}catch(F){if(F instanceof d&&F.code==="aborted")return {ok:false,reason:"aborted"};throw F}if(!f)throw y?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let b;try{b=e(o.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:t.producer??y.producer}:t.producer?{producer:t.producer}:{}});}catch(F){throw y?.dispose(),F}if(!b.ok)return y?.dispose(),b;let E=b.session,c=y,m="active",g=()=>m==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),R=F=>{if(m==="active"){m=F,t.signal?.removeEventListener("abort",h);try{E.dispose();}finally{c?.dispose(),c=void 0;}}},h=()=>R("aborted");return t.signal?.addEventListener("abort",h,{once:true}),t.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:f,layout:()=>m==="active"?E.layout():Promise.reject(g()),layoutFor:F=>m==="active"?E.layoutFor(F):Promise.reject(g()),validatedImageBytes:F=>m==="active"?E.validatedImageBytes(F):null,admittedFontFace:lt({status:()=>m,unavailable:g,resolve:()=>c?.resolveFont}),shapeLaidOutText:ut({status:()=>m,unavailable:g,shaping:()=>c}),dispose:()=>R("disposed")})}}async function Jt(e,t,o={}){if((o.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=Qt(o.timeoutMs),i=new AbortController,r=()=>i.abort(o.signal?.reason);o.signal?.addEventListener("abort",r,{once:true}),o.signal?.aborted&&r();let s=setTimeout(()=>i.abort(yt),n);try{de(i.signal);let a=(async()=>{let u=$t(o.onActiveFontBytesChange),p=!1;try{let l$1=to(e).slice(0,c$1),x=[],d={dropped:[]},f=ht(e,d),y=[...t,...f?[f]:[],...o.lastResortFonts??[]],b=await l(y,{families:[...new Set([...(o.glyphFallbacks??[]).map(g=>g.family),...l$1])].slice(0,c$1),defaultFamily:d$1.family,signal:i.signal},{onOriginFailure:g=>x.push(g),reserveOwnedBytes:u.reserve});de(i.signal);let E=e$1(b??{});if(E.sources.length===0){let g=te(l$1,E.defaultFont.family,x,void 0,d.dropped);oe(g,o),ne(g,o);return}let c=await mt(D$1(E),void 0,o.glyphFallbacks,o.documentLigatures);de(i.signal);let m=te(l$1,E.defaultFont.family,x,c.resolveFont,d.dropped);return oe(m,o),ne(m,o),p=!0,Object.freeze({...c,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,eo(i.signal)])}finally{clearTimeout(s),o.signal?.removeEventListener("abort",r);}}function Qt(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function eo(e){return new Promise((t,o)=>{let n=()=>{o(xt(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function xt(e){let t=e.reason===yt;return new d(t?"timedOut":"aborted",t?"Font resolution timed out":"Font resolution was aborted",t?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw xt(e)}function to(e){let t=[e.part().root],o=[],n=[],i=new Set([e.part().name]),r=(l,x)=>{!x||i.has(x.name)||(i.add(x.name),l.push(x.root));};for(let l of e.headerFooterPartsBySection()){for(let x of l.headers.values())r(o,x);for(let x of l.footers.values())r(o,x);}for(let l of ["footnote","endnote"])n.push(...oo(e,l));let s$1=e.documentThemeFonts(),a={...s$1,major:s$1.major,minor:s$1.minor,majorEastAsia:s$1.majorEastAsia??null,minorEastAsia:s$1.minorEastAsia??null},u=new Map,p=(l,x)=>{let d=d$2(l,e.stylesRoot(),a,ro(l,x)),f=v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...so(l),...f,...s(l,e.stylesRoot(),a),...d.inherited]){let b=y.toLowerCase();u.has(b)||u.set(b,y);}};return p(t,"body"),p(o,"furniture"),p(n,"note"),[...u.values()]}function oo(e,t){let o=$f(e.currentPackage(),t);if(!o)return [];let n=new Set(ag(e.part()).filter(r=>r.noteKind===t).map(r=>r.noteId)),i=[];for(let r of o.root.children){if(r.kind==="textValue")continue;let s=od(r),a=nd(r);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&i.push(r);}return i}var no="http://schemas.openxmlformats.org/officeDocument/2006/math";function ro(e,t){let o=new Set;for(let n of e){let i=[],r=[{node:n,context:t}];for(;r.length>0;){let{node:s,context:a}=r.pop();s.namespaceUri===da&&s.localName==="p"&&i.push({paragraph:s,context:a});let u=s.namespaceUri===da&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let p=s.children.length-1;p>=0;p-=1){let l=s.children[p];l.kind!=="textValue"&&r.push({node:l,context:u});}}for(let s of i)io(s.paragraph,o,s.context);}return o}function io(e,t,o){let n=La(),i=null,r=null,s="",a=false,u=false,p=false,l=0,x=[];for(let d=e.children.length-1;d>=0;d-=1){let f=e.children[d];f.kind!=="textValue"&&x.push({node:f,runId:null,visibility:D,containerDepth:0});}for(;x.length>0;){let{node:d,runId:f,visibility:y,containerDepth:b}=x.pop();if(b>=la||d.namespaceUri===da&&d.localName==="p")continue;let E=d.namespaceUri===da&&d.localName==="r"?d.id:f;if(d.namespaceUri===da&&d.localName==="fldSimple"){let c=ue(d,"instr")??"";wc(c,{allowPageFields:o==="body"||o==="furniture",allowRefFields:o==="body"||o==="note",allowPageRef:o==="body",allowAutonum:o==="body"||o==="note"})&&ao(d)!==D&&t.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let c=ue(d,"fldCharType");if(c==="begin")Oa(n),n.nesting===1&&(i=E,r=null,s="",a=false,u=false,p=qe(d),l=0);else if(c==="separate"){let m=n.nesting===1;if(Qa(n),m){let g=Na(n);s=g.instruction,a=g.overflow||n.nestingOverflow,r=E,u=true;}}else if(c==="end"){if(n.nesting===1){if(n.phase==="instruction"){let g=Na(n);s=g.instruction,a=g.overflow||n.nestingOverflow;}if(!a&&vc(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:o==="body"||o==="furniture",allowRefFields:o==="body"||o==="note",allowPageRef:o==="body",allowAutonum:o==="body"||o==="note"})&&l!==D){let g=r??i;g&&t.add(g);}}Ra(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){Pa(n,bt(d),d.localName==="delInstrText");continue}n.nesting>0&&Sa(n)&&d.namespaceUri===da&>(d)&&(l|=y);for(let c=d.children.length-1;c>=0;c-=1){let m=d.children[c];m.kind!=="textValue"&&x.push({node:m,runId:E,visibility:y&Rt(d),containerDepth:ma$1(d,b)});}}Ma(n);}function gt(e){return e.localName==="t"||e.localName==="delText"?bt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,Ft=2,Et=4,D=ce|Ft|Et;function ao(e){let t=[];for(let n of e.children)n.kind!=="textValue"&&t.push({node:n,visibility:D});let o=0;for(;t.length>0;){let{node:n,visibility:i}=t.pop();if(!(n.namespaceUri===da&&n.localName==="p")){if(n.namespaceUri===da&>(n)&&(o|=i,o===D))return o;for(let r of n.children)r.kind!=="textValue"&&t.push({node:r,visibility:i&Rt(n)});}}return o}function Rt(e){return e.namespaceUri!==da?D:e.localName==="ins"||e.localName==="moveTo"?ce|Ft:e.localName==="del"||e.localName==="moveFrom"?ce|Et:D}function so(e){let t=new Map,o=n=>{let i=a$1(n??void 0);if(i===null)return;let r=i.toLowerCase();t.has(r)||t.set(r,i);};for(let n of e){let i=[n];for(;i.length>0;){let r=i.pop();if(r.namespaceUri===no&&o(Eb),r.namespaceUri===da&&r.localName==="sym"&&o(b(Kt(r,"font"))),r.namespaceUri===da&&r.localName==="fldSimple"){let s=ue(r,"instr");o(qc(s??"")?.font??null);}if(r.namespaceUri===da&&r.localName==="p")for(let s of u(r))o(s);for(let s=r.children.length-1;s>=0;s-=1){let a=r.children[s];a.kind!=="textValue"&&i.push(a);}}}return [...t.values()]}function bt(e){let t="",o=[...e.children].reverse();for(;o.length>0&&t.length<=256;){let n=o.pop();if(n.kind==="textValue")t+=n.value;else for(let i=n.children.length-1;i>=0;i-=1)o.push(n.children[i]);}return t}var vt="FILE_TOO_LARGE",St=8;function lo(e){return typeof e=="object"&&e!==null}function wt(e){if(!(!lo(e)||typeof e.code!="string"))return e.code}function At(e){return e===""||e.toLowerCase()==="localhost"}function uo(e){try{let t=decodeURIComponent(e);return t.includes("\0")?null:t}catch{return null}}function Tt(e){let t=uo(e);if(t===null)return null;let o=[];for(let n of t.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(o.length===0)return null;o.pop();continue}o.push(n);}return `/${o.join("/")}`}function Lt(e){let t=Tt(e);return t===null?null:t.endsWith("/")?t:`${t}/`}function co(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function po(e){let t;try{t=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(t.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(t.username!==""||t.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!At(t.host))throw new TypeError("trustedRoot must be a local file: URL");let o=Lt(t.pathname);if(o===null||co(o))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=o,n}function fo(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function mo(e){let t=fo(e);if(t.length===0)throw new TypeError("trustedRoot must name at least one directory");if(t.length>St)throw new TypeError(`trustedRoot must not exceed ${St} directories`);return t.map(po)}function ho(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function yo(e,t){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!At(e.host))return null;let o=Tt(e.pathname);if(o===null)return null;for(let n of t){let i=Lt(n.pathname);if(i===null||!o.startsWith(i)||o.length<=i.length)continue;let r=new URL("file:///");return r.pathname=o,r}return null}function xo(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function go(e,t,o){let n=o.relative(o.resolve(e),o.resolve(t));return n!==""&&!n.startsWith("..")&&!o.isAbsolute(n)}function Ot(e,t,o){return e.some(n=>go(n,t,o))}async function Fo(e,t){let o=[];for(let n of e)try{o.push(await t(n));}catch(i){if(wt(i)==="ENOENT")continue;throw i}return o}function Eo(e){return async(t,{signal:o,maxBytes:n})=>{if(o?.aborted)throw o.reason;let[{open:i,realpath:r},{constants:s},{fileURLToPath:a},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),p=e.map(y=>u.resolve(a(y.href))),l=u.resolve(a(typeof t=="string"?t:t.href));if(!Ot(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await i(l,x),f=()=>{d.close();};o?.addEventListener("abort",f,{once:true});try{if(o?.aborted)throw o.reason;let y=await r(l);if(!Ot(await Fo(p,r),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let b=(await d.stat()).size;if(!Number.isSafeInteger(b)||b<0||b>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:vt});let E=new Uint8Array(b),c=0;for(;c<E.byteLength;){if(o?.aborted)throw o.reason;let{bytesRead:m}=await d.read(E,c,E.byteLength-c,c);if(m===0)break;c+=m;}if(o?.aborted)throw o.reason;return c===E.byteLength?E:E.slice(0,c)}catch(y){throw o?.aborted?o.reason:y}finally{o?.removeEventListener("abort",f),await d.close().catch(()=>{});}}}function Ro(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let t=mo(e.trustedRoot),o=ho(e.maxBytes),n=e.read??Eo(t),i=e.networkFetch??fetch;return(async(r,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=xo(r);if(u.protocol!=="file:")return i(u,s);let p=yo(u,t);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,x=()=>l?.abort(a?.reason);a?.addEventListener("abort",x,{once:true});let d;try{if(d=await n(p,{maxBytes:o,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>o)return new Response(null,{status:413})}catch(f){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??f;if(f instanceof DOMException&&f.name==="AbortError"||f instanceof Error&&f.name==="AbortError")throw f;let y=wt(f);if(y===vt)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw f}finally{a?.removeEventListener("abort",x);}return new Response(d,{status:200})})}
|
|
2
|
+
export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,Xt as acquireSharedExportShaping,Ro as createPackagedFileFetch,ee as hasExportAdmittedFont,ie as hasExportLaidOutText,Yt as hasFontBackedExportCapabilities,Zt as openFontBackedDocumentForExport};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-
|
|
1
|
+
import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-BKDVqXyk.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A partial font configuration one origin contributes: sources, substitutions, or both.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as HeaderFooterParts, e as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-
|
|
2
|
-
import { j as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-
|
|
1
|
+
import { d as HeaderFooterParts, e as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-DBb97w3F.js';
|
|
2
|
+
import { j as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-ChGvWjkO.js';
|
|
3
3
|
|
|
4
4
|
/** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
|
|
5
5
|
interface EnsuredHyperlinkRelationship {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as DrawingProjection, j as OoxmlPackage } from './types-barrel-
|
|
1
|
+
import { a4 as DrawingProjection, j as OoxmlPackage } from './types-barrel-ChGvWjkO.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|
|
@@ -207,4 +207,4 @@ declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageR
|
|
|
207
207
|
/** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
|
|
208
208
|
declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
|
|
209
209
|
|
|
210
|
-
export { type CreateImageResourceCacheOptions as C, DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, type
|
|
210
|
+
export { type CreateImageResourceCacheOptions as C, DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, type ImageDecodePort as I, MAX_SVG_SNIFF_BYTES as M, type PreservedImageMime as P, type RenderableImageMime as R, type SupportedImageMime as S, type ValidatedImageBytesHandle as V, type ImageResourceLimits as a, type ImageResourceState as b, type VectorImageMime as c, resolveSvgIntrinsicSize as d, type ResourceLimits as e, DEFAULT_LIMITS as f, IMAGE_RESOURCE_HARD_CEILINGS as g, type ImageResourceLookup as h, type ValidatedRasterHeader as i, createImageResourceCache as j, hasBoundedSvgRoot as k, imageResourceLookupFor as l, liveDrawingReferenceCount as m, resolveLimits as n, validateGifHeader as o, validateJpegHeader as p, validatePngHeader as q, resolveImageResourceLimits as r, sniffImageMime as s, validateRasterHeader as v };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { W as TreeDocOp, cl as TextFormFieldRange, ck as TextFormFieldOptions,
|
|
2
|
-
import {
|
|
3
|
-
import './document-protection-
|
|
1
|
+
import { W as TreeDocOp, cl as TextFormFieldRange, ck as TextFormFieldOptions, ah as Unsubscribe, ab as DrawingPositionInput, aJ as DrawingTransform, E as ExecResult, G as ParagraphTabStop, A as IndentFormatting, F as ParagraphFlags, ao as ParagraphDisagreements, aB as DrawingTreeDocOp, ag as SelectionPin, j as OoxmlPackage, g as ReviewRevisionKind, aa as ImageWrapTarget } from './types-barrel-ChGvWjkO.js';
|
|
2
|
+
import { I as ImageDecodePort, S as SupportedImageMime } from './image-resources-B0v-XaTM.js';
|
|
3
|
+
import './document-protection-CMPEonQc.js';
|
|
4
4
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, n as Editor, e as EditorCommand, C as CanResult, S as SelectedImageState, o as FormatPainterSurfaceState, h as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, t as TableContext } from './editor-
|
|
6
|
-
import { R as ReviewDisplayMode } from './revision-projection-
|
|
7
|
-
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-
|
|
8
|
-
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-
|
|
5
|
+
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, n as Editor, e as EditorCommand, C as CanResult, S as SelectedImageState, o as FormatPainterSurfaceState, h as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, t as TableContext } from './editor-BKDVqXyk.js';
|
|
6
|
+
import { R as ReviewDisplayMode } from './revision-projection-DDVBYTIG.js';
|
|
7
|
+
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-BNiYSBcB.js';
|
|
8
|
+
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-PBc8Vuxs.js';
|
|
9
9
|
import { EditorCollaborationSession, CollaborationRemoteSelection, CollaborationModuleContribution } from './collaboration.js';
|
|
10
|
-
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-
|
|
11
|
-
import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-
|
|
12
|
-
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-
|
|
13
|
-
import { B as BookmarkIndex } from './custom-node-writes-
|
|
14
|
-
import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-fragment-
|
|
15
|
-
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-
|
|
16
|
-
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-
|
|
10
|
+
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-DE236npp.js';
|
|
11
|
+
import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-D_lmG9xx.js';
|
|
12
|
+
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-C5OeXnaL.js';
|
|
13
|
+
import { B as BookmarkIndex } from './custom-node-writes-Ck6eOiJ3.js';
|
|
14
|
+
import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-fragment-DBb97w3F.js';
|
|
15
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-DW6qsmoC.js';
|
|
16
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-BYat3RKx.js';
|
|
17
17
|
import { C as CollaborationStatus } from './failure-DNNmwsgD.js';
|
|
18
18
|
import { V as ViewScope, b as EditorExecOptions } from './editor-scope-OHPwVQ5l.js';
|
|
19
19
|
import './contracts/document.js';
|
|
@@ -2415,6 +2415,10 @@ type ChromeControlState =
|
|
|
2415
2415
|
*/
|
|
2416
2416
|
| {
|
|
2417
2417
|
readonly kind: 'load';
|
|
2418
|
+
}
|
|
2419
|
+
/** Host conversion through `runChromeExport` or `runChromePrint`; not an editing command. */
|
|
2420
|
+
| {
|
|
2421
|
+
readonly kind: 'export';
|
|
2418
2422
|
};
|
|
2419
2423
|
/**
|
|
2420
2424
|
* The SHAPE a control renders as (task M6V.1).
|
|
@@ -2997,6 +3001,27 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2997
3001
|
readonly state: {
|
|
2998
3002
|
readonly kind: "save";
|
|
2999
3003
|
};
|
|
3004
|
+
}, {
|
|
3005
|
+
readonly id: "exportMarkdown";
|
|
3006
|
+
readonly labelKey: "toolbar.exportMarkdown";
|
|
3007
|
+
readonly paths: readonly string[];
|
|
3008
|
+
readonly state: {
|
|
3009
|
+
readonly kind: "export";
|
|
3010
|
+
};
|
|
3011
|
+
}, {
|
|
3012
|
+
readonly id: "exportPdf";
|
|
3013
|
+
readonly labelKey: "toolbar.exportPdf";
|
|
3014
|
+
readonly paths: readonly string[];
|
|
3015
|
+
readonly state: {
|
|
3016
|
+
readonly kind: "export";
|
|
3017
|
+
};
|
|
3018
|
+
}, {
|
|
3019
|
+
readonly id: "print";
|
|
3020
|
+
readonly labelKey: "toolbar.print";
|
|
3021
|
+
readonly paths: readonly string[];
|
|
3022
|
+
readonly state: {
|
|
3023
|
+
readonly kind: "export";
|
|
3024
|
+
};
|
|
3000
3025
|
}, {
|
|
3001
3026
|
readonly id: "pageSetup";
|
|
3002
3027
|
readonly labelKey: "toolbar.pageSetup";
|
|
@@ -3095,7 +3120,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
|
|
|
3095
3120
|
*
|
|
3096
3121
|
* @public
|
|
3097
3122
|
*/
|
|
3098
|
-
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.comments' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
3123
|
+
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.comments' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
3099
3124
|
/**
|
|
3100
3125
|
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
3101
3126
|
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
@@ -3529,4 +3554,97 @@ interface HistoryGroupBinding {
|
|
|
3529
3554
|
*/
|
|
3530
3555
|
declare function bindHistoryGroup(editor: Editor, element: HTMLElement, config: HistoryGroupBindingOptions): HistoryGroupBinding;
|
|
3531
3556
|
|
|
3532
|
-
|
|
3557
|
+
/** File menu conversion formats. @public */
|
|
3558
|
+
type ChromeExportFormat = 'markdown' | 'pdf';
|
|
3559
|
+
/**
|
|
3560
|
+
* Conversion handlers for File > Export. Install the corresponding converter package.
|
|
3561
|
+
* Use `exportMarkdown` for Markdown. PDF requires `exportPdf` on a Node.js server.
|
|
3562
|
+
* Browser hosts supply a PDF handler that calls that server after the user selects Export.
|
|
3563
|
+
* @public
|
|
3564
|
+
*/
|
|
3565
|
+
interface ChromeExportHandlers {
|
|
3566
|
+
/** Returns continuous document Markdown. Page output is not downloaded. */
|
|
3567
|
+
readonly markdown?: (source: Uint8Array) => Promise<{
|
|
3568
|
+
readonly markdown: string;
|
|
3569
|
+
}>;
|
|
3570
|
+
/** Returns PDF bytes from `@docx-editor.dev/docx-to-pdf` on Node.js. */
|
|
3571
|
+
readonly pdf?: (source: Uint8Array) => Promise<{
|
|
3572
|
+
readonly bytes: Uint8Array;
|
|
3573
|
+
}>;
|
|
3574
|
+
}
|
|
3575
|
+
/** Download data from a completed conversion. @public */
|
|
3576
|
+
interface ChromeExportResult {
|
|
3577
|
+
readonly bytes: Uint8Array;
|
|
3578
|
+
readonly extension: 'md' | 'pdf';
|
|
3579
|
+
readonly mimeType: string;
|
|
3580
|
+
}
|
|
3581
|
+
/** An export has no configured converter. @public */
|
|
3582
|
+
declare class ChromeExportError extends Error {
|
|
3583
|
+
readonly format: ChromeExportFormat;
|
|
3584
|
+
readonly code = "missing-exporter";
|
|
3585
|
+
constructor(format: ChromeExportFormat);
|
|
3586
|
+
}
|
|
3587
|
+
/**
|
|
3588
|
+
* Saves the current document and converts those bytes through the configured handler.
|
|
3589
|
+
* Missing handlers fail before saving. Conversion never changes the editor document.
|
|
3590
|
+
* @public
|
|
3591
|
+
*/
|
|
3592
|
+
declare function runChromeExport(editor: Pick<Editor, 'save'>, format: ChromeExportFormat, handlers?: ChromeExportHandlers): Promise<ChromeExportResult>;
|
|
3593
|
+
|
|
3594
|
+
/** Why the browser could not print the converted PDF. @public */
|
|
3595
|
+
type ChromePrintErrorCode = 'pdf-viewer-unavailable' | 'pdf-load-failed' | 'print-refused' | 'print-ended';
|
|
3596
|
+
/**
|
|
3597
|
+
* The browser could not print the converted PDF. The PDF at `ChromePrintJob.url` is still
|
|
3598
|
+
* available, so the user can open it and print from the PDF viewer.
|
|
3599
|
+
* @public
|
|
3600
|
+
*/
|
|
3601
|
+
declare class ChromePrintError extends Error {
|
|
3602
|
+
/** Why the browser could not print. */
|
|
3603
|
+
readonly code: ChromePrintErrorCode;
|
|
3604
|
+
constructor(code: ChromePrintErrorCode);
|
|
3605
|
+
}
|
|
3606
|
+
/**
|
|
3607
|
+
* True for the print shortcut: Cmd+P on Apple platforms, Ctrl+P elsewhere. On macOS,
|
|
3608
|
+
* Ctrl+P moves the caret to the previous line, so it is not a print shortcut there. The P
|
|
3609
|
+
* key matches by `code` too when it types no Latin letter, as on Cyrillic or Hebrew layouts.
|
|
3610
|
+
* @public
|
|
3611
|
+
*/
|
|
3612
|
+
declare function isChromePrintShortcut(event: KeyboardEvent): boolean;
|
|
3613
|
+
/** Options for `ChromePrintJob.print`. @public */
|
|
3614
|
+
interface ChromePrintOptions {
|
|
3615
|
+
/**
|
|
3616
|
+
* Runs after the PDF loads and before the print dialog opens. Close any modal dialog
|
|
3617
|
+
* here: a modal dialog makes the rest of the page, including the print frame, inert.
|
|
3618
|
+
*/
|
|
3619
|
+
readonly beforePrint?: () => void | Promise<void>;
|
|
3620
|
+
}
|
|
3621
|
+
/**
|
|
3622
|
+
* A converted PDF, ready for the browser print dialog.
|
|
3623
|
+
* Call `dispose()` when the job ends: it removes the print frame and revokes `url`.
|
|
3624
|
+
* @public
|
|
3625
|
+
*/
|
|
3626
|
+
interface ChromePrintJob {
|
|
3627
|
+
/** An object URL for the PDF. It stays valid until `dispose()`. */
|
|
3628
|
+
readonly url: string;
|
|
3629
|
+
/**
|
|
3630
|
+
* Opens the browser print dialog for the PDF from a hidden frame.
|
|
3631
|
+
* Rejects with `ChromePrintError` when the browser has no PDF viewer, the frame cannot
|
|
3632
|
+
* load the PDF, or the job has ended. A browser without a PDF viewer would download the
|
|
3633
|
+
* PDF instead of loading it, so the frame is not created in that case.
|
|
3634
|
+
*/
|
|
3635
|
+
print(options?: ChromePrintOptions): Promise<void>;
|
|
3636
|
+
/** Removes the print frame and revokes `url`. Later `print()` calls reject. */
|
|
3637
|
+
dispose(): void;
|
|
3638
|
+
}
|
|
3639
|
+
/**
|
|
3640
|
+
* Saves the current document, converts it with the configured PDF handler, and prepares
|
|
3641
|
+
* the result for printing. Uses the same handler and checks as File > Export > PDF, so a
|
|
3642
|
+
* missing handler rejects with `ChromeExportError` before the document is saved.
|
|
3643
|
+
* Saving commits pending form input and can refresh field results with an undo step.
|
|
3644
|
+
* `container` receives the hidden print frame. For an editor inside a modal dialog,
|
|
3645
|
+
* pass an element inside that dialog.
|
|
3646
|
+
* @public
|
|
3647
|
+
*/
|
|
3648
|
+
declare function runChromePrint(editor: Pick<Editor, 'save'>, handlers?: ChromeExportHandlers, container?: Document | Element): Promise<ChromePrintJob>;
|
|
3649
|
+
|
|
3650
|
+
export { type ImageInteractionSession as $, type AnchorFrameOrigin as A, type CustomFontsResolver as B, CHROME_GROUPS as C, type DocxEditorInstance as D, DEFAULT_TABLE_CHROME_DRAFT as E, type DocxEditorConfig as F, type DrawingSelectionIntent as G, EMU_PER_POINT as H, type EditorCommandExecute as I, type EquationActivation as J, type EquationChromeHandlers as K, type EquationOps as L, type FinalizedImageOverlayInteraction as M, type FontLoadFailure as N, type OpenPaginatedResult as O, type PaginatedSurfaceOptions as P, type FontLoadFailureReason as Q, type FontMeasurementState as R, type FontUrlSource as S, type TableCommandPlan as T, type HistoryGroupBinding as U, type HistoryGroupBindingOptions as V, type HyperlinkActivation as W, type HyperlinkChromeHandlers as X, type HyperlinkOps as Y, IMAGE_OVERLAY_NUDGE_PT as Z, IMAGE_OVERLAY_NUDGE_SHIFT_PT as _, type PaginatedSurface as a, cssPixelsToLayoutPoints as a$, type ImageOverlayScrollPort as a0, type ImageResizeHandle as a1, type ImageResizeResult as a2, type InvalidTextFormFieldChromeHandlers as a3, type InvalidTextFormFieldSession as a4, type LoadFontsRequest as a5, type LoadFontsResult as a6, type OverlayFrameRect as a7, type PaginatedSurfaceState as a8, type ParagraphPropertyEdit as a9, type TableInteractionLabelKey as aA, type TextFormFieldChromeHandlers as aB, type TextFormFieldDialogSession as aC, type ToolbarCommandState as aD, type ToolbarSlotValue as aE, type ToolbarValueMap as aF, type ToolbarValueSlot as aG, applyTableChromePick as aH, bindHistoryGroup as aI, blankDocumentBytes as aJ, canExecuteImageCommand as aK, captureImageMutationPreconditions as aL, chromeControlCount as aM, chromeMenuSlots as aN, chromeProbeForSlot as aO, chromeSlotId as aP, chromeSlotIsToggle as aQ, commandExecOptions as aR, commandForSlot as aS, commandForSlotValue as aT, commandForTableChromeSlotValue as aU, computeImageResizeResult as aV, computeMovedImagePosition as aW, computeResizedImageExtentEmu as aX, createDocxEditor as aY, createFontSource as aZ, createImageOverlayScrollPort as a_, type PopupChromeRegistrationOptions as aa, type RemoteCaretLabelAnchor as ab, type RemoteCaretLabelHost as ac, type ReviewWriteIntent as ad, type RunTableChromeCommandResult as ae, type SectionAnchor as af, type SectionBreakInsertType as ag, type SelectedDrawingOverlayTarget as ah, type SurfaceEquation as ai, type SurfaceFormatting as aj, type SurfaceHyperlink as ak, type SurfaceInsertImageInput as al, type SurfaceNavigation as am, type SurfaceOverlayCoordinates as an, type SurfaceParagraphFormat as ao, TABLE_BORDER_STYLE_OPTIONS as ap, TABLE_BORDER_TARGET_OPTIONS as aq, TABLE_BORDER_WIDTH_OPTIONS as ar, TABLE_CHROME_SLOT_IDS as as, type TableBorderStyleOption as at, type TableBorderTargetOption as au, type TableBorderTargetValue as av, type TableBorderWidthOption as aw, type TableChromeDraft as ax, type TableChromePick as ay, type TableChromeSlotId as az, CHROME_MENUS as b, customFonts as b0, defaultChromeGroups as b1, defaultTableLabel as b2, emuToOverlayPoints as b3, equationAtPosition as b4, executeImageCommand as b5, finalizeImageOverlayInteraction as b6, formattingBarChromeGroups as b7, isChromePrintShortcut as b8, isStaleImageInteractionCommit as b9, isTableChromeSlot as ba, layoutPointsToCssPixels as bb, loadFonts as bc, overlayFrameToSheetCssPixels as bd, overlayHostOrigin as be, pointsToEmu as bf, probeTableChromeCommand as bg, resizePreservesAspect as bh, runChromeExport as bi, runChromePrint as bj, runSave as bk, runTableChromeCommand as bl, runTableCommand as bm, runToolbarCommand as bn, selectedDrawingOverlayTargetOf as bo, selectedImageStateOf as bp, surfacePaintScale as bq, tableChromeIconPaths as br, tableChromeLabelKeyForTarget as bs, tableChromeToolbarState as bt, tableChromeVisible as bu, tableCommandToolbarState as bv, toolbarCommandState as bw, toolbarCommandStates as bx, CHROME_UNAVAILABLE_KEY as c, type ChromeControl as d, type ChromeControlId as e, type ChromeControlState as f, ChromeExportError as g, type ChromeExportFormat as h, type ChromeExportHandlers as i, type ChromeExportResult as j, type ChromeGroup as k, type ChromeGroupId as l, type ChromeMenu as m, type ChromeMenuEntry as n, type ChromeMenuId as o, type ChromeMenuItemEntry as p, type ChromeMenuSeparatorEntry as q, type ChromeMenuSubmenuEntry as r, ChromePrintError as s, type ChromePrintErrorCode as t, type ChromePrintJob as u, type ChromePrintOptions as v, type ChromeSlotId as w, type ContentControlWidgetChromeHandlers as x, type ContentControlWidgetSession as y, type CustomFontsOptions as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk6TBRG6SA_cjs=require('./chunk-6TBRG6SA.cjs');require('./chunk-TKQH7BNE.cjs'),require('./chunk-HL6NO7IH.cjs');var chunkUGLO2GA5_cjs=require('./chunk-UGLO2GA5.cjs');require('./chunk-A72MJGY7.cjs'),require('./chunk-REMFTPDL.cjs'),require('./chunk-W5H62AWM.cjs'),require('./chunk-65GJRSZ5.cjs'),require('./chunk-X2LJDR53.cjs'),require('./chunk-RLKX7BIP.cjs'),require('./chunk-YYFBYVW4.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-HZQFGB2X.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-P5PWSRNW.cjs'),require('./chunk-CB6RQ3GD.cjs'),require('./chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.wa}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Aa}});Object.defineProperty(exports,"ChromeExportError",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Eb}});Object.defineProperty(exports,"ChromePrintError",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Gb}});Object.defineProperty(exports,"bindHistoryGroup",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Bb}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Ba}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.ja}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.la}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.cb}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.i}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.j}});Object.defineProperty(exports,"isChromePrintShortcut",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Hb}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.h}});Object.defineProperty(exports,"runChromeExport",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Fb}});Object.defineProperty(exports,"runChromePrint",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.Ib}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.ra}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunk6TBRG6SA_cjs.na}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.g}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkUGLO2GA5_cjs.j}});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument,
|
|
2
|
-
export {
|
|
3
|
-
export { a as DocumentProtectionEdit, D as DocumentProtectionState } from './document-protection-
|
|
1
|
+
export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ai as DocxDocumentJSON, aj as DrawingHorizontalReferenceFrame, a9 as DrawingKind, ac as DrawingLocks, ab as DrawingPositionInput, ak as DrawingVerticalReferenceFrame, z as ExecErrorCode, E as ExecResult, n as Extent, al as FontDefinition, H as HeaderFooterSet, aa as ImageWrapTarget, A as IndentFormatting, I as InsertableContentControlType, am as NumberingRef, an as PageMargins, P as Paragraph, ao as ParagraphDisagreements, F as ParagraphFlags, ad as ParagraphFormatCommand, G as ParagraphTabStop, ap as Point, af as Rect, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, r as Revision, h as RevisionAddress, _ as RevisionBatchResult, J as RevisionType, aq as Run, m as RunFormatting, K as Section, L as SectionProperties, ag as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, ar as TableCell, as as TableRow, N as Theme, Q as ThemeColorScheme, ah as Unsubscribe, ae as Watermark } from './types-barrel-ChGvWjkO.js';
|
|
2
|
+
export { b as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, c as VectorImageMime } from './image-resources-B0v-XaTM.js';
|
|
3
|
+
export { a as DocumentProtectionEdit, D as DocumentProtectionState } from './document-protection-CMPEonQc.js';
|
|
4
4
|
export { CollectReviewItems, EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from './editor-
|
|
6
|
-
export { a as RevisionDisplayMode } from './revision-projection-
|
|
7
|
-
export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-
|
|
8
|
-
export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-
|
|
9
|
-
export { C as CHROME_GROUPS, b as CHROME_MENUS, i as
|
|
5
|
+
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from './editor-BKDVqXyk.js';
|
|
6
|
+
export { a as RevisionDisplayMode } from './revision-projection-DDVBYTIG.js';
|
|
7
|
+
export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-BNiYSBcB.js';
|
|
8
|
+
export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-PBc8Vuxs.js';
|
|
9
|
+
export { C as CHROME_GROUPS, b as CHROME_MENUS, g as ChromeExportError, h as ChromeExportFormat, i as ChromeExportHandlers, j as ChromeExportResult, m as ChromeMenu, n as ChromeMenuEntry, o as ChromeMenuId, p as ChromeMenuItemEntry, q as ChromeMenuSeparatorEntry, r as ChromeMenuSubmenuEntry, s as ChromePrintError, t as ChromePrintErrorCode, u as ChromePrintJob, v as ChromePrintOptions, w as ChromeSlotId, z as CustomFontsOptions, B as CustomFontsResolver, F as DocxEditorConfig, D as DocxEditorInstance, N as FontLoadFailure, Q as FontLoadFailureReason, R as FontMeasurementState, S as FontUrlSource, U as HistoryGroupBinding, V as HistoryGroupBindingOptions, W as HyperlinkActivation, X as HyperlinkChromeHandlers, a5 as LoadFontsRequest, a6 as LoadFontsResult, ak as SurfaceHyperlink, aD as ToolbarCommandState, aI as bindHistoryGroup, aJ as blankDocumentBytes, aN as chromeMenuSlots, aS as commandForSlot, aT as commandForSlotValue, aY as createDocxEditor, aZ as createFontSource, b0 as customFonts, b8 as isChromePrintShortcut, bc as loadFonts, bi as runChromeExport, bj as runChromePrint, bn as runToolbarCommand, bw as toolbarCommandState } from './index-DQA53aR1.js';
|
|
10
10
|
export { ApplyResult, ContentControlSummary, DocEdit, DocEdits, DocQueries, DocQuery, DocQueryResults, ParagraphSummary } from './contracts/document.js';
|
|
11
11
|
export { b as EditorExecOptions, E as EditorScope, H as HistoryDiagnostic, a as HistoryGroup, c as HistoryGroupOutcome, V as ViewScope } from './editor-scope-OHPwVQ5l.js';
|
|
12
12
|
export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './contracts/interaction.js';
|
|
13
13
|
import './collaboration.js';
|
|
14
|
-
import './tree-package-fragment-
|
|
14
|
+
import './tree-package-fragment-DBb97w3F.js';
|
|
15
15
|
import './collaboration/replication.js';
|
|
16
16
|
import './failure-DNNmwsgD.js';
|
|
17
|
-
import './semantic-records-
|
|
18
|
-
import './omml-equation-
|
|
19
|
-
import './semantic-paint-
|
|
20
|
-
import './note-properties-
|
|
21
|
-
import './custom-node-writes-
|
|
22
|
-
import './semantic-cell-selection-
|
|
23
|
-
import './tree-session-contract-
|
|
24
|
-
import './headless-document-view-
|
|
17
|
+
import './semantic-records-C5OeXnaL.js';
|
|
18
|
+
import './omml-equation-CfTm3jOK.js';
|
|
19
|
+
import './semantic-paint-DE236npp.js';
|
|
20
|
+
import './note-properties-D_lmG9xx.js';
|
|
21
|
+
import './custom-node-writes-Ck6eOiJ3.js';
|
|
22
|
+
import './semantic-cell-selection-DW6qsmoC.js';
|
|
23
|
+
import './tree-session-contract-BYat3RKx.js';
|
|
24
|
+
import './headless-document-view-9wjJT20Y.js';
|
|
25
25
|
import 'prosemirror-model';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{wa as CHROME_GROUPS,Aa as CHROME_MENUS,Bb as bindHistoryGroup,d as blankDocumentBytes,Ba as chromeMenuSlots,ja as commandForSlot,la as commandForSlotValue,cb as createDocxEditor,i as createFontSource,j as customFonts,h as loadFonts,ra as runToolbarCommand,na as toolbarCommandState}from'./chunk-
|
|
1
|
+
export{wa as CHROME_GROUPS,Aa as CHROME_MENUS,Eb as ChromeExportError,Gb as ChromePrintError,Bb as bindHistoryGroup,d as blankDocumentBytes,Ba as chromeMenuSlots,ja as commandForSlot,la as commandForSlotValue,cb as createDocxEditor,i as createFontSource,j as customFonts,Hb as isChromePrintShortcut,h as loadFonts,Fb as runChromeExport,Ib as runChromePrint,ra as runToolbarCommand,na as toolbarCommandState}from'./chunk-VD2MWTR6.js';import'./chunk-AJCCS53D.js';import'./chunk-OZXBAEWW.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-VIXH2OVP.js';import'./chunk-AZ7QSAXH.js';import'./chunk-RIYSCEFQ.js';import'./chunk-HJYLFMLX.js';import'./chunk-BL57VQ7E.js';import'./chunk-W2JIZ5JH.js';import'./chunk-YQXY6TQ3.js';import'./chunk-IWAUA732.js';import'./chunk-PD5XKBJA.js';import'./chunk-VP7SDFCM.js';import'./chunk-GG4IAKFI.js';import'./chunk-6JIJOZDW.js';import'./chunk-5RKCJ5DF.js';import'./chunk-UOQONZVQ.js';import'./chunk-S6J4O5XP.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as ShapingEnvironmentInput, f as TextShaper, R as ResolvedRunStyle, g as ResolvedFont, T as TextMeasurer, F as FontResourceSnapshot, V as VersionedShapingLibrary, N as NormalizationPolicy, h as FixedPointRoundingMode, i as FontRequest } from './semantic-records-
|
|
1
|
+
import { e as ShapingEnvironmentInput, f as TextShaper, R as ResolvedRunStyle, g as ResolvedFont, T as TextMeasurer, F as FontResourceSnapshot, V as VersionedShapingLibrary, N as NormalizationPolicy, h as FixedPointRoundingMode, i as FontRequest } from './semantic-records-C5OeXnaL.js';
|
|
2
2
|
|
|
3
3
|
/** Immutable per-operation environment. Configuration, extension, shaping, and producer changes are
|
|
4
4
|
* coarse gates; resource changes are compared through CacheProvenance.resourceDependencies. */
|
|
@@ -105,7 +105,10 @@ declare class ResolvedCache<V> {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/** Fingerprinted, operation-wide portion of every shaping call. @public */
|
|
108
|
-
type LayoutShapingEnvironment = Omit<ShapingEnvironmentInput, 'font' | 'direction' | 'fallbackOrder'
|
|
108
|
+
type LayoutShapingEnvironment = Omit<ShapingEnvironmentInput, 'font' | 'direction' | 'fallbackOrder'> & {
|
|
109
|
+
/** Host can apply document optional ligatures consistently to measurement and glyph output. */
|
|
110
|
+
readonly documentLigatures?: boolean;
|
|
111
|
+
};
|
|
109
112
|
|
|
110
113
|
/**
|
|
111
114
|
* A fully resolved shaping bundle: fonts, shaper, and the environment they were admitted
|