@docx-editor.dev/core 2.10.0 → 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.
Files changed (136) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +14 -5
  3. package/dist/automation.d.ts +14 -5
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +12 -11
  7. package/dist/binding.d.ts +12 -11
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-34BNQUD4.js +10 -0
  10. package/dist/chunk-5AVHO75P.cjs +19 -0
  11. package/dist/chunk-6HMSC7UV.js +2 -0
  12. package/dist/chunk-6JIJOZDW.js +1 -0
  13. package/dist/chunk-76Y3Y45J.cjs +2 -0
  14. package/dist/chunk-BP7ANXGA.js +1 -0
  15. package/dist/chunk-BTQKU64Q.cjs +1 -0
  16. package/dist/chunk-CRZR6K5Z.js +19 -0
  17. package/dist/chunk-D5EHDHYV.js +1 -0
  18. package/dist/chunk-EJATEGJZ.cjs +1 -0
  19. package/dist/{chunk-PSZH2VXP.js → chunk-GOEBQ26R.js} +1 -1
  20. package/dist/chunk-GRDFEH5Q.cjs +2 -0
  21. package/dist/chunk-GWV65NQW.cjs +10 -0
  22. package/dist/chunk-GXLZCXEH.js +2 -0
  23. package/dist/chunk-JUQOPVSK.cjs +2 -0
  24. package/dist/chunk-LAETEBHD.js +1 -0
  25. package/dist/chunk-M6Z3KFXM.cjs +5 -0
  26. package/dist/{chunk-YMYCPY5Y.cjs → chunk-OHJQ7GPZ.cjs} +1 -1
  27. package/dist/chunk-UQFOYZJO.cjs +18 -0
  28. package/dist/chunk-WPQMPHNR.cjs +1 -0
  29. package/dist/chunk-WXQ245MQ.js +18 -0
  30. package/dist/chunk-WZHIFNSU.js +5 -0
  31. package/dist/chunk-X7A5XART.js +2 -0
  32. package/dist/chunk-ZKWRCLT2.cjs +1 -0
  33. package/dist/collaboration/replication.cjs +1 -0
  34. package/dist/collaboration/replication.d.cts +216 -0
  35. package/dist/collaboration/replication.d.ts +216 -0
  36. package/dist/collaboration/replication.js +1 -0
  37. package/dist/collaboration.cjs +1 -0
  38. package/dist/collaboration.d.cts +176 -0
  39. package/dist/collaboration.d.ts +176 -0
  40. package/dist/collaboration.js +1 -0
  41. package/dist/contracts/editor.cjs +1 -1
  42. package/dist/contracts/editor.d.cts +8 -9
  43. package/dist/contracts/editor.d.ts +8 -9
  44. package/dist/contracts/editor.js +1 -1
  45. package/dist/contracts/interaction.d.cts +8 -9
  46. package/dist/contracts/interaction.d.ts +8 -9
  47. package/dist/contracts/modules.cjs +1 -1
  48. package/dist/contracts/modules.d.cts +21 -8
  49. package/dist/contracts/modules.d.ts +21 -8
  50. package/dist/contracts/modules.js +1 -1
  51. package/dist/custom-node-writes-CwkYRw3V.d.cts +310 -0
  52. package/dist/custom-node-writes-JfTn-Sy6.d.ts +310 -0
  53. package/dist/document-properties-D6Ahr8D6.d.cts +28 -0
  54. package/dist/document-properties-D6Ahr8D6.d.ts +28 -0
  55. package/dist/{editor-C0my6Uta.d.ts → editor-BogcVHXk.d.ts} +145 -49
  56. package/dist/{editor-CwzY2Hcg.d.cts → editor-C8edZgy5.d.cts} +145 -49
  57. package/dist/editor.cjs +1 -1
  58. package/dist/editor.css +1 -7299
  59. package/dist/editor.d.cts +26 -25
  60. package/dist/editor.d.ts +26 -25
  61. package/dist/editor.js +1 -1
  62. package/dist/failure-BnGjoXf0.d.cts +64 -0
  63. package/dist/failure-BnGjoXf0.d.ts +64 -0
  64. package/dist/{index-kID8Ymkp.d.ts → index-BNv-ZLQP.d.ts} +262 -81
  65. package/dist/{index-nLFwo_17.d.cts → index-Dn0lOp9Z.d.cts} +262 -81
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.cts +19 -18
  68. package/dist/index.d.ts +19 -18
  69. package/dist/index.js +1 -1
  70. package/dist/layout.cjs +1 -1
  71. package/dist/layout.d.cts +71 -53
  72. package/dist/layout.d.ts +71 -53
  73. package/dist/layout.js +1 -1
  74. package/dist/{note-properties-jvnw_DGG.d.ts → note-properties-BmoSdyKS.d.ts} +1 -1
  75. package/dist/{note-properties-CQlxjic_.d.cts → note-properties-BvGfHk5e.d.cts} +1 -1
  76. package/dist/{omml-equation-Dd3mBep-.d.ts → omml-equation-Ciq5rgb7.d.ts} +1 -1
  77. package/dist/{omml-equation-BD-LsmWE.d.cts → omml-equation-CqQOt_dD.d.cts} +1 -1
  78. package/dist/output.cjs +1 -1
  79. package/dist/output.d.cts +6 -8
  80. package/dist/output.d.ts +6 -8
  81. package/dist/output.js +1 -1
  82. package/dist/{protocol-UuZOcOp7.d.cts → protocol-BB-WP3zk.d.cts} +2 -2
  83. package/dist/{protocol-C7ahrdUx.d.ts → protocol-Ckl7hWsv.d.ts} +2 -2
  84. package/dist/{review-items-Dw-8a6Ie.d.ts → review-items-BdeLNRi2.d.cts} +1 -2
  85. package/dist/{review-items-CwixiHNe.d.cts → review-items-CkYyXhXM.d.ts} +1 -2
  86. package/dist/{review-reads-BqkiJTeR.d.cts → review-reads-BOLSBm5w.d.cts} +2 -2
  87. package/dist/{review-reads-C0u-IKEA.d.ts → review-reads-Crf0Xn42.d.ts} +2 -2
  88. package/dist/{revision-projection-CILpvv4M.d.ts → revision-projection-Ae2CWa8E.d.ts} +1 -1
  89. package/dist/{revision-projection-Cc4wz30g.d.cts → revision-projection-C2S8PSQm.d.cts} +1 -1
  90. package/dist/{semantic-cell-selection-DT9x9WLf.d.cts → semantic-cell-selection-C0OFD4D9.d.cts} +4 -4
  91. package/dist/{semantic-cell-selection-Utrf0lz7.d.ts → semantic-cell-selection-DdmoxC-y.d.ts} +4 -4
  92. package/dist/{semantic-interaction-B6hFRQLy.d.ts → semantic-interaction-COyhZ9WH.d.ts} +1 -1
  93. package/dist/{semantic-interaction-Z0xKQcB4.d.cts → semantic-interaction-Cs2jErnt.d.cts} +1 -1
  94. package/dist/{semantic-paint-CQEOC0Od.d.cts → semantic-paint-UHaj3sBY.d.cts} +2 -2
  95. package/dist/{semantic-paint-quke354p.d.ts → semantic-paint-vA-oLSdV.d.ts} +2 -2
  96. package/dist/{semantic-records-Do3-i5oB.d.ts → semantic-records-5AOQJmLX.d.cts} +5 -4
  97. package/dist/{semantic-records-CMakzQ1X.d.cts → semantic-records-9xhwbJ23.d.ts} +5 -4
  98. package/dist/{shaped-measurer-DzRwWrL5.d.cts → shaped-measurer-NeF2mPSu.d.cts} +1 -1
  99. package/dist/{shaped-measurer-BxwTUluj.d.ts → shaped-measurer-vzsY88oK.d.ts} +1 -1
  100. package/dist/store.cjs +1 -1
  101. package/dist/store.d.cts +74 -16
  102. package/dist/store.d.ts +74 -16
  103. package/dist/store.js +1 -1
  104. package/dist/{tree-op-types-DSJYmf5b.d.cts → tree-op-types-BPyXNxyL.d.cts} +1247 -10
  105. package/dist/{tree-op-types-BuOfCrkp.d.ts → tree-op-types-DnzAOnc9.d.ts} +1247 -10
  106. package/dist/{custom-node-writes-BvpWCnW8.d.ts → tree-package-fragment-BjZ3RWAS.d.cts} +107 -322
  107. package/dist/{custom-node-writes-Db8H6Z3n.d.cts → tree-package-fragment-CDER0G3B.d.ts} +107 -322
  108. package/dist/{tree-session-contract-C1dfE9hy.d.ts → tree-session-contract-BF2FVBOM.d.cts} +16 -10
  109. package/dist/{tree-session-contract-ByWx8eew.d.cts → tree-session-contract-DhdsFT_z.d.ts} +16 -10
  110. package/dist/{tree-store-ASBtz7UB.d.ts → tree-store-CNZ3O83s.d.ts} +130 -25
  111. package/dist/{tree-store-CWOUMGN8.d.cts → tree-store-DfZi7FqY.d.cts} +130 -25
  112. package/package.json +14 -3
  113. package/dist/chunk-27APDXY2.js +0 -2
  114. package/dist/chunk-35MI6K7M.cjs +0 -10
  115. package/dist/chunk-4XL7SOWQ.cjs +0 -2
  116. package/dist/chunk-6K6QQVAZ.cjs +0 -18
  117. package/dist/chunk-7VQ7YLW3.cjs +0 -1
  118. package/dist/chunk-7ZJL5AEY.cjs +0 -1
  119. package/dist/chunk-C6LK2BYA.cjs +0 -2
  120. package/dist/chunk-GQQOL4PV.js +0 -1
  121. package/dist/chunk-HBEBUCRM.cjs +0 -5
  122. package/dist/chunk-LG5K46OM.js +0 -2
  123. package/dist/chunk-LWADHMVV.js +0 -5
  124. package/dist/chunk-N725IUO7.js +0 -18
  125. package/dist/chunk-N7DBENH4.js +0 -10
  126. package/dist/chunk-NVGFWMCO.js +0 -1
  127. package/dist/chunk-SYTWKJPJ.cjs +0 -18
  128. package/dist/chunk-YI6JXF7U.js +0 -18
  129. package/dist/hf-references-Dvk6De4Q.d.cts +0 -70
  130. package/dist/hf-references-z5Y4N1ab.d.ts +0 -70
  131. package/dist/note-nodes-BNCANoGN.d.ts +0 -108
  132. package/dist/note-nodes-DL-Au22P.d.cts +0 -108
  133. package/dist/ooxml-package-CdEy9ufK.d.cts +0 -1222
  134. package/dist/ooxml-package-CdEy9ufK.d.ts +0 -1222
  135. package/dist/tree-op-revision-attribution-CN06Xshv.d.cts +0 -24
  136. package/dist/tree-op-revision-attribution-CN06Xshv.d.ts +0 -24
@@ -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;