@docx-editor.dev/core 2.17.0 → 2.18.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 +1 -1
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +35 -8
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +9 -11
- package/dist/binding.js +1 -1
- package/dist/chunk-2ZEU42EA.js +2 -0
- package/dist/chunk-4DB7ZFQN.js +1 -0
- package/dist/chunk-4KMSEFIG.js +3 -0
- package/dist/chunk-72BDQFHY.js +18 -0
- package/dist/chunk-77DD4EBC.cjs +11 -0
- package/dist/chunk-BEOPUDAB.js +5 -0
- package/dist/chunk-CG7CP632.cjs +1 -0
- package/dist/chunk-CJCFEXTA.js +11 -0
- package/dist/chunk-DQS4KZUX.js +4 -0
- package/dist/chunk-FZ2BIMCY.cjs +2 -0
- package/dist/chunk-GUPITGJQ.cjs +2 -0
- package/dist/chunk-KDYD5TAW.cjs +1 -0
- package/dist/chunk-LQ6XWTKQ.cjs +18 -0
- package/dist/chunk-MDP5SNK4.cjs +3 -0
- package/dist/chunk-MRPPCGCX.cjs +20 -0
- package/dist/chunk-MSIFK7TJ.js +1 -0
- package/dist/chunk-NJONXJJY.cjs +4 -0
- package/dist/chunk-OODFC5R2.js +1 -0
- package/dist/chunk-P6VGDI57.js +2 -0
- package/dist/{chunk-UIB2MDE3.cjs → chunk-PBM6WERF.cjs} +1 -1
- package/dist/chunk-QBMAXYN7.js +20 -0
- package/dist/chunk-SUEX3CL7.cjs +5 -0
- package/dist/{chunk-UXAWPVH6.js → chunk-THCGTV53.js} +1 -1
- package/dist/{chunk-NO7U62I2.cjs → chunk-YVYEJBLL.cjs} +1 -1
- package/dist/chunk-ZKQX2PNF.cjs +1 -0
- package/dist/{chunk-XXLS6O6B.js → chunk-ZMM5RNM6.js} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +2 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +4 -6
- package/dist/collaboration.js +1 -1
- package/dist/contracts/editor.d.ts +9 -8
- package/dist/contracts/modules.d.ts +7 -9
- package/dist/{custom-node-writes-ClTkWM7s.d.ts → custom-node-writes-BqIv94ei.d.ts} +14 -2
- package/dist/document-protection-BL5zp8cU.d.ts +19 -0
- package/dist/{editor-BlerWPyk.d.ts → editor-WXbTSXx1.d.ts} +14 -7
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +271 -30
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +15 -12
- package/dist/export.js +2 -2
- package/dist/{failure-BnGjoXf0.d.ts → failure-DNNmwsgD.d.ts} +1 -1
- package/dist/{font-resolver-DtADJcLL.d.ts → font-resolver-BSrKnTeR.d.ts} +5 -3
- package/dist/harfbuzz.wasm +0 -0
- package/dist/{headless-document-view-BDSeMGoK.d.ts → headless-document-view-C4ttQJ5H.d.ts} +11 -3
- package/dist/{index-D51bUVBE.d.ts → index-C3As-Xxp.d.ts} +133 -19
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -19
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-rTElghj2.d.ts → layout-shaping-Dqu3JW3p.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +23 -20
- package/dist/layout.js +1 -1
- package/dist/{note-properties-D5_fXW9K.d.ts → note-properties-RjYgbmXe.d.ts} +2 -2
- package/dist/{omml-equation-C9AJfWy5.d.ts → omml-equation-hcP9AUFX.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +16 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-K-Djpjjw.d.ts → protocol-OdRd17KZ.d.ts} +172 -7
- package/dist/{review-items-CiliAz8H.d.ts → review-items-CJz-kAW8.d.ts} +2 -2
- package/dist/{review-paragraph-order-BlSnyg9a.d.ts → review-paragraph-order--jLHXIcd.d.ts} +3 -3
- package/dist/{revision-projection-JiDclAFU.d.ts → revision-projection-BIHO_qvw.d.ts} +1 -1
- package/dist/{semantic-cell-selection-C-VsxNee.d.ts → semantic-cell-selection-lCYAVCCF.d.ts} +6 -24
- package/dist/{semantic-interaction-2vPh96Ey.d.ts → semantic-interaction-0vQXcMZk.d.ts} +2 -19
- package/dist/{semantic-paint-BEjYcsPK.d.ts → semantic-paint-BSan4pBk.d.ts} +10 -2
- package/dist/{semantic-records-Bc-MGXbM.d.ts → semantic-records-ZcYuB4-H.d.ts} +59 -13
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +49 -42
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-C71G7rIv.d.ts → tree-op-types-DbdM7fJV.d.ts} +84 -4
- package/dist/{tree-package-fragment-DRJkmfTW.d.ts → tree-package-fragment-1pdDnhZ_.d.ts} +491 -23
- package/dist/{tree-session-contract-Cp5W25RC.d.ts → tree-session-contract-Cgn6fQ-M.d.ts} +34 -9
- package/package.json +4 -4
- package/dist/chunk-27YEILW4.cjs +0 -20
- package/dist/chunk-4RDCLCLB.js +0 -2
- package/dist/chunk-7QG5FJ4X.js +0 -1
- package/dist/chunk-BML3CNUT.js +0 -2
- package/dist/chunk-CHRMIA3I.js +0 -20
- package/dist/chunk-FRRMJK2G.js +0 -5
- package/dist/chunk-G5GLQ4SX.cjs +0 -1
- package/dist/chunk-JP253KIZ.cjs +0 -2
- package/dist/chunk-JROG4U3Z.cjs +0 -21
- package/dist/chunk-MBXGQN6J.js +0 -1
- package/dist/chunk-MDMM3XVQ.js +0 -11
- package/dist/chunk-NPZX5O23.cjs +0 -2
- package/dist/chunk-OISZDVXT.cjs +0 -5
- package/dist/chunk-PRNYSOQL.cjs +0 -1
- package/dist/chunk-RXPOTTQQ.js +0 -21
- package/dist/chunk-T7JERNXT.cjs +0 -2
- package/dist/chunk-TDMGSCCL.cjs +0 -1
- package/dist/chunk-VYQTZIYH.js +0 -1
- package/dist/chunk-W7GY2IJC.js +0 -2
- package/dist/chunk-ZFBNCHRP.cjs +0 -11
- package/dist/hf-references-kSSFMq9X.d.ts +0 -70
- package/dist/tree-store-BRfhZceK.d.ts +0 -416
- /package/dist/{dist-OSUJGKTK.js → dist-PKZR6RSH.js} +0 -0
package/dist/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b,k,c as c$1,d,r as r$1,h,o,l,q}from'./chunk-MBXGQN6J.js';import {qb,y,Ib,md,ae,ld,B,D,C,c,I as I$1,z,x,F,nb,ge,r,w as w$1,fa,R,Te as Te$1,Se,Ve as Ve$1,g,a,d as d$2,be,Ee,Zd,bd,b as b$2,Fa,Vd,h as h$1,Va,dd,Ya,_a,Xa,cd,$a,Za,ab,Wa,Da,Ga,Ca,xa,Na,Ye,jf,af,cf,bf,uc}from'./chunk-RXPOTTQQ.js';import'./chunk-RIYSCEFQ.js';import {d as d$1,b as b$1,a as a$1}from'./chunk-VYQTZIYH.js';import'./chunk-VP7SDFCM.js';import {I}from'./chunk-BML3CNUT.js';import {P,Q,ya,ua,va,La,Fa as Fa$1}from'./chunk-W7GY2IJC.js';import {yb,Jf,Kf,hd,gd,da,E,Rd,la,je as je$1,ma,Od,lh,Te as Te$2,Va as Va$1,fb,W,Ua,Ta,jb,ib,Sa,kg,nh}from'./chunk-MDMM3XVQ.js';var mn=new WeakMap,ar=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function ir(e){let t=mn.get(e.root);if(t)return t;let n=new Set,r=[{node:e.root,scope:Va$1(),depth:0,mcSelected:false}],o=0;for(;r.length;){let{node:i,scope:s,depth:u,mcSelected:f}=r.pop();if(++o>fb||u>W){n.add("scan-limit");break}if(i.kind==="textValue")continue;if(o+r.length+i.children.length>fb){n.add("scan-limit");break}let l=Ua(s,i),d=Ta(i)?i:void 0;if(d){if(jb(d,l).drawing)continue;let c=ib(d,l);c.refused&&n.add("scan-limit"),c.branch&&r.push({node:c.branch,scope:l,depth:u+1,mcSelected:true});continue}if(!(!f&&Sa(i))){if(i.namespaceUri==="urn:schemas-microsoft-com:vml"&&i.localName==="textbox"){n.add("legacy-textbox");continue}i.namespaceUri==="urn:schemas-microsoft-com:vml"&&ar.has(i.localName)&&!i.children.some(c=>c.kind!=="textValue"&&c.namespaceUri==="urn:schemas-microsoft-com:vml"&&c.localName==="textbox")&&n.add("legacy-drawing");for(let c of i.children)r.push({node:c,scope:l,depth:u+1,mcSelected:f});}}let a=Object.freeze([...n]);return mn.set(e.root,a),a}function yn(e){let t=new Set([e.part()]);for(let n of e.headerFooterPartsBySection())for(let r of [n.headers,n.footers])for(let o of r.values())t.add(o);for(let n of ["footnote","endnote"]){let r=Jf(e.currentPackage(),n);r&&t.add(r);}return Object.freeze([...t].flatMap(n=>ir(n).map(r=>Object.freeze({code:r,partName:n.name}))))}var sr=Object.freeze({}),cr=Object.freeze([]);function dr(e){let t=Object.keys(e);if(t.length===0)return sr;let n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=o);}return Object.freeze(n)}function lr(e){let t=new Map(Te$2(e.part())),n=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!n.has(i)){n.add(i);for(let[s,u]of Te$2(i))t.has(s)||t.set(s,u);}let r=e.currentPackage();for(let o of ["footnote","endnote"]){let a=Jf(r,o);if(!(!a||n.has(a))){n.add(a);for(let[i,s]of Te$2(a))t.has(i)||t.set(i,s);}}return t}function ur(e,t){let n=jf(e,t);if(!n)return null;let r=e.pages[n.pageIndex];if(!r)return null;let o=af(r),a=cf(e,t.paragraphId,n.pageIndex),i=Object.freeze({x:n.x+a.x,y:n.y+a.y,height:n.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:n.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function pr(e,t){let n=[];for(let r of t.values()){let o=ur(e,r);o&&n.push(o);}return n.length===0?cr:Object.freeze(n)}function gn(e,t){return {documentMetadata:dr(e.documentProperties()),destinations:pr(t,lr(e))}}function fr(e,t){let n=e.destinations;if(n){for(let r of n)if(r.anchor.name===t)return r}}function Oe(e={}){return Object.freeze({async decode(t,n,r){let o=yb(t,n);if(!o)throw new Error(`Unsupported or malformed ${n} image`);if(o.pixelWidth>r.maxDimension||o.pixelHeight>r.maxDimension||o.pixelWidth>r.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var mr=65536;function bn(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function yr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function gr(e,t,n){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===n:true}function hr(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let n=null;return Ca(e,r=>{if(n||!gr(t,r.story,r.noteScopeId))return;let o=r.story==="header"||r.story==="footer"?a=>xa(a,r.origin,{x:e.box.x,y:e.box.y}):void 0;Ga(r.host,(a,i)=>{if(n||i.textboxDepth===0)return;let s=i.textboxPath.map(u=>u.drawingNodeId);yr(s,t.textboxPath)&&(n=bn(e,i.storyOrigin));},r.origin,o);}),n}function xr(e,t){if(t.story==="textbox")return hr(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?bf(e,e.header.box):{x:0,y:0};case "footer":return e.footer?bf(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let r=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return r?bf(e,r.box):{x:0,y:0}}case "note-separator":{let n=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes;return n?.separator?bf(e,n.separator.box):{x:0,y:0}}default:return {x:0,y:0}}}function Rn(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function En(e,t){let n=af(e);return Object.freeze({x:n.x+t.x,y:n.y+t.y,width:t.width,height:t.height})}function br(e,t){let n=jf(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!n||n.pageIndex!==t.pageIndex)return;let r=e.pages[n.pageIndex];if(!r)return;let o=xr(r,t),a=Object.freeze([Rn({x:n.x+o.x,y:n.y+o.y,width:0,height:n.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(r,i)))})}function Rr(e,t,n){let r=n.filter(i=>i.pageIndex===t.pageIndex);if(r.length===0)return wn(t)?br(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(r.map(i=>Rn(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(o,i)))})}function wn(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function xn(e,t){return `${e}\0${t}`}function Er(e,t,n){let r=Math.max(e.start,t.offset),o=Math.min(e.end,n.offset);return o>r?{start:r,end:o}:null}function wr(e,t){let n=new Map,r=new Map,o=new Set,a=0;let i=(s,u)=>{if(a>=mr)return false;a+=1;let f=xn(s.pageIndex,u),l=r.get(f);return l?l.push(s):r.set(f,[s]),true};for(let[s,u]of t.entries())for(let[f,l]of u.occurrences.entries()){if(wn(l)||l.source.start.paragraphId!==l.source.end.paragraphId)continue;o.add(l.pageIndex);let d=`${s}\0${f}`,c={paragraphId:l.source.start.paragraphId,offset:l.source.start.offset},m={paragraphId:l.source.end.paragraphId,offset:l.source.end.offset},y=c.offset<=m.offset?{from:c,to:m}:{from:m,to:c};i({key:d,from:y.from,to:y.to,pageIndex:l.pageIndex},y.from.paragraphId);}if(r.size===0)return n;for(let s of e.pages)o.has(s.index)&&Ca(s,u=>{let f=u.story==="header"||u.story==="footer"?l=>xa(l,u.origin,{x:s.box.x,y:s.box.y}):void 0;Ga(u.host,(l,d)=>{let c=bn(s,d.storyOrigin);for(let m of l.lines)for(let y of Na(m)){let p=r.get(xn(s.index,y.paragraphId));if(p)for(let x of p){let h=Er(y,x.from,x.to);if(!h)continue;let b=Ye(m,h.start,void 0,y),E=Ye(m,h.end,void 0,y),P=n.get(x.key)??[];P.push({pageIndex:s.index,x:Math.min(b,E)+c.x,y:m.box.y+c.y,width:Math.abs(E-b),height:m.box.height}),n.set(x.key,P);}}},u.origin,f);});return n}function Fn(e,t){let n=false;for(let o of t)if(o.occurrences.length!==0){n=true;break}if(!n)return t;let r=wr(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,u)=>{let f=`${a}\0${u}`,l=Rr(e,s,r.get(f)??[]);return l?{...s,geometry:l}:s});return {...o,occurrences:Object.freeze(i)}})}function Fr(e){let t=new Map,n=[{node:e.root,depth:0}];for(;n.length>0;){let{node:r,depth:o}=n.pop();if(!(r.kind==="textValue"||o>64)){r.kind==="paragraph"&&!t.has(r.id)&&t.set(r.id,t.size);for(let a=r.children.length-1;a>=0;a-=1)n.push({node:r.children[a],depth:o+1});}}return t}function Sn(){let e=new Map,t=r=>{let o=e.get(r.root);if(o)return o;let a=Fr(r);return e.set(r.root,a),a},n={retainRevisionItems:false,revisionSites:nh,locations:Fa$1,commentAnchors:kg,deepOrder:t};return Object.freeze({collectReviewItems:r=>La(r,n),deepParagraphOrderOfPart:t})}function Sr(e,t){if(t)return true;let n=e.map(r=>r.root);for(;n.length>0;){let r=n.pop();if(lh(r))return true;if(r.kind!=="textValue")for(let o of r.children)n.push(o);}return false}function vr(e,t){let n=[],r=new Set([t.name]),o=a=>{!a||r.has(a.name)||(r.add(a.name),n.push(a));};for(let a of Od(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(Jf(e,"footnote")),o(Jf(e,"endnote")),n}function Or(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return Jf(e,"footnote")?.name??null;case "endnote":return Jf(e,"endnote")?.name??null;case "note-separator":return Jf(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function Pr(e,t){let n=new Map;for(let r of e){let o=t.get(r.partName),a=o?.get(r.start.paragraphId),i=o?.get(r.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),u=Math.max(a,i),f=n.get(r.partName);n.set(r.partName,{lower:Math.min(f?.lower??s,s),upper:Math.max(f?.upper??u,u)});}return n}function Ir(e,t,n,r,o){let a=new Map(n.map(d=>[d.name,o(d)])),i=Pr(r,a),s=new Map,u=new Map,f=(d,c,m,y,p,x,h)=>{let b=a.get(d)?.get(p),E=i.get(d);if(b===void 0||!E||b<E.lower||b>E.upper)return;let P=s.get(d)??new Map;s.set(d,P);let q=u.get(d)??new Map;u.set(d,q);let z=JSON.stringify([c.story,c.noteScopeId,c.noteAreaKind]),ne=m==="textbox"?JSON.stringify([z,"textbox",y]):z,$=P.get(p)??[],G=`${p}\0${c.page.index}\0${ne}`,B=q.get(G);B||(B={pageIndex:c.page.index,story:m,rootStory:c.story,textboxPath:y,noteScopeId:c.noteScopeId,noteAreaKind:c.noteAreaKind,laneKey:ne,intervals:[],intervalKeys:new Set},q.set(G,B),$.push(B),P.set(p,$));let R=`${x}\0${h}`;B.intervalKeys?.has(R)||(B.intervalKeys?.add(R),B.intervals.push({start:x,end:h}));};Da(e,d=>{let c=Or(t,d);!c||!i.has(c)||Ga(d.host,(m,y)=>{let p=y.textboxDepth>0?"textbox":d.story,x=y.textboxPath.map(b=>b.drawingNodeId),h=[];for(let b of m.lines){for(let E of b.spans)h.push(E.range);for(let E of b.drawings??[])h.push({paragraphId:E.paragraphId,start:E.start,end:E.start+1});}h.length===0&&h.push({paragraphId:m.range.paragraphId,start:m.range.start,end:m.range.end});for(let{paragraphId:b,start:E,end:P}of h)f(c,d,p,x,b,E,P);});}),Fa(e,d=>{let c=d.drawing.ownerPartName;i.has(c)&&f(c,d.root,d.story,d.textboxPath.map(m=>m.drawingNodeId),d.drawing.paragraphId,d.drawing.start,d.drawing.start+1);});for(let d of s.values())for(let c of d.values())for(let m of c){m.intervals.sort((p,x)=>p.start-x.start||p.end-x.end);let y=[];for(let p of m.intervals){let x=y.at(-1);x&&p.start<=x.end?x.end=Math.max(x.end,p.end):y.push({...p});}m.intervals.splice(0,m.intervals.length,...y),m.intervalKeys=void 0;}let l=new Map;for(let[d,c]of s){let m=a.get(d);if(!m)continue;let y=[];for(let[p,x]of c){let h=m.get(p);h!==void 0&&y.push({paragraphId:p,position:h,laneKeys:new Set(x.map(({laneKey:b})=>b))});}y.sort((p,x)=>p.position-x.position),l.set(d,y);}return {byPart:s,orderByPart:a,visibleByPart:l}}function vn(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>>1;e[o].position<t?n=o+1:r=o;}return n}function Ar(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let n=t.orderByPart.get(e.partName),r=t.visibleByPart.get(e.partName),o=n?.get(e.start.paragraphId),a=n?.get(e.end.paragraphId);if(!n||!r||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),u=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:d})=>d)??[]),f=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:d})=>d)??[]),l=new Set([...u].filter(d=>f.has(d)));return l.size===0?[e.start.paragraphId,e.end.paragraphId]:r.slice(vn(r,i),vn(r,s+1)).filter(d=>[...d.laneKeys].some(c=>l.has(c))).map(d=>d.paragraphId)}function Dr(e,t,n,r){return r?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,n)};return a.end>a.start?[a]:[]})}function Lr(e,t){let n=Number.NEGATIVE_INFINITY;for(let r of e)for(let o of r.intervals)n=Math.max(n,o.end);return t!==n?new Set:new Set(e.filter(r=>r.intervals.some(o=>o.end===n)))}function On(e,t,n){let r=[],o=new Set;for(let[a,i]of e.entries()){let s=n===void 0?void 0:n===null?"neutral":a<n?"replaced":"replacement";for(let u of Ar(i,t)){let f=t.byPart.get(i.partName)?.get(u)??[],d=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,c=u===i.start.paragraphId?i.start.offset:0,m=u===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,y=d?Lr(f,c):new Set;for(let p of f){let x=Dr(p,c,m,d);d&&x.length===0&&y.has(p)&&(x=[{start:c,end:c}]);for(let h of x){let b=`${p.pageIndex}\0${p.story}\0${p.noteScopeId??""}\0${p.noteAreaKind??""}\0${p.textboxPath.join("\0")}\0${i.partName}\0${u}\0${h.start}\0${h.end}\0${s??""}`;o.has(b)||(o.add(b),r.push({pageIndex:p.pageIndex,physicalPageNumber:p.pageIndex+1,story:p.story,rootStory:p.rootStory,textboxPath:p.textboxPath,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:u,offset:h.start},end:{paragraphId:u,offset:h.end}}}));}}}}return r}function In(e,t){let n=2166136261,r=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);n=Math.imul(n^a,16777619)>>>0,r=Math.imul(r^a+o,2246822507)>>>0,r^=r>>>13;}return `${e}_${t.length.toString(36)}_${n.toString(36)}_${r.toString(36)}`}function Pn(e,t,n=In){let r=new Map;for(let a of t){let i=n(e,a),s=r.get(i)??new Set;s.add(a),r.set(i,s);}let o=new Map;for(let[a,i]of r){let s=[...i].sort();for(let[u,f]of s.entries())o.set(f,s.length===1?a:`${a}_${u.toString(36)}`);}return o}function Tr(e){let t=new Set,n=new Set;for(let r of e){if(r.kind==="comment"){t.add(r.id),r.parentId!==void 0&&t.add(r.parentId),r.parentRevisionId!==void 0&&n.add(r.parentRevisionId);for(let o of r.replyIds)t.add(o);}if(r.kind==="revision"){n.add(r.id),r.pairedWith!==void 0&&n.add(r.pairedWith);for(let o of r.replyIds)t.add(o);}}return {comment:Pn("comment",t),revision:Pn("change",n)}}function V(e,t,n){return e.get(n)??In(t,n)}function Mr(e,t,n){return e.kind==="revision"?{kind:"tracked-change",id:V(n.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:e.text,replacedText:e.replacedText,nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:V(n.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),occurrences:t?On(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:V(n.comment,"comment",e.id),author:e.comment.author,initials:va(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:ua(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:V(n.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:V(n.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),orphaned:e.orphaned,occurrences:t&&e.range?On([e.range],t):[]}}function An(e,t){let n=t.parts.get(t.mainDocumentPart);if(!n)return [];let r=vr(t,n),o=[n,...r],a=t.parts.get(P(t,n.name));if(!Sr(o,a))return [];let i=Sn(),s=i.collectReviewItems({storyPart:n,furnitureParts:r,commentsPart:a,commentsExtendedPart:t.parts.get(Q(t,n.name))});if(s.length===0)return [];let u=s.flatMap(d=>ya(d)),f=u.length>0?Ir(e,t,o,u,i.deepParagraphOrderOfPart):null,l=Tr(s);return s.map(d=>Mr(d,f,l)).filter(d=>d!==null)}var kr=new Set(["part","validatedHandle"]);function Dn(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function J(e,t,n,r,o){if(!(r!==void 0&&kr.has(r))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(n.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),n.add(e);try{if(Array.isArray(e)){for(let a of e)J(a,t,n,void 0,o);Object.freeze(e);return}if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");J(i.value,t,n,a,o);}}Object.freeze(e);}finally{n.delete(e);}}}}}function Ln(e){if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let r of e.pages)if(!(r===null||typeof r!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(r,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),J(i,new Set,s,o),t.add(i);}let n=(r,o)=>{let a=new Set;for(let i of r){let s=new Set;s.add(e),J(i,a,s,void 0,o);}Object.freeze(r);};for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(r==="pages"&&Array.isArray(o.value)){n(o.value,t);continue}if(r==="reviewArtifacts"&&Array.isArray(o.value)){n(o.value);continue}let a=new Set;a.add(e),J(o.value,new Set,a,r);}return Object.freeze(e),e}var Nr=Object.freeze([]),w=class extends Error{constructor(n,r,o){super(r,o);this.code=n;this.name="ExportResourceError";}code};function Br(e){try{return e instanceof w}catch{return false}}function Cr(e){try{return e instanceof Vd}catch{return false}}function _r(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function jr(e){if(Br(e))return e;let t=Cr(e),n=_r(e),r=n?`: ${n}`:"",o=new w(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${r}`:`Export layout failed${r}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function zr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function Tn(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var Ur=50,Pe=64;function Vr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function Hr(e){let t=false;return Fa(e,({drawing:n})=>{Vr(n.resource)&&(t=true);}),t}function Mn(e){return !ArrayBuffer.isView(e)}function Ie(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=Tn(t.displayMode??qb),r=Mn(e),o=Mn(e)?{ok:true,view:e}:I(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??r,s=zr(t.resourceTimeoutMs),u=t.measurer??y(),f=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),l$1=Ib({retainAcrossPasses:i}),d=0,c=new Set,m=()=>{d+=1;for(let R of c)R();c.clear();},y$1=md({session:a,decodePort:t.imageDecodePort??Oe(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:m}),p={view:a,measurer:u,paragraphCache:l$1,sessions:new Map,completed:new Map,inFlight:new Map,styles:ld(a),fieldLinks:new Map,links:ae(a),drawingBundle:y$1,furniture:new Map},x=new AbortController,h=t.signal,b=false,E=()=>b?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),P=()=>{b=true,q();};function q(){let R=p;if(R){p=null,h?.removeEventListener("abort",P),x.abort(h?.reason),R.drawingBundle.dispose(),R.paragraphCache.clear();for(let F of R.completed.values())nb(F.internal),ge(F.internal);for(let F of R.fieldLinks.values())F.registry.clear();R.fieldLinks.clear(),R.completed.clear(),R.inFlight.clear(),R.furniture.clear(),R.sessions.clear(),m();}}h?.addEventListener("abort",P,{once:true}),h?.aborted&&P();let z=()=>{if(!p)throw E();if(x.signal.aborted)throw new w("aborted","Export resource settlement was aborted")},ne=(R,F,D,g)=>d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D?Promise.resolve():(z(),new Promise((U,I)=>{let L=false,C,T=k=>{L||(L=true,C!==void 0&&clearTimeout(C),c.delete(M),x.signal.removeEventListener("abort",W),k?I(k):U());},M=()=>T(),W=()=>T(new w("aborted","Export resource settlement was aborted")),K=()=>{if(p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}let k=g-Date.now();if(k<=0){T(new w("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(K,Math.min(Ur,k));};if(c.add(M),x.signal.addEventListener("abort",W,{once:true}),d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}K();})),$=async(R,F=0,D=Date.now()+s)=>{if(z(),Date.now()>=D)throw new w("timedOut",`Export layout did not stabilize within ${s}ms`);let g=p,U=D,I=g.view.packageRevision(),L=g.view.currentPackage(),C=g.completed.get(R);if(C&&C.revision===I&&C.pkg===L)return C.published;let T=()=>{if(g.view.packageRevision()===I&&g.view.currentPackage()===L)return null;if(F>=Pe-1)throw new w("nonConvergent","Document revision did not stabilize during export layout");return $(R,F+1,U)},M=g.fieldLinks.get(R);if(!M||M.revision!==I||M.pkg!==L){let O=M?.registry??be();O.clear(),M={revision:I,pkg:L,registry:O},g.fieldLinks.set(R,M),g.furniture.delete(R);}let W=M.registry,K=g.sessions.get(R)??Ee();g.sessions.set(R,K);let k=g.furniture.get(R);k||(k=Zd({view:g.view,measurer:g.measurer,producer:f,cache:g.paragraphCache,styleCascade:g.styles.styleCascade,numberingIndex:g.styles.numberingIndex,defaultTabStopPt:g.styles.defaultTabStopPt,compatibilityMode:g.styles.compatibilityMode,displayMode:R,revisionAuthorFilter:void 0,inlineDrawingLayoutForPart:O=>g.drawingBundle.contextForPart(O),drawingLayoutTokenForPart:O=>g.drawingBundle.cacheTokenForPart(O),drawingTokenForParagraphForPart:(O,ye)=>g.drawingBundle.drawingTokenForParagraph(ye,O),linkProjectors:g.links,projectFieldLink:O=>W.project(O)}),g.furniture.set(R,k));for(let O=0;O<Pe;O+=1){let ye=d;g.drawingBundle.sync(g.view);let He=T();if(He)return He;let _=l({view:g.view,revision:g.view.packageRevision(),measurer:g.measurer,cache:g.paragraphCache,session:K,producer:f,styleCascade:g.styles.styleCascade,defaultTabStopPt:g.styles.defaultTabStopPt,numberingIndex:g.styles.numberingIndex,furniture:k,compatibilityMode:g.styles.compatibilityMode,linkProjectors:g.links,projectFieldLink:v=>W.project(v),inlineDrawingLayout:g.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>g.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>g.drawingBundle.drawingTokenForParagraph(v,g.view.part().name),drawingTokenForParagraphForPart:(v,re)=>g.drawingBundle.drawingTokenForParagraph(re,v),drawingLayoutEpoch:g.drawingBundle.cacheTokenForPart(g.view.part().name),drawingLayoutEpochForPart:v=>g.drawingBundle.cacheTokenForPart(v),displayMode:R,revisionAuthorFilter:void 0});if(!Hr(_)){let v=T();if(v)return v;i||(nb(_),ge(_),g.paragraphCache.clear(),g.sessions.delete(R),g.furniture.delete(R));let re=An(_,L),nr=re.length===0?Nr:Object.freeze(Fn(_,re)),rr=gn(g.view,_),or={..._,...rr,contentWarnings:yn(g.view),reviewArtifacts:nr},Ge=Ln(or);return g.completed.set(R,{revision:I,pkg:L,internal:_,published:Ge}),Ge}let qe=ye;for(;g.drawingBundle.pendingResourceCount()>0;){await ne(qe,I,L,U),qe=d,z();let v=T();if(v)return v}z();let $e=T();if($e)return $e}throw new w("nonConvergent",`Image resources did not reach quiescence after ${Pe} layout passes`)},G=R=>{let F;try{F=Tn(R);}catch(I){return Promise.reject(I)}if(!p)return Promise.reject(E());let D=p,g=D.inFlight.get(F);if(g)return g;let U=$(F).catch(I=>{throw jr(I)}).finally(()=>D.inFlight.delete(F));return D.inFlight.set(F,U),U};return {ok:true,session:{layout:()=>G(n),layoutFor:G,validatedImageBytes(R){let F=p;return !F||R.resource.kind!=="ready"?null:F.drawingBundle.mintValidatedBytes(R.resource.validatedHandle,R.resource.contentId)?.slice()??null},dispose:q}}}var Ae=b$2;function De(e){return typeof e.admittedFontFace=="function"}var qr=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function pe(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function Le(e){let t=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:pe(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:t?Object.freeze({requested:pe(t.requested),resolved:pe(t.resolved),...t.lineMetrics?{lineMetrics:Object.freeze({...t.lineMetrics})}:{}}):null})}function $r(e){return Object.freeze({...Le(e),bytes:h$1(e)})}function Gr(e,t){if(!e)return null;try{let n=e(t);return !n||n instanceof d$2?null:$r(n)}catch{return null}}function kn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return Gr(e.resolve(),t)}}function Wr(e){return Object.freeze(e.slice(0,Ae).map(t=>Object.freeze({request:pe(t.request),partName:t.partName,reason:t.reason})))}function Te(e,t,n,r,o=[]){let a=new Map;for(let s of [...e,t]){let u=s.toLowerCase();a.has(u)||a.set(u,s);}let i=[...a.values()].map(s=>{let u=[];for(let f of qr){let l=r?.({family:s,...f});!l||l instanceof d$2||u.push(Object.freeze({...f,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:s,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:t,families:Object.freeze(i),originFailures:Object.freeze([...n]),droppedEmbeddedFonts:Wr(o)})}function Me(e,t){if(t.onFontResolution){try{let n=t.onFontResolution(e);Promise.resolve(n).catch(r=>{console.warn("[fonts] font-resolution diagnostics callback failed",r);});}catch(n){console.warn("[fonts] font-resolution diagnostics callback failed",n);}return}for(let n of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",n);for(let n of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",n);}function ke(e,t){if(t.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(r=>r.coverage==="complete"))return;let n=e.families.filter(r=>r.coverage!=="complete").map(r=>r.family).join(", ");throw new w("layoutFailed",`Strict font policy refused export${n?`; incomplete families: ${n}`:"; a font origin failed"}`)}function fe(){return new Map}function Ne(e,t,n,r){if(n.trim().length===0)return null;let o={family:n,weight:r.bold?700:400,style:r.italic?"italic":"normal"},a=g(o),i=t.get(a);if(!i){try{i=e.fonts.resolve(o);}catch{return null}t.set(a,i);}return i instanceof d$2?null:i}function Nn(e,t,n){let r=n.fontFamily??e.defaultFont.family;return Ne(e,t,r,n)}function Be(e){return typeof e.shapeLaidOutText=="function"}function Ce(e){let t=fe(),n=new WeakMap;return r=>{let o=fa(r.style,r.fontSlot),a=R(r.text,o);if(a.length===0)return null;let i=o.fontFamily??e.defaultFont.family,s=Ne(e,t,i,o);if(!s)return null;try{if(o.smallCaps&&!Te$1(e.shaper,e.environment,s,o,n))return null;let u=Se(e.shaper,e.environment,s,o,a);return Object.freeze({run:u,font:Le(s),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Bn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(t)??null}}var ee=new Map,me=new WeakMap,_e=0,te,je=32,Cn=c;function _n(){if(te)return te;let e=(async()=>(await r(),w$1(z)))();return te=e,e.catch(()=>{te===e&&(te=void 0);}),e}function jn(e){let t=fe();return Ve$1(e,{resolveFont(n){return Nn(e,t,n)},fallback:y()})}async function zn(e,t){if(!B(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let n=await _n(),r=await I$1(e,n,z,t);return Object.freeze({createMeasurer:()=>jn(r),resolveFont:o=>r.fonts.resolve(o),shapeLaidOutText:Ce(r),producer:["node-export-session",e.fingerprint,r.operation.shapingHash,`producer:${r.operation.producerVersion}`,`fallback:${x}`].join("|"),extensionFingerprint:e.fingerprint})}function Kr(e,t){if(!B(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=me.get(e);if(n)return n;let r=D(e),o=ee.get(r);if(!o){if(ee.size>=je)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${je} process-wide configurations`));o=(async()=>{let u=C(e).sources.reduce((l,d)=>l+(d.availability==="forbidden"?0:d.bytes.byteLength),0);if(_e+u>Cn)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Cn} process-wide`);_e+=u;let f;try{let l=await _n();f=await I$1(e,l,z,t);}catch(l){throw _e-=u,l}return Object.freeze({createMeasurer:()=>jn(f),shapeLaidOutText:Ce(f),shapingHash:f.operation.shapingHash,producerVersion:f.operation.producerVersion})})(),ee.set(r,o),o.catch(()=>{ee.get(r)===o&&ee.delete(r);});}let a=e.fingerprint,i=o.then(s=>Object.freeze({createMeasurer:s.createMeasurer,shapeLaidOutText:s.shapeLaidOutText,producer:["node-export",a,s.shapingHash,`producer:${s.producerVersion}`,`fallback:${x}`].join("|"),extensionFingerprint:a}));return me.set(e,i),i.catch(()=>{me.get(e)===i&&me.delete(e);}),i}var Xr="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Yr(e){let t=e.currentPackage(),n=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.type===Xr),r;if(n){let o=E(n);o.mode==="Internal"&&o.target.ok&&(r=t.parts.get(o.target.partName));}return r??=t.parts.get("/word/fontTable.xml"),Rd(t,r)}function Un(e,t){let n=Yr(e);if(n.length!==0)return h(r=>{let o$1=new Set((r.resolvedFaces??[]).map(i=>g(i))),a$1=o(n,{maxFontBytes:a,aggregateBudget:Qr(r),shadowedRequests:o$1});if(t)for(let i of a$1.dropped){if(t.dropped.length>=Ae)break;t.dropped.push(i);}return {sources:a$1.sources}})}function Qr(e){let t=e.committedSourceBytes;return t===void 0||!Number.isSafeInteger(t)||t<=0?c:Math.max(0,c-t)}function Zr(e){return De(e)&&Be(e)}var N=0,Vn=Symbol("font-resolution-timeout");function Jr(e){let t=0,n=false;return e?.(N),{reserve:o=>{if(n)throw new Error("Document font-byte lease is already released");if(N+o>c)throw new w("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${o} bytes with ${N} bytes already active`);N+=o,t+=o,e?.(N);let a=false;return ()=>{a||n||(a=true,N-=o,t-=o,e?.(N));}},release:()=>{n||(n=true,N-=t,t=0,e?.(N));}}}function Ue(e,t){return e.attributes.find(n=>n.localName===t)?.value}function eo(e,t){return e.attributes.find(n=>n.localName===t&&(n.namespaceUri===da||n.namespaceUri===""))?.value}async function to(e,t){if(t.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=I(e);if(!n.ok)return n;let{fonts:r,fontResolutionTimeoutMs:o,fontPolicy:a,onFontResolution:i,...s}=t,u=Array.isArray(r)?r:[r],f,l;try{l=await no(n.view,u,{signal:t.signal,timeoutMs:o??t.resourceTimeoutMs,fontPolicy:a,onFontResolution:b=>(f=b,i?.(b))});}catch(b){if(b instanceof w&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!f)throw l?.dispose(),new w("layoutFailed","Document font resolution completed without publishing its evidence");let d;try{d=Ie(n.view,{...s,reuseAcrossRevisions:!1,...l?{measurer:l.createMeasurer(),producer:t.producer??l.producer}:t.producer?{producer:t.producer}:{}});}catch(b){throw l?.dispose(),b}if(!d.ok)return l?.dispose(),d;let c=d.session,m=l,y="active",p=()=>y==="aborted"?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),x=b=>{if(y==="active"){y=b,t.signal?.removeEventListener("abort",h);try{c.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>x("aborted");return t.signal?.addEventListener("abort",h,{once:true}),t.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:f,layout:()=>y==="active"?c.layout():Promise.reject(p()),layoutFor:b=>y==="active"?c.layoutFor(b):Promise.reject(p()),validatedImageBytes:b=>y==="active"?c.validatedImageBytes(b):null,admittedFontFace:kn({status:()=>y,unavailable:p,resolve:()=>m?.resolveFont}),shapeLaidOutText:Bn({status:()=>y,unavailable:p,shaping:()=>m}),dispose:()=>x("disposed")})}}async function no(e,t,n={}){let r=ro(n.timeoutMs),o=new AbortController,a=()=>o.abort(n.signal?.reason);n.signal?.addEventListener("abort",a,{once:true}),n.signal?.aborted&&a();let i=setTimeout(()=>o.abort(Vn),r);try{ze(o.signal);let s=(async()=>{let u=Jr(n.onActiveFontBytesChange),f=!1;try{let l=ao(e).slice(0,b),d$1=[],c={dropped:[]},m=Un(e,c),y=m?[...t,m]:t,p=await k(y,{families:l,defaultFamily:c$1.family,signal:o.signal},{onOriginFailure:E=>d$1.push(E),reserveOwnedBytes:u.reserve});ze(o.signal);let x=d(p??{});if(x.sources.length===0){let E=Te(l,x.defaultFont.family,d$1,void 0,c.dropped);Me(E,n),ke(E,n);return}let h=await zn(F(x));ze(o.signal);let b$1=Te(l,x.defaultFont.family,d$1,h.resolveFont,c.dropped);return Me(b$1,n),ke(b$1,n),f=!0,Object.freeze({...h,dispose:u.release})}finally{f||u.release();}})();return await Promise.race([s,oo(o.signal)])}finally{clearTimeout(i),n.signal?.removeEventListener("abort",a);}}function ro(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 oo(e){return new Promise((t,n)=>{let r=()=>{n(Hn(e));};e.aborted?r():e.addEventListener("abort",r,{once:true});})}function Hn(e){let t=e.reason===Vn;return new w(t?"timedOut":"aborted",t?"Font resolution timed out":"Font resolution was aborted",t?void 0:{cause:e.reason})}function ze(e){if(e.aborted)throw Hn(e)}function ao(e){let t=[e.part().root],n=[],r=[],o=new Set([e.part().name]),a=(l,d)=>{!d||o.has(d.name)||(o.add(d.name),l.push(d.root));};for(let l of e.headerFooterPartsBySection()){for(let d of l.headers.values())a(n,d);for(let d of l.footers.values())a(n,d);}for(let l of ["footnote","endnote"])r.push(...io(e,l));let i=e.documentThemeFonts(),s={major:i.major,minor:i.minor,majorEastAsia:i.majorEastAsia??null,minorEastAsia:i.minorEastAsia??null},u=new Map,f=(l,d)=>{let c=d$1(l,e.stylesRoot(),s,co(l,d)),m=r$1(l,e.numberingRoot(),e.stylesRoot(),s);for(let y of [...c.direct,...po(l),...m,...c.inherited]){let p=y.toLowerCase();u.has(p)||u.set(p,y);}};return f(t,"body"),f(n,"furniture"),f(r,"note"),[...u.values()]}function io(e,t){let n=Jf(e.currentPackage(),t);if(!n)return [];let r=new Set(Kf(e.part()).filter(a=>a.noteKind===t).map(a=>a.noteId)),o=[];for(let a of n.root.children){if(a.kind==="textValue")continue;let i=hd(a),s=gd(a);(i==="separator"||i==="continuationSeparator"||s!==null&&r.has(s))&&o.push(a);}return o}var so="http://schemas.openxmlformats.org/officeDocument/2006/math";function co(e,t){let n=new Set;for(let r of e){let o=[],a=[{node:r,context:t}];for(;a.length>0;){let{node:i,context:s}=a.pop();i.namespaceUri===da&&i.localName==="p"&&o.push({paragraph:i,context:s});let u=i.namespaceUri===da&&i.localName==="txbxContent"&&(s==="body"||s==="note")?"detached":s;for(let f=i.children.length-1;f>=0;f-=1){let l=i.children[f];l.kind!=="textValue"&&a.push({node:l,context:u});}}for(let i of o)lo(i.paragraph,n,i.context);}return n}function lo(e,t,n){let r=Va(),o=null,a=null,i="",s=false,u=false,f=false,l=0,d=[];for(let c=e.children.length-1;c>=0;c-=1){let m=e.children[c];m.kind!=="textValue"&&d.push({node:m,runId:null,visibility:H,containerDepth:0});}for(;d.length>0;){let{node:c,runId:m,visibility:y,containerDepth:p}=d.pop();if(p>=la||c.namespaceUri===da&&c.localName==="p")continue;let x=c.namespaceUri===da&&c.localName==="r"?c.id:m;if(c.namespaceUri===da&&c.localName==="fldSimple"){let h=Ue(c,"instr")??"";dd(h,{allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&uo(c)!==H&&t.add(c.id);}if(c.namespaceUri===da&&c.localName==="fldChar"){let h=Ue(c,"fldCharType");if(h==="begin")Ya(r),r.nesting===1&&(o=x,a=null,i="",s=false,u=false,f=je$1(c),l=0);else if(h==="separate"){let b=r.nesting===1;if(_a(r),b){let E=Xa(r);i=E.instruction,s=E.overflow||r.nestingOverflow,a=x,u=true;}}else if(h==="end"){if(r.nesting===1){if(r.phase==="instruction"){let E=Xa(r);i=E.instruction,s=E.overflow||r.nestingOverflow;}if(!s&&cd(i,{hasSeparate:u,hasLegacyFormData:f,allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&l!==H){let E=a??o;E&&t.add(E);}}$a(r);}continue}if(c.namespaceUri===da&&(c.localName==="instrText"||c.localName==="delInstrText")){Za(r,Kn(c),c.localName==="delInstrText");continue}r.nesting>0&&ab(r)&&c.namespaceUri===da&&qn(c)&&(l|=y);for(let h=c.children.length-1;h>=0;h-=1){let b=c.children[h];b.kind!=="textValue"&&d.push({node:b,runId:x,visibility:y&Wn(c),containerDepth:ma(c,p)});}}Wa(r);}function qn(e){return e.localName==="t"||e.localName==="delText"?Kn(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Ve=1,$n=2,Gn=4,H=Ve|$n|Gn;function uo(e){let t=[];for(let r of e.children)r.kind!=="textValue"&&t.push({node:r,visibility:H});let n=0;for(;t.length>0;){let{node:r,visibility:o}=t.pop();if(!(r.namespaceUri===da&&r.localName==="p")){if(r.namespaceUri===da&&qn(r)&&(n|=o,n===H))return n;for(let a of r.children)a.kind!=="textValue"&&t.push({node:a,visibility:o&Wn(r)});}}return n}function Wn(e){return e.namespaceUri!==da?H:e.localName==="ins"||e.localName==="moveTo"?Ve|$n:e.localName==="del"||e.localName==="moveFrom"?Ve|Gn:H}function po(e){let t=new Map,n=r=>{let o=a$1(r??void 0);if(o===null)return;let a=o.toLowerCase();t.has(a)||t.set(a,o);};for(let r of e){let o=[r];for(;o.length>0;){let a=o.pop();if(a.namespaceUri===so&&n(uc),a.namespaceUri===da&&a.localName==="sym"&&n(b$1(eo(a,"font"))),a.namespaceUri===da&&a.localName==="fldSimple"){let i=Ue(a,"instr");n(bd(i??"")?.font??null);}if(a.namespaceUri===da&&a.localName==="p")for(let i of q(a))n(i);for(let i=a.children.length-1;i>=0;i-=1){let s=a.children[i];s.kind!=="textValue"&&o.push(s);}}}return [...t.values()]}function Kn(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let r=n.pop();if(r.kind==="textValue")t+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}return t}var Qn="FILE_TOO_LARGE",Xn=8;function fo(e){return typeof e=="object"&&e!==null}function Zn(e){if(!(!fo(e)||typeof e.code!="string"))return e.code}function Jn(e){return e===""||e.toLowerCase()==="localhost"}function mo(e){try{let t=decodeURIComponent(e);return t.includes("\0")?null:t}catch{return null}}function er(e){let t=mo(e);if(t===null)return null;let n=[];for(let r of t.split(/[/\\]/))if(!(r===""||r===".")){if(r===".."){if(n.length===0)return null;n.pop();continue}n.push(r);}return `/${n.join("/")}`}function tr(e){let t=er(e);return t===null?null:t.endsWith("/")?t:`${t}/`}function yo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function go(e){let t;try{t=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(t.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(t.username!==""||t.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!Jn(t.host))throw new TypeError("trustedRoot must be a local file: URL");let n=tr(t.pathname);if(n===null||yo(n))throw new TypeError("trustedRoot must be a directory inside the filesystem");let r=new URL("file:///");return r.pathname=n,r}function ho(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 xo(e){let t=ho(e);if(t.length===0)throw new TypeError("trustedRoot must name at least one directory");if(t.length>Xn)throw new TypeError(`trustedRoot must not exceed ${Xn} directories`);return t.map(go)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function Ro(e,t){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Jn(e.host))return null;let n=er(e.pathname);if(n===null)return null;for(let r of t){let o=tr(r.pathname);if(o===null||!n.startsWith(o)||n.length<=o.length)continue;let a=new URL("file:///");return a.pathname=n,a}return null}function Eo(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 wo(e,t,n){let r=n.relative(n.resolve(e),n.resolve(t));return r!==""&&!r.startsWith("..")&&!n.isAbsolute(r)}function Yn(e,t,n){return e.some(r=>wo(r,t,n))}async function Fo(e,t){let n=[];for(let r of e)try{n.push(await t(r));}catch(o){if(Zn(o)==="ENOENT")continue;throw o}return n}function So(e){return async(t,{signal:n,maxBytes:r})=>{if(n?.aborted)throw n.reason;let[{open:o,realpath:a},{constants:i},{fileURLToPath:s},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),f=e.map(y=>u.resolve(s(y.href))),l=u.resolve(s(typeof t=="string"?t:t.href));if(!Yn(f,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let d=typeof i.O_NOFOLLOW=="number"?i.O_RDONLY|i.O_NOFOLLOW:"r",c=await o(l,d),m=()=>{c.close();};n?.addEventListener("abort",m,{once:true});try{if(n?.aborted)throw n.reason;let y=await a(l);if(!Yn(await Fo(f,a),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=(await c.stat()).size;if(!Number.isSafeInteger(p)||p<0||p>r)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Qn});let x=new Uint8Array(p),h=0;for(;h<x.byteLength;){if(n?.aborted)throw n.reason;let{bytesRead:b}=await c.read(x,h,x.byteLength-h,h);if(b===0)break;h+=b;}if(n?.aborted)throw n.reason;return h===x.byteLength?x:x.slice(0,h)}catch(y){throw n?.aborted?n.reason:y}finally{n?.removeEventListener("abort",m),await c.close().catch(()=>{});}}}function vo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let t=xo(e.trustedRoot),n=bo(e.maxBytes),r=e.read??So(t),o=e.networkFetch??fetch;return(async(a,i)=>{let s=i?.signal;if(s?.aborted)throw s.reason;let u=Eo(a);if(u.protocol!=="file:")return o(u,i);let f=Ro(u,t);if(!f)return new Response(null,{status:404});let l=s?new AbortController:void 0,d=()=>l?.abort(s?.reason);s?.addEventListener("abort",d,{once:true});let c;try{if(c=await r(f,{maxBytes:n,...l?{signal:l.signal}:{}}),s?.aborted)throw s.reason;if(c.byteLength>n)return new Response(null,{status:413})}catch(m){if(s?.aborted)throw s.reason;if(l?.signal.aborted)throw l.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let y=Zn(m);if(y===Qn)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw m}finally{s?.removeEventListener("abort",d);}return new Response(c,{status:200})})}
|
|
2
|
-
export{
|
|
1
|
+
import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-OODFC5R2.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-DQS4KZUX.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-MSIFK7TJ.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-MSIFK7TJ.js';import {a,z as z$2,j as j$1,b,jc,X as X$1,lc,_,aa,Z as Z$1,kc,ba,$ as $$1,ca,Y as Y$1,Ab}from'./chunk-72BDQFHY.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-4DB7ZFQN.js';import'./chunk-VP7SDFCM.js';import {Za}from'./chunk-4KMSEFIG.js';import {Nf,Of,id,hd,da,E,Sd,la as la$1,ke,ma as ma$1}from'./chunk-CJCFEXTA.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"),Sd(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=Za(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=Nf(e.currentPackage(),o);if(!t)return [];let n=new Set(Of(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=id(i),l=hd(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=X$1(),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")??"";lc(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")_(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(aa(n),y){let E=Z$1(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=Z$1(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&kc(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);}}ba(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){$$1(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&ca(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$1(d,x)});}}Y$1(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(Ab),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(jc(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{Y as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,gt as acquireSharedExportShaping,Yt as createPackagedFileFetch,q as hasExportAdmittedFont,X as hasExportLaidOutText,Ot as hasFontBackedExportCapabilities,vt as openFontBackedDocumentForExport};
|
|
@@ -34,7 +34,7 @@ type CollaborationStatus = 'initializing' | 'ready' | 'disconnected' | 'error' |
|
|
|
34
34
|
*
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
|
-
type CollaborationFailureCode = 'already-initialized' | 'authentication-failed' | 'baseline-digest-mismatch' | 'baseline-too-large' | 'blob-digest-mismatch' | 'blob-read' | 'blob-store-full' | 'blob-too-large' | 'collaboration-session-destroyed' | 'collaboration-session-not-attached' | 'collaboration-session-not-ready' | 'collaboration-text-limit' | 'concurrent-seed' | 'document-id-mismatch' | 'duplicate-paragraph-id' | 'experimental-collaboration-body-text-only' | 'experimental-collaboration-existing-paragraphs-only' | 'experimental-collaboration-text-only' | 'experimental-collaboration-untracked-text-only' | 'immutable-baseline-changed' | 'immutable-metadata-changed' | 'initialization-aborted' | 'initialization-timeout' | 'invalid-baseline' | 'invalid-blob-descriptor' | 'invalid-bound' | 'invalid-document-id' | 'invalid-identity' | 'invalid-identity-color' | 'invalid-logical-id' | 'invalid-relationships' | 'invalid-session-id' | 'invalid-shared-metadata' | 'invalid-string' | 'local-mirror-failed' | 'materialize-dropped-content' | 'missing-blob' | 'missing-local-blob' | 'missing-root' | 'no-main-document-part' | 'not-initialized' | 'paragraph-set-mismatch' | 'port-already-attached' | 'protocol-version-mismatch' | 'prototype-key' | 'remote-apply-failed' | 'schema-version-mismatch' | 'shared-schema-invalid' | 'text-too-long' | 'too-many-attributes' | 'too-many-children' | 'too-many-nodes' | 'too-many-parts' | 'too-many-relationships' | 'transport' | 'transport-disconnected' | 'tree-too-deep' | 'unknown-logical-id' | 'unknown-paragraph-id' | 'unsafe-part-name' | 'unsupported-root-key';
|
|
37
|
+
type CollaborationFailureCode = 'already-initialized' | 'authentication-failed' | 'baseline-digest-mismatch' | 'baseline-too-large' | 'blob-digest-mismatch' | 'blob-read' | 'blob-store-full' | 'blob-too-large' | 'collaboration-format-mismatch' | 'collaboration-session-destroyed' | 'collaboration-session-not-attached' | 'collaboration-session-not-ready' | 'collaboration-text-limit' | 'concurrent-seed' | 'document-id-mismatch' | 'duplicate-paragraph-id' | 'experimental-collaboration-body-text-only' | 'experimental-collaboration-existing-paragraphs-only' | 'experimental-collaboration-text-only' | 'experimental-collaboration-untracked-text-only' | 'immutable-baseline-changed' | 'immutable-metadata-changed' | 'initialization-aborted' | 'initialization-timeout' | 'invalid-baseline' | 'invalid-blob-descriptor' | 'invalid-bound' | 'invalid-document-id' | 'invalid-identity' | 'invalid-identity-color' | 'invalid-logical-id' | 'invalid-relationships' | 'invalid-saved-room' | 'invalid-session-id' | 'invalid-shared-metadata' | 'invalid-string' | 'local-mirror-failed' | 'materialize-dropped-content' | 'missing-blob' | 'missing-local-blob' | 'missing-root' | 'no-main-document-part' | 'not-initialized' | 'paragraph-set-mismatch' | 'port-already-attached' | 'protocol-version-mismatch' | 'prototype-key' | 'remote-apply-failed' | 'saved-room-unavailable' | 'schema-version-mismatch' | 'shared-schema-invalid' | 'text-too-long' | 'too-many-attributes' | 'too-many-children' | 'too-many-nodes' | 'too-many-parts' | 'too-many-relationships' | 'transport' | 'transport-disconnected' | 'tree-too-deep' | 'unknown-logical-id' | 'unknown-paragraph-id' | 'unsafe-part-name' | 'unsupported-root-key';
|
|
38
38
|
/** True when `value` is a {@link CollaborationFailureCode} member. @public */
|
|
39
39
|
declare function isCollaborationFailureCode(value: string): value is CollaborationFailureCode;
|
|
40
40
|
/** One collaboration failure: a typed code plus optional free-form detail. @public */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as
|
|
1
|
+
import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-WXbTSXx1.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A partial font configuration one origin contributes: sources, substitutions, or both.
|
|
@@ -7,6 +7,8 @@ import { F as FontSource, a as FontSourceSubstitution, b as FontFaceRequest, c a
|
|
|
7
7
|
* same way.
|
|
8
8
|
*/
|
|
9
9
|
interface FontConfigurationFragment {
|
|
10
|
+
/** Selectable provider families, independent of loaded bytes. Listing them performs no fetch. */
|
|
11
|
+
readonly supportedFamilies?: readonly string[];
|
|
10
12
|
readonly sources?: readonly FontSource[];
|
|
11
13
|
readonly substitutions?: readonly FontSourceSubstitution[];
|
|
12
14
|
}
|
|
@@ -68,8 +70,8 @@ interface FontResolutionRequest {
|
|
|
68
70
|
/**
|
|
69
71
|
* Resolve fonts once the document's needs are known, instead of ahead of them.
|
|
70
72
|
*
|
|
71
|
-
* Called
|
|
72
|
-
*
|
|
73
|
+
* Called after the file is mounted and again when editing requests a new family.
|
|
74
|
+
* Results compose with previously supplied faces; resolvedFaces identifies that coverage.
|
|
73
75
|
* Returning nothing is a valid answer — it means "I cover none of this", and the
|
|
74
76
|
* document stays on the fixed measurer.
|
|
75
77
|
*
|
package/dist/harfbuzz.wasm
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as OoxmlPackage, O as OoxmlPart,
|
|
1
|
+
import { c as HeaderFooterParts, d as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-1pdDnhZ_.js';
|
|
2
|
+
import { b as OoxmlPackage, O as OoxmlPart, e as OoxmlElement, g as OoxmlPackageRejection } from './tree-op-types-DbdM7fJV.js';
|
|
3
3
|
|
|
4
4
|
/** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
|
|
5
5
|
interface EnsuredHyperlinkRelationship {
|
|
@@ -87,6 +87,12 @@ interface HeadlessThemeFonts {
|
|
|
87
87
|
readonly majorEastAsia?: string | null;
|
|
88
88
|
/** East Asian body face; optional for backwards-compatible custom views. */
|
|
89
89
|
readonly minorEastAsia?: string | null;
|
|
90
|
+
/** Complex-script heading and body theme faces. */
|
|
91
|
+
readonly majorBidi?: string | null;
|
|
92
|
+
readonly minorBidi?: string | null;
|
|
93
|
+
/** Language-specific theme faces, keyed by ISO 15924 script. */
|
|
94
|
+
readonly majorSupplemental?: Readonly<Record<string, string>>;
|
|
95
|
+
readonly minorSupplemental?: Readonly<Record<string, string>>;
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
98
|
* The read capabilities shared by browser layout, server export, and future renderers.
|
|
@@ -130,5 +136,7 @@ type OpenHeadlessDocumentResult = {
|
|
|
130
136
|
* @public
|
|
131
137
|
*/
|
|
132
138
|
declare function openHeadlessDocument(bytes: Uint8Array): OpenHeadlessDocumentResult;
|
|
139
|
+
/** Internal live read view over the canonical store, preserving node identities for field pagination. */
|
|
140
|
+
declare function headlessViewOfStore(store: TreePackageStore): HeadlessDocumentView;
|
|
133
141
|
|
|
134
|
-
export { type DocumentProperties as D, type EnsuredHyperlinkRelationship as E, type HeadlessDocumentView as H, type OpenHeadlessDocumentResult as O, type HeadlessDocumentRejection as a, type HeadlessThemeFonts as b, authorableHyperlinkTarget as c, ensureHyperlinkRelationship as e, openHeadlessDocument as o, relationshipTargetIn as r };
|
|
142
|
+
export { type DocumentProperties as D, type EnsuredHyperlinkRelationship as E, type HeadlessDocumentView as H, type OpenHeadlessDocumentResult as O, type HeadlessDocumentRejection as a, type HeadlessThemeFonts as b, authorableHyperlinkTarget as c, ensureHyperlinkRelationship as e, headlessViewOfStore as h, openHeadlessDocument as o, relationshipTargetIn as r };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { T as TreeDocOp,
|
|
1
|
+
import { T as TreeDocOp, bE as TextFormFieldRange, bD as TextFormFieldOptions, t as ImageDecodePort, m as DrawingPositionInput, _ as DrawingTransform, G as DrawingTreeDocOp, p as SupportedImageMime, b as OoxmlPackage } from './tree-op-types-DbdM7fJV.js';
|
|
2
2
|
import { Unsubscribe, ExecResult, ParagraphTabStop, IndentFormatting, ParagraphFlags, ParagraphDisagreements, SelectionPin } from './contracts/types.js';
|
|
3
|
-
import { g as ReviewRevisionKind } from './review-items-
|
|
3
|
+
import { g as ReviewRevisionKind } from './review-items-CJz-kAW8.js';
|
|
4
|
+
import './document-protection-BL5zp8cU.js';
|
|
4
5
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
import { D as DocumentSource,
|
|
6
|
-
import { R as RevisionDisplayMode } 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 } from './font-resolver-
|
|
6
|
+
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, n as Editor, e as EditorCommand, C as CanResult, S as SelectedImageState, o as FormatPainterSurfaceState, h as TrackedChangePredicate, T as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, t as TableContext } from './editor-WXbTSXx1.js';
|
|
7
|
+
import { R as RevisionDisplayMode } from './revision-projection-BIHO_qvw.js';
|
|
8
|
+
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-0vQXcMZk.js';
|
|
9
|
+
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BSrKnTeR.js';
|
|
9
10
|
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 {
|
|
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,
|
|
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-
|
|
11
|
+
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-BSan4pBk.js';
|
|
12
|
+
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-RjYgbmXe.js';
|
|
13
|
+
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-ZcYuB4-H.js';
|
|
14
|
+
import { B as BookmarkIndex } from './custom-node-writes-BqIv94ei.js';
|
|
15
|
+
import { I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, h as ImageIntentResult } from './tree-package-fragment-1pdDnhZ_.js';
|
|
16
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-lCYAVCCF.js';
|
|
17
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-Cgn6fQ-M.js';
|
|
18
|
+
import { C as CollaborationStatus } from './failure-DNNmwsgD.js';
|
|
18
19
|
import { V as ViewScope } from './editor-scope-DZJT4ukT.js';
|
|
19
20
|
import './contracts/document.js';
|
|
20
21
|
import './contracts/interaction.js';
|
|
@@ -56,6 +57,60 @@ type NotePropertiesStateSnapshot = {
|
|
|
56
57
|
readonly endnote: NotePropertiesSlice;
|
|
57
58
|
};
|
|
58
59
|
|
|
60
|
+
/** Priority of an editor-owned popup renderer. @public */
|
|
61
|
+
interface PopupChromeRegistrationOptions {
|
|
62
|
+
/** Use only when no manually registered renderer exists. */
|
|
63
|
+
readonly fallback?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** A core-owned content-control value edit. @public */
|
|
66
|
+
interface ContentControlWidgetSession {
|
|
67
|
+
readonly controlId: string;
|
|
68
|
+
readonly kind: 'dropdown' | 'comboBox' | 'date';
|
|
69
|
+
readonly items: readonly {
|
|
70
|
+
readonly displayText: string;
|
|
71
|
+
readonly value: string;
|
|
72
|
+
}[];
|
|
73
|
+
readonly value: string;
|
|
74
|
+
readonly anchor: HTMLElement | null;
|
|
75
|
+
readonly signal: AbortSignal;
|
|
76
|
+
canApply(): boolean;
|
|
77
|
+
apply(value: string): boolean;
|
|
78
|
+
cancel(): void;
|
|
79
|
+
}
|
|
80
|
+
/** Framework rendering for content-control value widgets. @public */
|
|
81
|
+
interface ContentControlWidgetChromeHandlers {
|
|
82
|
+
readonly onRequest?: (session: ContentControlWidgetSession) => void;
|
|
83
|
+
}
|
|
84
|
+
/** An invalid protected-field acknowledgement. @public */
|
|
85
|
+
interface InvalidTextFormFieldSession {
|
|
86
|
+
readonly type: 'number' | 'date';
|
|
87
|
+
readonly signal: AbortSignal;
|
|
88
|
+
/** Clear the unchanged invalid value, if the target still permits it. */
|
|
89
|
+
acknowledge(): void;
|
|
90
|
+
/** Dismiss without clearing the authored value. */
|
|
91
|
+
cancel(): void;
|
|
92
|
+
}
|
|
93
|
+
/** Framework rendering for invalid protected-field acknowledgements. @public */
|
|
94
|
+
interface InvalidTextFormFieldChromeHandlers {
|
|
95
|
+
readonly onRequest?: (session: InvalidTextFormFieldSession) => void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** A core-owned options edit. Its signal aborts when the dialog must close. @public */
|
|
99
|
+
interface TextFormFieldDialogSession {
|
|
100
|
+
readonly field: TextFormFieldRange;
|
|
101
|
+
readonly signal: AbortSignal;
|
|
102
|
+
/** Whether the current target exists and permits editing. Draft validation happens on apply. */
|
|
103
|
+
canApply(): boolean;
|
|
104
|
+
/** Save one undoable edit. A refused write leaves the session open. */
|
|
105
|
+
apply(text: string, options: TextFormFieldOptions): boolean;
|
|
106
|
+
/** Close without changing the document. Safe to call more than once. */
|
|
107
|
+
cancel(): void;
|
|
108
|
+
}
|
|
109
|
+
/** Framework-owned presentation for core-owned Field Options sessions. @public */
|
|
110
|
+
interface TextFormFieldChromeHandlers {
|
|
111
|
+
readonly onRequest?: (session: TextFormFieldDialogSession) => void;
|
|
112
|
+
}
|
|
113
|
+
|
|
59
114
|
/**
|
|
60
115
|
* A hyperlink as the surface reports it: its identity, where it sits, and the SANITIZED
|
|
61
116
|
* target. `href: null` is an inert link — a refused scheme or a dangling relationship — which
|
|
@@ -360,6 +415,12 @@ interface DocxEditorInstance extends Editor {
|
|
|
360
415
|
* command needs.
|
|
361
416
|
*/
|
|
362
417
|
setHyperlinkChrome(handlers: HyperlinkChromeHandlers): Unsubscribe;
|
|
418
|
+
/** Register Field Options chrome. Disposal closes sessions owned by this registration. */
|
|
419
|
+
setTextFormFieldChrome(handlers: TextFormFieldChromeHandlers, options?: PopupChromeRegistrationOptions): Unsubscribe;
|
|
420
|
+
/** Register typed content-control widget chrome. */
|
|
421
|
+
setContentControlWidgetChrome(handlers: ContentControlWidgetChromeHandlers, options?: PopupChromeRegistrationOptions): Unsubscribe;
|
|
422
|
+
/** Register invalid protected-field acknowledgement chrome. */
|
|
423
|
+
setInvalidTextFormFieldChrome(handlers: InvalidTextFormFieldChromeHandlers, options?: PopupChromeRegistrationOptions): Unsubscribe;
|
|
363
424
|
/** Wire the host equation popover to painted equation clicks. */
|
|
364
425
|
setEquationChrome(handlers: EquationChromeHandlers): Unsubscribe;
|
|
365
426
|
/**
|
|
@@ -1178,6 +1239,10 @@ interface PaginatedSurfaceOptions {
|
|
|
1178
1239
|
* rather than doing something surprising with it.
|
|
1179
1240
|
*/
|
|
1180
1241
|
readonly onRequestHyperlink?: () => void;
|
|
1242
|
+
/** Return true when host chrome handles this session. */
|
|
1243
|
+
readonly onRequestTextFormField?: (session: TextFormFieldDialogSession) => boolean;
|
|
1244
|
+
readonly onRequestContentControlWidget?: (session: ContentControlWidgetSession) => boolean;
|
|
1245
|
+
readonly onRequestInvalidTextFormField?: (session: InvalidTextFormFieldSession) => boolean;
|
|
1181
1246
|
/**
|
|
1182
1247
|
* Localized accessible names for core-owned table insertion furniture.
|
|
1183
1248
|
* Defaults to English from `@docx-editor.dev/i18n` when omitted.
|
|
@@ -1846,7 +1911,7 @@ interface PaginatedSurface {
|
|
|
1846
1911
|
* planned left its target in a read-only document's `.rels`. A builder answering null means the
|
|
1847
1912
|
* target is one this engine will not author, and the write is refused having changed nothing.
|
|
1848
1913
|
*/
|
|
1849
|
-
applyAutomationOps(staged: (relate: (url: string) => string | null) => readonly TreeDocOp[] | null, scope?: StoryScope): TreeApplyResult;
|
|
1914
|
+
applyAutomationOps(staged: (relate: (url: string) => string | null) => readonly TreeDocOp[] | null, scope?: StoryScope, packageEdits?: readonly ((pkg: OoxmlPackage) => OoxmlPackage)[]): TreeApplyResult;
|
|
1850
1915
|
/**
|
|
1851
1916
|
* Which revision halves this surface is SHOWING.
|
|
1852
1917
|
*
|
|
@@ -2064,8 +2129,10 @@ interface PaginatedSurface {
|
|
|
2064
2129
|
* Flushes layout so the next enter/rebind sees the new resolution.
|
|
2065
2130
|
*/
|
|
2066
2131
|
applyHeaderFooterLifecycle(op: {
|
|
2067
|
-
readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions';
|
|
2132
|
+
readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions' | 'setDocumentProtection';
|
|
2068
2133
|
readonly sectionIndex?: number;
|
|
2134
|
+
/** `setDocumentProtection` only: enforce filling-in-forms protection, or lift it. */
|
|
2135
|
+
readonly enforce?: boolean;
|
|
2069
2136
|
readonly kind?: 'header' | 'footer';
|
|
2070
2137
|
readonly variant?: 'default' | 'first' | 'even';
|
|
2071
2138
|
readonly titlePage?: boolean;
|
|
@@ -2156,6 +2223,8 @@ interface LoadFontsRequest {
|
|
|
2156
2223
|
readonly fetcher?: typeof fetch;
|
|
2157
2224
|
/** Per-font byte ceiling; defaults to the engine hard maximum. */
|
|
2158
2225
|
readonly maxFontBytes?: number;
|
|
2226
|
+
/** Cancels loading with `signal.reason`, without returning per-source failures. */
|
|
2227
|
+
readonly signal?: AbortSignal;
|
|
2159
2228
|
}
|
|
2160
2229
|
/**
|
|
2161
2230
|
* Why one font did not load.
|
|
@@ -2201,7 +2270,7 @@ interface LoadFontsResult extends FontConfigurationFragment {
|
|
|
2201
2270
|
*
|
|
2202
2271
|
* Fetches ONLY the URLs listed — never a default host or engine-chosen CDN — and never
|
|
2203
2272
|
* rejects for a per-source failure: the result carries every admitted source and a
|
|
2204
|
-
* typed entry for every drop. Compose the result with `composeFontConfiguration`.
|
|
2273
|
+
* typed entry for every drop. Cancellation instead rejects with `signal.reason`. Compose the result with `composeFontConfiguration`.
|
|
2205
2274
|
*/
|
|
2206
2275
|
declare function loadFonts(request: LoadFontsRequest): Promise<LoadFontsResult>;
|
|
2207
2276
|
/**
|
|
@@ -2223,6 +2292,42 @@ declare function createFontSource(bytes: Uint8Array, request: FontFaceRequest &
|
|
|
2223
2292
|
readonly failure: FontLoadFailure;
|
|
2224
2293
|
};
|
|
2225
2294
|
|
|
2295
|
+
/** Options for loading application fonts when the editor resolves its font configuration. @public */
|
|
2296
|
+
interface CustomFontsOptions extends Omit<LoadFontsRequest, 'signal'> {
|
|
2297
|
+
/** Reports each failed face. Defaults to a console warning. Cancellation does not call this handler. */
|
|
2298
|
+
readonly onFailure?: (failure: FontLoadFailure) => void;
|
|
2299
|
+
}
|
|
2300
|
+
/** A font origin that supplies validated application font bytes on demand. @public */
|
|
2301
|
+
type CustomFontsResolver = MarkedFontResolver<(request: FontResolutionRequest) => Promise<LoadFontsResult>>;
|
|
2302
|
+
/**
|
|
2303
|
+
* Supply application fonts without manual resolver wiring.
|
|
2304
|
+
*
|
|
2305
|
+
* Loads all listed faces when the editor resolves fonts, including families the document
|
|
2306
|
+
* does not use yet. This makes company fonts available in the font picker for new documents.
|
|
2307
|
+
* Faces supplied by earlier origins are skipped by family, weight, and style; family
|
|
2308
|
+
* matching ignores case. URLs always come from `sources`, never from document text.
|
|
2309
|
+
*
|
|
2310
|
+
* Uses {@link loadFonts} for validation, optional hash checks, and browser caching.
|
|
2311
|
+
* The editor registers the returned bytes under private aliases. This function does not
|
|
2312
|
+
* change the document's selected fonts or register page-wide family names.
|
|
2313
|
+
*
|
|
2314
|
+
* Constructing the resolver does not fetch. Cancellation of the document load rejects
|
|
2315
|
+
* with `signal.reason`, without warnings or `onFailure` calls. Other face failures are
|
|
2316
|
+
* reported once per resolution, and successful faces remain available to the editor.
|
|
2317
|
+
*
|
|
2318
|
+
* ```ts
|
|
2319
|
+
* const fonts = useFonts(
|
|
2320
|
+
* customFonts({ sources: companyFontFiles, onFailure: reportFontFailure }),
|
|
2321
|
+
* packagedFonts(),
|
|
2322
|
+
* googleFonts(),
|
|
2323
|
+
* );
|
|
2324
|
+
* ```
|
|
2325
|
+
*
|
|
2326
|
+
* Use {@link loadFonts} directly to load every listed face eagerly.
|
|
2327
|
+
* @public
|
|
2328
|
+
*/
|
|
2329
|
+
declare function customFonts(options: CustomFontsOptions): CustomFontsResolver;
|
|
2330
|
+
|
|
2226
2331
|
/**
|
|
2227
2332
|
* HOW a control reaches the engine — never WHETHER it is enabled.
|
|
2228
2333
|
*
|
|
@@ -2662,6 +2767,15 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2662
2767
|
readonly state: {
|
|
2663
2768
|
readonly kind: "command";
|
|
2664
2769
|
};
|
|
2770
|
+
}, {
|
|
2771
|
+
readonly id: "protectDocument";
|
|
2772
|
+
readonly shape: "icon";
|
|
2773
|
+
readonly labelKey: "review.protectDocument";
|
|
2774
|
+
readonly defaultToolbar: false;
|
|
2775
|
+
readonly paths: readonly string[];
|
|
2776
|
+
readonly state: {
|
|
2777
|
+
readonly kind: "command";
|
|
2778
|
+
};
|
|
2665
2779
|
}, {
|
|
2666
2780
|
readonly id: "comments";
|
|
2667
2781
|
readonly shape: "icon";
|
|
@@ -2941,7 +3055,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
|
|
|
2941
3055
|
*
|
|
2942
3056
|
* @public
|
|
2943
3057
|
*/
|
|
2944
|
-
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.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';
|
|
3058
|
+
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.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';
|
|
2945
3059
|
/**
|
|
2946
3060
|
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
2947
3061
|
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
@@ -3324,4 +3438,4 @@ declare function runTableCommand(editor: Editor | null, command: EditorCommand):
|
|
|
3324
3438
|
*/
|
|
3325
3439
|
declare function createDocxEditor(config: DocxEditorConfig): DocxEditorInstance;
|
|
3326
3440
|
|
|
3327
|
-
export { type
|
|
3441
|
+
export { type PopupChromeRegistrationOptions as $, type AnchorFrameOrigin as A, type FontLoadFailureReason as B, CHROME_GROUPS as C, type DocxEditorInstance as D, EMU_PER_POINT as E, type FinalizedImageOverlayInteraction as F, type FontMeasurementState as G, type FontUrlSource as H, type HyperlinkActivation as I, type HyperlinkChromeHandlers as J, type HyperlinkOps as K, IMAGE_OVERLAY_NUDGE_PT as L, IMAGE_OVERLAY_NUDGE_SHIFT_PT as M, type ImageInteractionSession as N, type OpenPaginatedResult as O, type PaginatedSurfaceOptions as P, type ImageOverlayScrollPort as Q, type ImageResizeHandle as R, type ImageResizeResult as S, type TableCommandPlan as T, type InvalidTextFormFieldChromeHandlers as U, type InvalidTextFormFieldSession as V, type LoadFontsRequest as W, type LoadFontsResult as X, type OverlayFrameRect as Y, type PaginatedSurfaceState as Z, type ParagraphPropertyEdit as _, type PaginatedSurface as a, probeTableChromeCommand as a$, type RemoteCaretLabelAnchor as a0, type RemoteCaretLabelHost as a1, type ReviewWriteIntent as a2, type RunTableChromeCommandResult as a3, type SectionAnchor as a4, type SectionBreakInsertType as a5, type SelectedDrawingOverlayTarget as a6, type SurfaceEquation as a7, type SurfaceFormatting as a8, type SurfaceHyperlink as a9, chromeSlotId as aA, chromeSlotIsToggle as aB, commandForSlot as aC, commandForSlotValue as aD, commandForTableChromeSlotValue as aE, computeImageResizeResult as aF, computeMovedImagePosition as aG, computeResizedImageExtentEmu as aH, createDocxEditor as aI, createFontSource as aJ, createImageOverlayScrollPort as aK, cssPixelsToLayoutPoints as aL, customFonts as aM, defaultChromeGroups as aN, defaultTableLabel as aO, emuToOverlayPoints as aP, equationAtPosition as aQ, executeImageCommand as aR, finalizeImageOverlayInteraction as aS, formattingBarChromeGroups as aT, isStaleImageInteractionCommit as aU, isTableChromeSlot as aV, layoutPointsToCssPixels as aW, loadFonts as aX, overlayFrameToSheetCssPixels as aY, overlayHostOrigin as aZ, pointsToEmu as a_, type SurfaceInsertImageInput as aa, type SurfaceNavigation as ab, type SurfaceOverlayCoordinates as ac, type SurfaceParagraphFormat as ad, TABLE_BORDER_STYLE_OPTIONS as ae, TABLE_BORDER_TARGET_OPTIONS as af, TABLE_BORDER_WIDTH_OPTIONS as ag, TABLE_CHROME_SLOT_IDS as ah, type TableBorderStyleOption as ai, type TableBorderTargetOption as aj, type TableBorderTargetValue as ak, type TableBorderWidthOption as al, type TableChromeDraft as am, type TableChromePick as an, type TableChromeSlotId as ao, type TableInteractionLabelKey as ap, type TextFormFieldChromeHandlers as aq, type TextFormFieldDialogSession as ar, type ToolbarCommandState as as, applyTableChromePick as at, blankDocumentBytes as au, canExecuteImageCommand as av, captureImageMutationPreconditions as aw, chromeControlCount as ax, chromeMenuSlots as ay, chromeProbeForSlot as az, CHROME_MENUS as b, resizePreservesAspect as b0, runSave as b1, runTableChromeCommand as b2, runTableCommand as b3, runToolbarCommand as b4, selectedDrawingOverlayTargetOf as b5, selectedImageStateOf as b6, surfacePaintScale as b7, tableChromeIconPaths as b8, tableChromeLabelKeyForTarget as b9, tableChromeToolbarState as ba, tableChromeVisible as bb, tableCommandToolbarState as bc, toolbarCommandState as bd, toolbarCommandStates as be, CHROME_UNAVAILABLE_KEY as c, type ChromeControl as d, type ChromeControlId as e, type ChromeControlState as f, type ChromeGroup as g, type ChromeGroupId as h, type ChromeMenu as i, type ChromeMenuEntry as j, type ChromeMenuId as k, type ChromeMenuItemEntry as l, type ChromeMenuSeparatorEntry as m, type ChromeMenuSubmenuEntry as n, type ChromeSlotId as o, type ContentControlWidgetChromeHandlers as p, type ContentControlWidgetSession as q, type CustomFontsOptions as r, type CustomFontsResolver as s, DEFAULT_TABLE_CHROME_DRAFT as t, type DocxEditorConfig as u, type DrawingSelectionIntent as v, type EquationActivation as w, type EquationChromeHandlers as x, type EquationOps as y, type FontLoadFailure as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkMRPPCGCX_cjs=require('./chunk-MRPPCGCX.cjs');require('./chunk-ZKWRCLT2.cjs'),require('./chunk-FZ2BIMCY.cjs');var chunkKDYD5TAW_cjs=require('./chunk-KDYD5TAW.cjs');require('./chunk-NJONXJJY.cjs'),require('./chunk-GUPITGJQ.cjs'),require('./chunk-ZKQX2PNF.cjs'),require('./chunk-LQ6XWTKQ.cjs'),require('./chunk-SUEX3CL7.cjs'),require('./chunk-CG7CP632.cjs'),require('./chunk-YVYEJBLL.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-MDP5SNK4.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-PBM6WERF.cjs'),require('./chunk-77DD4EBC.cjs'),require('./chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.va}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.za}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.d}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Aa}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ia}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ka}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ma}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.i}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.j}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.h}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.qa}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ma}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.g}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.j}});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { q as DrawingHorizontalReferenceFrame, D as DrawingKind, n as DrawingLocks, m as DrawingPositionInput, r as DrawingVerticalReferenceFrame, o as ImageResourceState, I as ImageWrapTarget, P as PreservedImageMime, k as RenderableImageMime, R as RevisionAddress, p as SupportedImageMime, V as ValidatedImageBytesHandle, s as VectorImageMime } from './tree-op-types-DbdM7fJV.js';
|
|
2
2
|
export { Block, ColorValue, ContainerRef, ContentControl, ContentControlFilter, ContentControlType, DocAnchor, DocAnchorRange, DocComment, DocLocation, DocRange, DocTarget, DocumentBody, DocxDocument, DocxDocumentJSON, ExecErrorCode, ExecResult, Extent, FontDefinition, HeaderFooterSet, IndentFormatting, InsertableContentControlType, NumberingRef, PageMargins, Paragraph, ParagraphDisagreements, ParagraphFlags, ParagraphFormatCommand, ParagraphTabStop, Point, Rect, Revision, RevisionType, Run, RunFormatting, Section, SectionProperties, SelectionPin, StyleDefinition, StyleDefinitions, Table, TableCell, TableRow, Theme, ThemeColorScheme, Unsubscribe, Watermark } from './contracts/types.js';
|
|
3
|
-
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from './review-items-
|
|
3
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from './review-items-CJz-kAW8.js';
|
|
4
|
+
export { a as DocumentProtectionEdit, D as DocumentProtectionState } from './document-protection-BL5zp8cU.js';
|
|
4
5
|
export { CollectReviewItems, EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot,
|
|
6
|
-
export { R 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 ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId,
|
|
6
|
+
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolvedNoteNumbering, a3 as ReviewActivationOptions, a4 as ReviewCommentPlacement, a5 as ReviewCustomPlacement, a6 as ReviewItemPlacement, a7 as ReviewItemPlacementBase, a8 as ReviewItemQuery, a9 as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, aa as TableBorderTarget, ab as TableCellVerticalAlignment, ac as TableColumnDividerResizeTarget, ad as TableColumnOccurrenceTarget, t as TableContext, ae as TableRightEdgeResizeTarget, af as TableRowOccurrenceTarget, ag as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ah as ZoomFitTarget, Z as ZoomMode } from './editor-WXbTSXx1.js';
|
|
7
|
+
export { R as RevisionDisplayMode } from './revision-projection-BIHO_qvw.js';
|
|
8
|
+
export { S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-0vQXcMZk.js';
|
|
9
|
+
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-BSrKnTeR.js';
|
|
10
|
+
export { C as CHROME_GROUPS, b as CHROME_MENUS, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, r as CustomFontsOptions, s as CustomFontsResolver, u as DocxEditorConfig, D as DocxEditorInstance, z as FontLoadFailure, B as FontLoadFailureReason, G as FontMeasurementState, H as FontUrlSource, I as HyperlinkActivation, J as HyperlinkChromeHandlers, W as LoadFontsRequest, X as LoadFontsResult, a9 as SurfaceHyperlink, as as ToolbarCommandState, au as blankDocumentBytes, ay as chromeMenuSlots, aC as commandForSlot, aD as commandForSlotValue, aI as createDocxEditor, aJ as createFontSource, aM as customFonts, aX as loadFonts, b4 as runToolbarCommand, bd as toolbarCommandState } from './index-C3As-Xxp.js';
|
|
10
11
|
export { ApplyResult, ContentControlSummary, DocEdit, DocEdits, DocQueries, DocQuery, DocQueryResults, ParagraphSummary } from './contracts/document.js';
|
|
11
12
|
export { E as EditorScope, V as ViewScope } from './editor-scope-DZJT4ukT.js';
|
|
12
13
|
export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './contracts/interaction.js';
|
|
13
14
|
import './collaboration.js';
|
|
14
|
-
import './tree-package-fragment-
|
|
15
|
-
import './hf-references-kSSFMq9X.js';
|
|
16
|
-
import './tree-store-BRfhZceK.js';
|
|
15
|
+
import './tree-package-fragment-1pdDnhZ_.js';
|
|
17
16
|
import './collaboration/replication.js';
|
|
18
|
-
import './failure-
|
|
19
|
-
import './semantic-records-
|
|
20
|
-
import './omml-equation-
|
|
21
|
-
import './semantic-paint-
|
|
22
|
-
import './note-properties-
|
|
23
|
-
import './custom-node-writes-
|
|
24
|
-
import './semantic-cell-selection-
|
|
25
|
-
import './tree-session-contract-
|
|
26
|
-
import './headless-document-view-
|
|
17
|
+
import './failure-DNNmwsgD.js';
|
|
18
|
+
import './semantic-records-ZcYuB4-H.js';
|
|
19
|
+
import './omml-equation-hcP9AUFX.js';
|
|
20
|
+
import './semantic-paint-BSan4pBk.js';
|
|
21
|
+
import './note-properties-RjYgbmXe.js';
|
|
22
|
+
import './custom-node-writes-BqIv94ei.js';
|
|
23
|
+
import './semantic-cell-selection-lCYAVCCF.js';
|
|
24
|
+
import './tree-session-contract-Cgn6fQ-M.js';
|
|
25
|
+
import './headless-document-view-C4ttQJ5H.js';
|
|
27
26
|
import 'prosemirror-model';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{va as CHROME_GROUPS,za as CHROME_MENUS,d as blankDocumentBytes,Aa as chromeMenuSlots,ia as commandForSlot,ka as commandForSlotValue,Ma as createDocxEditor,i as createFontSource,j as customFonts,h as loadFonts,qa as runToolbarCommand,ma as toolbarCommandState}from'./chunk-QBMAXYN7.js';import'./chunk-D5EHDHYV.js';import'./chunk-2ZEU42EA.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-OODFC5R2.js';import'./chunk-DQS4KZUX.js';import'./chunk-RIYSCEFQ.js';import'./chunk-P6VGDI57.js';import'./chunk-MSIFK7TJ.js';import'./chunk-72BDQFHY.js';import'./chunk-BEOPUDAB.js';import'./chunk-4DB7ZFQN.js';import'./chunk-THCGTV53.js';import'./chunk-VP7SDFCM.js';import'./chunk-4KMSEFIG.js';import'./chunk-6JIJOZDW.js';import'./chunk-ZMM5RNM6.js';import'./chunk-CJCFEXTA.js';import'./chunk-GOEBQ26R.js';
|