@betteroffice/docx 0.0.2 → 0.0.3
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/dist/chunk-GGEGIQRK.mjs +1 -0
- package/dist/chunk-J7LNO6SM.mjs +1 -0
- package/dist/chunk-WON6K4FY.mjs +1 -0
- package/dist/chunk-Y7RUNRU2.mjs +1 -0
- package/dist/collaboration/index.d.mts +5 -4
- package/dist/core.d.mts +3 -3
- package/dist/{displayListQueries-UGc_XBUv.d.mts → displayListQueries-BJlo7Jkz.d.mts} +24 -6
- package/dist/docx/index.d.mts +1 -1
- package/dist/editor/index.d.mts +5 -4
- package/dist/{rustDisplayList-CX78djsZ.d.mts → frameDelta-D965X8yK.d.mts} +2 -273
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/{index-Bwxm3oiC.d.mts → index-Dx4Z3lkz.d.mts} +83 -7
- package/dist/layout/index.d.mts +5 -4
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +3 -3
- package/dist/layout/render/index.d.mts +8 -7
- package/dist/layout/render/index.mjs +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +5 -4
- package/dist/plugin-api/index.d.mts +1 -1
- package/dist/plugin-api/resolveItemPositions.d.mts +1 -1
- package/dist/rustDisplayList-BRuZBqdL.d.mts +278 -0
- package/dist/types/content.d.mts +1 -1
- package/dist/types/document.d.mts +2 -2
- package/dist/{types-DMkDbvEu.d.mts → types-BfqUl2h_.d.mts} +1 -1
- package/dist/utils/comments.d.mts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/wasm-DO3BUV7C.mjs +1 -0
- package/dist/wasm-NWXX4H5G.mjs +1 -0
- package/dist/wasm-edit.d.mts +1 -0
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.d.mts +10 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/yrs/index.d.mts +4 -3
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6NEKRDXF.mjs +0 -1
- package/dist/chunk-CIRN3LZA.mjs +0 -1
- package/dist/chunk-NTQM4EYN.mjs +0 -1
- package/dist/wasm-BGQBTR2J.mjs +0 -1
- package/dist/wasm-SA237OSP.mjs +0 -1
- package/dist/{content-DLFHRQav.d.mts → content-MOZ6hKP4.d.mts} +349 -349
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-TTRUPDAB.mjs';var ee=class{constructor(e){b(this,"provider");b(this,"maxEntries");b(this,"createPath");b(this,"entries",new Map);this.provider=e.provider,this.maxEntries=Math.max(1,e.maxEntries??4096),this.createPath=e.createPath??(()=>new Path2D);}get size(){return this.entries.size}get(e,n){let i=`${e}:${n}`,r=this.entries.get(i);if(r!==void 0)return this.entries.delete(i),this.entries.set(i,r),r;let o=this.build(e,n);if(this.entries.set(i,o),this.entries.size>this.maxEntries){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return o}build(e,n){let{upem:i,cmds:r}=Ge(this.provider(e,n));return r.length===0?{path:null,upem:i}:{path:Be(r,this.createPath),upem:i}}};function Ge(t){let e=JSON.parse(t),n=typeof e.upem=="number"&&e.upem>0?e.upem:NaN;if(!Number.isFinite(n))throw new Error("glyph outline: missing or non-positive upem");let i=Array.isArray(e.cmds)?e.cmds:[];return {upem:n,cmds:i}}function Be(t,e){let n=e();for(let i of t)switch(i.t){case "M":n.moveTo(i.x,i.y);break;case "L":n.lineTo(i.x,i.y);break;case "Q":n.quadraticCurveTo(i.cx,i.cy,i.x,i.y);break;case "C":n.bezierCurveTo(i.c1x,i.c1y,i.c2x,i.c2y,i.x,i.y);break;case "Z":n.closePath();break}return n}function Ue(t){let e=/(\d+(?:\.\d+)?)px/.exec(t),n=e?Number(e[1]):NaN;return Number.isFinite(n)&&n>0?n:1056/72}function z(t){let e=Ue(t.font);return {x:t.x,y:t.baselineY-e*.8,w:t.width,h:e*1.2}}function V(t){let{glyphs:e,size:n}=t;if(e.length===0)return {x:0,y:0,w:0,h:n*1.2};let i=1/0,r=-1/0,o=-1/0,a=true;for(let c of e)c.x<i&&(i=c.x),c.x>r&&(r=c.x),c.advance===void 0?a=false:o=Math.max(o,c.x+c.advance);let s=a?Math.max(o-i,0):r-i+(e.length>1?(r-i)/(e.length-1):n*.6);return {x:i,y:e[0].y-n*.8,w:s,h:n*1.2}}function $e(t){let e=Math.min(t.x1,t.x2),n=Math.min(t.y1,t.y2),i=Math.abs(t.x2-t.x1),r=Math.abs(t.y2-t.y1),o=t.strokeWidth;return r===0?{x:e,y:n-o/2,w:i,h:o}:i===0?{x:e-o/2,y:n,w:o,h:r}:{x:e-o/2,y:n-o/2,w:i+o,h:r+o}}function jt(t){switch(t.kind){case "text":return z(t);case "glyphRun":return V(t);case "rect":case "image":case "shape":case "decoration":return {x:t.x,y:t.y,w:t.w,h:t.h};case "line":return $e(t)}}async function Qt(t,e,n={},i=1,r=1){let o=t.getContext("2d");if(!o)throw new Error("Canvas 2D context is unavailable");let a=i*r,s=e.width*a,c=e.height*a;return t.width!==s&&(t.width=s),t.height!==c&&(t.height=c),o.resetTransform(),o.scale(a,a),await ce(o,e,n),t}function en(t,e,n,i=1){t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height),typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.style.width=`${n.width*i}px`,t.style.height=`${n.height*i}px`);let r=t.getContext("2d");if(!r)throw new Error("Canvas 2D context is unavailable");r.resetTransform(),r.globalCompositeOperation="copy",r.drawImage(e,0,0),r.globalCompositeOperation="source-over";}function tn(t,e){t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height);let n=t.getContext("bitmaprenderer");if(!n)throw new Error("Offscreen bitmap renderer is unavailable");n.transferFromImageBitmap(e.transferToImageBitmap());}function nn(t,e,n,i){n.width!==e.width&&(n.width=e.width),n.height!==e.height&&(n.height=e.height);let r=n.getContext("2d");if(!r)throw new Error("Caret stage 2D context is unavailable");r.resetTransform(),r.globalCompositeOperation="copy",r.drawImage(e,0,0),r.globalCompositeOperation="source-over",r.fillStyle=i.color,r.fillRect(i.x,i.y,i.width,i.height),t.width!==n.width&&(t.width=n.width),t.height!==n.height&&(t.height=n.height);let o=t.getContext("bitmaprenderer");if(!o)throw new Error("Offscreen bitmap renderer is unavailable");o.transferFromImageBitmap(n.transferToImageBitmap());}function Ve(t,e,n,i,r=1){let o=i*r;t.width=n.width*o,t.height=n.height*o,t.style.width=`${n.width*r}px`,t.style.height=`${n.height*r}px`,e.scale(o,o);}async function rn(t,e={},n=2){let i=[];for(let r of t.pages){let o=document.createElement("canvas"),a=o.getContext("2d");a&&(Ve(o,a,r,n),await ce(a,r,e),i.push(o));}return i}async function ce(t,e,n={}){t.clearRect(0,0,e.width,e.height),e.background&&(t.fillStyle=e.background,t.fillRect(0,0,e.width,e.height));for(let i of (e.pageBorders??[]).filter(r=>r.zOrder==="back"))se(t,i);for(let i of e.primitives)await X(t,i,n);for(let i of e.noteAreas??[]){for(let r of i.separatorPrimitives??[])await X(t,r,n);for(let r of i.primitives??[])await X(t,r,n);}for(let i of [e.header,e.footer])if(i)for(let r of i.primitives)await X(t,r,n);for(let i of (e.pageBorders??[]).filter(r=>r.zOrder!=="back"))se(t,i);}async function X(t,e,n={}){let i=e.clipGroup?.clip;if(i){t.save();let r=m(i.x,0),o=m(i.y,0),a=Math.max(0,m(i.w,0)),s=Math.max(0,m(i.h,0));t.beginPath(),t.rect(r,o,a,s),t.clip(),C(t,e.clipGroup?.opacity);}try{await We(t,e,n);}finally{i&&t.restore();}}async function We(t,e,n){switch(e.kind){case "text":ze(t,e);break;case "glyphRun":Ye(t,e,n.glyphCache);break;case "rect":Xe(t,e);break;case "line":je(t,e);break;case "shape":await Je(t,e,n.resolveImage);break;case "decoration":if(e.style&&e.style!=="solid"){J(t,e.x,e.y+e.h/2,e.x+e.w,e.y+e.h/2,Math.max(e.h,1),e.color,e.style);break}if(e.dashed||e.dotted){let i=Math.max(e.h,1),r=e.dotted?i:Math.max(Math.round(i*2),2),o=e.dotted?Math.max(Math.round(i*2),2):r;t.strokeStyle=e.color,t.lineWidth=i,t.setLineDash([r,o]);let a=e.y+e.h/2;t.beginPath(),t.moveTo(e.x,a),t.lineTo(e.x+e.w,a),t.stroke(),t.setLineDash([]);break}t.fillStyle=e.color,t.fillRect(e.x,e.y,e.w,e.h);break;case "image":await mt(t,e,n.resolveImage);break;default:throw Et(e)}}function ze(t,e){let n=ye(t,z(e),e.hidden&&e.opacity===void 0?.4:e.opacity,e.rotationDeg,e.horizontalScale);!n&&Se(e)&&(t.save(),n=true),t.font=ve(e.font,e.smallCaps),t.fillStyle=e.color,t.textAlign="left",t.textBaseline="alphabetic",t.direction=e.rtl?"rtl":"ltr","letterSpacing"in t&&(t.letterSpacing=`${e.letterSpacing??0}px`),"wordSpacing"in t&&(t.wordSpacing=`${e.wordSpacing??0}px`);let i=e.allCaps?e.text.toUpperCase():e.text;e.leaderGlyphs?.glyph&&(e.leaderGlyphs.count??0)>0?Pt(t,e):Ee(t,i,e.x,e.baselineY,e,z(e))||we(t,i,e.x,e.baselineY,e),It(t,i,e.x,e.baselineY,e.width,e),n&&t.restore();}function Xe(t,e){let n=e.opacity!==void 0;n&&(t.save(),C(t,e.opacity)),t.fillStyle=e.fill,t.fillRect(e.x,e.y,e.w,e.h),n&&t.restore();}var te=false;function He(t){te||(te=true,console.warn("[canvasBackend] glyph outlines unavailable; painting glyph runs with fillText",t));}function Ye(t,e,n){let i=ye(t,V(e),e.hidden&&e.opacity===void 0?.4:e.opacity,e.rotationDeg,e.horizontalScale);if(!i&&Se(e)&&(t.save(),i=true),n)try{let r=e.glyphs.map(d=>n.get(e.fontId,d.id)),o=e.modernEffects,a=V(e),s=Pe(t,o,a,e.color),c=()=>{for(let d=0;d<e.glyphs.length;d++){let{path:u,upem:h}=r[d];if(!u)continue;let g=e.glyphs[d],b=e.size/h;t.save(),t.translate(g.x,g.y),t.scale(b,-b);let y=o?.textOutline;if(e.textOutline||y){t.strokeStyle=y?.color??e.color;let P=y?.width??Math.max(.5,e.size/16);t.lineWidth=Math.max(.5,P)/b,t.stroke(u),y&&!e.textOutline&&o?.textFill?.kind!=="none"&&t.fill(u);}else o?.textFill?.kind!=="none"&&t.fill(u);t.restore();}},l=o?.reflection;if(l){t.save();let d=a.y+a.h;t.translate(0,2*d+m(l.distance,0)),t.scale(1,-1),C(t,v(m(l.startOpacity,.35),0,1)),t.fillStyle=s,c(),t.restore();}t.fillStyle=s,De(t,e.textShadow,e.size),Ie(t,o),c(),xe(t,e),i&&t.restore();return}catch(r){He(r);}qe(t,e),i&&t.restore();}function qe(t,e){let n=e.glyphs[0];if(!n)return;t.font=ve(e.fallbackFont??`${e.size}px sans-serif`,e.smallCaps),t.fillStyle=e.color,t.textAlign="left",t.textBaseline="alphabetic",t.direction=e.rtl?"rtl":"ltr";let i=e.allCaps?e.text.toUpperCase():e.text;Ee(t,i,n.x,n.y,e,V(e))||we(t,i,n.x,n.y,e),xe(t,e);}function je(t,e){let n=e.opacity!==void 0;n&&(t.save(),C(t,e.opacity)),J(t,e.x1,e.y1,e.x2,e.y2,e.strokeWidth,e.color,e.borderStyle??"solid",e.secondaryColor,e.dash),n&&t.restore();}async function Je(t,e,n){let i=e.fillPaint,r=e.strokePaint;if(!e.fill&&!e.stroke&&!i&&!r)return;t.save(),C(t,e.opacity),Ke(t,e);let o=Ze(e);o||(t.beginPath(),fe(t,e.geometryPath)),at(t,e);let a=i?.kind,s=a==="picture"?i?.pictureSrc??i?.pictureRelId:void 0;if(a==="picture"&&s&&n){let c=await n(s);if(c)et(t,e,o,c);else {let l=ie(t,e);l&&ne(t,o,l);}}else if(a==="pattern")it(t,e,o);else if(a!=="none"){let c=ie(t,e);c&&ne(t,o,c);}(e.stroke||r)&&st(t,e,o),t.restore();}function Ke(t,e){let n=e.transform;if(!n?.rotation&&!n?.flipH&&!n?.flipV)return;let i=e.x+e.w/2,r=e.y+e.h/2;t.translate(i,r),n.rotation&&t.rotate(n.rotation*Math.PI/180),(n.flipH||n.flipV)&&t.scale(n.flipH?-1:1,n.flipV?-1:1),t.translate(-i,-r);}function Ze(t){let e=typeof Path2D>"u"?void 0:Path2D;if(!e)return null;let n=new e;return fe(n,t.geometryPath),n}function fe(t,e){for(let n of e)switch(n.type){case "move":t.moveTo(n.x,n.y);break;case "line":t.lineTo(n.x,n.y);break;case "quad":t.quadraticCurveTo(n.cpx,n.cpy,n.x,n.y);break;case "cubic":t.bezierCurveTo(n.cp1x,n.cp1y,n.cp2x,n.cp2y,n.x,n.y);break;case "close":t.closePath();break}}function ne(t,e,n){t.fillStyle=n,e?t.fill(e):t.fill();}function ie(t,e){let n=e.fillPaint;if(!n||n.kind==="solid"||n.kind==="theme")return n?.color??e.fill??null;if(n.kind!=="gradient")return n.color??e.fill??null;let i=ue(n.stops,n.color??e.fill??"#000000"),r;if(n.gradientType==="radial"||n.gradientType==="rectangular"||n.gradientType==="path"){let o=e.x+e.w/2,a=e.y+e.h/2;r=t.createRadialGradient(o,a,0,o,a,Math.max(e.w,e.h)/2);}else {let{x1:o,y1:a,x2:s,y2:c}=he(e,n.angle??0);r=t.createLinearGradient(o,a,s,c);}for(let o of i)r.addColorStop(o.position,o.color);return r}function ue(t,e){let n=(t??[]).filter(i=>i!=null).map(i=>{let r=m(i.position,0);return {position:v(r>1?r/1e5:r,0,1),color:i.color??e}}).sort((i,r)=>i.position-r.position);return n.length===0?[{position:0,color:e},{position:1,color:e}]:n.length===1?[{position:0,color:n[0].color},{position:1,color:n[0].color}]:n}function he(t,e){let n=e*Math.PI/180,i=Math.cos(n),r=Math.sin(n),o=t.x+t.w/2,a=t.y+t.h/2,s=Math.abs(i)*t.w/2+Math.abs(r)*t.h/2;return {x1:o-i*s,y1:a-r*s,x2:o+i*s,y2:a+r*s}}function me(t,e){e?t.clip(e):t.clip();}var Qe=4096;function et(t,e,n,i){let r=e.fillPaint;if(t.save(),me(t,n),C(t,r?.pictureOpacity),r?.pictureFillMode==="tile"&&nt(t,e,i)){t.restore();return}let o=r?.pictureStretchRect,a=v(m(o?.left,0),-10,10),s=v(m(o?.top,0),-10,10),c=v(m(o?.right,0),-10,10),l=v(m(o?.bottom,0),-10,10),d={x:e.x+a*e.w,y:e.y+s*e.h,w:e.w*(1-a-c),h:e.h*(1-s-l)};d.w>0&&d.h>0&&ge(t,i,d,tt(r)),t.restore();}function tt(t){let e=t?.pictureSrcRect;if(e)return {top:m(e.top,0),right:m(e.right,0),bottom:m(e.bottom,0),left:m(e.left,0)}}function nt(t,e,n){let{width:i,height:r}=Ce(n);if(i<=0||r<=0||e.w<=0||e.h<=0)return false;let o=e.fillPaint?.pictureTile,a=Math.max(1,i*v(m(o?.scaleX,1),.01,100)),s=Math.max(1,r*v(m(o?.scaleY,1),.01,100)),c=Math.ceil(e.w/a)+1,l=Math.ceil(e.h/s)+1;if(c*l>Qe)return false;let d=o?.alignment??"tl",u=e.x;d==="t"||d==="ctr"||d==="b"?u=e.x+(e.w-a)/2:(d==="tr"||d==="r"||d==="br")&&(u=e.x+e.w-a);let h=e.y;d==="l"||d==="ctr"||d==="r"?h=e.y+(e.h-s)/2:(d==="bl"||d==="b"||d==="br")&&(h=e.y+e.h-s),u+=v(m(o?.offsetX,0),-1e5,1e5),h+=v(m(o?.offsetY,0),-1e5,1e5);let g=Math.ceil((u-e.x)/a),b=Math.ceil((h-e.y)/s),y=o?.flip??"none",P=y==="x"||y==="xy",O=y==="y"||y==="xy";for(let _=-b;;_++){let I=h+_*s;if(I>=e.y+e.h)break;for(let M=-g;;M++){let R=u+M*a;if(R>=e.x+e.w)break;let G=P&&Math.abs(M)%2===1,B=O&&Math.abs(_)%2===1;G||B?(t.save(),t.translate(G?2*R+a:0,B?2*I+s:0),t.scale(G?-1:1,B?-1:1),t.drawImage(n,R,I,a,s),t.restore()):t.drawImage(n,R,I,a,s);}}return true}function it(t,e,n){let i=e.fillPaint,r=i?.foregroundColor??i?.color??e.fill??"#000000",o=i?.backgroundColor??"#ffffff",a=i?.patternPreset??"pct50";t.save(),me(t,n),t.fillStyle=o,t.fillRect(e.x,e.y,e.w,e.h),t.strokeStyle=r,t.fillStyle=r,t.lineWidth=1,rt(t,e,a),t.restore();}function rt(t,e,n){let i=ot(n),r=e.x+e.w,o=e.y+e.h,a=/horz|horizontal|cross|grid|plaid|weave|trellis/i.test(n),s=/vert|vertical|cross|grid|plaid|weave|trellis/i.test(n),c=/dnDiag|downDiag|diagCross|trellis|weave/i.test(n),l=/upDiag|diagCross|trellis|weave|zigZag/i.test(n);if(/pct|dot|sphere|confetti/i.test(n)||!a&&!s&&!c&&!l){let u=/pct5|pct10|sm/i.test(n)?.5:1;for(let h=e.y;h<=o;h+=i)for(let g=e.x;g<=r;g+=i)t.beginPath(),t.arc(g,h,u,0,Math.PI*2),t.fill();}if(a)for(let u=e.y;u<=o;u+=i)A(t,e.x,u,r,u);if(s)for(let u=e.x;u<=r;u+=i)A(t,u,e.y,u,o);if(c)for(let u=-e.h;u<=e.w;u+=i)A(t,e.x+u,e.y,e.x+u+e.h,o);if(l)for(let u=0;u<=e.w+e.h;u+=i)A(t,e.x+u,o,e.x+u-e.h,e.y);}function ot(t){return /pct5|pct10|sm|lt/i.test(t)?8:/pct75|pct80|pct90|dk/i.test(t)?3:5}function at(t,e){let n=e.effects?.find(o=>o.kind==="shadow"||o.kind==="outerShadow"||o.kind==="glow");if(!n||(t.shadowColor=n.color??"#000000",t.shadowBlur=Math.max(0,n.blurRadius??n.size??0),n.kind==="glow"))return;let i=(n.direction??0)*Math.PI/180,r=n.distance??0;t.shadowOffsetX=Math.cos(i)*r,t.shadowOffsetY=Math.sin(i)*r;}function st(t,e,n){let i=e.strokePaint,r=e.stroke,o=i?.color??r?.color??"#000000",a=Math.max(0,i?.width??r?.width??1);if(a===0)return;t.strokeStyle=o,i?.cap&&(t.lineCap=i.cap==="flat"?"butt":i.cap),i?.join&&(t.lineJoin=i.join),i?.miterLimit!==void 0&&(t.miterLimit=Math.max(1,i.miterLimit));let s=i?.customDash?.length?i.customDash.map(d=>Math.max(0,d*a)):j(i?.dash??r?.dash,a);t.lineWidth=a,t.setLineDash(s);let c=i?.compound??"single";if(c==="single"){n?t.stroke(n):t.stroke(),re(t,e,i?.headEnd,i?.tailEnd,o,a);return}let l=lt(c,a);for(let d of l)t.lineWidth=d,n?t.stroke(n):t.stroke();re(t,e,i?.headEnd,i?.tailEnd,o,a);}function lt(t,e){switch(t){case "double":return [e,Math.max(.5,e/3)];case "triple":return [e,Math.max(.5,e*.6),Math.max(.5,e*.2)];case "thinThick":case "thickThin":return [e,Math.max(.5,e*.4)];default:return [e]}}function re(t,e,n,i,r,o){let a=dt(e.geometryPath);a&&(n?.type&&n.type!=="none"&&oe(t,a.start,a.next,n,r,o),i?.type&&i.type!=="none"&&oe(t,a.end,a.prev,i,r,o));}function dt(t){let e=[];for(let n of t)n.type==="move"||n.type==="line"?e.push({x:n.x,y:n.y}):n.type==="quad"?e.push({x:n.x,y:n.y}):n.type==="cubic"&&e.push({x:n.x,y:n.y});return e.length<2?null:{start:e[0],next:e[1],prev:e[e.length-2],end:e[e.length-1]}}function oe(t,e,n,i,r,o){let a=Math.atan2(n.y-e.y,n.x-e.x),s=o*ae(i.length,4),c=o*ae(i.width,2),l=e.x+Math.cos(a)*s,d=e.y+Math.sin(a)*s,u=-Math.sin(a)*c,h=Math.cos(a)*c;t.save(),t.fillStyle=r,t.strokeStyle=r,i.type==="oval"?(t.beginPath(),t.arc(e.x,e.y,c,0,Math.PI*2),t.fill()):i.type==="diamond"?(t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(l+u,d+h),t.lineTo(e.x+Math.cos(a)*s*2,e.y+Math.sin(a)*s*2),t.lineTo(l-u,d-h),t.closePath(),t.fill()):(t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(l+u,d+h),t.lineTo(l-u,d-h),t.closePath(),i.type==="arrow"?t.stroke():t.fill()),t.restore();}function ae(t,e){return t==="sm"?e*.75:t==="lg"?e*1.5:e}function j(t,e){switch(t){case "dot":case "dotted":case "sysDot":return [Math.max(1,e),Math.max(2,e*2)];case "dash":case "dashed":case "dashSmallGap":case "sysDash":return [Math.max(2,e*3),Math.max(2,e*2)];case "lgDash":case "dashLong":case "dashLongHeavy":return [Math.max(4,e*6),Math.max(2,e*2)];case "dashDot":case "lgDashDot":case "sysDashDot":case "dashDotHeavy":return [Math.max(2,e*3),Math.max(2,e*2),e,Math.max(2,e*2)];case "dashDotDot":case "lgDashDotDot":case "sysDashDotDot":case "dashDotDotHeavy":return [Math.max(2,e*3),Math.max(2,e*2),e,Math.max(2,e*2),e,Math.max(2,e*2)];default:return []}}function J(t,e,n,i,r,o,a,s,c,l){let d=Math.max(o,.5);if(s==="wave"||s==="doubleWave"){ut(t,e,n,i,r,d,a,s==="doubleWave");return}if(s==="double"||s==="triple"||s==="thinThick"||s==="thickThin"){ft(t,e,n,i,r,d,a,s);return}if(s==="groove"||s==="ridge"||s==="inset"||s==="outset"){ht(t,e,n,i,r,d,a,c,s);return}t.strokeStyle=a,t.lineWidth=d,t.setLineDash(l??ct(s,d)),A(t,e,n,i,r);}function ct(t,e){switch(t){case "dotted":return [Math.max(1,e),Math.max(1.5,e*1.5)];case "dashed":return [Math.max(2,e*4),Math.max(2,e*2)];case "dashDot":return [e*4,e*1.5,e,e*1.5];case "dashDotDot":return [e*4,e*1.5,e,e*1.5,e,e*1.5];default:return []}}function pe(t,e,n,i){let r=n-t,o=i-e,a=Math.hypot(r,o)||1;return {x:-o/a,y:r/a}}function ft(t,e,n,i,r,o,a,s){let c=pe(e,n,i,r),l=s==="triple"?[{offset:-o,width:Math.max(.5,o/3)},{offset:0,width:Math.max(.5,o/3)},{offset:o,width:Math.max(.5,o/3)}]:s==="thinThick"?[{offset:-o*.45,width:Math.max(.5,o*.25)},{offset:o*.3,width:Math.max(.75,o*.55)}]:s==="thickThin"?[{offset:-o*.3,width:Math.max(.75,o*.55)},{offset:o*.45,width:Math.max(.5,o*.25)}]:[{offset:-o/2,width:Math.max(.5,o/3)},{offset:o/2,width:Math.max(.5,o/3)}];t.strokeStyle=a,t.setLineDash([]);for(let d of l){t.lineWidth=d.width;let u=c.x*d.offset,h=c.y*d.offset;A(t,e+u,n+h,i+u,r+h);}}function ut(t,e,n,i,r,o,a,s){let c=i-e,l=r-n,d=Math.hypot(c,l);if(d===0)return;let u={x:c/d,y:l/d},h={x:-u.y,y:u.x},g=Math.max(4,o*4),b=Math.max(1,o),y=s?[-b,b]:[0];t.strokeStyle=a,t.lineWidth=Math.max(.5,o/(s?2:1)),t.setLineDash([]);for(let P of y){t.beginPath(),t.moveTo(e+h.x*P,n+h.y*P);let O=0,_=1;for(;O<d;){let I=Math.min(d,O+g/2),M=(O+I)/2;t.quadraticCurveTo(e+u.x*M+h.x*(P+b*_),n+u.y*M+h.y*(P+b*_),e+u.x*I+h.x*P,n+u.y*I+h.y*P),O=I,_*=-1;}t.stroke();}}function ht(t,e,n,i,r,o,a,s,c){let l=pe(e,n,i,r),d=s??le(a,"#ffffff",.55),u=le(a,"#000000",.45),h=c==="ridge"||c==="outset",g=h?d:u,b=h?u:d,y=o/4;t.setLineDash([]),t.lineWidth=Math.max(.5,o/2),t.strokeStyle=g,A(t,e-l.x*y,n-l.y*y,i-l.x*y,r-l.y*y),t.strokeStyle=b,A(t,e+l.x*y,n+l.y*y,i+l.x*y,r+l.y*y);}function se(t,e){let n=e.x,i=e.y,r=e.x+e.w,o=e.y+e.h;e.top&&H(t,n,i,r,i,e.top),e.right&&H(t,r,i,r,o,e.right),e.bottom&&H(t,n,o,r,o,e.bottom),e.left&&H(t,n,i,n,o,e.left);}function H(t,e,n,i,r,o,a){J(t,e,n,i,r,o.width,o.color,o.style),t.setLineDash([]);}function A(t,e,n,i,r){t.beginPath(),t.moveTo(e,n),t.lineTo(i,r),t.stroke();}async function mt(t,e,n){if(!n)return;let i=await n(e.relId);if(!i)return;let r=pt(e);t.save(),C(t,e.opacity);let o=gt(e);if(o&&"filter"in t&&(t.filter=o),e.rotationDeg||e.flipH||e.flipV){let a=r.x+r.w/2,s=r.y+r.h/2;t.translate(a,s),e.rotationDeg&&t.rotate(e.rotationDeg*Math.PI/180),(e.flipH||e.flipV)&&t.scale(e.flipH?-1:1,e.flipV?-1:1),t.translate(-a,-s);}ge(t,i,r,e.crop),bt(t,e,r),e.revision&&(t.strokeStyle=e.revision.kind==="ins"?"rgb(46, 125, 50)":"rgb(198, 40, 40)",t.lineWidth=2,t.setLineDash([]),t.strokeRect(r.x,r.y,r.w,r.h),e.revision.kind==="del"&&(t.beginPath(),t.moveTo(r.x,r.y+r.h),t.lineTo(r.x+r.w,r.y),t.stroke())),t.restore();}function pt(t){return {x:m(t.contentFrame?.x,t.x),y:m(t.contentFrame?.y,t.y),w:Math.max(0,m(t.contentFrame?.w,t.w)),h:Math.max(0,m(t.contentFrame?.h,t.h))}}function ge(t,e,n,i){if(!i){t.drawImage(e,n.x,n.y,n.w,n.h);return}let{width:r,height:o}=Ce(e);if(r<=0||o<=0||n.w<=0||n.h<=0)return;let a={x:i.left*r,y:i.top*o,w:r*(1-i.left-i.right),h:o*(1-i.top-i.bottom)};if(a.w<=0||a.h<=0)return;if(a.x>=0&&a.y>=0&&a.x+a.w<=r&&a.y+a.h<=o){t.drawImage(e,a.x,a.y,a.w,a.h,n.x,n.y,n.w,n.h);return}let s={x:v(a.x,0,r),y:v(a.y,0,o),right:v(a.x+a.w,0,r),bottom:v(a.y+a.h,0,o)},c=s.right-s.x,l=s.bottom-s.y;if(c<=0||l<=0)return;let d={x:n.x+(s.x-a.x)/a.w*n.w,y:n.y+(s.y-a.y)/a.h*n.h,w:c/a.w*n.w,h:l/a.h*n.h};t.drawImage(e,s.x,s.y,c,l,d.x,d.y,d.w,d.h);}function gt(t){let e=[],n=yt(t.filter);n&&e.push(n);for(let i of t.effects??[]){let r=m(i.amount,1);switch(i.kind){case "brightness":case "contrast":case "saturate":e.push(`${i.kind}(${Math.max(0,r)})`);break;case "saturation":e.push(`saturate(${Math.max(0,r)})`);break;case "grayscale":e.push(`grayscale(${v(r,0,1)})`);break;case "biLevel":e.push(`grayscale(1) contrast(${Math.max(1,r||4)})`);break;case "blur":e.push(`blur(${v(r,0,128)}px)`);break}}return e.length>0?e.join(" "):null}function yt(t){if(!t)return null;let e=/^(?:\s*(?:blur\(\d+(?:\.\d+)?px\)|brightness\(\d+(?:\.\d+)?\)|contrast\(\d+(?:\.\d+)?\)|grayscale\(\d+(?:\.\d+)?%?\)|hue-rotate\(-?\d+(?:\.\d+)?deg\)|invert\(\d+(?:\.\d+)?%?\)|opacity\(\d+(?:\.\d+)?%?\)|saturate\(\d+(?:\.\d+)?\)|sepia\(\d+(?:\.\d+)?%?\))\s*)+$/;return t.length<=512&&e.test(t)?t.trim():null}function bt(t,e,n){let i=e.border,r=m(i?.width,0);!i||r<=0||(t.strokeStyle=i.color??"#000000",t.lineWidth=r,t.setLineDash(i.dash??j(i.style,r)),t.strokeRect(n.x,n.y,n.w,n.h));}function ye(t,e,n,i,r){return n===void 0&&!i&&!be(r)?false:(t.save(),vt(t,e,n,i,r),true)}function vt(t,e,n,i,r){if(C(t,n),i){let o=e.x+e.w/2,a=e.y+e.h/2;t.translate(o,a),t.rotate(i*Math.PI/180),t.translate(-o,-a);}if(be(r)){let o=r/100,a=e.y+e.h/2;t.translate(e.x,a),t.scale(o,1),t.translate(-e.x,-a);}}function Pt(t,e){let n=e.leaderGlyphs;if(!n?.glyph)return;let i=Math.max(0,Math.floor(n.count??0)),r=m(n.advance,0);if(i===0||r<=0)return;let o=m(n.x,e.x),a=m(n.baselineY,e.baselineY);t.font=n.font??e.font,t.fillStyle=n.color??e.color;for(let s=0;s<i;s++){let c=n.rtl?i-1-s:s;t.fillText(n.glyph,o+c*r,a);}}function be(t){return t!==void 0&&t!==100}function ve(t,e){return !e||/\bsmall-caps\b/.test(t)?t:t.replace(/^(italic|oblique)\s+/,"$1 small-caps ").replace(/^((?!italic|oblique).*)$/,"small-caps $1")}function Pe(t,e,n,i){let r=e?.textFill;if(!r)return i;if(r.kind==="gradient"){let o=ue(r.stops,i),{x1:a,y1:s,x2:c,y2:l}=he({x:n.x,y:n.y,w:Math.max(n.w,1),h:Math.max(n.h,1)},m(r.angle,90)),d=t.createLinearGradient(a,s,c,l);for(let u of o)d.addColorStop(u.position,u.color);return d}return r.kind==="solid"&&r.color?r.color:i}function Ie(t,e){if(!e)return;if(e.glow){t.shadowColor=e.glow.color??"rgba(255, 192, 0, 0.75)",t.shadowBlur=Math.max(0,m(e.glow.radius,4)),t.shadowOffsetX=0,t.shadowOffsetY=0;return}let n=e.shadow;if(!n)return;t.shadowColor=n.color??"rgba(0, 0, 0, 0.4)",t.shadowBlur=Math.max(0,m(n.blurRadius,0));let i=m(n.direction,0)*Math.PI/180,r=m(n.distance,0);t.shadowOffsetX=Math.cos(i)*r,t.shadowOffsetY=Math.sin(i)*r;}function Ee(t,e,n,i,r,o){let a=r.modernEffects;if(!a)return false;let s=Pe(t,a,o,r.color),c=a.reflection;if(c){t.save();let d=o.y+o.h;t.translate(0,2*d+m(c.distance,0)),t.scale(1,-1),C(t,v(m(c.startOpacity,.35),0,1)),t.fillStyle=s,t.fillText(e,n,i),t.restore();}Ie(t,a),a.textFill?.kind!=="none"&&(t.fillStyle=s,t.fillText(e,n,i));let l=a.textOutline;if(l&&!l.noFill){let d=Math.max(.5,m(l.width,1));t.strokeStyle=l.color??r.color,t.lineWidth=d,t.setLineDash(j(l.dash,d)),t.strokeText(e,n,i),t.setLineDash([]);}return true}function we(t,e,n,i,r){if(!r.textShadow&&!r.textOutline){t.fillText(e,n,i);return}let o=r.size??Re(r.font),a=Math.max(.5,o/16);if(r.textShadow==="emboss"?(t.fillStyle="rgba(255,255,255,0.5)",t.fillText(e,n+a,i+a),t.fillStyle="rgba(0,0,0,0.3)",t.fillText(e,n-a,i-a)):r.textShadow==="imprint"?(t.fillStyle="rgba(255,255,255,0.5)",t.fillText(e,n-a,i-a),t.fillStyle="rgba(0,0,0,0.3)",t.fillText(e,n+a,i+a)):De(t,r.textShadow,o),t.fillStyle=r.color,r.textOutline){t.strokeStyle=r.color,t.lineWidth=a,t.strokeText(e,n,i);return}t.fillText(e,n,i);}function Se(t){return t.textShadow!==void 0||t.textOutline===true||t.modernEffects!=null}function De(t,e,n=16){e==="shadow"&&(t.shadowColor="rgba(0,0,0,0.3)",t.shadowBlur=Math.max(1,n/8),t.shadowOffsetX=Math.max(.5,n/16),t.shadowOffsetY=Math.max(.5,n/16));}function It(t,e,n,i,r,o){if(!o.emphasisMark)return;let a=[...e];if(a.length===0||r<=0)return;let s=Te(o.emphasisMark);if(!s)return;let c=o.size??Re(o.font),l=Math.max(4,c*.5),d=o.emphasisMark==="underDot"?i+c*.45:i-c*.85,u=r/a.length;t.save(),t.font=`${l}px sans-serif`,t.fillStyle=o.color,t.textAlign="center",t.textBaseline="middle";for(let h=0;h<a.length;h++)/\s/.test(a[h])||t.fillText(s,n+u*h+u/2,d);t.restore();}function xe(t,e){if(!e.emphasisMark||e.glyphs.length===0)return;let n=Te(e.emphasisMark);if(!n)return;let i=new Map;for(let s of e.glyphs){let c=i.get(s.cluster),l=s.x+Math.max(0,s.advance??0);c?(c.minX=Math.min(c.minX,s.x),c.maxX=Math.max(c.maxX,l),c.baselineY=Math.max(c.baselineY,s.y)):i.set(s.cluster,{minX:s.x,maxX:l,baselineY:s.y});}let r=[...i.keys()].sort((s,c)=>s-c),o=new TextEncoder().encode(e.text),a=Math.max(4,e.size*.5);t.save(),t.font=`${a}px sans-serif`,t.fillStyle=e.color,t.textAlign="center",t.textBaseline="middle";for(let s=0;s<r.length;s++){let c=r[s],l=r[s+1]??o.length,d=new TextDecoder().decode(o.slice(c,l));if(!d||/^\s+$/u.test(d))continue;let u=i.get(c);if(!u)continue;let h=e.size*.5,g=u.maxX>u.minX?u.maxX:u.minX+h,b=e.emphasisMark==="underDot"?u.baselineY+e.size*.45:u.baselineY-e.size*.85;t.fillText(n,(u.minX+g)/2,b);}t.restore();}function Te(t){switch(t){case "dot":case "underDot":return "\u2022";case "comma":return "\uFE45";case "circle":return "\u25CB";default:return null}}function Re(t){let e=t?.match(/(\d+(?:\.\d+)?)px\b/);return e?Number(e[1]):16}function Ce(t){let e=t;if(typeof e.naturalWidth=="number"&&typeof e.naturalHeight=="number")return {width:e.naturalWidth,height:e.naturalHeight};if(typeof e.videoWidth=="number"&&typeof e.videoHeight=="number")return {width:e.videoWidth,height:e.videoHeight};let n=typeof e.width=="number"?e.width:e.width?.baseVal.value??0,i=typeof e.height=="number"?e.height:e.height?.baseVal.value??0;return {width:n,height:i}}function C(t,e){if(e===void 0)return;let n=Number.isFinite(t.globalAlpha)?t.globalAlpha:1;t.globalAlpha=n*v(e,0,1);}function m(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function v(t,e,n){return Math.min(n,Math.max(e,t))}function le(t,e,n){let i=de(t),r=de(e);if(!i||!r)return t;let o=(a,s)=>Math.round(a+(s-a)*v(n,0,1)).toString(16).padStart(2,"0");return `#${o(i.r,r.r)}${o(i.g,r.g)}${o(i.b,r.b)}`}function de(t){let e=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!e)return null;let n=e[1].length===3?[...e[1]].map(i=>i+i).join(""):e[1];return {r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}}function Et(t){let e=t.kind;return new Error(`[canvasBackend] unsupported display primitive kind: ${String(e)}`)}var sn=1,ln=80,dn=48;var K=BigInt(Number.MAX_SAFE_INTEGER),Ae=BigInt(Number.MIN_SAFE_INTEGER),wt=0,St=1,Dt=2,xt=3,Tt=4,Rt=5,Ct=6,Ot=7,_t=8,Mt=9,Oe=1,_e=2,N=class extends Error{constructor(n,i){super(`FrameDelta: ${i}`);b(this,"code");this.name="FrameDeltaError",this.code=n;}};function cn(t){let e=t instanceof Uint8Array?t:new Uint8Array(t);e.byteOffset%8!==0&&(e=e.slice());let n=new Q(e);n.requireLength(80,"fixed header"),(n.u8(0)!==70||n.u8(1)!==68||n.u8(2)!==86||n.u8(3)!==49)&&f("bad magic");let i=n.u16(4);if(i!==1)throw new N("unsupported-version",`unsupported protocol version ${i}`);n.u16(6)!==80&&f("invalid v1 header length"),n.u32(8)!==e.byteLength&&f("declared total length does not match buffer");let r=n.u32(12);(r&-2)!==0&&f(`unknown frame flags 0x${r.toString(16)}`);let o=(r&1)!==0,a=n.safeU64(16,"document epoch"),s=n.safeU64(24,"layout epoch"),c=n.safeU64(32,"frame epoch"),l=n.safeU64(40,"base frame epoch");o&&l!==0&&f("full frame must have base epoch zero"),!o&&l===0&&f("delta frame requires a nonzero base epoch");let d=n.u32(48),u=n.u32(52),h=n.u32(56),g=n.u32(60),b=n.u32(64),y=n.u32(68),P=n.u32(72),O=P===0?void 0:P;n.u32(76)!==0&&f("reserved header bytes must be zero"),h!==80&&f("invalid operation table offset"),D(h,ke(u,48,"operation table"),"operation table")!==g&&f("operation table/string table are not contiguous");let I=D(g,b,"string table");(I>y||y>e.byteLength)&&f("string/data section bounds are invalid"),y%8!==0&&f("data section is not 8-byte aligned");let M=Lt(n,g,I),R=[],G=new Set;for(let p=0;p<u;p++){let E=h+p*48,w=n.u8(E);w!==1&&w!==2&&w!==3&&w!==4&&w!==5&&f(`unknown page opcode ${w}`);for(let x=1;x<4;x++)n.u8(E+x)!==0&&f("page operation reserved bytes are nonzero");for(let x=40;x<48;x++)n.u8(E+x)!==0&&f("page operation tail is nonzero");let U=n.u32(E+4),k=n.u64(E+8),W=n.u64(E+16),F=n.u32(E+24),T=n.u32(E+28),L=n.u32(E+32),$=n.u32(E+36);if(k===0n&&f("page id zero is reserved"),G.has(k)&&f(`duplicate page operation for id ${k}`),G.add(k),w===2||w===3)(F||T||L||$)&&f("remove/move operation carries an unexpected payload");else if(w===1){U>=d&&f("upsert page index exceeds final page count"),(T<y||T%8!==0)&&f("primitive id array has an invalid offset/alignment");let x=D(T,ke(F,8,"primitive id array"),"primitive id array"),Le=D(L,$,"page payload");(x>e.byteLength||L<x||Le>e.byteLength||$===0)&&f("page payload bounds are invalid");}else {U>=d&&f("position patch page index exceeds final page count");let x=D(L,$,"position patch payload");(F>1e7||T!==0||L<y||L%8!==0||$<8||x>e.byteLength)&&f("position patch payload bounds are invalid");}R.push({opcode:w,pageIndex:U,pageId:k,fingerprint:W,primitiveCount:F,primitiveIdsOffset:T,payloadOffset:L,payloadLength:$});}o&&R.some(p=>p.opcode!==1)&&f("full frame may contain only page upserts"),Gt(n,R,I,y);let B=R.map(p=>{if(p.opcode===2)return {kind:"remove",pageIndex:p.pageIndex,pageId:p.pageId};if(p.opcode===3)return p.pageIndex>=d&&f("move page index exceeds final page count"),{kind:"move",pageIndex:p.pageIndex,pageId:p.pageId,fingerprint:p.fingerprint};if(p.opcode===4)return {kind:"patch-positions",pageIndex:p.pageIndex,pageId:p.pageId,fingerprint:p.fingerprint,patches:Ut(n,p)};if(p.opcode===5)return {kind:"shift-positions",pageIndex:p.pageIndex,pageId:p.pageId,fingerprint:p.fingerprint,runs:Bt(n,p)};let E=p.payloadOffset+p.payloadLength,w=new Z(n,M,p.payloadOffset,E),U=w.value(0);w.offset!==E&&f("page payload has trailing bytes"),Xt(U,p.pageIndex,p.primitiveCount);let k=e.byteOffset+p.primitiveIdsOffset;k%8!==0&&f("primitive id array is not host-view aligned");let W=new BigUint64Array(e.buffer,k,p.primitiveCount),F=new Set;for(let T of W)(T===0n||F.has(T))&&f("primitive id array contains zero or duplicate ids"),F.add(T);return {kind:"upsert",pageIndex:p.pageIndex,pageId:p.pageId,fingerprint:p.fingerprint,primitiveIds:W,page:U}});return o&&B.length!==d&&f("full frame does not define every page"),{protocolVersion:1,full:o,docEpoch:a,layoutEpoch:s,frameEpoch:c,baseFrameEpoch:l,pageCount:d,contractVersion:O,operations:B,bytes:e}}function fn(t,e){return Ne(t,e,false)}function un(t,e){return Ne(t,e,true)}function Ne(t,e,n){if(t&&e.frameEpoch<=t.frameEpoch)throw new N("stale-frame",`frame ${e.frameEpoch} is not newer than applied frame ${t.frameEpoch}`);if(!e.full&&(!t||e.baseFrameEpoch!==t.frameEpoch))throw new N("base-mismatch",`delta base ${e.baseFrameEpoch} does not match applied frame ${t?.frameEpoch??0}`);if(t&&e.docEpoch<t.docEpoch)throw new N("stale-frame","document epoch moved backwards");if(t&&e.layoutEpoch<t.layoutEpoch)throw new N("stale-frame","layout epoch moved backwards");let i=new Map;if(!e.full&&t)for(let l of t.pages)i.set(l.pageId,l);let r=new Set,o=new Set;for(let l of e.operations){if(l.kind==="remove"){i.delete(l.pageId)||f(`remove references unknown page ${l.pageId}`),o.add(l.pageId);continue}if(l.kind==="move"){let d=i.get(l.pageId);d||f(`move references unknown page ${l.pageId}`),d.fingerprint!==l.fingerprint&&f(`move fingerprint differs for page ${l.pageId}`),i.set(l.pageId,{...d,pageIndex:l.pageIndex,page:d.page.pageIndex===l.pageIndex?d.page:{...d.page,pageIndex:l.pageIndex}});continue}if(l.kind==="patch-positions"){let d=i.get(l.pageId);d||f(`position patch references unknown page ${l.pageId}`),i.set(l.pageId,{...d,pageIndex:l.pageIndex,fingerprint:l.fingerprint,page:$t(d.page,d.primitiveIds,l.patches,l.pageIndex)});continue}if(l.kind==="shift-positions"){let d=i.get(l.pageId);d||f(`position shift references unknown page ${l.pageId}`),i.set(l.pageId,{...d,pageIndex:l.pageIndex,fingerprint:l.fingerprint,page:n?Nt(d.page,l.runs,l.pageIndex):Vt(d.page,l.runs,l.pageIndex)});continue}i.set(l.pageId,{pageIndex:l.pageIndex,pageId:l.pageId,fingerprint:l.fingerprint,primitiveIds:l.primitiveIds,page:l.page}),r.add(l.pageId);}if(e.full&&t)for(let l of t.pages)i.has(l.pageId)||o.add(l.pageId);i.size!==e.pageCount&&f("applied page count does not match frame header");let a=[...i.values()].sort((l,d)=>l.pageIndex-d.pageIndex),s=new Set;for(let l=0;l<a.length;l++){let d=a[l];(d.pageIndex!==l||d.page.pageIndex!==l)&&f("applied pages are not a contiguous zero-based sequence"),s.has(d.pageId)&&f(`duplicate retained page id ${d.pageId}`),s.add(d.pageId);}let c={...e.contractVersion===void 0?{}:{contractVersion:e.contractVersion},pages:a.map(l=>l.page)};return {protocolVersion:1,docEpoch:e.docEpoch,layoutEpoch:e.layoutEpoch,frameEpoch:e.frameEpoch,contractVersion:e.contractVersion,pages:a,damagedPageIds:r,removedPageIds:o,displayList:c}}var Fe="__betterofficePageRevision";function kt(t){return t[Fe]??0}function At(t){Object.defineProperty(t,Fe,{value:kt(t)+1,enumerable:false,configurable:true,writable:true});}function Nt(t,e,n){At(t);let i=0,r=0,o=a=>{for(let s of a){for(;r<e.length&&e[r].start+e[r].count<=i;)r+=1;let c=e[r];c&&i>=c.start&&i<c.start+c.count&&Ft(s,c.changedMask,c.delta),i+=1;}};o(t.primitives);for(let a of t.noteAreas??[])o(a.separatorPrimitives??[]),o(a.primitives??[]);return t.header&&o(t.header.primitives),t.footer&&o(t.footer.primitives),e.some(a=>a.start+a.count>i)&&f("position shift range exceeds retained primitive count"),t.pageIndex===n?t:{...t,pageIndex:n}}function Ft(t,e,n){let i=(r,o)=>{if((e&r)===0)return;let a=t[o];typeof a!="number"&&f(`position shift requires retained ${o}`);let s=a+n;Number.isSafeInteger(s)||f(`position shift overflows ${o}`),t[o]=s;};i(1,"docStart"),i(2,"docEnd"),i(4,"fragmentDocStart"),i(8,"fragmentDocEnd"),(e&16)!==0&&((!t.inlineSdtWidget||!Number.isSafeInteger(t.inlineSdtWidget.pos+n))&&f("position shift requires retained inline widget metadata"),t.inlineSdtWidget.pos+=n);}function Lt(t,e,n){let i=e;i+4>n&&f("truncated string table count");let r=t.u32(i);i+=4,r>1e7&&f("string table count exceeds decoder limit");let o=new TextDecoder("utf-8",{fatal:true}),a=[];for(let s=0;s<r;s++){i+4>n&&f("truncated string length");let c=t.u32(i);i+=4;let l=D(i,c,"string bytes");l>n&&f("string exceeds string table bounds");try{a.push(o.decode(t.bytes.subarray(i,l)));}catch{f("string table contains invalid UTF-8");}i=l;}return i!==n&&f("string table length/count mismatch"),a}function Gt(t,e,n,i){let r=[];for(let a of e)a.opcode===1?(a.primitiveCount>0&&r.push({start:a.primitiveIdsOffset,end:a.primitiveIdsOffset+a.primitiveCount*8}),r.push({start:a.payloadOffset,end:a.payloadOffset+a.payloadLength})):(a.opcode===4||a.opcode===5)&&r.push({start:a.payloadOffset,end:a.payloadOffset+a.payloadLength});r.sort((a,s)=>a.start-s.start||a.end-s.end),Me(t,n,i);let o=i;for(let a of r)a.start<o&&f("data regions overlap"),Me(t,o,a.start),o=a.end;o!==t.bytes.byteLength&&f("data section has trailing bytes");}function Bt(t,e){let n=e.payloadOffset,i=e.payloadOffset+e.payloadLength,r=(c,l)=>{let d=D(n,c,l);d>i&&f(`truncated ${l}`);let u=n;return n=d,u},o=t.u32(r(4,"position shift run count"));(o!==e.primitiveCount||o===0||o>1e7)&&f("position shift run count mismatch"),t.u32(r(4,"position shift reserved word"))!==0&&f("position shift reserved word is nonzero");let a=[],s=0;for(let c=0;c<o;c++){let l=t.u32(r(4,"position shift start")),d=t.u32(r(4,"position shift count")),u=t.u8(r(1,"position shift changed mask"));r(7,"position shift reserved bytes");for(let b=n-7;b<n;b++)t.u8(b)!==0&&f("position shift reserved bytes are nonzero");let h=t.safeI64(r(8,"position shift delta"),"position shift delta"),g=D(l,d,"position shift range");(d===0||l<s||u===0||(u&-32)!==0||h===0)&&f("position shift run is invalid"),s=g,a.push({start:l,count:d,changedMask:u,delta:h});}return n!==i&&f("position shift byte length/count mismatch"),a}function Me(t,e,n){for(let i=e;i<n;i++)t.u8(i)!==0&&f("alignment padding is nonzero");}function Ut(t,e){let n=e.payloadOffset,i=e.payloadOffset+e.payloadLength,r=(l,d)=>{let u=D(n,l,d);u>i&&f(`truncated ${d}`);let h=n;return n=u,h},o=t.u32(r(4,"position patch count"));o!==e.primitiveCount&&f("position patch count mismatch"),(o===0||o>1e7)&&f("invalid position patch count"),t.u32(r(4,"position patch reserved word"))!==0&&f("position patch reserved word is nonzero");let a=new Set,s=[],c=[[1,"docStart"],[2,"docEnd"],[4,"fragmentDocStart"],[8,"fragmentDocEnd"],[16,"inlineWidgetPos"]];for(let l=0;l<o;l++){let d=t.u64(r(8,"position patch primitive id"));(d===0n||a.has(d))&&f("position patch carries an invalid or duplicate primitive id"),a.add(d);let u=t.u8(r(1,"position patch changed mask")),h=t.u8(r(1,"position patch present mask"));(u===0||(u&-32)!==0)&&f("position patch changed mask is invalid"),(h&~u)!==0&&f("position patch present mask is not a subset of changed fields"),t.u16(r(2,"position patch reserved bytes"))!==0&&f("position patch reserved bytes are nonzero");let g={primitiveId:d};for(let[b,y]of c)(u&b)!==0&&(g[y]=(h&b)===0?null:t.safeI64(r(8,`position patch ${y}`),y));s.push(g);}return n!==i&&f("position patch byte length/count mismatch"),s}function $t(t,e,n,i){let r=new Map;for(let u of n)r.has(u.primitiveId)&&f(`duplicate position patch ${u.primitiveId}`),r.set(u.primitiveId,u);let o=0,a=u=>u.map(h=>{o>=e.length&&f("retained primitive id array is shorter than its page");let g=e[o++],b=r.get(g);return b?(r.delete(g),zt(h,b)):h}),s=a(t.primitives),c=t.noteAreas?.map(u=>({...u,...u.separatorPrimitives?{separatorPrimitives:a(u.separatorPrimitives)}:{},...u.primitives?{primitives:a(u.primitives)}:{}})),l=t.header?{...t.header,primitives:a(t.header.primitives)}:void 0,d=t.footer?{...t.footer,primitives:a(t.footer.primitives)}:void 0;return o!==e.length&&f("retained primitive id array is longer than its page"),r.size!==0&&f("position patch references an unknown primitive id"),{...t,pageIndex:i,primitives:s,...c?{noteAreas:c}:{},...l?{header:l}:{},...d?{footer:d}:{}}}function Vt(t,e,n){let i=0,r=0,o=d=>d.map(u=>{for(;r<e.length&&e[r].start+e[r].count<=i;)r+=1;let h=e[r],g=h&&i>=h.start&&i<h.start+h.count?Wt(u,h.changedMask,h.delta):u;return i+=1,g}),a=o(t.primitives),s=t.noteAreas?.map(d=>({...d,...d.separatorPrimitives?{separatorPrimitives:o(d.separatorPrimitives)}:{},...d.primitives?{primitives:o(d.primitives)}:{}})),c=t.header?{...t.header,primitives:o(t.header.primitives)}:void 0,l=t.footer?{...t.footer,primitives:o(t.footer.primitives)}:void 0;return e.some(d=>d.start+d.count>i)&&f("position shift range exceeds retained primitive count"),{...t,pageIndex:n,primitives:a,...s?{noteAreas:s}:{},...c?{header:c}:{},...l?{footer:l}:{}}}function Wt(t,e,n){let i={...t},r=(o,a)=>{if((e&o)===0)return;let s=i[a];typeof s!="number"&&f(`position shift requires retained ${a}`);let c=s+n;Number.isSafeInteger(c)||f(`position shift overflows ${a}`),i[a]=c;};return r(1,"docStart"),r(2,"docEnd"),r(4,"fragmentDocStart"),r(8,"fragmentDocEnd"),(e&16)!==0&&((!i.inlineSdtWidget||!Number.isSafeInteger(i.inlineSdtWidget.pos+n))&&f("position shift requires retained inline widget metadata"),i.inlineSdtWidget={...i.inlineSdtWidget,pos:i.inlineSdtWidget.pos+n}),i}function zt(t,e){let n={...t},i=(r,o)=>{o===null?delete n[r]:n[r]=o;};return e.docStart!==void 0&&i("docStart",e.docStart),e.docEnd!==void 0&&i("docEnd",e.docEnd),e.fragmentDocStart!==void 0&&i("fragmentDocStart",e.fragmentDocStart),e.fragmentDocEnd!==void 0&&i("fragmentDocEnd",e.fragmentDocEnd),e.inlineWidgetPos!==void 0&&((e.inlineWidgetPos===null||!n.inlineSdtWidget)&&f("inline widget position patch requires retained widget metadata"),n.inlineSdtWidget={...n.inlineSdtWidget,pos:e.inlineWidgetPos}),n}var Z=class{constructor(e,n,i,r){b(this,"reader",e);b(this,"strings",n);b(this,"end",r);b(this,"offset");this.offset=i;}value(e){e>64&&f("typed value nesting exceeds decoder limit");let n=this.readU8("value tag");switch(n){case wt:return null;case St:return false;case Dt:return true;case xt:return this.safeInteger(this.readI64("i64 value"),"signed value");case Tt:return this.safeInteger(this.readU64("u64 value"),"unsigned value");case Rt:{let i=this.readF64("f64 value");return Number.isFinite(i)||f("non-finite f64 value"),i}case Ct:return this.string(this.readU32("string id"));case Ot:{let i=this.readU32("array byte length"),r=this.readU32("array item count");r>1e7&&f("array item count exceeds decoder limit");let o=D(this.offset,i,"array payload");o>this.end&&f("array payload exceeds parent bounds");let a=[];for(let s=0;s<r;s++)a.push(this.value(e+1));return this.offset!==o&&f("array byte length/count mismatch"),a}case _t:{let i=this.readU32("object byte length"),r=this.readU32("object field count");r>1e7&&f("object field count exceeds decoder limit");let o=D(this.offset,i,"object payload");o>this.end&&f("object payload exceeds parent bounds");let a={};for(let s=0;s<r;s++){let c=this.string(this.readU32("object key id"));Object.prototype.hasOwnProperty.call(a,c)&&f(`duplicate object key ${c}`),Object.defineProperty(a,c,{value:this.value(e+1),enumerable:true,configurable:true,writable:true});}return this.offset!==o&&f("object byte length/count mismatch"),a}case Mt:{let i=this.readU32("glyph array byte length"),r=this.readU32("glyph array item count");r>1e7&&f("glyph array item count exceeds decoder limit");let o=D(this.offset,i,"glyph array payload");o>this.end&&f("glyph array payload exceeds parent bounds");let a=[];for(let s=0;s<r;s++){let c=this.readU32("glyph id"),l=this.finiteF64("glyph x"),d=this.finiteF64("glyph y"),u=this.readU32("glyph cluster"),h=this.finiteF64("glyph advance"),g=this.readU8("glyph flags");(g&-4)!==0&&f("glyph flags contain unknown bits");let b={id:c,x:l,y:d,cluster:u,advance:h};(g&Oe)!==0&&(b.logicalOrder=this.safeInteger(this.readU64("glyph logical order"),"glyph logical order")),(g&_e)!==0&&(b.bidiLevel=this.readU8("glyph bidi level")),a.push(b);}return this.offset!==o&&f("glyph array byte length/count mismatch"),a}default:f(`unknown typed value opcode ${n}`);}}string(e){let n=this.strings[e];return n===void 0&&f(`string id ${e} is out of bounds`),n}safeInteger(e,n){return (e<Ae||e>K)&&f(`${n} exceeds JavaScript safe-integer range`),Number(e)}require(e,n){let i=D(this.offset,e,n);i>this.end&&f(`truncated ${n}`);let r=this.offset;return this.offset=i,r}readU8(e){return this.reader.u8(this.require(1,e))}readU32(e){return this.reader.u32(this.require(4,e))}readU64(e){return this.reader.u64(this.require(8,e))}readI64(e){return this.reader.i64(this.require(8,e))}readF64(e){return this.reader.f64(this.require(8,e))}finiteF64(e){let n=this.readF64(e);return Number.isFinite(n)||f(`non-finite ${e}`),n}},Q=class{constructor(e){b(this,"bytes",e);b(this,"view");this.view=new DataView(e.buffer,e.byteOffset,e.byteLength);}requireLength(e,n){this.bytes.byteLength<e&&f(`truncated ${n}`);}u8(e){return this.bounds(e,1),this.view.getUint8(e)}u16(e){return this.bounds(e,2),this.view.getUint16(e,true)}u32(e){return this.bounds(e,4),this.view.getUint32(e,true)}u64(e){return this.bounds(e,8),this.view.getBigUint64(e,true)}i64(e){return this.bounds(e,8),this.view.getBigInt64(e,true)}f64(e){return this.bounds(e,8),this.view.getFloat64(e,true)}safeU64(e,n){let i=this.u64(e);return i>K&&f(`${n} exceeds JavaScript safe-integer range`),Number(i)}safeI64(e,n){let i=this.i64(e);return (i<Ae||i>K)&&f(`${n} exceeds JavaScript safe-integer range`),Number(i)}bounds(e,n){(e<0||e+n>this.bytes.byteLength)&&f("read exceeds frame bounds");}};function Xt(t,e,n){(!t||typeof t!="object"||Array.isArray(t))&&f("page payload is not an object"),t.pageIndex!==e&&f("page payload/index operation mismatch"),(!Number.isFinite(t.width)||t.width<0||!Number.isFinite(t.height)||t.height<0)&&f("page dimensions are invalid"),Array.isArray(t.primitives)||f("page primitives are not an array");let i=t.primitives.length;for(let r of t.noteAreas??[])(!Array.isArray(r.separatorPrimitives??[])||!Array.isArray(r.primitives??[]))&&f("note primitive collections are invalid"),i+=(r.separatorPrimitives?.length??0)+(r.primitives?.length??0);for(let r of [t.header,t.footer])r&&!Array.isArray(r.primitives)&&f("header/footer primitives are invalid"),i+=r?.primitives.length??0;i!==n&&f("primitive id count does not match decoded page");}function D(t,e,n){let i=t+e;return (!Number.isSafeInteger(i)||i<0)&&f(`${n} byte offset overflow`),i}function ke(t,e,n){let i=t*e;return (!Number.isSafeInteger(i)||i<0)&&f(`${n} byte length overflow`),i}function f(t){throw new N("invalid-frame",t)}export{ee as a,Ue as b,z as c,V as d,$e as e,jt as f,Qt as g,en as h,tn as i,nn as j,Ve as k,rn as l,ce as m,X as n,sn as o,ln as p,dn as q,N as r,cn as s,fn as t,un as u,kt as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function d(t,r,e,i){let n=e*i;return {x:t.x*n,y:t.y*n,width:Math.max(1,r.width*e),height:t.height*n}}function m(t,r){if(!Number.isSafeInteger(t.frameEpoch)||t.frameEpoch!==r.frameEpoch)return null;let e=t.caretRect;return e?!Number.isInteger(e.pageIndex)||e.pageIndex<0||!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.height)||e.height<0||!/^[1-9]\d*$/u.test(e.pageId)?null:r.pages[e.pageIndex]?.pageId.toString()===e.pageId?t:null:t}export{d as a,m as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-T4EZMUXM.mjs';import {a}from'./chunk-TTRUPDAB.mjs';var H={};a(H,{build_display_list_json:()=>L,clear_measure_fonts:()=>D,close_display_list:()=>z,default:()=>U,hit_test_json:()=>N,hit_test_regions_by_handle:()=>V,hit_test_regions_json:()=>T,initSync:()=>S,layout_document_json:()=>W,measure_paragraph_json:()=>O,open_display_list:()=>X,outline_glyph_json:()=>I,range_rects_by_handle:()=>Y,range_rects_json:()=>B,range_rects_region_by_handle:()=>K,range_rects_region_json:()=>Q,register_measure_font:()=>M,update_display_list:()=>Z});function L(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.build_display_list_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,d(i[2]);return n=r,t=s,y(r,s)}finally{o.__wbindgen_free(n,t,1);}}function D(){o.clear_measure_fonts();}function z(e){o.close_display_list(e);}function N(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),p=u,f=o.hit_test_json(l,p,n,t,r);var a=f[0],i=f[1];if(f[3])throw a=0,i=0,d(f[2]);return s=a,_=i,y(a,i)}finally{o.__wbindgen_free(s,_,1);}}function V(e,n,t,r){let s,_;try{let l=o.hit_test_regions_by_handle(e,n,t,r);var a=l[0],i=l[1];if(l[3])throw a=0,i=0,d(l[2]);return s=a,_=i,y(a,i)}finally{o.__wbindgen_free(s,_,1);}}function T(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),p=u,f=o.hit_test_regions_json(l,p,n,t,r);var a=f[0],i=f[1];if(f[3])throw a=0,i=0,d(f[2]);return s=a,_=i,y(a,i)}finally{o.__wbindgen_free(s,_,1);}}function W(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.layout_document_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,d(i[2]);return n=r,t=s,y(r,s)}finally{o.__wbindgen_free(n,t,1);}}function O(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.measure_paragraph_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,d(i[2]);return n=r,t=s,y(r,s)}finally{o.__wbindgen_free(n,t,1);}}function X(e){let n=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.open_display_list(n,t);if(r[2])throw d(r[1]);return r[0]>>>0}function I(e,n){let t,r;try{let a=o.outline_glyph_json(e,n);var s=a[0],_=a[1];if(a[3])throw s=0,_=0,d(a[2]);return t=s,r=_,y(s,_)}finally{o.__wbindgen_free(t,r,1);}}function Y(e,n,t){let r,s;try{let i=o.range_rects_by_handle(e,n,t);var _=i[0],a=i[1];if(i[3])throw _=0,a=0,d(i[2]);return r=_,s=a,y(_,a)}finally{o.__wbindgen_free(r,s,1);}}function B(e,n,t){let r,s;try{let i=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=u,p=o.range_rects_json(i,l,n,t);var _=p[0],a=p[1];if(p[3])throw _=0,a=0,d(p[2]);return r=_,s=a,y(_,a)}finally{o.__wbindgen_free(r,s,1);}}function K(e,n,t,r,s){let _,a;try{let p=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),f=u,E=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),j=u,w=o.range_rects_region_by_handle(e,p,f,E,j,r,s);var i=w[0],l=w[1];if(w[3])throw i=0,l=0,d(w[2]);return _=i,a=l,y(i,l)}finally{o.__wbindgen_free(_,a,1);}}function Q(e,n,t,r,s){let _,a;try{let p=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=u,E=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),j=u,w=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),F=u,R=o.range_rects_region_json(p,f,E,j,w,F,r,s);var i=R[0],l=R[1];if(R[3])throw i=0,l=0,d(R[2]);return _=i,a=l,y(i,l)}finally{o.__wbindgen_free(_,a,1);}}function M(e){let n=$(e,o.__wbindgen_malloc),t=u,r=o.register_measure_font(n,t);if(r[2])throw d(r[1]);return r[0]>>>0}function Z(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,s=o.update_display_list(e,t,r);if(s[1])throw d(s[0])}function k(){return {__proto__:null,"./docx_layout_bg.js":{__proto__:null,__wbindgen_cast_0000000000000001:function(n,t){return y(n,t)},__wbindgen_init_externref_table:function(){let n=o.__wbindgen_externrefs,t=n.grow(4);n.set(0,void 0),n.set(t+0,void 0),n.set(t+1,null),n.set(t+2,true),n.set(t+3,false);}}}}function y(e,n){return ne(e>>>0,n)}var m=null;function h(){return (m===null||m.byteLength===0)&&(m=new Uint8Array(o.memory.buffer)),m}function $(e,n){let t=n(e.length*1,1)>>>0;return h().set(e,t/1),u=e.length,t}function g(e,n,t){if(t===void 0){let i=x.encode(e),l=n(i.length,1)>>>0;return h().subarray(l,l+i.length).set(i),u=i.length,l}let r=e.length,s=n(r,1)>>>0,_=h(),a=0;for(;a<r;a++){let i=e.charCodeAt(a);if(i>127)break;_[s+a]=i;}if(a!==r){a!==0&&(e=e.slice(a)),s=t(s,r,r=a+e.length*3,1)>>>0;let i=h().subarray(s+a,s+r),l=x.encodeInto(e,i);a+=l.written,s=t(s,r,a,1)>>>0;}return u=a,s}function d(e){let n=o.__wbindgen_externrefs.get(e);return o.__externref_table_dealloc(e),n}var v=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});v.decode();var ee=2146435072,A=0;function ne(e,n){return A+=n,A>=ee&&(v=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),v.decode(),A=n),v.decode(h().subarray(e,e+n))}var x=new TextEncoder;"encodeInto"in x||(x.encodeInto=function(e,n){let t=x.encode(e);return n.set(t),{read:e.length,written:t.length}});var u=0,o;function q(e,n){return o=e.exports,m=null,o.__wbindgen_start(),o}async function oe(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(s){if(e.ok&&t(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",s);else throw s}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}else {let r=await WebAssembly.instantiate(e,n);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}function t(r){switch(r){case "basic":case "cors":case "default":return true}return false}}function S(e){if(o!==void 0)return o;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let n=k();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let t=new WebAssembly.Instance(e,n);return q(t)}async function U(e){if(o!==void 0)return o;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),e===void 0)throw new Error("docx-layout wasm requires an explicit module or URL");let n=k();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:t,module:r}=await oe(await e,n);return q(t)}var c=a$1({label:"docx-layout",preloadName:"preloadLayoutWasm",assetUrl:()=>new URL("./generated/layout/docx_layout_bg.wasm",import.meta.url),initAsync:U,initSync:S});function le(e){return c.preload(e)}function ce(e,n,t,r){return c.ensure(),T(e,n,t,r)}function ue(e,n,t){return c.ensure(),B(e,n,t)}function b(e){let n=H[e];return typeof n=="function"?n:void 0}function de(){return c.ensure(),b("open_display_list")!==void 0}function fe(){return c.ensure(),b("range_rects_region_json")!==void 0}function ge(e){c.ensure();let n=b("open_display_list");if(!n)throw new Error("open_display_list is not available in the embedded layout wasm yet");return n(e)}function pe(e){c.ensure(),b("close_display_list")?.(e);}function ye(e,n){c.ensure();let t=b("update_display_list");if(!t)throw new Error("update_display_list is not available in the embedded layout wasm yet");t(e,n);}function be(){return c.ensure(),b("update_display_list")!==void 0}function we(e,n,t,r){c.ensure();let s=b("hit_test_regions_by_handle");if(!s)throw new Error("hit_test_regions_by_handle is not available in the embedded layout wasm yet");return s(e,n,t,r)}function me(e,n,t){c.ensure();let r=b("range_rects_by_handle");if(!r)throw new Error("range_rects_by_handle is not available in the embedded layout wasm yet");return r(e,n,t)}function he(e,n,t,r,s){c.ensure();let _=b("range_rects_region_json");if(!_)throw new Error("range_rects_region_json is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function xe(e,n,t,r,s){c.ensure();let _=b("range_rects_region_by_handle");if(!_)throw new Error("range_rects_region_by_handle is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function Re(e){return c.ensure(),L(e)}function ve(e){return c.ensure(),W(e)}function Ee(e){return c.ensure(),M(e)}function je(){c.ensure(),D();}function Ae(e){return c.ensure(),O(e)}function se(){let e=I;return typeof e=="function"?e:void 0}function Le(e,n){c.ensure();let t=se();if(!t)throw new Error("outline_glyph_json is not available in the embedded layout wasm yet");return t(e,n)}export{le as a,ce as b,ue as c,de as d,fe as e,ge as f,pe as g,ye as h,be as i,we as j,me as k,he as l,xe as m,Re as n,ve as o,Ee as p,je as q,Ae as r,Le as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-T4EZMUXM.mjs';var I=class{__destroy_into_raw(){let _=this.__wbg_ptr;return this.__wbg_ptr=0,q.unregister(this),_}free(){let _=this.__destroy_into_raw();e.__wbg_editsession_free(_,0);}accept_change(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_accept_change(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}add_comment(_,r,o,n){let t,i;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=e.editsession_add_comment(this.__wbg_ptr,w,f,g,u,m,y,h,x);var l=v[0],s=v[1];if(v[3])throw l=0,s=0,b(v[2]);return t=l,i=s,p(l,s)}finally{e.__wbindgen_free(t,i,1);}}apply_delete(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=e.editsession_apply_delete(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var i=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),i}apply_delete_profiled(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=e.editsession_apply_delete_profiled(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var i=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),i}apply_input(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=e.editsession_apply_input(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var i=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),i}apply_input_profile_json(){let _,r;try{let o=e.editsession_apply_input_profile_json(this.__wbg_ptr);return _=o[0],r=o[1],p(o[0],o[1])}finally{e.__wbindgen_free(_,r,1);}}apply_input_profiled(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=e.editsession_apply_input_profiled(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var i=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),i}apply_local_update(_){let r=F(_,e.__wbindgen_malloc),o=c,n=e.editsession_apply_local_update(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}apply_paragraph_style(_,r,o,n,t,i,l,s){let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var v=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,W=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c;let A=e.editsession_apply_paragraph_style(this.__wbg_ptr,w,f,g,u,o,m,y,t,h,x,v,E,W,k);if(A[1])throw b(A[0])}apply_raw_ops(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_apply_raw_ops(this.__wbg_ptr,o,n,t,i);if(l[1])throw b(l[0])}apply_update(_){let r=F(_,e.__wbindgen_malloc),o=c,n=e.editsession_apply_update(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}build_display_list_frame(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=e.editsession_build_display_list_frame(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var i=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),i}build_display_list_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_build_display_list_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}can_redo(){return e.editsession_can_redo(this.__wbg_ptr)!==0}can_undo(){return e.editsession_can_undo(this.__wbg_ptr)!==0}cell_selection(){let _,r;try{let t=e.editsession_cell_selection(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,p(o,n)}finally{e.__wbindgen_free(_,r,1);}}clear_content_control_value(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_clear_content_control_value(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}clear_formatting(_,r,o,n,t){let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c,f=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=e.editsession_clear_formatting(this.__wbg_ptr,i,l,s,w,o,f,g,t);if(u[1])throw b(u[0])}clear_measure_fonts(){e.editsession_clear_measure_fonts(this.__wbg_ptr);}clear_update_event_observation(){e.editsession_clear_update_event_observation(this.__wbg_ptr);}clear_update_observer(){e.editsession_clear_update_observer(this.__wbg_ptr);}client_id(){return e.editsession_client_id(this.__wbg_ptr)}create_story(_,r,o,n){let t,i;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=e.editsession_create_story(this.__wbg_ptr,w,f,g,u,m,y,h,x);var l=v[0],s=v[1];if(v[3])throw l=0,s=0,b(v[2]);return t=l,i=s,p(l,s)}finally{e.__wbindgen_free(t,i,1);}}delete_column(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_delete_column(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}delete_range(_,r,o,n,t,i,l){let s,w;try{let x=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c,E=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=c,k=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c;var f=j(i)?0:a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;let T=e.editsession_delete_range(this.__wbg_ptr,x,v,E,W,o,k,A,t,f,g,u,m);var y=T[0],h=T[1];if(T[3])throw y=0,h=0,b(T[2]);return s=y,w=h,p(y,h)}finally{e.__wbindgen_free(s,w,1);}}delete_row(_,r,o){let n,t;try{let u=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;var i=j(r)?0:a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c;let y=e.editsession_delete_row(this.__wbg_ptr,u,m,i,l,s,w);var f=y[0],g=y[1];if(y[3])throw f=0,g=0,b(y[2]);return n=f,t=g,p(f,g)}finally{e.__wbindgen_free(n,t,1);}}delete_story(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_delete_story(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}delete_table(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_delete_table(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}display_hit_test_regions_json(_,r,o){let n,t;try{let s=e.editsession_display_hit_test_regions_json(this.__wbg_ptr,_,r,o);var i=s[0],l=s[1];if(s[3])throw i=0,l=0,b(s[2]);return n=i,t=l,p(i,l)}finally{e.__wbindgen_free(n,t,1);}}display_range_rects_json(_,r){let o,n;try{let l=e.editsession_display_range_rects_json(this.__wbg_ptr,_,r);var t=l[0],i=l[1];if(l[3])throw t=0,i=0,b(l[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}display_range_rects_region_json(_,r,o,n){let t,i;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=e.editsession_display_range_rects_region_json(this.__wbg_ptr,w,f,g,u,o,n);var l=m[0],s=m[1];if(m[3])throw l=0,s=0,b(m[2]);return t=l,i=s,p(l,s)}finally{e.__wbindgen_free(t,i,1);}}drain_update_event(){let _=e.editsession_drain_update_event(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}encode_diff(_){let r=F(_,e.__wbindgen_malloc),o=c,n=e.editsession_encode_diff(this.__wbg_ptr,r,o);if(n[3])throw b(n[2]);var t=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),t}encode_state(){let _=e.editsession_encode_state(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}encode_state_vector(){let _=e.editsession_encode_state_vector(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}format_range(_,r,o,n,t,i){let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_format_range(this.__wbg_ptr,l,s,w,f,o,g,u,t,m,y);if(h[1])throw b(h[0])}insert_column(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=e.editsession_insert_column(this.__wbg_ptr,l,s,r);var t=w[0],i=w[1];if(w[3])throw t=0,i=0,b(w[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}insert_image(_,r,o,n,t,i){let l,s;try{let h=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,W=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c;var w=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=j(i)?0:a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c;let A=e.editsession_insert_image(this.__wbg_ptr,h,x,v,E,o,W,k,w,f,g,u);var m=A[0],y=A[1];if(A[3])throw m=0,y=0,b(A[2]);return l=m,s=y,p(m,y)}finally{e.__wbindgen_free(l,s,1);}}insert_page_break(_,r,o){let n=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,i=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_insert_page_break(this.__wbg_ptr,n,t,i,l,o);if(s[1])throw b(s[0])}insert_row(_,r,o,n){let t,i;try{let m=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c;var l=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;let h=e.editsession_insert_row(this.__wbg_ptr,m,y,r,l,s,w,f);var g=h[0],u=h[1];if(h[3])throw g=0,u=0,b(h[2]);return t=g,i=u,p(g,u)}finally{e.__wbindgen_free(t,i,1);}}insert_section_break(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_insert_section_break(this.__wbg_ptr,t,i,l,s,o,w,f);if(g[1])throw b(g[0])}insert_table(_,r,o,n,t,i,l){let s,w;try{let x=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c,E=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=c;var f=j(i)?0:a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;let k=e.editsession_insert_table(this.__wbg_ptr,x,v,E,W,o,n,t,f,g,u,m);var y=k[0],h=k[1];if(k[3])throw y=0,h=0,b(k[2]);return s=y,w=h,p(y,h)}finally{e.__wbindgen_free(s,w,1);}}insert_text(_,r,o,n,t,i){let l,s;try{let h=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,W=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c;var w=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=j(i)?0:a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c;let A=e.editsession_insert_text(this.__wbg_ptr,h,x,v,E,o,W,k,w,f,g,u);var m=A[0],y=A[1];if(A[3])throw m=0,y=0,b(A[2]);return l=m,s=y,p(m,y)}finally{e.__wbindgen_free(l,s,1);}}insert_watermark(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_insert_watermark(this.__wbg_ptr,t,i,l,s,o,w,f);if(g[1])throw b(g[0])}layout_document_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_document_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}layout_document_with_regions_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_document_with_regions_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}layout_font_requirements_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_font_requirements_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}list_revisions(){let _,r;try{let t=e.editsession_list_revisions(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,p(o,n)}finally{e.__wbindgen_free(_,r,1);}}load(_){let r=F(_,e.__wbindgen_malloc),o=c,n=e.editsession_load(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}load_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_load_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}locate_paragraph(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_locate_paragraph(this.__wbg_ptr,l,s,w,f);var t=g[0],i=g[1];if(g[3])throw t=0,i=0,b(g[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}measure_paragraph_json(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_measure_paragraph_json(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}merge_cells(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_merge_cells(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}merge_paragraphs(_,r,o,n){let t,i;try{let m=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var l=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;let v=e.editsession_merge_paragraphs(this.__wbg_ptr,m,y,h,x,l,s,w,f);var g=v[0],u=v[1];if(v[3])throw g=0,u=0,b(v[2]);return t=g,i=u,p(g,u)}finally{e.__wbindgen_free(t,i,1);}}constructor(_){let r=e.editsession_new(_);if(r[2])throw b(r[1]);return this.__wbg_ptr=r[0],q.register(this,this.__wbg_ptr,this),this}outline_glyph_json(_,r){let o,n;try{let l=e.editsession_outline_glyph_json(this.__wbg_ptr,_,r);var t=l[0],i=l[1];if(l[3])throw t=0,i=0,b(l[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}paragraph_spans(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_paragraph_spans(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}paragraphs(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_paragraphs(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}redo(){return e.editsession_redo(this.__wbg_ptr)!==0}redo_depth(){return e.editsession_redo_depth(this.__wbg_ptr)>>>0}register_measure_font(_){let r=F(_,e.__wbindgen_malloc),o=c,n=e.editsession_register_measure_font(this.__wbg_ptr,r,o);if(n[2])throw b(n[1]);return n[0]>>>0}reject_change(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_reject_change(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}replace_range(_,r,o,n,t,i,l,s){let w,f;try{let v=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,W=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c,A=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),T=c,J=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),Y=c;var g=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c;let D=e.editsession_replace_range(this.__wbg_ptr,v,E,W,k,o,A,T,t,J,Y,g,u,m,y);var h=D[0],x=D[1];if(D[3])throw h=0,x=0,b(D[2]);return w=h,f=x,p(h,x)}finally{e.__wbindgen_free(w,f,1);}}resident_caret_snapshot_json(){let _,r;try{let t=e.editsession_resident_caret_snapshot_json(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,p(o,n)}finally{e.__wbindgen_free(_,r,1);}}resolve_comment(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_resolve_comment(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}selection(){let _,r;try{let t=e.editsession_selection(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,p(o,n)}finally{e.__wbindgen_free(_,r,1);}}selection_context(_,r,o,n,t){let i,l;try{let f=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c,y=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),h=c,x=e.editsession_selection_context(this.__wbg_ptr,f,g,u,m,o,y,h,t);var s=x[0],w=x[1];if(x[3])throw s=0,w=0,b(x[2]);return i=s,l=w,p(s,w)}finally{e.__wbindgen_free(i,l,1);}}set_cell_borders(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_cell_borders(this.__wbg_ptr,l,s,w,f);var t=g[0],i=g[1];if(g[3])throw t=0,i=0,b(g[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}set_cell_selection(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_set_cell_selection(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}set_cell_shading(_,r){let o,n;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;var t=j(r)?0:a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c;let g=e.editsession_set_cell_shading(this.__wbg_ptr,w,f,t,i);var l=g[0],s=g[1];if(g[3])throw l=0,s=0,b(g[2]);return o=l,n=s,p(l,s)}finally{e.__wbindgen_free(o,n,1);}}set_cell_text_format(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_cell_text_format(this.__wbg_ptr,l,s,w,f);var t=g[0],i=g[1];if(g[3])throw t=0,i=0,b(g[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}set_column_width(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=e.editsession_set_column_width(this.__wbg_ptr,l,s,r);var t=w[0],i=w[1];if(w[3])throw t=0,i=0,b(w[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}set_content_control_value(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_set_content_control_value(this.__wbg_ptr,o,n,t,i);if(l[1])throw b(l[0])}set_content_control_value_at(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_content_control_value_at(this.__wbg_ptr,t,i,l,s,o,w,f);if(g[1])throw b(g[0])}set_hyperlink(_,r,o,n,t,i){let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_set_hyperlink(this.__wbg_ptr,l,s,w,f,o,g,u,t,m,y);if(h[1])throw b(h[0])}set_image_geometry(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_set_image_geometry(this.__wbg_ptr,o,n,t,i);if(l[1])throw b(l[0])}set_paragraph_attr(_,r,o){let n=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,i=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c,f=e.editsession_set_paragraph_attr(this.__wbg_ptr,n,t,i,l,s,w);if(f[1])throw b(f[0])}set_paragraph_attrs(_,r,o,n,t,i,l,s){let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var v=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,W=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c;let A=e.editsession_set_paragraph_attrs(this.__wbg_ptr,w,f,g,u,o,m,y,t,h,x,v,E,W,k);if(A[1])throw b(A[0])}set_selection(_,r,o,n,t){let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c,f=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=e.editsession_set_selection(this.__wbg_ptr,i,l,s,w,o,f,g,t);if(u[1])throw b(u[0])}set_table_width(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=e.editsession_set_table_width(this.__wbg_ptr,l,s,r);var t=w[0],i=w[1];if(w[3])throw t=0,i=0,b(w[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}set_update_observer(_){let r=e.editsession_set_update_observer(this.__wbg_ptr,_);if(r[1])throw b(r[0])}split_cell(_,r,o){let n,t;try{let s=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c,f=e.editsession_split_cell(this.__wbg_ptr,s,w,j(r)?Number.MAX_SAFE_INTEGER:r>>>0,j(o)?Number.MAX_SAFE_INTEGER:o>>>0);var i=f[0],l=f[1];if(f[3])throw i=0,l=0,b(f[2]);return n=i,t=l,p(i,l)}finally{e.__wbindgen_free(n,t,1);}}split_paragraph(_,r,o,n,t){let i,l;try{let y=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),h=c,x=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c;var s=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),w=c,f=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c;let E=e.editsession_split_paragraph(this.__wbg_ptr,y,h,x,v,o,s,w,f,g);var u=E[0],m=E[1];if(E[3])throw u=0,m=0,b(E[2]);return i=u,l=m,p(u,m)}finally{e.__wbindgen_free(i,l,1);}}start_update_event_observation(){let _=e.editsession_start_update_event_observation(this.__wbg_ptr);if(_[1])throw b(_[0])}story_checksum(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_story_checksum(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}story_ids(){let _=e.editsession_story_ids(this.__wbg_ptr);var r=Z(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*4,4),r}story_len(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_story_len(this.__wbg_ptr,r,o);if(n[2])throw b(n[1]);return n[0]>>>0}story_segments(_){let r,o;try{let i=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_story_segments(this.__wbg_ptr,i,l);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,p(n,t)}finally{e.__wbindgen_free(r,o,1);}}toggle_mark(_,r,o,n,t,i){let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=a(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_toggle_mark(this.__wbg_ptr,l,s,w,f,o,g,u,t,m,y);if(h[1])throw b(h[0])}track_table_undo(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_track_table_undo(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}track_undo(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,n=e.editsession_track_undo(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}undo(){return e.editsession_undo(this.__wbg_ptr)!==0}undo_depth(){return e.editsession_undo_depth(this.__wbg_ptr)>>>0}yrs_blocks_for_story(_,r){let o,n;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_yrs_blocks_for_story(this.__wbg_ptr,l,s,w,f);var t=g[0],i=g[1];if(g[3])throw t=0,i=0,b(g[2]);return o=t,n=i,p(t,i)}finally{e.__wbindgen_free(o,n,1);}}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);function B(){return {__proto__:null,"./docx_edit_bg.js":{__proto__:null,__wbg___wbindgen_throw_344f42d3211c4765:function(_,r){throw new Error(p(_,r))},__wbg_call_e3b662382210db98:function(){return z(function(_,r,o,n){return _.call(r,o,n)},arguments)},__wbg_getRandomValues_3f44b700395062e5:function(){return z(function(_,r){globalThis.crypto.getRandomValues(S(_,r));},arguments)},__wbg_new_from_slice_77cdfb7977362f3c:function(_,r){return new Uint8Array(S(_,r))},__wbg_now_7521c72b0797ac47:function(){return performance.now()},__wbindgen_cast_0000000000000001:function(_){return _},__wbindgen_cast_0000000000000002:function(_,r){return p(_,r)},__wbindgen_init_externref_table:function(){let _=e.__wbindgen_externrefs,r=_.grow(4);_.set(0,void 0),_.set(r+0,void 0),_.set(r+1,null),_.set(r+2,true),_.set(r+3,false);}}}}var q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(d=>e.__wbg_editsession_free(d,1));function Q(d){let _=e.__externref_table_alloc();return e.__wbindgen_externrefs.set(_,d),_}function Z(d,_){d=d>>>0;let r=$(),o=[];for(let n=d;n<d+4*_;n+=4)o.push(e.__wbindgen_externrefs.get(r.getUint32(n,true)));return e.__externref_drop_slice(d,_),o}function S(d,_){return d=d>>>0,M().subarray(d/1,d/1+_)}var R=null;function $(){return (R===null||R.buffer.detached===true||R.buffer.detached===void 0&&R.buffer!==e.memory.buffer)&&(R=new DataView(e.memory.buffer)),R}function p(d,_){return _e(d>>>0,_)}var O=null;function M(){return (O===null||O.byteLength===0)&&(O=new Uint8Array(e.memory.buffer)),O}function z(d,_){try{return d.apply(this,_)}catch(r){let o=Q(r);e.__wbindgen_exn_store(o);}}function j(d){return d==null}function F(d,_){let r=_(d.length*1,1)>>>0;return M().set(d,r/1),c=d.length,r}function a(d,_,r){if(r===void 0){let l=U.encode(d),s=_(l.length,1)>>>0;return M().subarray(s,s+l.length).set(l),c=l.length,s}let o=d.length,n=_(o,1)>>>0,t=M(),i=0;for(;i<o;i++){let l=d.charCodeAt(i);if(l>127)break;t[n+i]=l;}if(i!==o){i!==0&&(d=d.slice(i)),n=r(n,o,o=i+d.length*3,1)>>>0;let l=M().subarray(n+i,n+o),s=U.encodeInto(d,l);i+=s.written,n=r(n,o,i,1)>>>0;}return c=i,n}function b(d){let _=e.__wbindgen_externrefs.get(d);return e.__externref_table_dealloc(d),_}var L=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});L.decode();var ee=2146435072,N=0;function _e(d,_){return N+=_,N>=ee&&(L=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),L.decode(),N=_),L.decode(M().subarray(d,d+_))}var U=new TextEncoder;"encodeInto"in U||(U.encodeInto=function(d,_){let r=U.encode(d);return _.set(r),{read:d.length,written:r.length}});var c=0,e;function C(d,_){return e=d.exports,R=null,O=null,e.__wbindgen_start(),e}async function re(d,_){if(typeof Response=="function"&&d instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(d,_)}catch(n){if(d.ok&&r(d.type)&&d.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let o=await d.arrayBuffer();return await WebAssembly.instantiate(o,_)}else {let o=await WebAssembly.instantiate(d,_);return o instanceof WebAssembly.Instance?{instance:o,module:d}:o}function r(o){switch(o){case "basic":case "cors":case "default":return true}return false}}function P(d){if(e!==void 0)return e;d!==void 0&&(Object.getPrototypeOf(d)===Object.prototype?{module:d}=d:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let _=B();d instanceof WebAssembly.Module||(d=new WebAssembly.Module(d));let r=new WebAssembly.Instance(d,_);return C(r)}async function X(d){if(e!==void 0)return e;if(d!==void 0&&(Object.getPrototypeOf(d)===Object.prototype?{module_or_path:d}=d:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),d===void 0)throw new Error("docx-edit wasm requires an explicit module or URL");let _=B();(typeof d=="string"||typeof Request=="function"&&d instanceof Request||typeof URL=="function"&&d instanceof URL)&&(d=fetch(d));let{instance:r,module:o}=await re(await d,_);return C(r)}var G=a$1({label:"docx-edit",preloadName:"preloadEditWasm",assetUrl:()=>new URL("./generated/edit/docx_edit_bg.wasm",import.meta.url),initAsync:X,initSync:P});function ce(d){return G.preload(d)}function ae(d){return G.ensure(),new I(d)}export{ce as a,ae as b};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { C as CollaborationReplica, b as CollaborationTransport, c as CollaborationProviderOptions, d as CollaborationStatus, e as CollaborationStatusListener, f as CollaborationErrorListener, g as YrsSelection, Y as YrsSession } from '../index-
|
|
2
|
-
export { h as CollaborationError, i as CollaborationErrorCode, j as CollaborationStatusChange, k as CollaborationTransportEvent, l as CollaborationUpdateOrigin } from '../index-
|
|
3
|
-
import '../
|
|
4
|
-
import '../content-
|
|
1
|
+
import { C as CollaborationReplica, b as CollaborationTransport, c as CollaborationProviderOptions, d as CollaborationStatus, e as CollaborationStatusListener, f as CollaborationErrorListener, g as YrsSelection, Y as YrsSession } from '../index-Dx4Z3lkz.mjs';
|
|
2
|
+
export { h as CollaborationError, i as CollaborationErrorCode, j as CollaborationStatusChange, k as CollaborationTransportEvent, l as CollaborationUpdateOrigin } from '../index-Dx4Z3lkz.mjs';
|
|
3
|
+
import '../frameDelta-D965X8yK.mjs';
|
|
4
|
+
import '../content-MOZ6hKP4.mjs';
|
|
5
5
|
import '../formatting-D1EPSaJP.mjs';
|
|
6
6
|
import '../docx/wrapTypes.mjs';
|
|
7
|
+
import '../types/document.mjs';
|
|
7
8
|
import '../styles-Dn_o3Vo5.mjs';
|
|
8
9
|
|
|
9
10
|
declare class CollaborationProvider {
|
package/dist/core.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { a as attemptSelectiveSave, c as createDocx, p as parseDocx, r as repackDocx, u as updateMultipleFiles } from './selectiveSave-CVoajSKE.mjs';
|
|
2
2
|
import { Document } from './types/document.mjs';
|
|
3
3
|
export { DocxPackage } from './types/document.mjs';
|
|
4
|
-
import { h as DocumentBody, S as SectionProperties, b5 as Table } from './content-
|
|
5
|
-
export { B as BlockContent, n as BookmarkEnd, o as BookmarkStart, g as Comment, I as CommentRangeEnd, J as CommentRangeStart, Q as Deletion, k as Endnote, X as Field, a0 as FooterReference, j as Footnote, H as HeaderFooter, a3 as HeaderReference, a4 as Hyperlink, a6 as Image, ai as Insertion, am as ListLevel, ap as MoveFrom, as as MoveTo, i as NumberingDefinitions, f as Paragraph, aE as ParagraphContent, aI as Run, aJ as RunContent, aT as Shape, b6 as TableCell, b9 as TableRow, bc as TextBox, bd as TextContent, bf as TrackedChangeInfo, bg as TrackedRunChange } from './content-
|
|
4
|
+
import { h as DocumentBody, S as SectionProperties, b5 as Table } from './content-MOZ6hKP4.mjs';
|
|
5
|
+
export { B as BlockContent, n as BookmarkEnd, o as BookmarkStart, g as Comment, I as CommentRangeEnd, J as CommentRangeStart, Q as Deletion, k as Endnote, X as Field, a0 as FooterReference, j as Footnote, H as HeaderFooter, a3 as HeaderReference, a4 as Hyperlink, a6 as Image, ai as Insertion, am as ListLevel, ap as MoveFrom, as as MoveTo, i as NumberingDefinitions, f as Paragraph, aE as ParagraphContent, aI as Run, aJ as RunContent, aT as Shape, b6 as TableCell, b9 as TableRow, bc as TextBox, bd as TextContent, bf as TrackedChangeInfo, bg as TrackedRunChange } from './content-MOZ6hKP4.mjs';
|
|
6
6
|
export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pixelsToTwips, pointsToPixels, twipsToEmu, twipsToPixels } from './utils/units.mjs';
|
|
7
7
|
export { c as canRenderFont, a as colorsEqual, b as createRgbColor, d as createThemeColor, e as ensureHexPrefix, g as getLoadedFonts, i as isBlack, f as isFontLoaded, h as isFontsLoading, j as isGoogleFontsEnabled, k as isWhite, l as loadFont, m as loadFontFromBuffer, n as loadFonts, o as onFontsLoaded, p as parseColorString, q as preloadCommonFonts, r as resolveHighlightColor, s as resolveHighlightToCss, t as resolveShadingColor, u as setGoogleFontsEnabled } from './fontLoader-aSewHMKF.mjs';
|
|
8
8
|
export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.mjs';
|
|
9
9
|
export { EditorPluginCore, PanelConfig, PluginPanelProps, PositionCoordinates, RenderedDomContext } from './plugin-api/index.mjs';
|
|
10
|
-
export { B as BlockExtent, F as FootnoteContent, a as Layout, L as LayoutBlock, P as Page, R as ResolvedLine, c as ResolvedSegment } from './types-
|
|
10
|
+
export { B as BlockExtent, F as FootnoteContent, a as Layout, L as LayoutBlock, P as Page, R as ResolvedLine, c as ResolvedSegment } from './types-BfqUl2h_.mjs';
|
|
11
11
|
export { P as ParagraphFormatting, a as TextFormatting, e as Theme, u as ThemeColorScheme, v as ThemeFont, w as ThemeFontScheme, x as ThemeMatrixCell, y as blendColors, z as darkenColor, A as generateThemeTintShadeMatrix, D as getContrastingColor, G as getThemeTintShadeHex, H as lightenColor, I as resolveColor } from './formatting-D1EPSaJP.mjs';
|
|
12
12
|
export { d as Relationship, a as Style, S as StyleDefinitions } from './styles-Dn_o3Vo5.mjs';
|
|
13
13
|
import './docx/wrapTypes.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { I as ImagePrimitive,
|
|
1
|
+
import { I as ImagePrimitive, D as DisplayList } from './frameDelta-D965X8yK.mjs';
|
|
2
|
+
import { R as RustDisplayListQueryEngine } from './rustDisplayList-BRuZBqdL.mjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Locate an image primitive in a built DisplayList by its document position.
|
|
@@ -59,10 +60,14 @@ declare function captureInlinePositionEmuFromDisplayList(queries: DisplayListQue
|
|
|
59
60
|
* facade parses the display list into the Rust store exactly ONCE
|
|
60
61
|
* (`openDisplayList` → handle) and routes every hit-test / range-rect query
|
|
61
62
|
* through the by-handle exports — no per-query re-serialization or re-parse.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* The handle is acquired LAZILY: at the first query that needs it, or when the
|
|
64
|
+
* host calls `prime()` from idle time. Keystroke-driven facade replacement
|
|
65
|
+
* therefore costs no serialization on the input path; superseded generations
|
|
66
|
+
* chain their adoption donor so a deferred pickup still ships one page-delta
|
|
67
|
+
* instead of a full re-open. When the session exports are absent (before the
|
|
68
|
+
* integrator re-embeds the wasm) it falls back to the JSON-arg exports,
|
|
69
|
+
* stringifying the list once and reusing the string for every query. Either
|
|
70
|
+
* way the query RESULTS are byte-identical — the handle path is pure perf.
|
|
66
71
|
*
|
|
67
72
|
* Handle lifecycle: the handle is opened once per facade (per display-list
|
|
68
73
|
* build) and released by `dispose()`. Callers that drop the facade without
|
|
@@ -204,6 +209,13 @@ interface DisplayListQueries {
|
|
|
204
209
|
anchorRect(pos: number): DisplayListRect | null;
|
|
205
210
|
/** Explicit body-sidebar alias retained alongside `anchorRect`. */
|
|
206
211
|
sidebarAnchorRect(pos: number): DisplayListRect | null;
|
|
212
|
+
/**
|
|
213
|
+
* Acquire the Rust session handle now (adopting the donor facade's parsed
|
|
214
|
+
* list when possible). Optional: the first query acquires it on demand;
|
|
215
|
+
* hosts call this from idle time to keep serialization off interaction
|
|
216
|
+
* paths. No-op once attempted, superseded, or disposed.
|
|
217
|
+
*/
|
|
218
|
+
prime(): void;
|
|
207
219
|
/**
|
|
208
220
|
* Release the wasm session handle backing this facade. Idempotent; safe to
|
|
209
221
|
* call even when no handle was opened (JSON-arg fallback path). Callers that
|
|
@@ -216,7 +228,13 @@ interface DisplayListQueries {
|
|
|
216
228
|
* Build a query facade for one display list. The optional `engine` makes the
|
|
217
229
|
* facade synchronous and deterministic in tests; without it the shared wasm
|
|
218
230
|
* module is loaded lazily and queries no-op (`null`/`[]`) until it resolves.
|
|
231
|
+
*
|
|
232
|
+
* `previous` (the facade this build replaces) enables handle adoption: instead
|
|
233
|
+
* of re-serializing and re-parsing the WHOLE list into the Rust store, the new
|
|
234
|
+
* facade takes over the previous parsed list and patches only the pages that
|
|
235
|
+
* changed. The donor facade's remaining queries degrade to its own JSON-arg
|
|
236
|
+
* path (same stale-list semantics it always had after replacement).
|
|
219
237
|
*/
|
|
220
|
-
declare function createDisplayListQueries(list: DisplayList, engine?: RustDisplayListQueryEngine | ResidentDisplayListQueryEngine): DisplayListQueries;
|
|
238
|
+
declare function createDisplayListQueries(list: DisplayList, engine?: RustDisplayListQueryEngine | ResidentDisplayListQueryEngine, previous?: DisplayListQueries | null): DisplayListQueries;
|
|
221
239
|
|
|
222
240
|
export { type DisplayListRect as D, type LocatedImagePrimitive as L, type ResidentDisplayListQueryEngine as R, type DisplayListQueries as a, type DisplayListRegionHit as b, type DisplayListHitRegion as c, type DisplayListImageGeometry as d, type DisplayListImageRegion as e, type DisplayListParagraphGeometry as f, type DisplayListQuerySourceState as g, type DisplayListVisualLine as h, captureInlinePositionEmuFromDisplayList as i, createDisplayListQueries as j, findImagePrimitiveAtPoint as k, findImagePrimitiveByDocPos as l };
|
package/dist/docx/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { a as attemptSelectiveSave, c as createDocx, p as parseDocx, r as repackDocx, u as updateMultipleFiles } from '../selectiveSave-CVoajSKE.mjs';
|
|
2
2
|
import { WrapType } from './wrapTypes.mjs';
|
|
3
|
-
import { B as BlockContent, g as Comment, W as Watermark } from '../content-
|
|
3
|
+
import { B as BlockContent, g as Comment, W as Watermark } from '../content-MOZ6hKP4.mjs';
|
|
4
4
|
import { Document } from '../types/document.mjs';
|
|
5
5
|
import '../docxInput-DTbCa48g.mjs';
|
|
6
6
|
import '../formatting-D1EPSaJP.mjs';
|
package/dist/editor/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { R as ResidentMeasurementConfig } from '../rustMeasureSource-D1KsQvVC.mjs';
|
|
2
|
-
import { L as LayoutBlock, B as BlockExtent, a as Layout, b as LayoutOptions } from '../types-
|
|
2
|
+
import { L as LayoutBlock, B as BlockExtent, a as Layout, b as LayoutOptions } from '../types-BfqUl2h_.mjs';
|
|
3
3
|
import { MeasuredBlock } from '../layout/pagination/index.mjs';
|
|
4
|
-
import { D as DisplayListHeadersFooters } from '../rustDisplayList-
|
|
4
|
+
import { D as DisplayListHeadersFooters } from '../rustDisplayList-BRuZBqdL.mjs';
|
|
5
5
|
import { Document } from '../types/document.mjs';
|
|
6
|
-
import { Y as YrsSession, a as YrsRenderEnv } from '../index-
|
|
7
|
-
import { S as SectionProperties, N as NoteKind } from '../content-
|
|
6
|
+
import { Y as YrsSession, a as YrsRenderEnv } from '../index-Dx4Z3lkz.mjs';
|
|
7
|
+
import { S as SectionProperties, N as NoteKind } from '../content-MOZ6hKP4.mjs';
|
|
8
8
|
import '../formatting-D1EPSaJP.mjs';
|
|
9
|
+
import '../frameDelta-D965X8yK.mjs';
|
|
9
10
|
import '../styles-Dn_o3Vo5.mjs';
|
|
10
11
|
import '../docx/wrapTypes.mjs';
|
|
11
12
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MeasuredBlock } from './layout/pagination/index.mjs';
|
|
3
|
-
import { D as DrawingScene, d as ShapeTextBodyProperties } from './content-DLFHRQav.mjs';
|
|
1
|
+
import { D as DrawingScene, d as ShapeTextBodyProperties } from './content-MOZ6hKP4.mjs';
|
|
4
2
|
import { T as TextModernEffects } from './formatting-D1EPSaJP.mjs';
|
|
5
3
|
|
|
6
4
|
interface DisplayList {
|
|
@@ -764,273 +762,4 @@ declare function applyFrameDelta(previous: RetainedFrame | null, delta: DecodedF
|
|
|
764
762
|
*/
|
|
765
763
|
declare function applyFrameDeltaOwned(previous: RetainedFrame | null, delta: DecodedFrameDelta): RetainedFrame;
|
|
766
764
|
|
|
767
|
-
|
|
768
|
-
* JS seam to the Rust display-list builder (crates/docx-layout).
|
|
769
|
-
*
|
|
770
|
-
* Marshals the same `{ measured, options, layout }` triple the golden
|
|
771
|
-
* fixtures pin (see scripts/export-displaylist-fixtures.ts) across the wasm
|
|
772
|
-
* boundary and parses the resulting DisplayList. All paint/geometry decisions
|
|
773
|
-
* happen in Rust — this module is serialization glue only.
|
|
774
|
-
*
|
|
775
|
-
* The wasm module is loaded lazily via dynamic import on first build, so the
|
|
776
|
-
* ~800KB inlined binary costs nothing until the experimental canvas renderer
|
|
777
|
-
* is actually enabled.
|
|
778
|
-
*
|
|
779
|
-
* @experimental part of the rust-canvas-engine change; shape may evolve.
|
|
780
|
-
*/
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* One header/footer part in the `headersFooters` envelope field: the measured
|
|
784
|
-
* blocks of the HF ProseMirror doc identified by `rId`, plus the band metrics
|
|
785
|
-
* `convertHeaderFooterPmDocToContent` computed (passed through verbatim — the
|
|
786
|
-
* Rust builder re-derives nothing).
|
|
787
|
-
*/
|
|
788
|
-
interface DisplayListHfVariant {
|
|
789
|
-
rId: string;
|
|
790
|
-
kind: 'header' | 'footer';
|
|
791
|
-
type: 'default' | 'first' | 'even';
|
|
792
|
-
/** `toMeasuredBlocks(content.blocks, content.measures)` — same schema as body `measured` */
|
|
793
|
-
measured: MeasuredBlock[];
|
|
794
|
-
/** HeaderFooterContent.height (in-flow stack incl. floating blocks) */
|
|
795
|
-
height: number;
|
|
796
|
-
/** HeaderFooterContent.flowHeight (in-flow band height; fallback: height) */
|
|
797
|
-
flowHeight?: number;
|
|
798
|
-
visualTop?: number;
|
|
799
|
-
visualBottom?: number;
|
|
800
|
-
/**
|
|
801
|
-
* Per-page resolved widths of PAGE/NUMPAGES field runs in this HF part, so a
|
|
802
|
-
* centered/right-aligned line carrying such a field re-centers per page. The
|
|
803
|
-
* line width is measured ONCE at the field's fallback text ("1"), so without
|
|
804
|
-
* this the builder holds the same centered position on every page even though
|
|
805
|
-
* "Page 2 of 3"/"Page 10 of 12" have different widths. Omitted ⇒ the fields
|
|
806
|
-
* ride the char-distributed fallback width (byte-identical to before).
|
|
807
|
-
*/
|
|
808
|
-
fieldWidths?: DisplayListFieldWidths[];
|
|
809
|
-
}
|
|
810
|
-
/**
|
|
811
|
-
* Per-page widths of one PAGE/NUMPAGES field run in an HF part. `pmStart` is the
|
|
812
|
-
* field run's position in the HF ProseMirror doc (the key the Rust builder
|
|
813
|
-
* matches). `fallbackWidth` is the width the measure baked into `line.width`
|
|
814
|
-
* (the field's fallback text); `perPage[i]` is the width of the field's resolved
|
|
815
|
-
* text on layout page index `i` (PAGE → that page's number, NUMPAGES → total).
|
|
816
|
-
*/
|
|
817
|
-
interface DisplayListFieldWidths {
|
|
818
|
-
pmStart: number;
|
|
819
|
-
fallbackWidth: number;
|
|
820
|
-
perPage: number[];
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Optional header/footer payload of the builder envelope. Absent ⇒ the Rust
|
|
824
|
-
* output is byte-identical to the body-only build. Flags come off the section
|
|
825
|
-
* properties / settings the DOM painter uses; distances are the same px the
|
|
826
|
-
* painter resolves (`headerDistance ?? page.margins.header ?? 48`).
|
|
827
|
-
*/
|
|
828
|
-
interface DisplayListHeadersFooters {
|
|
829
|
-
titlePg?: boolean;
|
|
830
|
-
evenAndOddHeaders?: boolean;
|
|
831
|
-
headerDistance?: number;
|
|
832
|
-
footerDistance?: number;
|
|
833
|
-
/** Page-level Word watermark, painted behind body/header/footer content. */
|
|
834
|
-
watermark?: DisplayListWatermark;
|
|
835
|
-
variants: DisplayListHfVariant[];
|
|
836
|
-
/** Stable section identity. Undefined = document-global legacy envelope. */
|
|
837
|
-
sectionId?: string;
|
|
838
|
-
/** Zero-based section index. */
|
|
839
|
-
sectionIndex?: number;
|
|
840
|
-
}
|
|
841
|
-
type DisplayListWatermark = DisplayListTextWatermark | DisplayListPictureWatermark;
|
|
842
|
-
interface DisplayListTextWatermark {
|
|
843
|
-
kind: 'text';
|
|
844
|
-
text: string;
|
|
845
|
-
font: string;
|
|
846
|
-
color: string;
|
|
847
|
-
semitransparent: boolean;
|
|
848
|
-
layout: 'diagonal' | 'horizontal';
|
|
849
|
-
fontSize?: number;
|
|
850
|
-
/** Undefined defaults to true for watermarks. */
|
|
851
|
-
decorative?: boolean;
|
|
852
|
-
}
|
|
853
|
-
interface DisplayListPictureWatermark {
|
|
854
|
-
kind: 'picture';
|
|
855
|
-
relId?: string;
|
|
856
|
-
dataUrl?: string;
|
|
857
|
-
scale: number;
|
|
858
|
-
washout: boolean;
|
|
859
|
-
widthEmu?: number;
|
|
860
|
-
heightEmu?: number;
|
|
861
|
-
/** Undefined defaults to true for watermarks. */
|
|
862
|
-
decorative?: boolean;
|
|
863
|
-
}
|
|
864
|
-
/** One measured note in a page/section note area. */
|
|
865
|
-
interface DisplayListNoteItem {
|
|
866
|
-
kind?: 'footnote' | 'endnote';
|
|
867
|
-
id?: number;
|
|
868
|
-
displayLabel?: string;
|
|
869
|
-
measured?: MeasuredBlock[];
|
|
870
|
-
height?: number;
|
|
871
|
-
anchorDocStart?: number;
|
|
872
|
-
anchorDocEnd?: number;
|
|
873
|
-
customMarkFollows?: boolean;
|
|
874
|
-
}
|
|
875
|
-
/** Typed non-fragmented note-region input for the Rust display builder. */
|
|
876
|
-
interface DisplayListNoteArea {
|
|
877
|
-
pageIndex?: number;
|
|
878
|
-
sectionId?: string;
|
|
879
|
-
kind?: 'footnote' | 'endnote';
|
|
880
|
-
placement?: 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
|
|
881
|
-
y?: number;
|
|
882
|
-
height?: number;
|
|
883
|
-
columns?: number;
|
|
884
|
-
separator?: DisplayListNoteItem;
|
|
885
|
-
notes?: DisplayListNoteItem[];
|
|
886
|
-
}
|
|
887
|
-
/** Stable reviewer palette entry for comments/revisions. */
|
|
888
|
-
interface DisplayListCommentAuthor {
|
|
889
|
-
id?: string;
|
|
890
|
-
name?: string;
|
|
891
|
-
paletteIndex?: number;
|
|
892
|
-
color?: string;
|
|
893
|
-
}
|
|
894
|
-
/** One reply of a comment thread (a11y announcement input). */
|
|
895
|
-
interface DisplayListCommentReply {
|
|
896
|
-
id?: number;
|
|
897
|
-
authorId?: string;
|
|
898
|
-
authorName?: string;
|
|
899
|
-
date?: string;
|
|
900
|
-
/** Plain-text body (the builder caps it before it reaches primitives). */
|
|
901
|
-
text?: string;
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* Per-comment thread metadata keyed by comment id, joined by the builder onto
|
|
905
|
-
* every primitive carrying that id in `commentIds` so the a11y mirror can
|
|
906
|
-
* announce the complete thread (author name, date, body, replies). All string
|
|
907
|
-
* values are file-derived/attacker-controlled; consumers must only ever
|
|
908
|
-
* assign them via textContent/setAttribute.
|
|
909
|
-
*/
|
|
910
|
-
interface DisplayListCommentThread {
|
|
911
|
-
/** Comment id — matches the numeric ids in `resolvedCommentIds`/`commentIds`. */
|
|
912
|
-
id?: number;
|
|
913
|
-
authorId?: string;
|
|
914
|
-
authorName?: string;
|
|
915
|
-
date?: string;
|
|
916
|
-
/** Plain-text body (builder-capped before emission). */
|
|
917
|
-
text?: string;
|
|
918
|
-
/** Replies in thread order (builder-capped count and text). */
|
|
919
|
-
replies?: DisplayListCommentReply[];
|
|
920
|
-
}
|
|
921
|
-
/** The `{ measured, options, layout }` envelope the Rust builder consumes. */
|
|
922
|
-
interface DisplayListBuildInputs {
|
|
923
|
-
/** Serialization contract version. Undefined reads as legacy version 0. */
|
|
924
|
-
contractVersion?: number;
|
|
925
|
-
measured: MeasuredBlock[];
|
|
926
|
-
options: unknown;
|
|
927
|
-
layout: Layout;
|
|
928
|
-
/** header/footer parts + section flags; omitted ⇒ body-only display list */
|
|
929
|
-
headersFooters?: DisplayListHeadersFooters;
|
|
930
|
-
/**
|
|
931
|
-
* Doc-wide font-id chains keyed `"<family lowercase>|<bold 0|1>|<italic 0|1>"`
|
|
932
|
-
* → measurement `FontStore` ids — the SAME map the measurement input carries.
|
|
933
|
-
* Present only under Rust measurement (the ids must belong to a populated
|
|
934
|
-
* store); its presence against that store is what gates GlyphRun emission.
|
|
935
|
-
* Omitted ⇒ every text run takes the browser-measured `TextRunPrimitive` path
|
|
936
|
-
* (byte-identical to the pre-glyph build).
|
|
937
|
-
*/
|
|
938
|
-
fontChains?: Record<string, number[]>;
|
|
939
|
-
/** Page/section note regions. Undefined = no note emission. */
|
|
940
|
-
noteAreas?: DisplayListNoteArea[];
|
|
941
|
-
/** Resolved comments suppressed from active tint. Undefined = none known. */
|
|
942
|
-
resolvedCommentIds?: number[];
|
|
943
|
-
/** Stable reviewer palette. Undefined = legacy hard-coded colors. */
|
|
944
|
-
commentAuthors?: DisplayListCommentAuthor[];
|
|
945
|
-
/** Per-comment thread metadata for a11y announcements. Undefined = none. */
|
|
946
|
-
commentThreads?: DisplayListCommentThread[];
|
|
947
|
-
}
|
|
948
|
-
/** Minimal engine surface, injectable so tests can fake the wasm module. */
|
|
949
|
-
interface RustDisplayListEngine {
|
|
950
|
-
buildDisplayListJson(input: string): string;
|
|
951
|
-
/** Resident editing engines expose binary deltas; the stateless layout wasm does not. */
|
|
952
|
-
buildDisplayListFrame?(input: string, expectedFrameEpoch: number): Uint8Array;
|
|
953
|
-
/** One-owner ordinary input path; available on the resident editing engine. */
|
|
954
|
-
applyInput?(text: string, expectedFrameEpoch: number): Uint8Array;
|
|
955
|
-
displayHitTestRegionsJson?(pageIndex: number, x: number, y: number): string;
|
|
956
|
-
displayRangeRectsJson?(from: number, to: number): string;
|
|
957
|
-
displayRangeRectsRegionJson?(region: 'body' | 'header' | 'footer', rId: string, from: number, to: number): string;
|
|
958
|
-
}
|
|
959
|
-
type RustDisplayListSourceErrorStage = 'load' | 'build' | 'parse' | 'decode' | 'apply';
|
|
960
|
-
interface RustDisplayFrameResult {
|
|
961
|
-
displayList: DisplayList;
|
|
962
|
-
/** Null only on the compatibility JSON engine path. */
|
|
963
|
-
frame: RetainedFrame | null;
|
|
964
|
-
transport: 'frame-delta-v1' | 'json';
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Typed terminal error from the mandatory Rust display-list source. Hosts may
|
|
968
|
-
* surface this through their editor error boundary; it is never permission to
|
|
969
|
-
* silently substitute painter geometry.
|
|
970
|
-
*/
|
|
971
|
-
declare class RustDisplayListSourceError extends Error {
|
|
972
|
-
readonly stage: RustDisplayListSourceErrorStage;
|
|
973
|
-
constructor(stage: RustDisplayListSourceErrorStage, cause: unknown);
|
|
974
|
-
}
|
|
975
|
-
/**
|
|
976
|
-
* Query surface over an already-built display list, injectable so tests can
|
|
977
|
-
* fake the wasm module.
|
|
978
|
-
*
|
|
979
|
-
* The `*Json` calls take the display-list JSON string as an argument (the Rust
|
|
980
|
-
* side re-parses it per query — callers should cache the string). The
|
|
981
|
-
* session-handle members parse the list ONCE (`openDisplayList` → handle) and
|
|
982
|
-
* answer many queries by handle with no re-serialization, reusing the same
|
|
983
|
-
* hit/range logic so results are byte-identical. The handle members are
|
|
984
|
-
* OPTIONAL: the embedded wasm carries them only after the integrator re-embeds,
|
|
985
|
-
* so `createDisplayListQueries` feature-detects `hasDisplayListSession` and
|
|
986
|
-
* falls back to the `*Json` path when they are absent.
|
|
987
|
-
*/
|
|
988
|
-
interface RustDisplayListQueryEngine {
|
|
989
|
-
/** region-aware hit test → `{"region","rId"?,"pos"}` or `"null"` JSON */
|
|
990
|
-
hitTestRegionsJson(displayList: string, pageIndex: number, x: number, y: number): string;
|
|
991
|
-
/** body PM range → JSON array of `{pageIndex,x,y,width,height}` rects */
|
|
992
|
-
rangeRectsJson(displayList: string, from: number, to: number): string;
|
|
993
|
-
/**
|
|
994
|
-
* Region-aware PM range → JSON array of rects. `region` is
|
|
995
|
-
* `'body' | 'header' | 'footer'`; `rId` scopes header/footer to one HF part
|
|
996
|
-
* (empty for body / match-any). OPTIONAL: the embedded wasm carries it only
|
|
997
|
-
* after the integrator re-embeds, so `createDisplayListQueries` falls back to
|
|
998
|
-
* `[]` when absent (HF selection geometry stays a documented gap until then).
|
|
999
|
-
*/
|
|
1000
|
-
rangeRectsRegionJson?(displayList: string, region: string, rId: string, from: number, to: number): string;
|
|
1001
|
-
/** true when the embedded wasm carries the region-aware range-rect exports */
|
|
1002
|
-
hasRangeRectsRegion?(): boolean;
|
|
1003
|
-
/** true when the embedded wasm carries the session-handle exports below */
|
|
1004
|
-
hasDisplayListSession?(): boolean;
|
|
1005
|
-
/** parse a display list once, return a handle for the by-handle queries */
|
|
1006
|
-
openDisplayList?(displayList: string): number;
|
|
1007
|
-
/** free a handle's parsed display list */
|
|
1008
|
-
closeDisplayList?(handle: number): void;
|
|
1009
|
-
/** region-aware hit test against a stored display list (by handle) */
|
|
1010
|
-
hitTestRegionsByHandle?(handle: number, pageIndex: number, x: number, y: number): string;
|
|
1011
|
-
/** body PM range against a stored display list (by handle) */
|
|
1012
|
-
rangeRectsByHandle?(handle: number, from: number, to: number): string;
|
|
1013
|
-
/** region-aware PM range against a stored display list (by handle) */
|
|
1014
|
-
rangeRectsRegionByHandle?(handle: number, region: string, rId: string, from: number, to: number): string;
|
|
1015
|
-
}
|
|
1016
|
-
/**
|
|
1017
|
-
* Lazily load the wasm query surface (hit-test + range-rects). Shares the
|
|
1018
|
-
* module promise with `buildRustDisplayList`, so on the canvas-renderer path
|
|
1019
|
-
* the engine is already resolved by the time the first display list lands.
|
|
1020
|
-
*/
|
|
1021
|
-
declare function loadRustDisplayListQueryEngine(): Promise<RustDisplayListQueryEngine>;
|
|
1022
|
-
/** Display-only fields sent to an engine that already retains pagination. */
|
|
1023
|
-
declare function encodeDisplayListFrameExtras(inputs: DisplayListBuildInputs): string;
|
|
1024
|
-
/**
|
|
1025
|
-
* Build a DisplayList for a computed layout through the Rust engine. Throws
|
|
1026
|
-
* when the wasm module fails to load or the builder rejects the input — the
|
|
1027
|
-
* caller is expected to fall back to the DOM painter.
|
|
1028
|
-
*/
|
|
1029
|
-
declare function buildRustDisplayList(inputs: DisplayListBuildInputs, engine?: RustDisplayListEngine): Promise<DisplayList>;
|
|
1030
|
-
/**
|
|
1031
|
-
* Production display build. Resident editing engines return FrameDelta v1;
|
|
1032
|
-
* older/stateless engines retain the full-JSON parity path.
|
|
1033
|
-
*/
|
|
1034
|
-
declare function buildRustDisplayFrame(inputs: DisplayListBuildInputs, engine?: RustDisplayListEngine, previous?: RetainedFrame | null): Promise<RustDisplayFrameResult>;
|
|
1035
|
-
|
|
1036
|
-
export { applyFrameDeltaOwned as A, buildRustDisplayFrame as B, buildRustDisplayList as C, type DisplayListHeadersFooters as D, decodeFrameDelta as E, FRAME_DELTA_HEADER_BYTES as F, type GlyphRunPrimitive as G, type HfRegion as H, type ImagePrimitive as I, encodeDisplayListFrameExtras as J, loadRustDisplayListQueryEngine as K, type LinePrimitive as L, type PositionedGlyph as P, type RustDisplayListQueryEngine as R, type TextRunPrimitive as T, type DisplayList as a, type DisplayPage as b, type DisplayPrimitive as c, type DecodedFrameDelta as d, type DecorationPrimitive as e, type DisplayBounds as f, type DisplayListBuildInputs as g, type DisplayListHfVariant as h, type DisplayListPictureWatermark as i, type DisplayListTextWatermark as j, type DisplayListWatermark as k, type DocAttrs as l, FRAME_DELTA_PAGE_OP_BYTES as m, FRAME_DELTA_VERSION as n, FrameDeltaError as o, type FrameDeltaErrorCode as p, type FramePageOperation as q, type RectPrimitive as r, type RetainedFrame as s, type RetainedFramePage as t, type RustDisplayFrameResult as u, type RustDisplayListEngine as v, RustDisplayListSourceError as w, type RustDisplayListSourceErrorStage as x, type TableCellRef as y, applyFrameDelta as z };
|
|
765
|
+
export { type DisplayList as D, FRAME_DELTA_HEADER_BYTES as F, type GlyphRunPrimitive as G, type HfRegion as H, type ImagePrimitive as I, type LinePrimitive as L, type PositionedGlyph as P, type RetainedFrame as R, type TextRunPrimitive as T, type DisplayPage as a, type DisplayPrimitive as b, type DecodedFrameDelta as c, type DecorationPrimitive as d, type DisplayBounds as e, type DocAttrs as f, FRAME_DELTA_PAGE_OP_BYTES as g, FRAME_DELTA_VERSION as h, FrameDeltaError as i, type FrameDeltaErrorCode as j, type FramePageOperation as k, type RectPrimitive as l, type RetainedFramePage as m, type TableCellRef as n, applyFrameDelta as o, applyFrameDeltaOwned as p, decodeFrameDelta as q };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|