@docx-editor.dev/core 2.22.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- 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-5RKCJ5DF.js → chunk-2LXGB2X7.js} +1 -1
- package/dist/chunk-3OMDEMLL.js +1 -0
- package/dist/{chunk-RLKX7BIP.cjs → chunk-6CPYOVRT.cjs} +1 -1
- package/dist/chunk-AKF5KM2W.cjs +4 -0
- package/dist/chunk-BOGQGMMU.cjs +1 -0
- package/dist/chunk-CVNDMQIX.cjs +26 -0
- package/dist/chunk-DF7F7TNU.cjs +1 -0
- package/dist/{chunk-IWAUA732.js → chunk-G765WG4R.js} +1 -1
- package/dist/{chunk-X2LJDR53.cjs → chunk-IEXYOLNR.cjs} +5 -5
- package/dist/chunk-J3EM5ZEA.js +18 -0
- package/dist/{chunk-P5PWSRNW.cjs → chunk-JDAAGZNE.cjs} +1 -1
- package/dist/chunk-JNE6QF47.js +26 -0
- package/dist/chunk-JQTVFP72.cjs +2 -0
- package/dist/chunk-JXL25DRU.js +11 -0
- package/dist/chunk-KPSGB64S.js +1 -0
- package/dist/chunk-P4SBMHHO.cjs +5 -0
- package/dist/chunk-QQAF64KN.js +5 -0
- package/dist/chunk-SI5FLZGU.js +4 -0
- package/dist/chunk-SOUJNWXV.js +1 -0
- package/dist/chunk-T4TKRNZT.cjs +11 -0
- package/dist/chunk-TBFZZX7Z.cjs +1 -0
- package/dist/chunk-VPKKYCZI.cjs +2 -0
- package/dist/chunk-W3ZUPQIZ.cjs +18 -0
- package/dist/chunk-XMWH2R23.js +5 -0
- package/dist/chunk-XWXJB4J7.js +1 -0
- package/dist/chunk-YIBEBHT3.js +2 -0
- package/dist/chunk-ZSM6X52G.cjs +1 -0
- package/dist/chunk-ZXAGLAY2.js +2 -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-BU6rjQZz.d.ts} +134 -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-CPO7wtg6.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-BOkQYOsZ.d.ts} +75 -36
- 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-BOOxnLxF.d.ts} +3 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +164 -83
- 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-BtO2s2Za.d.ts} +10 -6
- package/dist/{semantic-interaction-BNiYSBcB.d.ts → semantic-interaction-COMnWyBQ.d.ts} +3 -2
- package/dist/{semantic-paint-DE236npp.d.ts → semantic-paint-C032N0ps.d.ts} +4 -3
- package/dist/{semantic-records-C5OeXnaL.d.ts → semantic-records-BSjo-xck.d.ts} +889 -779
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +17 -17
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkT4TKRNZT_cjs=require('./chunk-T4TKRNZT.cjs');var X=new Set(["document","hdr","ftr","footnotes","endnotes"]),W=24,U=512,E=chunkT4TKRNZT_cjs.$g(W);function z(o){let t=o.root;return t.namespaceUri===chunkT4TKRNZT_cjs.fa&&X.has(t.localName)}function $(o){let t=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkT4TKRNZT_cjs.fa&&r.localName==="p"&&t.push(r);for(let i of r.children)e(i);}};return e(o.root),t}function V(o){let t=chunkT4TKRNZT_cjs.gb(o);let e=[],r=new Set;for(let i of $(t)){let n=chunkT4TKRNZT_cjs.ab(i);if(!n||!chunkT4TKRNZT_cjs.$a(n))continue;let a=n.toUpperCase();if(r.has(a))continue;r.add(a);let s=chunkT4TKRNZT_cjs.vj(t,i.id);s!==null&&e.push(Object.freeze({paragraphId:a,nodeId:i.id,text:s}));}return Object.freeze(e)}function Y(o){let t=E.get(o.root);if(t)return t;let e=chunkT4TKRNZT_cjs.gb(o);let r=new Map,i=new Set,n=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===chunkT4TKRNZT_cjs.fa&&a.localName==="p"){let s=chunkT4TKRNZT_cjs.ab(a);if(s&&chunkT4TKRNZT_cjs.$a(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),a.kind==="paragraph"&&r.set(p,a.id));}}for(let s of a.children)n(s);}};return n(e.root),E.set(o.root,r),r}function w(o,t){if(o.length!==t.length)return false;for(let e=0;e<o.length;e+=1)if(o[e].root!==t[e])return false;return true}function B(o){let t=new Map,e=null,r=(n,a,s)=>{for(t.delete(n),t.set(n,{partName:a.name,root:a.root,nodeId:s});t.size>U;){let p=t.keys().next();if(p.done)break;t.delete(p.value);}},i=(n,a)=>{let s=t.get(n);if(!s)return null;let p=a.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkT4TKRNZT_cjs.Ja(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkT4TKRNZT_cjs.ab(l);return !d||d.toUpperCase()!==n?null:(r(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let a=o(),s=i(n,a);if(s)return s;if(e&&e.ids.has(n)&&w(a,e.roots))return null;for(let p of a){let l=Y(p).get(n);if(l!==void 0)return r(n,p,l),{part:p,nodeId:l}}return (!e||!w(a,e.roots))&&(e={roots:a.map(p=>p.root),ids:new Set}),e.ids.size<U&&e.ids.add(n),null}}function H(o,t){return chunkT4TKRNZT_cjs.Da(o,t)}var q=Object.freeze({kind:"body"}),F=1e6;function b(o,t){if(t<=0||t>=o.length)return false;let e=o.charCodeAt(t-1),r=o.charCodeAt(t);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function Q(o,t,e){if(t===e)return [];let r=0,i=Math.min(t.length,e.length);for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(b(t,r)||b(e,r));)r-=1;let n=0;for(;n<t.length-r&&n<e.length-r&&t.charCodeAt(t.length-n-1)===e.charCodeAt(e.length-n-1);)n+=1;for(;n>0&&(b(t,t.length-n)||b(e,e.length-n));)n-=1;let a=t.length-r-n,s=e.slice(r,e.length-n),p=[];return a>0&&p.push({op:"deleteText",paragraphId:o,start:r,end:r+a}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:r,text:s}),Object.freeze(p)}function K(o){let t=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkT4TKRNZT_cjs.fa&&r.localName==="t"&&r.attributes.every(i=>i.namespaceUri===chunkT4TKRNZT_cjs.ga&&i.localName==="space")&&r.children.every(i=>i.kind==="textValue"),e=[];for(let r of o){let i=e.at(-1);if(!t(i)||!t(r)){e.push(r);continue}let n=i.children.map(a=>a.kind==="textValue"?a.value:"").join("")+r.children.map(a=>a.kind==="textValue"?a.value:"").join("");e[e.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkT4TKRNZT_cjs.ga,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return e}function G(o){if(o.kind==="textValue")return o;let t=false,e=o.children.map(r=>{let i=G(r);return i!==r&&(t=true),i});if(o.namespaceUri===chunkT4TKRNZT_cjs.fa&&o.localName==="r"){let r=K(e);(r.length!==e.length||r.some((i,n)=>i!==e[n]))&&(e=[...r],t=true);}return t?{...o,children:e}:o}function rr(o,t,e){let r=o.parts.get(t);if(!r)return o;let i=false,n=new Set;for(let a of e)(a.op==="insertText"||a.op==="deleteText")&&!a.revision&&n.add(a.paragraphId);for(let a of n){let s=chunkT4TKRNZT_cjs.Ja(r,a);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunkT4TKRNZT_cjs.Oa(r,a,p,{deferValidation:true});l.ok&&(r=l.part,i=true);}return i?chunkT4TKRNZT_cjs.Nd(o,r):o}function er(o,t){let e=t.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>V(o.bodyStore().part),i,a=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=r(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>F)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(L=>L.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...Q(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(q,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>rr(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:e,paragraphs:r,paragraphByNodeId(l){return r().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=a(d);if(!c)return null;let g=chunkT4TKRNZT_cjs.vj(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>chunkT4TKRNZT_cjs.Ba(o),flushPendingJournals:()=>{chunkT4TKRNZT_cjs.Ca(o);},save:()=>chunkT4TKRNZT_cjs.Md(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}exports.a=rr;exports.b=er;
|