@docx-editor.dev/core 2.22.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +13 -12
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +11 -10
- package/dist/binding.js +1 -1
- package/dist/chunk-4OAXZNBU.js +5 -0
- package/dist/chunk-6745I4XF.cjs +20 -0
- package/dist/chunk-6KA3L3FR.cjs +11 -0
- package/dist/chunk-6QS5WL63.js +1 -0
- package/dist/{chunk-X2LJDR53.cjs → chunk-BUDXZ7T2.cjs} +5 -5
- package/dist/chunk-DYRXA5UJ.cjs +2 -0
- package/dist/chunk-DZOGUV7O.js +1 -0
- package/dist/chunk-EHT4LKKZ.cjs +1 -0
- package/dist/chunk-F5LAOPAD.js +20 -0
- package/dist/chunk-FWX535CS.cjs +1 -0
- package/dist/chunk-GRVRQBKU.js +1 -0
- package/dist/chunk-JN62FLHE.cjs +4 -0
- package/dist/{chunk-5RKCJ5DF.js → chunk-KRBBWATQ.js} +1 -1
- package/dist/chunk-KV5HFE23.cjs +2 -0
- package/dist/{chunk-RLKX7BIP.cjs → chunk-PCPBDYEL.cjs} +1 -1
- package/dist/chunk-Q4RDWB3U.cjs +18 -0
- package/dist/{chunk-P5PWSRNW.cjs → chunk-QK23BSRK.cjs} +1 -1
- package/dist/chunk-QTFAXWVI.cjs +1 -0
- package/dist/chunk-RLO64PHP.cjs +1 -0
- package/dist/chunk-T7RGKBCE.cjs +5 -0
- package/dist/{chunk-IWAUA732.js → chunk-UMBHUW6R.js} +1 -1
- package/dist/chunk-VE6H5EJA.js +5 -0
- package/dist/chunk-WHG23WNI.js +1 -0
- package/dist/chunk-XBYZTDF7.js +4 -0
- package/dist/chunk-XRBPZCNK.js +11 -0
- package/dist/chunk-Y5JCIWTF.js +2 -0
- package/dist/chunk-ZA6HEWUM.js +2 -0
- package/dist/chunk-ZCRSPN4Q.js +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +6 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +7 -6
- package/dist/contracts/document.d.ts +4 -3
- package/dist/contracts/editor.d.ts +9 -9
- package/dist/contracts/interaction.d.ts +2 -1
- package/dist/contracts/modules.d.ts +9 -8
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-Ck6eOiJ3.d.ts → custom-node-writes-77rvPW2-.d.ts} +4 -3
- package/dist/{document-protection-CMPEonQc.d.ts → document-protection-CYIjO-li.d.ts} +3 -2
- package/dist/{editor-BKDVqXyk.d.ts → editor-DhUQsWWH.d.ts} +132 -26
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +57 -66
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +17 -16
- package/dist/export.js +2 -2
- package/dist/{failure-DNNmwsgD.d.ts → failure-BIPVQbRm.d.ts} +2 -1
- package/dist/{font-resolver-PBc8Vuxs.d.ts → font-resolver-BwoHFBlr.d.ts} +3 -2
- package/dist/{headless-document-view-9wjJT20Y.d.ts → headless-document-view-Cc3fFWhv.d.ts} +4 -3
- package/dist/{image-resources-B0v-XaTM.d.ts → image-resources-DkuzBnTM.d.ts} +3 -2
- package/dist/{index-DQA53aR1.d.ts → index-BYaCkGKO.d.ts} +61 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-Dyr0ZSOI.d.ts → layout-shaping-DpWQG26a.d.ts} +3 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +116 -50
- package/dist/layout.js +1 -1
- package/dist/{note-properties-D_lmG9xx.d.ts → note-properties-DMfKK3QU.d.ts} +3 -2
- package/dist/{omml-equation-CfTm3jOK.d.ts → omml-equation-BY7OdfGY.d.ts} +3 -2
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +9 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-CkVDxyQ3.d.ts → protocol-CPAakntQ.d.ts} +4 -3
- package/dist/{review-paragraph-order-BjUs-tDd.d.ts → review-paragraph-order-B0BP_wJP.d.ts} +1 -1
- package/dist/{revision-projection-DDVBYTIG.d.ts → revision-projection-CVJeA2jp.d.ts} +3 -2
- package/dist/{semantic-cell-selection-DW6qsmoC.d.ts → semantic-cell-selection-B8GF_H2e.d.ts} +10 -6
- package/dist/{semantic-interaction-BNiYSBcB.d.ts → semantic-interaction-DQjtIruQ.d.ts} +3 -2
- package/dist/{semantic-paint-DE236npp.d.ts → semantic-paint-DoPl85nR.d.ts} +4 -3
- package/dist/{semantic-records-C5OeXnaL.d.ts → semantic-records-DB0VgWsr.d.ts} +888 -778
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +17 -16
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-DBb97w3F.d.ts → tree-package-fragment-BIyGh6L8.d.ts} +4 -3
- package/dist/{tree-session-contract-BYat3RKx.d.ts → tree-session-contract-CHcCnz3W.d.ts} +7 -6
- package/dist/{types-barrel-ChGvWjkO.d.ts → types-barrel-DN_-gaRX.d.ts} +70 -5
- package/package.json +3 -3
- package/dist/chunk-65GJRSZ5.cjs +0 -18
- package/dist/chunk-6TBRG6SA.cjs +0 -20
- package/dist/chunk-A72MJGY7.cjs +0 -4
- package/dist/chunk-AZ7QSAXH.js +0 -4
- package/dist/chunk-BL57VQ7E.js +0 -1
- package/dist/chunk-CB6RQ3GD.cjs +0 -11
- package/dist/chunk-FGBADUSK.cjs +0 -1
- package/dist/chunk-GG4IAKFI.js +0 -5
- package/dist/chunk-HJYLFMLX.js +0 -2
- package/dist/chunk-HL6NO7IH.cjs +0 -2
- package/dist/chunk-HZQFGB2X.cjs +0 -5
- package/dist/chunk-OZXBAEWW.js +0 -2
- package/dist/chunk-PD5XKBJA.js +0 -1
- package/dist/chunk-REMFTPDL.cjs +0 -2
- package/dist/chunk-UGLO2GA5.cjs +0 -1
- package/dist/chunk-UOQONZVQ.js +0 -11
- package/dist/chunk-VD2MWTR6.js +0 -20
- package/dist/chunk-VIXH2OVP.js +0 -1
- package/dist/chunk-VP7SDFCM.js +0 -1
- package/dist/chunk-W2JIZ5JH.js +0 -18
- package/dist/chunk-W5H62AWM.cjs +0 -1
- package/dist/chunk-YQXY6TQ3.js +0 -5
- package/dist/chunk-YYFBYVW4.cjs +0 -1
package/dist/chunk-VIXH2OVP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {g,a,b,e,c,f}from'./chunk-AZ7QSAXH.js';import {Kb,La,Oa,Qa,Ra,Pa,qc,Ma,Na,Cc,Vb,ud,td,Yc,Lb,zc,Nb}from'./chunk-W2JIZ5JH.js';import {a as a$1}from'./chunk-IWAUA732.js';import {la,da,ma,Nd,a as a$2}from'./chunk-UOQONZVQ.js';var Te=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function D(e){let n=new Map;for(let t of e)if(Array.isArray(t)){for(let r of t.slice(0,2048)){if(typeof r!="string"||!Te.test(r))continue;let o=r.toLowerCase();if(n.has(o)||n.set(o,r),n.size===2048)break}if(n.size===2048)break}return Object.freeze([...n.values()])}function We(e){let n=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(n===void 0||Array.isArray(n)&&n.length===0)?void 0:e}var Je=64,Ee=Object.freeze({family:"Calibri",sizeHalfPoints:22});function Oe(e,...n){let t=[e,...n],r=[],o=new Set;for(let a of t)for(let d of a.sources??[]){let c=g(d.request);o.has(c)||(o.add(c),r.push(d));}let s=[],i=new Set;for(let a of t)for(let d of a.substitutions??[]){let c=g(d.from);o.has(c)||i.has(c)||(i.add(c),s.push(d));}let u=D(t.map(a=>a.supportedFamilies));return Object.freeze({...u.length?{supportedFamilies:u}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??a,sources:Object.freeze(r),...s.length>0?{substitutions:Object.freeze(s)}:{},defaultFont:e.defaultFont??Ee,...e.language!==void 0?{language:e.language}:{}})}var Ne=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function we(e){let n=e?.defaultFont?.family;return n!==void 0&&Ne.test(n)?n:Ee.family}var Ie="docx-editor.dev/font-resolver",Ce=Symbol.for("docx-editor.dev/font-resolver");function on(e){let n={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,Ce,n),Object.defineProperty(e,Ie,n);}catch(t){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:t})}return e}function rn(e){return typeof e=="function"&&e[Ce]===true}var X=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Me(e,n,t){let r=new Map(e.map(o=>[X(o),o]));for(let[o,s]of n)r.set(o,s);for(let o of t)r.has(X(o.to))&&r.set(X(o.from),o.from);return [...r.values()]}async function sn(e,n,t={}){return ve(e,n,t)}async function an(e,n,t={}){return ve(e,n,t)}async function ve(e,n,t){let r=e.map(_e),o,s=[],i=[],u=new Map,a$1=new Set,d=0,c=[],f=new Set,m=[],O=n.resolvedFaces??[],w=n.defaultFamily;for(let b$1=0;b$1<e.length;b$1+=1){ke(n.signal);let k=e[b$1],I=Me(O,u,c),P;try{let x=r[b$1],S;if(x){let l=await Re(x,n.signal);if(!l.ok)throw l.cause;S=l.value;}else if(typeof k=="function"){let l=await Re(Promise.resolve(k(Le(n,w,I,d))).then(p=>({ok:!0,value:p}),p=>({ok:!1,cause:p})),n.signal);if(!l.ok)throw l.cause;S=l.value;}else S=k;if(S==null)continue;if(typeof S=="function"){Z(t,k,b$1,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}let R="failures"in S?S.failures:void 0,M=[];if(Array.isArray(R)){let l=Math.min(R.length,b);for(let p=0;p<l;p++)M.push(R[p]);R.length>l&&M.push(new Error("Additional font-origin failures were omitted"));}else R!==void 0&&M.push(R);let C=Be(S,a$1,d,f,o?"maxFontBytes"in o&&o.maxFontBytes!==void 0?o.maxFontBytes:a:void 0,t.reserveOwnedBytes,t.instrumentation);P=C;for(let l of new Set([...C.dropped,...M]))Z(t,k,b$1,l);let E=C.fragment;E.supportedFamilies&&s.push(E.supportedFamilies),m.push(...M);let $=(E.sources??[]).map(l=>(g(l.request),[X(l.request),l.request])),y=[...E.substitutions??[]];!o&&"defaultFont"in E&&(w=we(E)),o||(o=E);let g$1=new Set(C.sourceKeys);if(g$1.size>0){c=c.filter(l=>!g$1.has(g(l.from)));for(let l of g$1)f.delete(l);}i.push(...E.sources??[]);for(let l of C.sourceKeys)a$1.add(l);d+=C.ownedBytes;for(let[l,p]of $)u.set(l,p);for(let l of y)c.push(l),f.add(g(l.from));}catch(x){if(P?.releaseOwnedBytes?.(),n.signal?.aborted)throw n.signal.reason??x;if(x instanceof V)throw x.cause;Z(t,k,b$1,x);continue}}if(!o)return;let{epoch:N,...j}=Oe({...o,supportedFamilies:D(s),sources:i,substitutions:c});return m.length===0?j:{...j,failures:Object.freeze(m)}}var V=class extends Error{constructor(t){super("Unable to reserve owned font bytes");this.cause=t;this.name="FontOwnershipReservationError";}cause},Y=class extends RangeError{};async function Re(e,n){if(!n)return e;ke(n);let t,r=new Promise((s,i)=>{t=i;}),o=()=>t?.(n.reason);n.addEventListener("abort",o,{once:true});try{return await Promise.race([e,r])}finally{n.removeEventListener("abort",o);}}function _e(e){if(e===null||typeof e!="object")return;let n;try{n=e.then;}catch(t){return Promise.resolve({ok:false,cause:t})}if(typeof n=="function")return Promise.resolve(e).then(t=>({ok:true,value:t}),t=>({ok:false,cause:t}))}function Be(e$1,n,t,r,o,s,i){let u=e$1.sources??[],a$1=e$1.substitutions??[],d="maxFontBytes"in e$1?e$1.maxFontBytes:void 0,c$1="defaultFont"in e$1?e$1.defaultFont:void 0,f$1="epoch"in e$1?e$1.epoch:void 0,m="language"in e$1?e$1.language:void 0;if(!Array.isArray(u)||!Array.isArray(a$1))throw new TypeError("Font origin sources and substitutions must be arrays");let O=u.length,w=a$1.length;if(O>b)throw new RangeError(`Font source count must not exceed ${b}`);if(w>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let N=d??a;if(!Number.isSafeInteger(N)||N<=0||N>a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${a}`);let j=o??N,b$1=0,k=[],I=new Set,P=[],x=[];for(let y=0;y<O;y+=1){let g$1=u[y];try{let l=Q(g$1.request),p=g$1.availability,B=g$1.faceIndex,h=g$1.hash,A=g$1.id,L=g(l);if(p!==void 0&&p!=="available"&&p!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(B)||B<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof h!="string"||h.length===0)throw new TypeError("Font source hash must be a non-empty string");let K;if(p!=="forbidden"){if(typeof A!="string"||A.length===0)throw new TypeError("Font source id must be a non-empty string");K=g$1.bytes;let J=e(K);if(J>j)throw new RangeError("Font source exceeds the effective base byte ceiling");if(n.has(L)||I.has(L))continue;if(t+b$1+J>c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${c}`);b$1+=J;}else K=new Uint8Array(0);if(n.has(L)||I.has(L))continue;if(n.size+I.size>=b)throw new Y(`Font source count must not exceed ${b}`);I.add(L),k.push(L),P.push(Object.freeze({request:l,id:A,bytes:K,hash:h,faceIndex:B,...p?{availability:p}:{}}));}catch(l){if(l instanceof Y)throw l;x.push(l);}}let S=new Set,R=[];for(let y=0;y<w;y+=1){let g$1=a$1[y];try{let l=Q(g$1.from),p=Q(g$1.to);g(l),g(p);let B=g$1.lineMetrics,h=B?Object.freeze({heightEm:B.heightEm,baselineEm:B.baselineEm}):void 0;if(h&&(!Number.isFinite(h.heightEm)||!Number.isFinite(h.baselineEm)||h.heightEm<=0||h.heightEm>4||h.baselineEm<0||h.baselineEm>h.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let A=g(l);if(n.has(A)||I.has(A)||r.has(A)||S.has(A))continue;S.add(A),R.push(Object.freeze({from:l,to:p,...h?{lineMetrics:h}:{}}));}catch(l){x.push(l);}}if((O>0||w>0)&&P.length===0&&R.length===0&&x.length>0)throw x[0];let M=r.size;for(let y of I)r.has(y)&&(M-=1);if(M+S.size>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let C;if(c$1!==void 0){let y=c$1.family,g$1=c$1.sizeHalfPoints;if(g({family:y,weight:400,style:"normal"}),!Number.isSafeInteger(g$1)||g$1<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");C=Object.freeze({family:y,sizeHalfPoints:g$1});}if(f$1!==void 0&&(!Number.isSafeInteger(f$1)||f$1<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(m!==void 0&&typeof m!="string")throw new TypeError("Font shaping language must be a string");let E;if(b$1>0&&s)try{E=s(b$1);}catch(y){throw new V(y)}let $;try{$=P.map(y=>f(y,i));}catch(y){throw E?.(),y}return {fragment:Object.freeze({supportedFamilies:D([e$1.supportedFamilies]),sources:Object.freeze($),substitutions:Object.freeze(R),...f$1!==void 0?{epoch:f$1}:{},...d!==void 0?{maxFontBytes:d}:{},...C?{defaultFont:C}:{},...m!==void 0?{language:m}:{}}),sourceKeys:Object.freeze(k),ownedBytes:b$1,dropped:Object.freeze(x),releaseOwnedBytes:E}}function Pe(e){return !Number.isSafeInteger(e)||e<=0?0:e>c?c:e}function Le(e,n,t,r){let{committedSourceBytes:o,...s}=e,i=Pe(r);return {...s,defaultFamily:n,...t.length>0?{resolvedFaces:t}:{},...i>0?{committedSourceBytes:i}:{}}}function Q(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function ke(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function Z(e,n,t,r){let o;try{typeof n=="function"&&n.name.length>0&&(o=n.name);}catch{}let s=Object.freeze({originIndex:t,...o!==void 0?{originName:o}:{},cause:r});if(e.onOriginFailure)try{let u=e.onOriginFailure(s);Promise.resolve(u).catch(a=>{console.warn("[fonts] font-origin diagnostic callback failed",a);});return}catch(u){console.warn("[fonts] font-origin diagnostic callback failed",u);}let i="";try{r instanceof Error&&r.message.length>0&&(i=`: ${r.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${i}`,r);}function G(e){let n=new WeakMap;return (t,r)=>{let o=new Set;for(let s of t){let i=[{node:s,context:r,next:0}],u=a=>{i.pop();let d=i.at(-1)?.found??o;for(let c of a)d.add(c);};for(;i.length;){let a=i[i.length-1],d=n.get(a.node);if(d?.key===a.context.key){u(d.families);continue}if(!a.children){let m=e(a.node,a.context);a.children=m.children,a.found=new Set(m.families);}let c=a.children[a.next++];if(c){i.push({...c,next:0});continue}let f=[...a.found];f.length<=256?n.set(a.node,{key:a.context.key,families:f}):n.delete(a.node),u(f);}}return [...o]}}function W(e,n){return e.children.flatMap(t=>t.kind==="textValue"?[]:[{node:t,context:n}])}function qe(e,n){let{styles:t,theme:r,supplementalFamilies:o,depth:s}=n;if(e.kind==="table"){let a=Yc(e,468,s,t),d=[];for(let c of a?.rows??[])for(let f of c.cells){let m={...n,depth:s+1,cellStyle:f.styleFormatting,key:`${n.baseKey}|${s+1}|${JSON.stringify(f.styleFormatting)}`};for(let O of f.blocks)d.push({node:O,context:m});}return {children:d.reverse()}}let i=new Set;if(e.kind==="paragraph"){let a=e.children.find(c=>c.kind==="paragraphProperties"),d=Lb(t,a,n.cellStyle).runProperties;for(let c of zc(e,d,void 0,(f,m)=>Nb(f,m,t),void 0,void 0,"all-markup",void 0,void 0,r)){if(!c.text||c.fontSlot!=="eastAsia"&&!o.has(c.style.fontFamily??""))continue;let f=a$1((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&i.add(f);}}let u=e.localName==="txbxContent"?{...n,cellStyle:void 0,key:`${n.baseKey}|${s}|undefined`}:n;return {families:[...i],children:W(e,u).reverse()}}function ze(){let e=G(qe),n,t;return (r,o,s)=>{if(!n||t!==o||n.theme!==s){let i=Kb(o,s);t=o,n={key:`${i.cacheToken}|0|undefined`,baseKey:i.cacheToken,styles:i,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return e([...r].reverse(),n)}}function pn(e,n,t){return ze()(e,n,t)}function ee(e,n){return e.attributes.find(t=>t.localName===n)?.value}var De=G((e,n)=>{let t=[];if(e.namespaceUri===da){if(e.localName==="fldSimple"){let r=qc(ee(e,"instr")??"")?.font;r&&t.push(r);}if(e.localName==="p")for(let r of je(e))t.push(r);}return {families:t,children:W(e,n)}});function vn(e){let n=new Map;for(let t of De(e,{key:""})){let r=a$1(t);r!==null&&!n.has(r.toLowerCase())&&n.set(r.toLowerCase(),r);}return [...n.values()]}function je(e){let n=[],t=La(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let s=e.children[o];s.kind!=="textValue"&&r.push({node:s,containerDepth:0});}for(;r.length>0;){let{node:o,containerDepth:s}=r.pop();if(s>=la||o.namespaceUri===da&&o.localName==="p")continue;if(o.namespaceUri===da&&o.localName==="fldChar"){let u=ee(o,"fldCharType");u==="begin"?Oa(t):u==="separate"?(t.nesting===1&&Ae(t,n),Qa(t)):u==="end"&&(t.nesting===1&&Ae(t,n),Ra(t));continue}if(o.namespaceUri===da&&(o.localName==="instrText"||o.localName==="delInstrText")){Pa(t,$e(o),o.localName==="delInstrText");continue}if(o.namespaceUri===da&&o.localName==="fldSimple"){let u=qc(ee(o,"instr")??"");u?.font&&n.push(u.font);}let i=ma(o,s);for(let u=o.children.length-1;u>=0;u-=1){let a=o.children[u];a.kind!=="textValue"&&r.push({node:a,containerDepth:i});}}return Ma(t),n}function Ae(e,n){let t=Na(e);if(t.overflow)return;let r=qc(t.instruction);r?.font&&n.push(r.font);}function $e(e){let n="",t=[...e.children].reverse();for(;t.length>0&&n.length<=256;){let r=t.pop();if(r.kind==="textValue")n+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)t.push(r.children[o]);}return n}var Ke=()=>true;function kn(e,n,t,r){if(!n)return [];let o=Cc(n),s=Kb(t,r),i=new Map;for(let u of e)for(let a of Ue(u)){let d=Nd(a.children),c=f=>{if(f)for(let m of f.values())for(let O of [m.markerStyle.fontFamily,m.markerStyle.fontFamilyEastAsia]){let w=a$1(O??void 0);if(w===null)continue;let N=w.toLowerCase();i.has(N)||i.set(N,w);}};c(Vb(d,o,s,Ke));for(let f of d){let m=ud(f);for(let O of m.contents)c(td(O,o,s));}}return [...i.values()].sort((u,a)=>u.localeCompare(a))}function Ue(e){if(e.localName==="document"){for(let n of e.children)if(n.kind!=="textValue"&&n.localName==="body")return [n];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let n=[];for(let t of e.children)t.kind!=="textValue"&&(t.localName==="footnote"||t.localName==="endnote")&&n.push(t);return n}return [e]}var He={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Nn(e,n){let t=[],r=[],o=0;for(let s of e){let i=s.bytes.byteLength;if(!Number.isSafeInteger(i)||i>n||i>a||i>c-o){r.push(s);continue}o+=i,t.push(s);}return {sources:t,dropped:r}}function In(e,n,t){let r=n.reduce((s,i)=>s+i.bytes.byteLength,0),o=new Set(n.filter(s=>s.request.family.trim().length>0).map(s=>g(s.request)));return Xe(e,{maxFontBytes:t,aggregateBudget:Math.max(0,c-r),shadowedRequests:o})}function Xe(e,n){let t=[],r=[],o=n.aggregateBudget,s=new Set;for(let i of e){let u=He[i.style],a=Object.freeze({family:i.family,weight:u.weight,style:u.style});if(i.family.trim().length===0){r.push({request:a,partName:i.partName,reason:"malformed"});continue}let d=g(a);if(!(n.shadowedRequests?.has(d)||s.has(d))){if(s.add(d),i.bytes.byteLength>n.maxFontBytes||i.bytes.byteLength>o){r.push({request:a,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,t.push({request:a,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:a$2(i.bytes),faceIndex:0});}}return {sources:t,dropped:r}}export{D as a,We as b,Je as c,Ee as d,Oe as e,we as f,Ie as g,Ce as h,on as i,rn as j,sn as k,an as l,Nn as m,In as n,Xe as o,G as p,W as q,ze as r,pn as s,vn as t,je as u,kn as v};
|
package/dist/chunk-VP7SDFCM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function m(e){return e.kind!=="textValue"}function o(e,t){for(let n of e.children)if(m(n)&&n.localName===t)return n}function u(e,t){return e.attributes.find(n=>n.localName===t)?.value}function d(e){let t=o(e,"pPr"),n=t?o(t,"outlineLvl"):void 0;if(n){let l=u(n,"val");return l!==void 0&&/^[0-8]$/.test(l)?Number(l):null}let r=o(e,"name"),i=r?/^heading\s+([1-9])$/i.exec(u(r,"val")?.trim()??""):null;return i?Number(i[1])-1:null}export{d as a};
|