@docx-editor.dev/core 2.9.2 → 2.11.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.cts +14 -5
- package/dist/automation.d.ts +14 -5
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +78 -13
- package/dist/binding.d.ts +78 -13
- package/dist/binding.js +1 -1
- package/dist/chunk-34BNQUD4.js +10 -0
- package/dist/chunk-5AVHO75P.cjs +19 -0
- package/dist/chunk-6HMSC7UV.js +2 -0
- package/dist/chunk-6JIJOZDW.js +1 -0
- package/dist/chunk-76Y3Y45J.cjs +2 -0
- package/dist/chunk-BP7ANXGA.js +1 -0
- package/dist/chunk-BTQKU64Q.cjs +1 -0
- package/dist/chunk-CRZR6K5Z.js +19 -0
- package/dist/chunk-D5EHDHYV.js +1 -0
- package/dist/chunk-EJATEGJZ.cjs +1 -0
- package/dist/{chunk-PSZH2VXP.js → chunk-GOEBQ26R.js} +1 -1
- package/dist/chunk-GRDFEH5Q.cjs +2 -0
- package/dist/chunk-GWV65NQW.cjs +10 -0
- package/dist/chunk-GXLZCXEH.js +2 -0
- package/dist/chunk-JUQOPVSK.cjs +2 -0
- package/dist/chunk-LAETEBHD.js +1 -0
- package/dist/chunk-M6Z3KFXM.cjs +5 -0
- package/dist/{chunk-YMYCPY5Y.cjs → chunk-OHJQ7GPZ.cjs} +1 -1
- package/dist/chunk-UQFOYZJO.cjs +18 -0
- package/dist/chunk-WPQMPHNR.cjs +1 -0
- package/dist/chunk-WXQ245MQ.js +18 -0
- package/dist/chunk-WZHIFNSU.js +5 -0
- package/dist/chunk-X7A5XART.js +2 -0
- package/dist/chunk-ZKWRCLT2.cjs +1 -0
- package/dist/collaboration/replication.cjs +1 -0
- package/dist/collaboration/replication.d.cts +216 -0
- package/dist/collaboration/replication.d.ts +216 -0
- package/dist/collaboration/replication.js +1 -0
- package/dist/collaboration.cjs +1 -0
- package/dist/collaboration.d.cts +176 -0
- package/dist/collaboration.d.ts +176 -0
- package/dist/collaboration.js +1 -0
- package/dist/contracts/document.d.cts +6 -1
- package/dist/contracts/document.d.ts +6 -1
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.cts +8 -9
- package/dist/contracts/editor.d.ts +8 -9
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.cts +8 -9
- package/dist/contracts/interaction.d.ts +8 -9
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.cts +20 -8
- package/dist/contracts/modules.d.ts +20 -8
- package/dist/contracts/modules.js +1 -1
- package/dist/custom-node-writes-CwkYRw3V.d.cts +310 -0
- package/dist/custom-node-writes-JfTn-Sy6.d.ts +310 -0
- package/dist/document-properties-D6Ahr8D6.d.cts +28 -0
- package/dist/document-properties-D6Ahr8D6.d.ts +28 -0
- package/dist/{editor-Cvd7Geoc.d.ts → editor-BogcVHXk.d.ts} +176 -59
- package/dist/{editor-cAEf1uXW.d.cts → editor-C8edZgy5.d.cts} +176 -59
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -7698
- package/dist/editor.d.cts +26 -25
- package/dist/editor.d.ts +26 -25
- package/dist/editor.js +1 -1
- package/dist/failure-BnGjoXf0.d.cts +64 -0
- package/dist/failure-BnGjoXf0.d.ts +64 -0
- package/dist/{index-DRqY5JVF.d.ts → index-BNv-ZLQP.d.ts} +327 -86
- package/dist/{index-wb-iOxfh.d.cts → index-Dn0lOp9Z.d.cts} +327 -86
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +20 -19
- package/dist/index.d.ts +20 -19
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +92 -55
- package/dist/layout.d.ts +92 -55
- package/dist/layout.js +1 -1
- package/dist/{note-properties-jvnw_DGG.d.ts → note-properties-BmoSdyKS.d.ts} +1 -1
- package/dist/{note-properties-CQlxjic_.d.cts → note-properties-BvGfHk5e.d.cts} +1 -1
- package/dist/{omml-equation-Dd3mBep-.d.ts → omml-equation-Ciq5rgb7.d.ts} +1 -1
- package/dist/{omml-equation-BD-LsmWE.d.cts → omml-equation-CqQOt_dD.d.cts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +6 -8
- package/dist/output.d.ts +6 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-UuZOcOp7.d.cts → protocol-BB-WP3zk.d.cts} +2 -2
- package/dist/{protocol-C7ahrdUx.d.ts → protocol-Ckl7hWsv.d.ts} +2 -2
- package/dist/{review-items-bdGxFWNA.d.ts → review-items-BdeLNRi2.d.cts} +1 -2
- package/dist/{review-items-B8tffIXj.d.cts → review-items-CkYyXhXM.d.ts} +1 -2
- package/dist/{review-reads-Bxz03tHG.d.cts → review-reads-BOLSBm5w.d.cts} +2 -2
- package/dist/{review-reads-CHODU0LI.d.ts → review-reads-Crf0Xn42.d.ts} +2 -2
- package/dist/{revision-projection-CILpvv4M.d.ts → revision-projection-Ae2CWa8E.d.ts} +1 -1
- package/dist/{revision-projection-Cc4wz30g.d.cts → revision-projection-C2S8PSQm.d.cts} +1 -1
- package/dist/{semantic-cell-selection-BPzx6DdT.d.cts → semantic-cell-selection-C0OFD4D9.d.cts} +4 -4
- package/dist/{semantic-cell-selection-CsHcr-yk.d.ts → semantic-cell-selection-DdmoxC-y.d.ts} +4 -4
- package/dist/{semantic-interaction-D-RZ9Ust.d.ts → semantic-interaction-COyhZ9WH.d.ts} +21 -2
- package/dist/{semantic-interaction-BfWDD_0V.d.cts → semantic-interaction-Cs2jErnt.d.cts} +21 -2
- package/dist/{semantic-paint-WhVtSDJK.d.ts → semantic-paint-UHaj3sBY.d.cts} +2 -2
- package/dist/{semantic-paint-Bd7EqzXV.d.cts → semantic-paint-vA-oLSdV.d.ts} +2 -2
- package/dist/{semantic-records-DadVT_E1.d.cts → semantic-records-5AOQJmLX.d.cts} +20 -5
- package/dist/{semantic-records-DCt-ZwKU.d.ts → semantic-records-9xhwbJ23.d.ts} +20 -5
- package/dist/{shaped-measurer-CninrHr_.d.cts → shaped-measurer-NeF2mPSu.d.cts} +1 -1
- package/dist/{shaped-measurer-B9f4A7QA.d.ts → shaped-measurer-vzsY88oK.d.ts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +193 -19
- package/dist/store.d.ts +193 -19
- package/dist/store.js +1 -1
- package/dist/tree-op-types-BPyXNxyL.d.cts +3053 -0
- package/dist/tree-op-types-DnzAOnc9.d.ts +3053 -0
- package/dist/{custom-node-writes-D6SGwebL.d.ts → tree-package-fragment-BjZ3RWAS.d.cts} +128 -312
- package/dist/{custom-node-writes-Dy3b20PS.d.cts → tree-package-fragment-CDER0G3B.d.ts} +128 -312
- package/dist/{tree-session-ZuBFOhIh.d.ts → tree-session-contract-BF2FVBOM.d.cts} +52 -106
- package/dist/{tree-session-Df02ajqc.d.cts → tree-session-contract-DhdsFT_z.d.ts} +52 -106
- package/dist/{tree-store-B_sJBMIS.d.cts → tree-store-CNZ3O83s.d.ts} +130 -25
- package/dist/{tree-store-DgETo6Mf.d.ts → tree-store-DfZi7FqY.d.cts} +130 -25
- package/package.json +14 -3
- package/dist/chunk-6JWP2H7K.js +0 -2
- package/dist/chunk-6KNLLEUW.cjs +0 -18
- package/dist/chunk-7ADTI533.cjs +0 -10
- package/dist/chunk-7ETDCPF6.cjs +0 -2
- package/dist/chunk-7I3BSGGS.js +0 -1
- package/dist/chunk-7UU5YFCD.cjs +0 -2
- package/dist/chunk-7VQ7YLW3.cjs +0 -1
- package/dist/chunk-CKDAK3MV.js +0 -10
- package/dist/chunk-DIMEYVNS.js +0 -2
- package/dist/chunk-GQQOL4PV.js +0 -1
- package/dist/chunk-H2656QDI.cjs +0 -1
- package/dist/chunk-KQGENNL5.cjs +0 -15
- package/dist/chunk-LIXPSV4T.js +0 -18
- package/dist/chunk-O4UULRAQ.cjs +0 -5
- package/dist/chunk-SIIFNE6U.js +0 -15
- package/dist/chunk-VXYECPKA.js +0 -5
- package/dist/hf-references-Dvk6De4Q.d.cts +0 -70
- package/dist/hf-references-z5Y4N1ab.d.ts +0 -70
- package/dist/image-resources-BgA9EQxY.d.ts +0 -203
- package/dist/image-resources-BiA-IXgo.d.cts +0 -203
- package/dist/note-nodes-BNCANoGN.d.ts +0 -108
- package/dist/note-nodes-DL-Au22P.d.cts +0 -108
- package/dist/ooxml-package-CdEy9ufK.d.cts +0 -1222
- package/dist/ooxml-package-CdEy9ufK.d.ts +0 -1222
- package/dist/tree-op-types-CnRb7AYo.d.ts +0 -1589
- package/dist/tree-op-types-D1vNJ7XC.d.cts +0 -1589
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkGWV65NQW_cjs=require('./chunk-GWV65NQW.cjs');var W=new Set(["document","hdr","ftr","footnotes","endnotes"]),$=24,U=512,E=chunkGWV65NQW_cjs.Jf($);function z(o){let a=o.root;return a.namespaceUri===chunkGWV65NQW_cjs.ca&&W.has(a.localName)}function Y(o){let a=[],r=e=>{if(e.kind!=="textValue"){e.namespaceUri===chunkGWV65NQW_cjs.ca&&e.localName==="p"&&a.push(e);for(let i of e.children)r(i);}};return r(o.root),a}function V(o){let a=chunkGWV65NQW_cjs.yb(o);let r=[],e=new Set;for(let i of Y(a)){let n=chunkGWV65NQW_cjs.sb(i);if(!n||!chunkGWV65NQW_cjs.rb(n))continue;let t=n.toUpperCase();if(e.has(t))continue;e.add(t);let s=chunkGWV65NQW_cjs.Xg(a,i.id);s!==null&&r.push(Object.freeze({paragraphId:t,nodeId:i.id,text:s}));}return Object.freeze(r)}function G(o){let a=E.get(o.root);if(a)return a;let r=chunkGWV65NQW_cjs.yb(o);let e=new Map,i=new Set,n=t=>{if(t.kind!=="textValue"){if(t.namespaceUri===chunkGWV65NQW_cjs.ca&&t.localName==="p"){let s=chunkGWV65NQW_cjs.sb(t);if(s&&chunkGWV65NQW_cjs.rb(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),t.kind==="paragraph"&&e.set(p,t.id));}}for(let s of t.children)n(s);}};return n(r.root),E.set(o.root,e),e}function w(o,a){if(o.length!==a.length)return false;for(let r=0;r<o.length;r+=1)if(o[r].root!==a[r])return false;return true}function B(o){let a=new Map,r=null,e=(n,t,s)=>{for(a.delete(n),a.set(n,{partName:t.name,root:t.root,nodeId:s});a.size>U;){let p=a.keys().next();if(p.done)break;a.delete(p.value);}},i=(n,t)=>{let s=a.get(n);if(!s)return null;let p=t.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkGWV65NQW_cjs.Ca(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkGWV65NQW_cjs.sb(l);return !d||d.toUpperCase()!==n?null:(e(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let t=o(),s=i(n,t);if(s)return s;if(r&&r.ids.has(n)&&w(t,r.roots))return null;for(let p of t){let l=G(p).get(n);if(l!==void 0)return e(n,p,l),{part:p,nodeId:l}}return (!r||!w(t,r.roots))&&(r={roots:t.map(p=>p.root),ids:new Set}),r.ids.size<U&&r.ids.add(n),null}}function H(o,a){return chunkGWV65NQW_cjs.wa(o,a)}var Z=Object.freeze({kind:"body"}),q=1e6;function b(o,a){if(a<=0||a>=o.length)return false;let r=o.charCodeAt(a-1),e=o.charCodeAt(a);return r>=55296&&r<=56319&&e>=56320&&e<=57343}function F(o,a,r){if(a===r)return [];let e=0,i=Math.min(a.length,r.length);for(;e<i&&a.charCodeAt(e)===r.charCodeAt(e);)e+=1;for(;e>0&&(b(a,e)||b(r,e));)e-=1;let n=0;for(;n<a.length-e&&n<r.length-e&&a.charCodeAt(a.length-n-1)===r.charCodeAt(r.length-n-1);)n+=1;for(;n>0&&(b(a,a.length-n)||b(r,r.length-n));)n-=1;let t=a.length-e-n,s=r.slice(e,r.length-n),p=[];return t>0&&p.push({op:"deleteText",paragraphId:o,start:e,end:e+t}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:e,text:s}),Object.freeze(p)}function Q(o){let a=e=>!!e&&e.kind!=="textValue"&&e.namespaceUri===chunkGWV65NQW_cjs.ca&&e.localName==="t"&&e.attributes.every(i=>i.namespaceUri===chunkGWV65NQW_cjs.da&&i.localName==="space")&&e.children.every(i=>i.kind==="textValue"),r=[];for(let e of o){let i=r.at(-1);if(!a(i)||!a(e)){r.push(e);continue}let n=i.children.map(t=>t.kind==="textValue"?t.value:"").join("")+e.children.map(t=>t.kind==="textValue"?t.value:"").join("");r[r.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkGWV65NQW_cjs.da,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return r}function L(o){if(o.kind==="textValue")return o;let a=false,r=o.children.map(e=>{let i=L(e);return i!==e&&(a=true),i});if(o.namespaceUri===chunkGWV65NQW_cjs.ca&&o.localName==="r"){let e=Q(r);(e.length!==r.length||e.some((i,n)=>i!==r[n]))&&(r=[...e],a=true);}return a?{...o,children:r}:o}function K(o,a,r){let e=o.parts.get(a);if(!e)return o;let i=false,n=new Set;for(let t of r)(t.op==="insertText"||t.op==="deleteText")&&!t.revision&&n.add(t.paragraphId);for(let t of n){let s=chunkGWV65NQW_cjs.Ca(e,t);if(!s||s.kind==="textValue")continue;let p=L(s);if(p===s)continue;let l=chunkGWV65NQW_cjs.Ga(e,t,p,{deferValidation:true});l.ok&&(e=l.part,i=true);}return i?chunkGWV65NQW_cjs.Ub(o,e):o}function ee(o,a){let r=a.documentId.trim();if(r.length===0||r.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let e=()=>V(o.bodyStore().part),i,t=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=e(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>q)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(X=>X.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...F(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(Z,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>K(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:r,paragraphs:e,paragraphByNodeId(l){return e().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=t(d);if(!c)return null;let g=chunkGWV65NQW_cjs.Xg(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:()=>chunkGWV65NQW_cjs.ua(o),flushPendingJournals:()=>{chunkGWV65NQW_cjs.va(o);},save:()=>chunkGWV65NQW_cjs.Tb(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=K;exports.b=ee;
|