@docx-editor.dev/core 2.21.1 → 2.23.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 +13 -12
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +11 -10
- package/dist/binding.js +1 -1
- package/dist/chunk-4OAXZNBU.js +5 -0
- package/dist/chunk-6745I4XF.cjs +20 -0
- package/dist/chunk-6KA3L3FR.cjs +11 -0
- package/dist/chunk-6QS5WL63.js +1 -0
- package/dist/{chunk-E5OUYRNM.cjs → chunk-BUDXZ7T2.cjs} +5 -5
- package/dist/chunk-DYRXA5UJ.cjs +2 -0
- package/dist/chunk-DZOGUV7O.js +1 -0
- package/dist/chunk-EHT4LKKZ.cjs +1 -0
- package/dist/chunk-F5LAOPAD.js +20 -0
- package/dist/chunk-FWX535CS.cjs +1 -0
- package/dist/chunk-GRVRQBKU.js +1 -0
- package/dist/chunk-JN62FLHE.cjs +4 -0
- package/dist/{chunk-BF2TOG2V.js → chunk-KRBBWATQ.js} +1 -1
- package/dist/chunk-KV5HFE23.cjs +2 -0
- package/dist/{chunk-T5B4NMKF.cjs → chunk-PCPBDYEL.cjs} +1 -1
- package/dist/chunk-Q4RDWB3U.cjs +18 -0
- package/dist/{chunk-4TYA4RLP.cjs → chunk-QK23BSRK.cjs} +1 -1
- package/dist/chunk-QTFAXWVI.cjs +1 -0
- package/dist/chunk-RLO64PHP.cjs +1 -0
- package/dist/chunk-T7RGKBCE.cjs +5 -0
- package/dist/{chunk-FPDIJ4RF.js → chunk-UMBHUW6R.js} +1 -1
- package/dist/chunk-VE6H5EJA.js +5 -0
- package/dist/chunk-WHG23WNI.js +1 -0
- package/dist/chunk-XBYZTDF7.js +4 -0
- package/dist/chunk-XRBPZCNK.js +11 -0
- package/dist/chunk-Y5JCIWTF.js +2 -0
- package/dist/chunk-ZA6HEWUM.js +2 -0
- package/dist/chunk-ZCRSPN4Q.js +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +6 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +7 -6
- package/dist/contracts/document.d.ts +4 -3
- package/dist/contracts/editor.d.ts +9 -9
- package/dist/contracts/interaction.d.ts +2 -1
- package/dist/contracts/modules.d.ts +9 -8
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-CncR6KfC.d.ts → custom-node-writes-77rvPW2-.d.ts} +4 -3
- package/dist/{document-protection-DM6mA8Rf.d.ts → document-protection-CYIjO-li.d.ts} +3 -2
- package/dist/{editor-BRh7GuZF.d.ts → editor-DhUQsWWH.d.ts} +179 -52
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +181 -28
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +36 -18
- package/dist/export.js +2 -2
- package/dist/{failure-DNNmwsgD.d.ts → failure-BIPVQbRm.d.ts} +2 -1
- package/dist/{font-resolver-DwuQYj3P.d.ts → font-resolver-BwoHFBlr.d.ts} +3 -2
- package/dist/{headless-document-view-C3fc_jV0.d.ts → headless-document-view-Cc3fFWhv.d.ts} +4 -3
- package/dist/{image-resources-DxF-SN_8.d.ts → image-resources-DkuzBnTM.d.ts} +3 -2
- package/dist/{index-3pNnG4z4.d.ts → index-BYaCkGKO.d.ts} +179 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-_GGjhhVc.d.ts → layout-shaping-DpWQG26a.d.ts} +7 -3
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +473 -64
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CjT31AuP.d.ts → note-properties-DMfKK3QU.d.ts} +3 -2
- package/dist/{omml-equation-Bk3OP1fv.d.ts → omml-equation-BY7OdfGY.d.ts} +3 -2
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +9 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-CrbTIW2Z.d.ts → protocol-CPAakntQ.d.ts} +4 -3
- package/dist/{review-paragraph-order-D3KZohIL.d.ts → review-paragraph-order-B0BP_wJP.d.ts} +1 -1
- package/dist/{revision-projection-kVd7p6Wd.d.ts → revision-projection-CVJeA2jp.d.ts} +3 -2
- package/dist/{semantic-cell-selection-CkSsZHDL.d.ts → semantic-cell-selection-B8GF_H2e.d.ts} +10 -6
- package/dist/{semantic-interaction-Z2Xa68U5.d.ts → semantic-interaction-DQjtIruQ.d.ts} +3 -2
- package/dist/{semantic-paint-BHKprI9P.d.ts → semantic-paint-DoPl85nR.d.ts} +4 -3
- package/dist/{semantic-records-StH-AnHK.d.ts → semantic-records-DB0VgWsr.d.ts} +1125 -1039
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +17 -16
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CpEV1gl3.d.ts → tree-package-fragment-BIyGh6L8.d.ts} +4 -3
- package/dist/{tree-session-contract-CTT9nM7Z.d.ts → tree-session-contract-CHcCnz3W.d.ts} +7 -6
- package/dist/{types-barrel-PwcfEkaX.d.ts → types-barrel-DN_-gaRX.d.ts} +72 -5
- package/package.json +3 -3
- 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-7N77EN2Z.cjs +0 -2
- package/dist/chunk-AGWWNVIJ.cjs +0 -1
- package/dist/chunk-DFTVN25X.cjs +0 -5
- package/dist/chunk-DGONGMAV.js +0 -2
- package/dist/chunk-DZYKU2HG.js +0 -1
- package/dist/chunk-F4H3LC6M.cjs +0 -2
- package/dist/chunk-FGBADUSK.cjs +0 -1
- 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-RA2TDTEQ.cjs +0 -1
- package/dist/chunk-U5GUJKTS.js +0 -1
- package/dist/chunk-VP7SDFCM.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,l as l$1,d as d$2,e as e$1,v,s,i,o,u}from'./chunk-GRVRQBKU.js';import {j as j$1,l,k,q as q$1,h,n,b,g,_ as _$1,Z,aa}from'./chunk-XBYZTDF7.js';import'./chunk-RIYSCEFQ.js';import {d as d$1,e}from'./chunk-WHG23WNI.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-WHG23WNI.js';import {d,ea,sa,$,fa,i as i$1,b as b$1,e as e$2,Vc,c as c$1,j as j$2,gb,$c,jb,lb,ib,_c,mb,kb,nb,hb,q as q$2,t,o as o$1,Zb}from'./chunk-ZCRSPN4Q.js';import {d as d$3,b as b$2,a}from'./chunk-UMBHUW6R.js';import'./chunk-6QS5WL63.js';import {Ka}from'./chunk-VE6H5EJA.js';import {bg,cg,Yb,Xb,da,E,ge,la,ve,ma}from'./chunk-XRBPZCNK.js';function I(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((d,c)=>d.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let d of o.text){let c=d.toUpperCase()!==d,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(d))?y.text+=d:i.push({text:d,start:s,lower:c}),s+=d.length;}let a=[],u=[],p=[],l=true,g=0;for(let d of o.environment.direction==="rtl"?i.reverse():i){let c=d.lower?.8:1,y=[],R=[],b="",f=d.start;for(let F of d.text){let m=d.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?l=false:p.push(E*c),a.push({...m,cluster:y[m.cluster]??d.start,originX:o$1(g+Math.round(m.originX*c)),originY:o$1(Math.round(m.originY*c)),offsetX:o$1(Math.round(m.offsetX*c)),offsetY:o$1(Math.round(m.offsetY*c)),advanceX:o$1(Math.round(m.advanceX*c)),advanceY:o$1(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??d.start,E=R[F.textEnd-1]??f,L=o$1(Math.round(F.advance*c)),A=u.at(-1);A&&A.textStart===m&&A.textEnd===E?u[u.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:o$1(A.advance+L),caretEdges:[o$1(0),o$1(A.advance+L)]}:u.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:L,caretEdges:F.caretEdges.map(G=>o$1(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:u,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:l&&p.length===a.length?p:void 0}}var nt=new WeakMap;function Nt(e){let o=nt.get(e);return o===void 0&&(o=Ct(e.bytes,e.faceIndex),nt.set(e,o)),o}var _t=new Set(["COLR","CBDT","sbix"]),Mt=512;function Ct(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(rt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),Mt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(_t.has(rt(e,s)))return true}return false}function rt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var Ut=/\p{Emoji_Presentation}|️/u;function Bt(e){return Ut.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Nt);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Bt(o)?[...t,...n]:[...n,...t]}var qt=2048;function it(e,o,t$1,n){if(!t$1.clusters.length||t$1.clusters.length>qt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:q$2({...o.environment,font:f})};return I(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t$1.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t$1.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),L=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!L)return null;s.set(x,L),h=L;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],u=[],p=[],l=[],g=true,d=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=p.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:o$1(d+m.originX),originY:o$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)l.push(m);for(let m of h.clusters)u.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&p.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),d+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return t({...t$1,glyphs:a,clusters:u,fontSpans:p,exactAdvancesX:g&&l.length===a.length?l:void 0,metrics:{ascent:o$1(y),descent:o$1(R),lineGap:o$1(b)}},{...o.environment,fallbackOrder:n})}var jt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),zt=512,at=new WeakMap;function Ht(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let u=r(a+4);if(u<0||u>1024)return t;let p=-1;for(let c=0;c<u;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){p=i(y+8);break}}if(p<0)return t;let l=r(p+4);if(l<=0)return t;let g=p+l,d=r(g);if(d<0)return t;for(let c=0;c<Math.min(d,zt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Xt(e,o){let t=at.get(e);return t||(t=Ht(e.bytes,e.faceIndex),at.set(e,t)),(jt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function st(e,o){let t=e.filter(n=>Xt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t$1){if(!o.text.includes("\u2011"))return t$1;let n=new Set(t$1.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t$1;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t$1;try{let i=e.shape({...o,text:r});return t({...i,text:o.text},o.environment)}catch{return t$1}}function lt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof e$2)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let u=e.shaper.shape(a),p=r.get(u);if(p&&p.input.text===a.text&&p.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&p.input.bidiLevel===a.bidiLevel&&p.input.context?.before===a.context?.before&&p.input.context?.after===a.context?.after&&p.input.environment===a.environment)return p.run;let l=s(a,J(e.shaper,a,u));return r.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|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let l=it(n,a,p,t);if(l)return l}for(let l of st(q(t,a.text),a.environment.script))if(!(l.hash===a.environment.font.hash&&l.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:q$2({...a.environment,font:l})},d=I(n,g,n.shape(g));if(!d.glyphs.some(c=>c.id===0))return d}catch{}return p};return {...e,shaper:i}}var Q=c$1;function ee(e){return typeof e.admittedFontFace=="function"}var Gt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function j(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var dt=new WeakMap;function z(e){let o=dt.get(e);return o||dt.set(e,o=Vt(e)),o}function Vt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:j(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:j(o.requested),resolved:j(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function Wt(e){return Object.freeze({...z(e),bytes:j$2(e)})}function Yt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof e$2?null:Wt(t)}catch{return null}}function ct(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Yt(e.resolve(),o)}}function $t(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:j(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let u=a.toLowerCase();i.has(u)||i.set(u,a);}let s=[...i.values()].map(a=>{let u=[];for(let p of Gt){let l=n?.({family:a,...p});!l||l instanceof e$2||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:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:$t(r)})}function oe(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 ne(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$1("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function H(){return new Map}function re(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=i$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof e$2?null:s}function ut(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=sa(n.style,n.fontSlot),i=$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!_$1(e.shaper,e.environment,a,r,t))return null;let u=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:u,font:z(u.fontSpans[0]?.font??a),...u.fontSpans.length>1?{fonts:Object.freeze(u.fontSpans.map(p=>z(p.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function pt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,_,le=32,ft=d;function mt(){if(_)return _;let e=(async()=>(await b(),g(h)))();return _=e,e.catch(()=>{_===e&&(_=void 0);}),e}function yt(e){let o=H();return aa(e,{resolveFont(t){return ut(e,o,t)},fallback:fa()})}async function ht(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await mt(),i=lt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>yt(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:e.fingerprint})}function Kt(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let u=k(e).sources.reduce((l,g)=>l+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+u>ft)throw new RangeError(`Shared exporter shaping font bytes are limited to ${ft} process-wide`);se+=u;let p;try{let l=await mt();p=await q$1(e,l,h,o);}catch(l){throw se-=u,l}return Object.freeze({createMeasurer:()=>yt(p),shapeLaidOutText:ae(p),shapingHash:p.operation.shapingHash,producerVersion:p.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Jt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Zt),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"),ge(o,n)}function gt(e,o$1){let t=Jt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>i$1(s))),i=o(t,{maxFontBytes:b$1,aggregateBudget:Qt(n),shadowedRequests:r});if(o$1)for(let s of i.dropped){if(o$1.dropped.length>=Q)break;o$1.dropped.push(s);}return {sources:i.sources}})}function Qt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?d:Math.max(0,d-o)}function eo(e){return ee(e)&&ie(e)}var w=0,xt=Symbol("font-resolution-timeout");function to(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>d)throw new d$1("layoutFailed",`Active document export font bytes are limited to ${d}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ce(e,o){return e.attributes.find(t=>t.localName===o)?.value}function oo(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===da||t.namespaceUri===""))?.value}async function no(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=Ka(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:u,documentLigatures:p,...l}=o,g=Array.isArray(n)?n:[n],d=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await ro(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:u,documentLigatures:p,lastResortFonts:d,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d$1&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d$1("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...l,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new d$1("aborted","Export resource settlement was aborted"):new d$1("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:ct({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:pt({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function ro(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=io(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(xt),n$1);try{de(r.signal);let a=(async()=>{let u=to(t.onActiveFontBytesChange),p=!1;try{let l=so(e).slice(0,c),g=[],d={dropped:[]},c$1=gt(e,d),y=[...o,...c$1?[c$1]:[],...t.lastResortFonts??[]],R=await l$1(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...l])].slice(0,c),defaultFamily:d$2.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:u.reserve});de(r.signal);let b=e$1(R??{});if(b.sources.length===0){let x=te(l,b.defaultFont.family,g,void 0,d.dropped);oe(x,t),ne(x,t);return}let f=await ht(n(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(l,b.defaultFont.family,g,f.resolveFont,d.dropped);return oe(h,t),ne(h,t),p=!0,Object.freeze({...f,dispose:u.release})}finally{p||u.release();}})();return await Promise.race([a,ao(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function io(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 ao(e){return new Promise((o,t)=>{let n=()=>{t(Ft(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function Ft(e){let o=e.reason===xt;return new d$1(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw Ft(e)}function so(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(l,g)=>{!g||r.has(g.name)||(r.add(g.name),l.push(g.root));};for(let l of e.headerFooterPartsBySection()){for(let g of l.headers.values())i(t,g);for(let g of l.footers.values())i(t,g);}for(let l of ["footnote","endnote"])n.push(...lo(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,g)=>{let d=d$3(l,e.stylesRoot(),a,uo(l,g)),c=v(l,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...d.direct,...mo(l),...c,...s(l,e.stylesRoot(),a),...d.inherited]){let R=y.toLowerCase();u.has(R)||u.set(R,y);}};return p(o,"body"),p(t,"furniture"),p(n,"note"),[...u.values()]}function lo(e,o){let t=bg(e.currentPackage(),o);if(!t)return [];let n=new Set(cg(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 s=Yb(i),a=Xb(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var co="http://schemas.openxmlformats.org/officeDocument/2006/math";function uo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===da&&s.localName==="p"&&r.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"&&i.push({node:l,context:u});}}for(let s of r)po(s.paragraph,t,s.context);}return t}function po(e,o,t){let n=gb(),r=null,i=null,s="",a=false,u=false,p=false,l=0,g=[];for(let d=e.children.length-1;d>=0;d-=1){let c=e.children[d];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:d,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=la||d.namespaceUri===da&&d.localName==="p")continue;let b=d.namespaceUri===da&&d.localName==="r"?d.id:c;if(d.namespaceUri===da&&d.localName==="fldSimple"){let f=ce(d,"instr")??"";$c(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&fo(d)!==D&&o.add(d.id);}if(d.namespaceUri===da&&d.localName==="fldChar"){let f=ce(d,"fldCharType");if(f==="begin")jb(n),n.nesting===1&&(r=b,i=null,s="",a=false,u=false,p=ve(d),l=0);else if(f==="separate"){let h=n.nesting===1;if(lb(n),h){let x=ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,u=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=ib(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&_c(s,{hasSeparate:u,hasLegacyFormData:p,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&l!==D){let x=i??r;x&&o.add(x);}}mb(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){kb(n,Ot(d),d.localName==="delInstrText");continue}n.nesting>0&&nb(n)&&d.namespaceUri===da&&Et(d)&&(l|=y);for(let f=d.children.length-1;f>=0;f-=1){let h=d.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&St(d),containerDepth:ma(d,R)});}}hb(n);}function Et(e){return e.localName==="t"||e.localName==="delText"?Ot(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ue=1,bt=2,Rt=4,D=ue|bt|Rt;function fo(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});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&&Et(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&St(n)});}}return t}function St(e){return e.namespaceUri!==da?D:e.localName==="ins"||e.localName==="moveTo"?ue|bt:e.localName==="del"||e.localName==="moveFrom"?ue|Rt:D}function mo(e){let o=new Map,t=n=>{let r=a(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===co&&t(Zb),i.namespaceUri===da&&i.localName==="sym"&&t(b$2(oo(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let s=ce(i,"instr");t(Vc(s??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let s of u(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Ot(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 At="FILE_TOO_LARGE",vt=8;function yo(e){return typeof e=="object"&&e!==null}function Tt(e){if(!(!yo(e)||typeof e.code!="string"))return e.code}function Lt(e){return e===""||e.toLowerCase()==="localhost"}function ho(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function Pt(e){let o=ho(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 Dt(e){let o=Pt(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function go(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function xo(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(!Lt(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Dt(o.pathname);if(t===null||go(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,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 Eo(e){let o=Fo(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>vt)throw new TypeError(`trustedRoot must not exceed ${vt} directories`);return o.map(xo)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>b$1)throw new TypeError(`maxBytes must not exceed ${b$1}`);return e}function Ro(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Lt(e.host))return null;let t=Pt(e.pathname);if(t===null)return null;for(let n of o){let r=Dt(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 So(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 Oo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function wt(e,o,t){return e.some(n=>Oo(n,o,t))}async function vo(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(Tt(r)==="ENOENT")continue;throw r}return t}function wo(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{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 o=="string"?o:o.href));if(!wt(p,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",d=await r(l,g),c=()=>{d.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(l);if(!wt(await vo(p,i),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await d.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:At});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await d.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await d.close().catch(()=>{});}}}function Ao(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=Eo(e.trustedRoot),t=bo(e.maxBytes),n=e.read??wo(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let u=So(i);if(u.protocol!=="file:")return r(u,s);let p=Ro(u,o);if(!p)return new Response(null,{status:404});let l=a?new AbortController:void 0,g=()=>l?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let d;try{if(d=await n(p,{maxBytes:t,...l?{signal:l.signal}:{}}),a?.aborted)throw a.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(l?.signal.aborted)throw l.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=Tt(c);if(y===At)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(d,{status:200})})}
|
|
2
|
+
export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,Kt as acquireSharedExportShaping,Ao as createPackagedFileFetch,ee as hasExportAdmittedFont,ie as hasExportLaidOutText,eo as hasFontBackedExportCapabilities,no as openFontBackedDocumentForExport};
|
|
@@ -61,4 +61,5 @@ interface CollaborationStatusTracker {
|
|
|
61
61
|
/** @internal */
|
|
62
62
|
declare function createCollaborationStatusTracker(initial?: CollaborationStatus): CollaborationStatusTracker;
|
|
63
63
|
|
|
64
|
-
export {
|
|
64
|
+
export { createCollaborationStatusTracker as d, isCollaborationFailureCode as i };
|
|
65
|
+
export type { CollaborationStatus as C, CollaborationStatusSnapshot as a, CollaborationFailureCode as b, CollaborationFailure as c };
|
|
@@ -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-DhUQsWWH.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A partial font configuration one origin contributes: sources, substitutions, or both.
|
|
@@ -250,4 +250,5 @@ interface ComposeFontOriginsOptions {
|
|
|
250
250
|
*/
|
|
251
251
|
declare function composeFontOrigins(origins: readonly FontOrigin[], request: FontResolutionRequest, options?: ComposeFontOriginsOptions): Promise<FontConfigurationFragment | undefined>;
|
|
252
252
|
|
|
253
|
-
export {
|
|
253
|
+
export { MAX_RESOLVER_FAMILIES as M, WORD_DEFAULT_FONT as W, FONT_RESOLVER_BRAND as b, FONT_RESOLVER_MARK_KEY as c, composeFontConfiguration as j, composeFontOrigins as k, defineFontResolver as l, isFontResolver as m };
|
|
254
|
+
export type { ComposeFontOriginsOptions as C, FontOriginFailure as F, FontOrigin as a, FontConfigurationBase as d, FontConfigurationFragment as e, FontResolutionRequest as f, FontResolver as g, FontResolverMark as h, MarkedFontResolver as i };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as HeaderFooterParts, e as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-
|
|
2
|
-
import {
|
|
1
|
+
import { d as HeaderFooterParts, e as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-BIyGh6L8.js';
|
|
2
|
+
import { Q as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-DN_-gaRX.js';
|
|
3
3
|
|
|
4
4
|
/** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
|
|
5
5
|
interface EnsuredHyperlinkRelationship {
|
|
@@ -139,4 +139,5 @@ declare function openHeadlessDocument(bytes: Uint8Array): OpenHeadlessDocumentRe
|
|
|
139
139
|
/** Internal live read view over the canonical store, preserving node identities for field pagination. */
|
|
140
140
|
declare function headlessViewOfStore(store: TreePackageStore): HeadlessDocumentView;
|
|
141
141
|
|
|
142
|
-
export {
|
|
142
|
+
export { authorableHyperlinkTarget as c, ensureHyperlinkRelationship as e, headlessViewOfStore as h, openHeadlessDocument as o, relationshipTargetIn as r };
|
|
143
|
+
export type { DocumentProperties as D, EnsuredHyperlinkRelationship as E, HeadlessDocumentView as H, OpenHeadlessDocumentResult as O, HeadlessDocumentRejection as a, HeadlessThemeFonts as b };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as DrawingProjection,
|
|
1
|
+
import { a4 as DrawingProjection, Q as OoxmlPackage } from './types-barrel-DN_-gaRX.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|
|
@@ -207,4 +207,5 @@ 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 {
|
|
210
|
+
export { DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, MAX_SVG_SNIFF_BYTES as M, resolveSvgIntrinsicSize as d, DEFAULT_LIMITS as f, IMAGE_RESOURCE_HARD_CEILINGS as g, 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 };
|
|
211
|
+
export type { CreateImageResourceCacheOptions as C, ImageResourceLimits as I, PreservedImageMime as P, RenderableImageMime as R, SupportedImageMime as S, ValidatedImageBytesHandle as V, ImageDecodePort as a, ImageResourceState as b, VectorImageMime as c, ResourceLimits as e, ImageResourceLookup as h, ValidatedRasterHeader as i };
|
|
@@ -1,20 +1,20 @@
|
|
|
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, A as ParagraphTabStop, y as IndentFormatting, z as ParagraphFlags, ao as ParagraphDisagreements, aB as DrawingTreeDocOp, ag as SelectionPin, Q as OoxmlPackage, g as ReviewRevisionKind, aa as ImageWrapTarget } from './types-barrel-DN_-gaRX.js';
|
|
2
|
+
import { a as ImageDecodePort, S as SupportedImageMime } from './image-resources-DkuzBnTM.js';
|
|
3
|
+
import './document-protection-CYIjO-li.js';
|
|
4
4
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError,
|
|
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, q as Editor, e as EditorCommand, C as CanResult, j as SelectedImageState, r as FormatPainterSurfaceState, k as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, t as TableBorderEdgeTarget, u as TableBorderSpec, w as TableBorderStyle, x as TableContext } from './editor-DhUQsWWH.js';
|
|
6
|
+
import { R as ReviewDisplayMode } from './revision-projection-CVJeA2jp.js';
|
|
7
|
+
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-DQjtIruQ.js';
|
|
8
|
+
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BwoHFBlr.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-
|
|
17
|
-
import { C as CollaborationStatus } from './failure-
|
|
10
|
+
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-DoPl85nR.js';
|
|
11
|
+
import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-DMfKK3QU.js';
|
|
12
|
+
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-DB0VgWsr.js';
|
|
13
|
+
import { B as BookmarkIndex } from './custom-node-writes-77rvPW2-.js';
|
|
14
|
+
import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-fragment-BIyGh6L8.js';
|
|
15
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-B8GF_H2e.js';
|
|
16
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CHcCnz3W.js';
|
|
17
|
+
import { C as CollaborationStatus } from './failure-BIPVQbRm.js';
|
|
18
18
|
import { V as ViewScope, b as EditorExecOptions } from './editor-scope-OHPwVQ5l.js';
|
|
19
19
|
import './contracts/document.js';
|
|
20
20
|
import './contracts/interaction.js';
|
|
@@ -964,6 +964,8 @@ type SurfaceInsertImageInput = Omit<InsertImageInput, 'decodePort' | 'actorId'>;
|
|
|
964
964
|
*/
|
|
965
965
|
interface SurfaceParagraphFormat {
|
|
966
966
|
readonly alignment?: 'left' | 'center' | 'right' | 'both';
|
|
967
|
+
/** Base direction; see `directionalParagraphEntry` for what each value writes. */
|
|
968
|
+
readonly direction?: 'ltr' | 'rtl';
|
|
967
969
|
readonly spaceBeforePt?: number | null;
|
|
968
970
|
readonly spaceAfterPt?: number | null;
|
|
969
971
|
readonly lineSpacing?: {
|
|
@@ -992,6 +994,19 @@ interface ParagraphPropertyEdit {
|
|
|
992
994
|
readonly attributes?: Record<string, string | null>;
|
|
993
995
|
/** Keep the attributes this entry does not name, for multi-setting elements. */
|
|
994
996
|
readonly mergeAttributes?: boolean;
|
|
997
|
+
/**
|
|
998
|
+
* For `w:jc` only: `attributes.val` names a PHYSICAL edge, as a toolbar button does. The
|
|
999
|
+
* writer converts it per paragraph, because a bidi paragraph reaches its right margin
|
|
1000
|
+
* with `left` (see `jcValueForAlignment`).
|
|
1001
|
+
*/
|
|
1002
|
+
readonly physicalAlignment?: boolean;
|
|
1003
|
+
/**
|
|
1004
|
+
* For `w:bidi` only: the base direction the paragraph must END in. The writer spells it per
|
|
1005
|
+
* paragraph and skips one already in that direction (see `directionalParagraphEntry`).
|
|
1006
|
+
*/
|
|
1007
|
+
readonly paragraphDirection?: 'ltr' | 'rtl';
|
|
1008
|
+
/** Drop the paragraph's own element of this name instead of writing one. */
|
|
1009
|
+
readonly remove?: boolean;
|
|
995
1010
|
}
|
|
996
1011
|
|
|
997
1012
|
/**
|
|
@@ -1312,6 +1327,8 @@ interface SurfaceFormatting {
|
|
|
1312
1327
|
readonly color: string | null;
|
|
1313
1328
|
readonly highlight: string | null;
|
|
1314
1329
|
readonly alignment: 'left' | 'center' | 'right' | 'both' | null;
|
|
1330
|
+
/** Paragraph base direction through the cascade; null when the selection mixes them. */
|
|
1331
|
+
readonly direction: 'ltr' | 'rtl' | null;
|
|
1315
1332
|
readonly styleId: string | null;
|
|
1316
1333
|
/**
|
|
1317
1334
|
* `w:spacing`'s line rule and its value: LINES for `multiple`, points for the other two
|
|
@@ -1457,9 +1474,8 @@ type SurfaceEditingMode = 'edit' | 'suggest' | 'view';
|
|
|
1457
1474
|
/**
|
|
1458
1475
|
* Where the section after an inserted break begins — Word's Layout > Breaks menu.
|
|
1459
1476
|
*
|
|
1460
|
-
*
|
|
1461
|
-
*
|
|
1462
|
-
* entry that silently behaves like `nextPage` is the lie this vocabulary exists to avoid.
|
|
1477
|
+
* `evenPage` / `oddPage` sections from a file paginate with their blank parity sheet, but
|
|
1478
|
+
* inserting one is not offered here.
|
|
1463
1479
|
*
|
|
1464
1480
|
* @public
|
|
1465
1481
|
*/
|
|
@@ -1674,9 +1690,7 @@ interface PaginatedSurface {
|
|
|
1674
1690
|
* the space before and after, so a line-spacing pick must not delete the space-before. A
|
|
1675
1691
|
* null-valued attribute removes just that one.
|
|
1676
1692
|
*/
|
|
1677
|
-
setParagraphProperty(localName: string, attributes?: Record<string, string | null>, options?:
|
|
1678
|
-
readonly mergeAttributes?: boolean;
|
|
1679
|
-
}): void;
|
|
1693
|
+
setParagraphProperty(localName: string, attributes?: Record<string, string | null>, options?: Pick<ParagraphPropertyEdit, 'mergeAttributes' | 'physicalAlignment' | 'paragraphDirection'>): void;
|
|
1680
1694
|
/**
|
|
1681
1695
|
* Several paragraph properties in ONE transaction, so a dialog is one undo step.
|
|
1682
1696
|
*
|
|
@@ -2077,15 +2091,17 @@ interface PaginatedSurface {
|
|
|
2077
2091
|
* Every clipboard flavour for the current selection: plain text, and the interop HTML
|
|
2078
2092
|
* carrying the embedded fragment when the selection is a body-story range. A cell
|
|
2079
2093
|
* rectangle answers grid text plus a flattened table; `html` is null where only plain
|
|
2080
|
-
* text should be written.
|
|
2094
|
+
* text should be written. Unsupported object selections return a refusal reason.
|
|
2081
2095
|
*/
|
|
2082
2096
|
copyFlavours(): {
|
|
2083
2097
|
readonly text: string;
|
|
2084
2098
|
readonly html: string | null;
|
|
2099
|
+
readonly reason?: 'unsupported-content';
|
|
2085
2100
|
};
|
|
2086
2101
|
/**
|
|
2087
2102
|
* Route one paste payload by fidelity: embedded fragment, then external HTML, then
|
|
2088
|
-
* plain text
|
|
2103
|
+
* plain text. Unsupported object fragments refuse without fallback. Other decode, read,
|
|
2104
|
+
* or apply failures can degrade. Suggesting mode, non-body
|
|
2089
2105
|
* stories and an armed force-plain all land on the plain lane. False when the payload
|
|
2090
2106
|
* landed on no lane at all (nothing to insert).
|
|
2091
2107
|
*/
|
|
@@ -2415,6 +2431,10 @@ type ChromeControlState =
|
|
|
2415
2431
|
*/
|
|
2416
2432
|
| {
|
|
2417
2433
|
readonly kind: 'load';
|
|
2434
|
+
}
|
|
2435
|
+
/** Host conversion through `runChromeExport` or `runChromePrint`; not an editing command. */
|
|
2436
|
+
| {
|
|
2437
|
+
readonly kind: 'export';
|
|
2418
2438
|
};
|
|
2419
2439
|
/**
|
|
2420
2440
|
* The SHAPE a control renders as (task M6V.1).
|
|
@@ -2665,6 +2685,24 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2665
2685
|
readonly kind: "command";
|
|
2666
2686
|
};
|
|
2667
2687
|
}];
|
|
2688
|
+
}, {
|
|
2689
|
+
readonly id: "direction";
|
|
2690
|
+
readonly labelKey: "formattingBar.groups.direction";
|
|
2691
|
+
readonly controls: readonly [{
|
|
2692
|
+
readonly id: "ltr";
|
|
2693
|
+
readonly labelKey: "toolbar.leftToRight";
|
|
2694
|
+
readonly paths: readonly string[];
|
|
2695
|
+
readonly state: {
|
|
2696
|
+
readonly kind: "command";
|
|
2697
|
+
};
|
|
2698
|
+
}, {
|
|
2699
|
+
readonly id: "rtl";
|
|
2700
|
+
readonly labelKey: "toolbar.rightToLeft";
|
|
2701
|
+
readonly paths: readonly string[];
|
|
2702
|
+
readonly state: {
|
|
2703
|
+
readonly kind: "command";
|
|
2704
|
+
};
|
|
2705
|
+
}];
|
|
2668
2706
|
}, {
|
|
2669
2707
|
readonly id: "list";
|
|
2670
2708
|
readonly labelKey: "formattingBar.groups.listFormatting";
|
|
@@ -2997,6 +3035,27 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2997
3035
|
readonly state: {
|
|
2998
3036
|
readonly kind: "save";
|
|
2999
3037
|
};
|
|
3038
|
+
}, {
|
|
3039
|
+
readonly id: "exportMarkdown";
|
|
3040
|
+
readonly labelKey: "toolbar.exportMarkdown";
|
|
3041
|
+
readonly paths: readonly string[];
|
|
3042
|
+
readonly state: {
|
|
3043
|
+
readonly kind: "export";
|
|
3044
|
+
};
|
|
3045
|
+
}, {
|
|
3046
|
+
readonly id: "exportPdf";
|
|
3047
|
+
readonly labelKey: "toolbar.exportPdf";
|
|
3048
|
+
readonly paths: readonly string[];
|
|
3049
|
+
readonly state: {
|
|
3050
|
+
readonly kind: "export";
|
|
3051
|
+
};
|
|
3052
|
+
}, {
|
|
3053
|
+
readonly id: "print";
|
|
3054
|
+
readonly labelKey: "toolbar.print";
|
|
3055
|
+
readonly paths: readonly string[];
|
|
3056
|
+
readonly state: {
|
|
3057
|
+
readonly kind: "export";
|
|
3058
|
+
};
|
|
3000
3059
|
}, {
|
|
3001
3060
|
readonly id: "pageSetup";
|
|
3002
3061
|
readonly labelKey: "toolbar.pageSetup";
|
|
@@ -3087,7 +3146,7 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
3087
3146
|
*
|
|
3088
3147
|
* @public
|
|
3089
3148
|
*/
|
|
3090
|
-
type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script' | 'alignment' | 'list' | 'format' | 'review' | 'contentControl' | 'image' | 'table' | 'paragraph' | 'file' | 'insert';
|
|
3149
|
+
type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script' | 'alignment' | 'direction' | 'list' | 'format' | 'review' | 'contentControl' | 'image' | 'table' | 'paragraph' | 'file' | 'insert';
|
|
3091
3150
|
/**
|
|
3092
3151
|
* The public slot vocabulary: `${groupId}.${controlId}` for every control that actually
|
|
3093
3152
|
* exists — `text.bold`, `font.family`, `alignment.left`. THE stable contract a host
|
|
@@ -3095,7 +3154,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
|
|
|
3095
3154
|
*
|
|
3096
3155
|
* @public
|
|
3097
3156
|
*/
|
|
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';
|
|
3157
|
+
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' | 'direction.ltr' | 'direction.rtl' | '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
3158
|
/**
|
|
3100
3159
|
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
3101
3160
|
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
@@ -3529,4 +3588,98 @@ interface HistoryGroupBinding {
|
|
|
3529
3588
|
*/
|
|
3530
3589
|
declare function bindHistoryGroup(editor: Editor, element: HTMLElement, config: HistoryGroupBindingOptions): HistoryGroupBinding;
|
|
3531
3590
|
|
|
3532
|
-
|
|
3591
|
+
/** File menu conversion formats. @public */
|
|
3592
|
+
type ChromeExportFormat = 'markdown' | 'pdf';
|
|
3593
|
+
/**
|
|
3594
|
+
* Conversion handlers for File > Export. Install the corresponding converter package.
|
|
3595
|
+
* Use `exportMarkdown` for Markdown. PDF requires `exportPdf` on a Node.js server.
|
|
3596
|
+
* Browser hosts supply a PDF handler that calls that server after the user selects Export.
|
|
3597
|
+
* @public
|
|
3598
|
+
*/
|
|
3599
|
+
interface ChromeExportHandlers {
|
|
3600
|
+
/** Returns continuous document Markdown. Page output is not downloaded. */
|
|
3601
|
+
readonly markdown?: (source: Uint8Array) => Promise<{
|
|
3602
|
+
readonly markdown: string;
|
|
3603
|
+
}>;
|
|
3604
|
+
/** Returns PDF bytes from `@docx-editor.dev/docx-to-pdf` on Node.js. */
|
|
3605
|
+
readonly pdf?: (source: Uint8Array) => Promise<{
|
|
3606
|
+
readonly bytes: Uint8Array;
|
|
3607
|
+
}>;
|
|
3608
|
+
}
|
|
3609
|
+
/** Download data from a completed conversion. @public */
|
|
3610
|
+
interface ChromeExportResult {
|
|
3611
|
+
readonly bytes: Uint8Array;
|
|
3612
|
+
readonly extension: 'md' | 'pdf';
|
|
3613
|
+
readonly mimeType: string;
|
|
3614
|
+
}
|
|
3615
|
+
/** An export has no configured converter. @public */
|
|
3616
|
+
declare class ChromeExportError extends Error {
|
|
3617
|
+
readonly format: ChromeExportFormat;
|
|
3618
|
+
readonly code = "missing-exporter";
|
|
3619
|
+
constructor(format: ChromeExportFormat);
|
|
3620
|
+
}
|
|
3621
|
+
/**
|
|
3622
|
+
* Saves the current document and converts those bytes through the configured handler.
|
|
3623
|
+
* Missing handlers fail before saving. Conversion never changes the editor document.
|
|
3624
|
+
* @public
|
|
3625
|
+
*/
|
|
3626
|
+
declare function runChromeExport(editor: Pick<Editor, 'save'>, format: ChromeExportFormat, handlers?: ChromeExportHandlers): Promise<ChromeExportResult>;
|
|
3627
|
+
|
|
3628
|
+
/** Why the browser could not print the converted PDF. @public */
|
|
3629
|
+
type ChromePrintErrorCode = 'pdf-viewer-unavailable' | 'pdf-load-failed' | 'print-refused' | 'print-ended';
|
|
3630
|
+
/**
|
|
3631
|
+
* The browser could not print the converted PDF. The PDF at `ChromePrintJob.url` is still
|
|
3632
|
+
* available, so the user can open it and print from the PDF viewer.
|
|
3633
|
+
* @public
|
|
3634
|
+
*/
|
|
3635
|
+
declare class ChromePrintError extends Error {
|
|
3636
|
+
/** Why the browser could not print. */
|
|
3637
|
+
readonly code: ChromePrintErrorCode;
|
|
3638
|
+
constructor(code: ChromePrintErrorCode);
|
|
3639
|
+
}
|
|
3640
|
+
/**
|
|
3641
|
+
* True for the print shortcut: Cmd+P on Apple platforms, Ctrl+P elsewhere. On macOS,
|
|
3642
|
+
* Ctrl+P moves the caret to the previous line, so it is not a print shortcut there. The P
|
|
3643
|
+
* key matches by `code` too when it types no Latin letter, as on Cyrillic or Hebrew layouts.
|
|
3644
|
+
* @public
|
|
3645
|
+
*/
|
|
3646
|
+
declare function isChromePrintShortcut(event: KeyboardEvent): boolean;
|
|
3647
|
+
/** Options for `ChromePrintJob.print`. @public */
|
|
3648
|
+
interface ChromePrintOptions {
|
|
3649
|
+
/**
|
|
3650
|
+
* Runs after the PDF loads and before the print dialog opens. Close any modal dialog
|
|
3651
|
+
* here: a modal dialog makes the rest of the page, including the print frame, inert.
|
|
3652
|
+
*/
|
|
3653
|
+
readonly beforePrint?: () => void | Promise<void>;
|
|
3654
|
+
}
|
|
3655
|
+
/**
|
|
3656
|
+
* A converted PDF, ready for the browser print dialog.
|
|
3657
|
+
* Call `dispose()` when the job ends: it removes the print frame and revokes `url`.
|
|
3658
|
+
* @public
|
|
3659
|
+
*/
|
|
3660
|
+
interface ChromePrintJob {
|
|
3661
|
+
/** An object URL for the PDF. It stays valid until `dispose()`. */
|
|
3662
|
+
readonly url: string;
|
|
3663
|
+
/**
|
|
3664
|
+
* Opens the browser print dialog for the PDF from a hidden frame.
|
|
3665
|
+
* Rejects with `ChromePrintError` when the browser has no PDF viewer, the frame cannot
|
|
3666
|
+
* load the PDF, or the job has ended. A browser without a PDF viewer would download the
|
|
3667
|
+
* PDF instead of loading it, so the frame is not created in that case.
|
|
3668
|
+
*/
|
|
3669
|
+
print(options?: ChromePrintOptions): Promise<void>;
|
|
3670
|
+
/** Removes the print frame and revokes `url`. Later `print()` calls reject. */
|
|
3671
|
+
dispose(): void;
|
|
3672
|
+
}
|
|
3673
|
+
/**
|
|
3674
|
+
* Saves the current document, converts it with the configured PDF handler, and prepares
|
|
3675
|
+
* the result for printing. Uses the same handler and checks as File > Export > PDF, so a
|
|
3676
|
+
* missing handler rejects with `ChromeExportError` before the document is saved.
|
|
3677
|
+
* Saving commits pending form input and can refresh field results with an undo step.
|
|
3678
|
+
* `container` receives the hidden print frame. For an editor inside a modal dialog,
|
|
3679
|
+
* pass an element inside that dialog.
|
|
3680
|
+
* @public
|
|
3681
|
+
*/
|
|
3682
|
+
declare function runChromePrint(editor: Pick<Editor, 'save'>, handlers?: ChromeExportHandlers, container?: Document | Element): Promise<ChromePrintJob>;
|
|
3683
|
+
|
|
3684
|
+
export { CHROME_GROUPS as C, DEFAULT_TABLE_CHROME_DRAFT as E, EMU_PER_POINT as H, IMAGE_OVERLAY_NUDGE_PT as Z, IMAGE_OVERLAY_NUDGE_SHIFT_PT as _, cssPixelsToLayoutPoints as a$, 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_, TABLE_BORDER_STYLE_OPTIONS as ap, TABLE_BORDER_TARGET_OPTIONS as aq, TABLE_BORDER_WIDTH_OPTIONS as ar, TABLE_CHROME_SLOT_IDS as as, 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, ChromeExportError as g, ChromePrintError as s };
|
|
3685
|
+
export type { ImageInteractionSession as $, AnchorFrameOrigin as A, CustomFontsResolver as B, DocxEditorInstance as D, DocxEditorConfig as F, DrawingSelectionIntent as G, EditorCommandExecute as I, EquationActivation as J, EquationChromeHandlers as K, EquationOps as L, FinalizedImageOverlayInteraction as M, FontLoadFailure as N, OpenPaginatedResult as O, PaginatedSurfaceOptions as P, FontLoadFailureReason as Q, FontMeasurementState as R, FontUrlSource as S, TableCommandPlan as T, HistoryGroupBinding as U, HistoryGroupBindingOptions as V, HyperlinkActivation as W, HyperlinkChromeHandlers as X, HyperlinkOps as Y, PaginatedSurface as a, ImageOverlayScrollPort as a0, ImageResizeHandle as a1, ImageResizeResult as a2, InvalidTextFormFieldChromeHandlers as a3, InvalidTextFormFieldSession as a4, LoadFontsRequest as a5, LoadFontsResult as a6, OverlayFrameRect as a7, PaginatedSurfaceState as a8, ParagraphPropertyEdit as a9, TableInteractionLabelKey as aA, TextFormFieldChromeHandlers as aB, TextFormFieldDialogSession as aC, ToolbarCommandState as aD, ToolbarSlotValue as aE, ToolbarValueMap as aF, ToolbarValueSlot as aG, PopupChromeRegistrationOptions as aa, RemoteCaretLabelAnchor as ab, RemoteCaretLabelHost as ac, ReviewWriteIntent as ad, RunTableChromeCommandResult as ae, SectionAnchor as af, SectionBreakInsertType as ag, SelectedDrawingOverlayTarget as ah, SurfaceEquation as ai, SurfaceFormatting as aj, SurfaceHyperlink as ak, SurfaceInsertImageInput as al, SurfaceNavigation as am, SurfaceOverlayCoordinates as an, SurfaceParagraphFormat as ao, TableBorderStyleOption as at, TableBorderTargetOption as au, TableBorderTargetValue as av, TableBorderWidthOption as aw, TableChromeDraft as ax, TableChromePick as ay, TableChromeSlotId as az, ChromeControl as d, ChromeControlId as e, ChromeControlState as f, ChromeExportFormat as h, ChromeExportHandlers as i, ChromeExportResult as j, ChromeGroup as k, ChromeGroupId as l, ChromeMenu as m, ChromeMenuEntry as n, ChromeMenuId as o, ChromeMenuItemEntry as p, ChromeMenuSeparatorEntry as q, ChromeMenuSubmenuEntry as r, ChromePrintErrorCode as t, ChromePrintJob as u, ChromePrintOptions as v, ChromeSlotId as w, ContentControlWidgetChromeHandlers as x, ContentControlWidgetSession as y, CustomFontsOptions as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk6745I4XF_cjs=require('./chunk-6745I4XF.cjs');require('./chunk-TKQH7BNE.cjs'),require('./chunk-DYRXA5UJ.cjs');var chunkFWX535CS_cjs=require('./chunk-FWX535CS.cjs');require('./chunk-JN62FLHE.cjs'),require('./chunk-KV5HFE23.cjs'),require('./chunk-RLO64PHP.cjs'),require('./chunk-Q4RDWB3U.cjs'),require('./chunk-BUDXZ7T2.cjs'),require('./chunk-PCPBDYEL.cjs'),require('./chunk-QTFAXWVI.cjs'),require('./chunk-EHT4LKKZ.cjs'),require('./chunk-T7RGKBCE.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-QK23BSRK.cjs'),require('./chunk-6KA3L3FR.cjs'),require('./chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunk6745I4XF_cjs.wa}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Aa}});Object.defineProperty(exports,"ChromeExportError",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Fb}});Object.defineProperty(exports,"ChromePrintError",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Hb}});Object.defineProperty(exports,"bindHistoryGroup",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Cb}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunk6745I4XF_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Ba}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunk6745I4XF_cjs.ja}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunk6745I4XF_cjs.la}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunk6745I4XF_cjs.cb}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunk6745I4XF_cjs.i}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunk6745I4XF_cjs.j}});Object.defineProperty(exports,"isChromePrintShortcut",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Ib}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunk6745I4XF_cjs.h}});Object.defineProperty(exports,"runChromeExport",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Gb}});Object.defineProperty(exports,"runChromePrint",{enumerable:true,get:function(){return chunk6745I4XF_cjs.Jb}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunk6745I4XF_cjs.ra}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunk6745I4XF_cjs.na}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkFWX535CS_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkFWX535CS_cjs.g}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkFWX535CS_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkFWX535CS_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkFWX535CS_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkFWX535CS_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkFWX535CS_cjs.j}});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export { B as Block,
|
|
2
|
-
export {
|
|
3
|
-
export { a as DocumentProtectionEdit, D as DocumentProtectionState } from './document-protection-
|
|
1
|
+
export { B as Block, r as ColorValue, C as CommentRecord, m as ContainerRef, s as ContentControl, n as ContentControlFilter, i as ContentControlType, t as DocAnchor, u as DocAnchorRange, q as DocComment, v as DocLocation, o as DocRange, j as DocTarget, w as DocumentBody, D as DocxDocument, ai as DocxDocumentJSON, aj as DrawingHorizontalReferenceFrame, a9 as DrawingKind, ac as DrawingLocks, ab as DrawingPositionInput, ak as DrawingVerticalReferenceFrame, x as ExecErrorCode, E as ExecResult, l as Extent, al as FontDefinition, H as HeaderFooterSet, aa as ImageWrapTarget, y as IndentFormatting, I as InsertableContentControlType, am as NumberingRef, an as PageMargins, P as Paragraph, ao as ParagraphDisagreements, z as ParagraphFlags, ad as ParagraphFormatCommand, A 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, p as Revision, h as RevisionAddress, _ as RevisionBatchResult, F as RevisionType, aq as Run, k as RunFormatting, G as Section, J as SectionProperties, ag as SelectionPin, K as StyleDefinition, S as StyleDefinitions, T as Table, ar as TableCell, as as TableRow, L as Theme, M as ThemeColorScheme, ah as Unsubscribe, ae as Watermark } from './types-barrel-DN_-gaRX.js';
|
|
2
|
+
export { b as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, c as VectorImageMime } from './image-resources-DkuzBnTM.js';
|
|
3
|
+
export { a as DocumentProtectionEdit, D as DocumentProtectionState } from './document-protection-CYIjO-li.js';
|
|
4
4
|
export { CollectReviewItems, EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
export { A as AuthoredNoteNumbering, C as CanResult,
|
|
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 { g as AnchorHighlightAnimation, A as AnchorHighlightOptions, y as AuthoredNoteNumbering, C as CanResult, f as ClearAnchorHighlightOptions, z as DocumentChange, B as DocumentEditingMode, G as DocumentHandle, D as DocumentSource, q as Editor, H as EditorAnchorNavigation, e as EditorCommand, J as EditorCommandShape, K as EditorCommands, L as EditorError, M as EditorEvents, E as EditorFontError, N as EditorFontErrorCode, O as EditorFormatPainterCommands, P as EditorHeaderFooterCommands, Q as EditorNoteCommands, R as EditorPosition, U as EditorQueries, V as EditorQuery, W as EditorQueryResults, X as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, Y as FormatPainterLevel, _ as FormatPainterMode, r as FormatPainterSurfaceState, $ as FurnitureVariant, a0 as HeaderFooterSlotArgs, a1 as HeaderFooterState, a2 as HyperlinkInfo, I as ImageContext, h as ImageCropPercent, a3 as NoteKind, a4 as NotePropertiesSide, a5 as NotePropertiesState, a6 as PageSetup, a7 as ResolveReviewChangesOptions, a8 as ResolvedNoteNumbering, a9 as ReviewActivationOptions, aa as ReviewCommentPlacement, ab as ReviewCustomPlacement, ac as ReviewItemPlacement, ad as ReviewItemPlacementBase, ae as ReviewItemQuery, af as ReviewRevisionPlacement, S as ScrollToAnchorOptions, j as SelectedImageState, t as TableBorderEdgeTarget, u as TableBorderSpec, w as TableBorderStyle, ag as TableBorderTarget, ah as TableCellVerticalAlignment, ai as TableColumnDividerResizeTarget, aj as TableColumnOccurrenceTarget, x as TableContext, ak as TableRightEdgeResizeTarget, al as TableRowOccurrenceTarget, am as TextMatch, T as TrackedChangeFilterMode, k as TrackedChangePredicate, an as ZoomFitTarget, Z as ZoomMode } from './editor-DhUQsWWH.js';
|
|
6
|
+
export { a as RevisionDisplayMode } from './revision-projection-CVJeA2jp.js';
|
|
7
|
+
export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-DQjtIruQ.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-BwoHFBlr.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-BYaCkGKO.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-BIyGh6L8.js';
|
|
15
15
|
import './collaboration/replication.js';
|
|
16
|
-
import './failure-
|
|
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-
|
|
16
|
+
import './failure-BIPVQbRm.js';
|
|
17
|
+
import './semantic-records-DB0VgWsr.js';
|
|
18
|
+
import './omml-equation-BY7OdfGY.js';
|
|
19
|
+
import './semantic-paint-DoPl85nR.js';
|
|
20
|
+
import './note-properties-DMfKK3QU.js';
|
|
21
|
+
import './custom-node-writes-77rvPW2-.js';
|
|
22
|
+
import './semantic-cell-selection-B8GF_H2e.js';
|
|
23
|
+
import './tree-session-contract-CHcCnz3W.js';
|
|
24
|
+
import './headless-document-view-Cc3fFWhv.js';
|
|
25
25
|
import 'prosemirror-model';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{wa as CHROME_GROUPS,Aa as CHROME_MENUS,
|
|
1
|
+
export{wa as CHROME_GROUPS,Aa as CHROME_MENUS,Fb as ChromeExportError,Hb as ChromePrintError,Cb as bindHistoryGroup,d as blankDocumentBytes,Ba as chromeMenuSlots,ja as commandForSlot,la as commandForSlotValue,cb as createDocxEditor,i as createFontSource,j as customFonts,Ib as isChromePrintShortcut,h as loadFonts,Gb as runChromeExport,Jb as runChromePrint,ra as runToolbarCommand,na as toolbarCommandState}from'./chunk-F5LAOPAD.js';import'./chunk-AJCCS53D.js';import'./chunk-Y5JCIWTF.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-GRVRQBKU.js';import'./chunk-XBYZTDF7.js';import'./chunk-RIYSCEFQ.js';import'./chunk-ZA6HEWUM.js';import'./chunk-WHG23WNI.js';import'./chunk-ZCRSPN4Q.js';import'./chunk-4OAXZNBU.js';import'./chunk-UMBHUW6R.js';import'./chunk-DZOGUV7O.js';import'./chunk-6QS5WL63.js';import'./chunk-VE6H5EJA.js';import'./chunk-6JIJOZDW.js';import'./chunk-KRBBWATQ.js';import'./chunk-XRBPZCNK.js';import'./chunk-S6J4O5XP.js';
|