@docx-editor.dev/core 2.15.1 → 2.16.1

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 (101) hide show
  1. package/README.md +9 -15
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +11 -9
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +12 -16
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-3XTHXWEB.js +20 -0
  9. package/dist/chunk-7QG5FJ4X.js +1 -0
  10. package/dist/chunk-B2HDVIGY.cjs +2 -0
  11. package/dist/chunk-BML3CNUT.js +2 -0
  12. package/dist/chunk-DD7ETSGW.cjs +20 -0
  13. package/dist/chunk-FRRMJK2G.js +5 -0
  14. package/dist/chunk-G5GLQ4SX.cjs +1 -0
  15. package/dist/chunk-JP253KIZ.cjs +2 -0
  16. package/dist/chunk-JROG4U3Z.cjs +21 -0
  17. package/dist/chunk-L7MVY3DW.js +2 -0
  18. package/dist/chunk-MBXGQN6J.js +1 -0
  19. package/dist/chunk-MDMM3XVQ.js +11 -0
  20. package/dist/{chunk-Q4AB7E4O.cjs → chunk-NO7U62I2.cjs} +1 -1
  21. package/dist/{chunk-PXKZUTHX.cjs → chunk-NPZX5O23.cjs} +2 -2
  22. package/dist/chunk-OISZDVXT.cjs +5 -0
  23. package/dist/chunk-PRNYSOQL.cjs +1 -0
  24. package/dist/chunk-RXPOTTQQ.js +21 -0
  25. package/dist/chunk-TDMGSCCL.cjs +1 -0
  26. package/dist/{chunk-YL4Q5LZP.cjs → chunk-UIB2MDE3.cjs} +1 -1
  27. package/dist/chunk-UXAWPVH6.js +1 -0
  28. package/dist/chunk-VYQTZIYH.js +1 -0
  29. package/dist/chunk-W7GY2IJC.js +2 -0
  30. package/dist/{chunk-KXPVOPR5.js → chunk-XXLS6O6B.js} +1 -1
  31. package/dist/chunk-ZFBNCHRP.cjs +11 -0
  32. package/dist/collaboration/replication.cjs +1 -1
  33. package/dist/collaboration/replication.d.ts +4 -4
  34. package/dist/collaboration/replication.js +1 -1
  35. package/dist/collaboration.d.ts +4 -4
  36. package/dist/contracts/editor.d.ts +9 -7
  37. package/dist/contracts/interaction.d.ts +73 -10
  38. package/dist/contracts/modules.d.ts +8 -8
  39. package/dist/{custom-node-writes-C9ArIlJh.d.ts → custom-node-writes-ClTkWM7s.d.ts} +2 -2
  40. package/dist/{editor-sRxrFJd8.d.ts → editor-BlerWPyk.d.ts} +44 -125
  41. package/dist/editor-scope-DZJT4ukT.d.ts +53 -0
  42. package/dist/editor.cjs +1 -1
  43. package/dist/editor.css +1 -1
  44. package/dist/editor.d.ts +32 -26
  45. package/dist/editor.js +1 -1
  46. package/dist/export.cjs +2 -2
  47. package/dist/export.d.ts +24 -12
  48. package/dist/export.js +2 -2
  49. package/dist/{font-resolver-BYEHQGTw.d.ts → font-resolver-DtADJcLL.d.ts} +2 -2
  50. package/dist/{headless-document-view-DELC4E5v.d.ts → headless-document-view-BDSeMGoK.d.ts} +2 -2
  51. package/dist/{hf-references-DTrHkktY.d.ts → hf-references-kSSFMq9X.d.ts} +1 -1
  52. package/dist/{index-C3Gvq4jN.d.ts → index-D51bUVBE.d.ts} +157 -30
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.d.ts +20 -18
  55. package/dist/index.js +1 -1
  56. package/dist/{layout-shaping-DoGR5cf8.d.ts → layout-shaping-rTElghj2.d.ts} +1 -1
  57. package/dist/layout.cjs +1 -1
  58. package/dist/layout.d.ts +272 -459
  59. package/dist/layout.js +1 -1
  60. package/dist/{note-properties-DSe8igrz.d.ts → note-properties-D5_fXW9K.d.ts} +1 -1
  61. package/dist/{omml-equation-BpRmfDAf.d.ts → omml-equation-C9AJfWy5.d.ts} +1 -1
  62. package/dist/output.cjs +1 -1
  63. package/dist/output.d.ts +6 -6
  64. package/dist/output.js +1 -1
  65. package/dist/{protocol-DZzKxH5r.d.ts → protocol-K-Djpjjw.d.ts} +28 -6
  66. package/dist/{review-items-DYRx187i.d.ts → review-items-CiliAz8H.d.ts} +11 -1
  67. package/dist/review-paragraph-order-BlSnyg9a.d.ts +79 -0
  68. package/dist/{revision-projection-DHRJH48u.d.ts → revision-projection-JiDclAFU.d.ts} +1 -1
  69. package/dist/{semantic-cell-selection-BXVWCBYm.d.ts → semantic-cell-selection-C-VsxNee.d.ts} +4 -4
  70. package/dist/{semantic-interaction-DZsDmPg5.d.ts → semantic-interaction-2vPh96Ey.d.ts} +1 -1
  71. package/dist/{semantic-paint-f7SqN4oW.d.ts → semantic-paint-BEjYcsPK.d.ts} +4 -2
  72. package/dist/{semantic-records-EIdwId-a.d.ts → semantic-records-Bc-MGXbM.d.ts} +1237 -947
  73. package/dist/store.cjs +1 -1
  74. package/dist/store.d.ts +164 -20
  75. package/dist/store.js +1 -1
  76. package/dist/{tree-op-types-egdarvH_.d.ts → tree-op-types-C71G7rIv.d.ts} +137 -55
  77. package/dist/{tree-package-fragment-DjkH4ESI.d.ts → tree-package-fragment-DRJkmfTW.d.ts} +3 -3
  78. package/dist/{tree-session-contract-CGOOgPjW.d.ts → tree-session-contract-Cp5W25RC.d.ts} +18 -8
  79. package/dist/{tree-store-DKJB0IcA.d.ts → tree-store-BRfhZceK.d.ts} +1 -1
  80. package/package.json +2 -2
  81. package/dist/chunk-24APKZAN.cjs +0 -11
  82. package/dist/chunk-2YH4MSHX.cjs +0 -2
  83. package/dist/chunk-5Y7AADI6.js +0 -1
  84. package/dist/chunk-AREFLNUP.js +0 -11
  85. package/dist/chunk-AS7YZNQE.cjs +0 -2
  86. package/dist/chunk-AVGCKH6A.cjs +0 -20
  87. package/dist/chunk-CDYVDQRI.cjs +0 -5
  88. package/dist/chunk-HOEWFH5U.cjs +0 -1
  89. package/dist/chunk-KFELX7CN.js +0 -2
  90. package/dist/chunk-LGFKIF4M.cjs +0 -1
  91. package/dist/chunk-M52QXFKI.js +0 -1
  92. package/dist/chunk-MNUKSXRO.js +0 -1
  93. package/dist/chunk-PBOIGBDO.js +0 -2
  94. package/dist/chunk-PMHGONET.cjs +0 -1
  95. package/dist/chunk-QJYH6AYD.js +0 -1
  96. package/dist/chunk-QRC37MWG.cjs +0 -20
  97. package/dist/chunk-RJSB6RJ7.js +0 -20
  98. package/dist/chunk-SB54HLFJ.js +0 -20
  99. package/dist/chunk-XCESLTJL.js +0 -2
  100. package/dist/chunk-Z4527AXR.js +0 -5
  101. package/dist/review-reads-LbGUdNzn.d.ts +0 -160
package/README.md CHANGED
@@ -50,7 +50,7 @@ layout pass, and the paint step directly.
50
50
  | `./store` | The canonical tree and its transactional store. |
51
51
  | `./layout` | The DOM-free layout pass. |
52
52
  | `./output` | Serialization. |
53
- | `./export` | Reusable, DOM-free semantic layout sessions for Markdown, PDF, and future exporters. |
53
+ | `./export` | Document layout sessions for exporters. No DOM required. |
54
54
  | `./automation` | The object model behind `@docx-editor.dev/editor-api`. |
55
55
  | `./collaboration` | Provider-neutral collaboration session contracts. |
56
56
  | `./collaboration/replication` | Replication helpers for collaboration providers. |
@@ -70,17 +70,14 @@ Nodes are typed where layout needs them and generic everywhere else, preserving
70
70
  verbatim. Content the engine does not model is carried rather than dropped, so a document full
71
71
  of unknown extensions still opens, edits, and saves.
72
72
 
73
- Export sessions use the editor's reader-safe revision view by default: `all-markup` keeps both
74
- halves of pending tracked changes visible. Pass `displayMode: 'proposed'` or
75
- `displayMode: 'original'` explicitly when the exporter should present a resolved view instead.
73
+ Export sessions default to `all-markup`, which shows inserted and deleted text.
74
+ Use `displayMode: 'proposed'` for the accepted view or `displayMode: 'original'` for the rejected view.
76
75
 
77
- ### Building a physical-page exporter
76
+ ### Build a paginated exporter
78
77
 
79
- Use the document-aware font composition root for Markdown, PDF, or any exporter whose page breaks
80
- matter. `openDocumentForExport(bytes)` without a measurer intentionally uses deterministic
81
- fixed-width approximation. `openFontBackedDocumentForExport` discovers the document's actual run,
82
- style, header, footer, note, field, symbol, and equation families, then binds the resolved shaping
83
- snapshot to the layout session.
78
+ For exports that need accurate page breaks, use `openFontBackedDocumentForExport`. It resolves
79
+ the fonts used throughout the document before layout. Without a measurer,
80
+ `openDocumentForExport(bytes)` uses a fixed-width approximation.
84
81
 
85
82
  ```ts
86
83
  import { readFile } from 'node:fs/promises';
@@ -105,11 +102,8 @@ try {
105
102
  }
106
103
  ```
107
104
 
108
- Keep font retrieval, substitution, cancellation, diagnostics, and memory ownership in this Core
109
- lane. Format adapters should consume the resulting semantic pages; Markdown binds Core source
110
- artifacts to string offsets, while PDF can bind the same artifacts to page rectangles. For a live
111
- `HeadlessDocumentView`, pass the revision-stable measurer already used by its editor rather than
112
- starting asynchronous document-specific font resolution against mutable state.
105
+ Let Core manage fonts, resources, and layout. Build your output from the returned pages.
106
+ For a live `HeadlessDocumentView`, pass the editor's revision-stable measurer.
113
107
 
114
108
  ## Fidelity
115
109
 
@@ -1 +1 @@
1
- 'use strict';var chunkLGFKIF4M_cjs=require('./chunk-LGFKIF4M.cjs');require('./chunk-Q4AB7E4O.cjs');var chunk2YH4MSHX_cjs=require('./chunk-2YH4MSHX.cjs'),chunkYL4Q5LZP_cjs=require('./chunk-YL4Q5LZP.cjs'),chunk24APKZAN_cjs=require('./chunk-24APKZAN.cjs');var N=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),b=Object.freeze({kind:"body"});function U(t,e={}){let s=chunk24APKZAN_cjs.Wb(t,e.limits??{});if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let u=s.package.parts.get(s.package.mainDocumentPart);if(!u)return {ok:false,reason:"no-main-document-part",detail:s.package.mainDocumentPart};let m=new chunk2YH4MSHX_cjs.G(s.package,chunk24APKZAN_cjs.Cb(u)),f=e.collaborationModel?.session,l=()=>{},n=F(m,f,()=>l()),a=chunkLGFKIF4M_cjs.g({port:n,capabilities:N});return f&&(l=f.attach(chunkYL4Q5LZP_cjs.b(m,{documentId:f.documentId}))),{ok:true,host:a}}function W(t,e,s){let u=t.partFor(s);return u?chunk24APKZAN_cjs.xa(t,()=>{let m=chunk24APKZAN_cjs.Jd(t.currentPackage(),e,u.name);return m?(t.replacePackageShell(m.pkg),m.relationshipId):null},m=>m!==null):null}function F(t,e,s=()=>{}){let u=true,m=0,f=()=>e?(m+=1,{origin:e.identity.role==="agent"?chunk24APKZAN_cjs.b.mutationAgent:chunk24APKZAN_cjs.b.mutationHuman,actorId:e.identity.actorId,operationId:`${e.identity.actorId}:${e.sessionId}:automation:${m}`,recordsHistory:false}):{},l=n=>(e?.flushPendingJournals(),n);return {revision:()=>t.packageRevision,currentPackage:()=>u?t.currentPackage():null,apply(n,a=b){if(!u)return {ok:false,reason:"disposed"};let r=n(i=>chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>W(t,i,a)));if(r===null)return {ok:false,reason:"unsupported-target"};let p=e?.gateOperations(r,a);if(p)return {ok:false,reason:p};let o=e?t.partFor(a)?.name:void 0,d=t.transact(a,i=>{for(let A of r)i.apply(A);o&&i.applyPackage(A=>chunkYL4Q5LZP_cjs.a(A,o,r));},f());return d.ok?l({ok:true,changed:d.change!==null}):{ok:false,reason:d.detail?`${d.reason}: ${d.detail}`:d.reason}},applyLifecycle(n){if(!u)return {ok:false,reason:"disposed"};let a=e?.gateOperations([n],b);if(a)return {ok:false,reason:a};let r=chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>t.applyLifecycleOp(n));return r.ok?l({ok:true,changed:r.change!==null}):{ok:false,reason:r.detail?`${r.reason}: ${r.detail}`:r.reason}},applyCommentWrites(n,a){if(!u)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};if(p.store.graftPackage(()=>t.currentPackage()),n.every(i=>i.kind==="delete")){let i=n.find(k=>k.kind==="delete"),A=chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>chunk2YH4MSHX_cjs.T(t,n.flatMap(k=>k.kind==="delete"?[{commentId:k.commentId,...k.parentCommentId===void 0?{}:{parentCommentId:k.parentCommentId}}]:[]),a,i?.kind==="delete"?i.noteId:void 0));return A?l({ok:true,changed:A}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let o=n[0];if(o.kind==="create"||o.kind==="reply"){let i=chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>chunk2YH4MSHX_cjs.R(t,{anchor:o.anchor,author:o.author,text:o.text,...o.date===void 0?{}:{date:o.date},...o.kind==="reply"?{replyToCommentId:o.parentCommentId}:{}},a));return i.ok?l({ok:true,changed:true,..."commentId"in i?{commentId:i.commentId}:{}}):{ok:false,reason:i.reason}}if(o.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let d=chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>chunk2YH4MSHX_cjs.S(t,o.commentId,o.resolved));return d.ok?l({ok:true,changed:true}):{ok:false,reason:d.reason}},applyCustomNodeWrite(n,a){if(!u)return {ok:false,reason:"disposed"};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};let o=chunk24APKZAN_cjs.Eb(e?.identity.actorId,()=>chunk2YH4MSHX_cjs.$(t,n,a));return o.ok?l({ok:true,changed:o.change!==null}):{ok:false,reason:o.detail?`${o.reason}: ${o.detail}`:o.reason}},save:()=>u?chunk24APKZAN_cjs.Xb(t.currentPackage()):null,subscribe:n=>t.subscribe(()=>n()),dispose(){s(),u=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.c}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.b}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.d}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.a}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.f}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkLGFKIF4M_cjs.e}});exports.SERVER_AUTOMATION_CAPABILITIES=N;exports.createServerAutomationHost=U;
1
+ 'use strict';var chunkTDMGSCCL_cjs=require('./chunk-TDMGSCCL.cjs');require('./chunk-NO7U62I2.cjs');var chunkJP253KIZ_cjs=require('./chunk-JP253KIZ.cjs'),chunkUIB2MDE3_cjs=require('./chunk-UIB2MDE3.cjs'),chunkZFBNCHRP_cjs=require('./chunk-ZFBNCHRP.cjs');var N=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),b=Object.freeze({kind:"body"});function U(t,e={}){let i=chunkZFBNCHRP_cjs.cc(t,e.limits??{});if(!i.ok)return {ok:false,reason:i.reason,...i.limit===void 0?{}:{limit:i.limit},...i.detail?{detail:i.detail}:{}};let s=i.package.parts.get(i.package.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-part",detail:i.package.mainDocumentPart};let m=new chunkJP253KIZ_cjs.G(i.package,chunkZFBNCHRP_cjs.Kb(s)),f=e.collaborationModel?.session,l=()=>{},n=F(m,f,()=>l()),a=chunkTDMGSCCL_cjs.g({port:n,capabilities:N});return f&&(l=f.attach(chunkUIB2MDE3_cjs.b(m,{documentId:f.documentId}))),{ok:true,host:a}}function W(t,e,i){let s=t.partFor(i);return s?chunkZFBNCHRP_cjs.Ba(t,()=>{let m=chunkZFBNCHRP_cjs.of(t.currentPackage(),e,s.name);return m?(t.replacePackageShell(m.pkg),m.relationshipId):null},m=>m!==null):null}function F(t,e,i=()=>{}){let s=true,m=0,f=()=>e?(m+=1,{origin:e.identity.role==="agent"?chunkZFBNCHRP_cjs.b.mutationAgent:chunkZFBNCHRP_cjs.b.mutationHuman,actorId:e.identity.actorId,operationId:`${e.identity.actorId}:${e.sessionId}:automation:${m}`,recordsHistory:false}):{},l=n=>(e?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>t.packageRevision,currentPackage:()=>s?t.currentPackage():null,apply(n,a=b){if(!s)return {ok:false,reason:"disposed"};let r=n(u=>chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>W(t,u,a)));if(r===null)return {ok:false,reason:"unsupported-target"};let p=e?.gateOperations(r,a);if(p)return {ok:false,reason:p};let o=e?t.partFor(a)?.name:void 0,d=t.transact(a,u=>{for(let A of r)u.apply(A);o&&u.applyPackage(A=>chunkUIB2MDE3_cjs.a(A,o,r));},f());return d.ok?l({ok:true,changed:d.change!==null}):{ok:false,reason:d.detail?`${d.reason}: ${d.detail}`:d.reason}},applyLifecycle(n){if(!s)return {ok:false,reason:"disposed"};let a=e?.gateOperations([n],b);if(a)return {ok:false,reason:a};let r=chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>t.applyLifecycleOp(n));return r.ok?l({ok:true,changed:r.change!==null}):{ok:false,reason:r.detail?`${r.reason}: ${r.detail}`:r.reason}},applyCommentWrites(n,a){if(!s)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};if(p.store.graftPackage(()=>t.currentPackage()),n.every(u=>u.kind==="delete")){let u=n.find(y=>y.kind==="delete"),A=chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>chunkJP253KIZ_cjs.T(t,n.flatMap(y=>y.kind==="delete"?[{commentId:y.commentId,...y.parentCommentId===void 0?{}:{parentCommentId:y.parentCommentId}}]:[]),a,u?.kind==="delete"?u.noteId:void 0));return A?l({ok:true,changed:A}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let o=n[0];if(o.kind==="create"||o.kind==="reply"){let u=chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>chunkJP253KIZ_cjs.R(t,{anchor:o.anchor,author:o.author,text:o.text,...o.date===void 0?{}:{date:o.date},...o.kind==="reply"?{replyToCommentId:o.parentCommentId}:{}},a));return u.ok?l({ok:true,changed:true,..."commentId"in u?{commentId:u.commentId}:{}}):{ok:false,reason:u.reason}}if(o.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let d=chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>chunkJP253KIZ_cjs.S(t,o.commentId,o.resolved));return d.ok?l({ok:true,changed:true}):{ok:false,reason:d.reason}},applyCustomNodeWrite(n,a){if(!s)return {ok:false,reason:"disposed"};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};let o=chunkZFBNCHRP_cjs.Mb(e?.identity.actorId,()=>chunkJP253KIZ_cjs.$(t,n,a));return o.ok?l({ok:true,changed:o.change!==null}):{ok:false,reason:o.detail?`${o.reason}: ${o.detail}`:o.reason}},save:()=>s?chunkZFBNCHRP_cjs.dc(t.currentPackage()):null,subscribe:n=>t.subscribe(()=>n()),dispose(){i(),s=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.b}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.a}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.c}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.f}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.e}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkTDMGSCCL_cjs.d}});exports.SERVER_AUTOMATION_CAPABILITIES=N;exports.createServerAutomationHost=U;
@@ -1,11 +1,11 @@
1
- import { A as AutomationCapabilities, a as AutomationHost } from './protocol-DZzKxH5r.js';
2
- export { b as AUTOMATION_COMMAND_OPERATIONS, c as AUTOMATION_QUERY_OPERATIONS, d as AUTOMATION_SOLITARY_OPERATIONS, e as AutomationAlignment, f as AutomationBatchRequest, g as AutomationBatchResponse, h as AutomationChangeEvent, i as AutomationContentControlLock, j as AutomationContentControlRangeLocation, k as AutomationContentControlScope, l as AutomationContentControlSubtype, m as AutomationContentControlValue, n as AutomationError, o as AutomationErrorCode, p as AutomationFontRead, q as AutomationFontWrite, r as AutomationHandle, s as AutomationHandleRef, t as AutomationObjectKind, u as AutomationOperation, v as AutomationOperationKind, w as AutomationOperationResult, x as AutomationPageOrientation, y as AutomationPageSetupRead, z as AutomationPageSetupWrite, B as AutomationParagraphFormatRead, C as AutomationParagraphFormatWrite, D as AutomationParagraphRef, E as AutomationPoint, F as AutomationSaveResult, G as AutomationSearchOptions, H as AutomationSelectionMode, I as AutomationSpan, J as AutomationSpanRef, K as AutomationTextProjection, L as AutomationUnsubscribe, M as AutomationValue, N as isAutomationCommand, O as isSolitaryAutomationCommand } from './protocol-DZzKxH5r.js';
3
- import { H as HeaderFooterVariant } from './hf-references-DTrHkktY.js';
4
- import { N as NoteKind } from './tree-store-DKJB0IcA.js';
5
- import { f as OoxmlPackageLimits, g as OoxmlPackageRejection } from './tree-op-types-egdarvH_.js';
1
+ import { A as AutomationCapabilities, a as AutomationHost } from './protocol-K-Djpjjw.js';
2
+ export { b as AUTOMATION_COMMAND_OPERATIONS, c as AUTOMATION_QUERY_OPERATIONS, d as AUTOMATION_SOLITARY_OPERATIONS, e as AutomationAlignment, f as AutomationBatchRequest, g as AutomationBatchResponse, h as AutomationChangeEvent, i as AutomationContentControlLock, j as AutomationContentControlRangeLocation, k as AutomationContentControlScope, l as AutomationContentControlSubtype, m as AutomationContentControlValue, n as AutomationError, o as AutomationErrorCode, p as AutomationFontRead, q as AutomationFontWrite, r as AutomationHandle, s as AutomationHandleRef, t as AutomationObjectKind, u as AutomationOperation, v as AutomationOperationKind, w as AutomationOperationResult, x as AutomationPageOrientation, y as AutomationPageSetupRead, z as AutomationPageSetupWrite, B as AutomationParagraphFormatRead, C as AutomationParagraphFormatWrite, D as AutomationParagraphRef, E as AutomationPoint, F as AutomationSaveResult, G as AutomationSearchOptions, H as AutomationSelectionMode, I as AutomationSpan, J as AutomationSpanRef, K as AutomationTextProjection, L as AutomationUnsubscribe, M as AutomationValue, N as isAutomationCommand, O as isSolitaryAutomationCommand } from './protocol-K-Djpjjw.js';
3
+ import { H as HeaderFooterVariant } from './hf-references-kSSFMq9X.js';
4
+ import { N as NoteKind } from './tree-store-BRfhZceK.js';
5
+ import { f as OoxmlPackageLimits, g as OoxmlPackageRejection } from './tree-op-types-C71G7rIv.js';
6
6
  import { CollaborationModuleContribution } from './collaboration.js';
7
7
  import './contracts/types.js';
8
- import './tree-package-fragment-DjkH4ESI.js';
8
+ import './tree-package-fragment-DRJkmfTW.js';
9
9
  import './collaboration/replication.js';
10
10
  import './failure-BnGjoXf0.js';
11
11
 
@@ -51,6 +51,7 @@ type ServerAutomationHostResult = {
51
51
  } | {
52
52
  readonly ok: false;
53
53
  readonly reason: ServerAutomationHostRejection;
54
+ readonly limit?: 'zip.maxTotalBytes' | 'zip.maxRatio';
54
55
  readonly detail?: string;
55
56
  };
56
57
  /**
@@ -60,10 +61,11 @@ type ServerAutomationHostResult = {
60
61
  */
61
62
  interface ServerAutomationHostOptions {
62
63
  /**
63
- * Tighter budgets for the bounded reader — zip ratio, part count, XML depth.
64
+ * Budgets for the bounded reader — archive size, part count, and XML elements.
64
65
  *
65
- * Exposed because a server opening documents it did not author is exactly where a caller
66
- * may want smaller limits than the defaults. Omitted means the engine's own defaults.
66
+ * Omitted means the engine defaults. Lower budgets for untrusted input, or raise
67
+ * `xml.maxElements` for larger documents when the host has sufficient memory.
68
+ * Engine ceilings still apply.
67
69
  */
68
70
  readonly limits?: OoxmlPackageLimits;
69
71
  /**
@@ -1 +1 @@
1
- import {g}from'./chunk-5Y7AADI6.js';export{c as AUTOMATION_COMMAND_OPERATIONS,b as AUTOMATION_QUERY_OPERATIONS,d as AUTOMATION_SOLITARY_OPERATIONS,a as HEADER_FOOTER_VARIANTS,f as isAutomationCommand,e as isSolitaryAutomationCommand}from'./chunk-5Y7AADI6.js';import'./chunk-QJYH6AYD.js';import {G,$,T,R,S}from'./chunk-KFELX7CN.js';import {b as b$1,a}from'./chunk-KXPVOPR5.js';import {Wb,Cb,Xb,Eb,xa,Jd,b as b$2}from'./chunk-AREFLNUP.js';var N=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),b=Object.freeze({kind:"body"});function U(t,e={}){let s=Wb(t,e.limits??{});if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let u=s.package.parts.get(s.package.mainDocumentPart);if(!u)return {ok:false,reason:"no-main-document-part",detail:s.package.mainDocumentPart};let m=new G(s.package,Cb(u)),f=e.collaborationModel?.session,l=()=>{},n=F(m,f,()=>l()),a=g({port:n,capabilities:N});return f&&(l=f.attach(b$1(m,{documentId:f.documentId}))),{ok:true,host:a}}function W(t,e,s){let u=t.partFor(s);return u?xa(t,()=>{let m=Jd(t.currentPackage(),e,u.name);return m?(t.replacePackageShell(m.pkg),m.relationshipId):null},m=>m!==null):null}function F(t,e,s=()=>{}){let u=true,m=0,f=()=>e?(m+=1,{origin:e.identity.role==="agent"?b$2.mutationAgent:b$2.mutationHuman,actorId:e.identity.actorId,operationId:`${e.identity.actorId}:${e.sessionId}:automation:${m}`,recordsHistory:false}):{},l=n=>(e?.flushPendingJournals(),n);return {revision:()=>t.packageRevision,currentPackage:()=>u?t.currentPackage():null,apply(n,a$1=b){if(!u)return {ok:false,reason:"disposed"};let r=n(i=>Eb(e?.identity.actorId,()=>W(t,i,a$1)));if(r===null)return {ok:false,reason:"unsupported-target"};let p=e?.gateOperations(r,a$1);if(p)return {ok:false,reason:p};let o=e?t.partFor(a$1)?.name:void 0,d=t.transact(a$1,i=>{for(let A of r)i.apply(A);o&&i.applyPackage(A=>a(A,o,r));},f());return d.ok?l({ok:true,changed:d.change!==null}):{ok:false,reason:d.detail?`${d.reason}: ${d.detail}`:d.reason}},applyLifecycle(n){if(!u)return {ok:false,reason:"disposed"};let a=e?.gateOperations([n],b);if(a)return {ok:false,reason:a};let r=Eb(e?.identity.actorId,()=>t.applyLifecycleOp(n));return r.ok?l({ok:true,changed:r.change!==null}):{ok:false,reason:r.detail?`${r.reason}: ${r.detail}`:r.reason}},applyCommentWrites(n,a){if(!u)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};if(p.store.graftPackage(()=>t.currentPackage()),n.every(i=>i.kind==="delete")){let i=n.find(k=>k.kind==="delete"),A=Eb(e?.identity.actorId,()=>T(t,n.flatMap(k=>k.kind==="delete"?[{commentId:k.commentId,...k.parentCommentId===void 0?{}:{parentCommentId:k.parentCommentId}}]:[]),a,i?.kind==="delete"?i.noteId:void 0));return A?l({ok:true,changed:A}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let o=n[0];if(o.kind==="create"||o.kind==="reply"){let i=Eb(e?.identity.actorId,()=>R(t,{anchor:o.anchor,author:o.author,text:o.text,...o.date===void 0?{}:{date:o.date},...o.kind==="reply"?{replyToCommentId:o.parentCommentId}:{}},a));return i.ok?l({ok:true,changed:true,..."commentId"in i?{commentId:i.commentId}:{}}):{ok:false,reason:i.reason}}if(o.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let d=Eb(e?.identity.actorId,()=>S(t,o.commentId,o.resolved));return d.ok?l({ok:true,changed:true}):{ok:false,reason:d.reason}},applyCustomNodeWrite(n,a){if(!u)return {ok:false,reason:"disposed"};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};let o=Eb(e?.identity.actorId,()=>$(t,n,a));return o.ok?l({ok:true,changed:o.change!==null}):{ok:false,reason:o.detail?`${o.reason}: ${o.detail}`:o.reason}},save:()=>u?Xb(t.currentPackage()):null,subscribe:n=>t.subscribe(()=>n()),dispose(){s(),u=false;}}}export{N as SERVER_AUTOMATION_CAPABILITIES,U as createServerAutomationHost};
1
+ import {g}from'./chunk-7QG5FJ4X.js';export{b as AUTOMATION_COMMAND_OPERATIONS,a as AUTOMATION_QUERY_OPERATIONS,c as AUTOMATION_SOLITARY_OPERATIONS,f as HEADER_FOOTER_VARIANTS,e as isAutomationCommand,d as isSolitaryAutomationCommand}from'./chunk-7QG5FJ4X.js';import'./chunk-UXAWPVH6.js';import {G,$,T,R,S}from'./chunk-W7GY2IJC.js';import {b as b$1,a}from'./chunk-XXLS6O6B.js';import {cc,Kb,dc,Mb,Ba,of,b as b$2}from'./chunk-MDMM3XVQ.js';var N=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),b=Object.freeze({kind:"body"});function U(t,e={}){let i=cc(t,e.limits??{});if(!i.ok)return {ok:false,reason:i.reason,...i.limit===void 0?{}:{limit:i.limit},...i.detail?{detail:i.detail}:{}};let s=i.package.parts.get(i.package.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-part",detail:i.package.mainDocumentPart};let m=new G(i.package,Kb(s)),f=e.collaborationModel?.session,l=()=>{},n=F(m,f,()=>l()),a=g({port:n,capabilities:N});return f&&(l=f.attach(b$1(m,{documentId:f.documentId}))),{ok:true,host:a}}function W(t,e,i){let s=t.partFor(i);return s?Ba(t,()=>{let m=of(t.currentPackage(),e,s.name);return m?(t.replacePackageShell(m.pkg),m.relationshipId):null},m=>m!==null):null}function F(t,e,i=()=>{}){let s=true,m=0,f=()=>e?(m+=1,{origin:e.identity.role==="agent"?b$2.mutationAgent:b$2.mutationHuman,actorId:e.identity.actorId,operationId:`${e.identity.actorId}:${e.sessionId}:automation:${m}`,recordsHistory:false}):{},l=n=>(e?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>t.packageRevision,currentPackage:()=>s?t.currentPackage():null,apply(n,a$1=b){if(!s)return {ok:false,reason:"disposed"};let r=n(u=>Mb(e?.identity.actorId,()=>W(t,u,a$1)));if(r===null)return {ok:false,reason:"unsupported-target"};let p=e?.gateOperations(r,a$1);if(p)return {ok:false,reason:p};let o=e?t.partFor(a$1)?.name:void 0,d=t.transact(a$1,u=>{for(let A of r)u.apply(A);o&&u.applyPackage(A=>a(A,o,r));},f());return d.ok?l({ok:true,changed:d.change!==null}):{ok:false,reason:d.detail?`${d.reason}: ${d.detail}`:d.reason}},applyLifecycle(n){if(!s)return {ok:false,reason:"disposed"};let a=e?.gateOperations([n],b);if(a)return {ok:false,reason:a};let r=Mb(e?.identity.actorId,()=>t.applyLifecycleOp(n));return r.ok?l({ok:true,changed:r.change!==null}):{ok:false,reason:r.detail?`${r.reason}: ${r.detail}`:r.reason}},applyCommentWrites(n,a){if(!s)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};if(p.store.graftPackage(()=>t.currentPackage()),n.every(u=>u.kind==="delete")){let u=n.find(y=>y.kind==="delete"),A=Mb(e?.identity.actorId,()=>T(t,n.flatMap(y=>y.kind==="delete"?[{commentId:y.commentId,...y.parentCommentId===void 0?{}:{parentCommentId:y.parentCommentId}}]:[]),a,u?.kind==="delete"?u.noteId:void 0));return A?l({ok:true,changed:A}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let o=n[0];if(o.kind==="create"||o.kind==="reply"){let u=Mb(e?.identity.actorId,()=>R(t,{anchor:o.anchor,author:o.author,text:o.text,...o.date===void 0?{}:{date:o.date},...o.kind==="reply"?{replyToCommentId:o.parentCommentId}:{}},a));return u.ok?l({ok:true,changed:true,..."commentId"in u?{commentId:u.commentId}:{}}):{ok:false,reason:u.reason}}if(o.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let d=Mb(e?.identity.actorId,()=>S(t,o.commentId,o.resolved));return d.ok?l({ok:true,changed:true}):{ok:false,reason:d.reason}},applyCustomNodeWrite(n,a){if(!s)return {ok:false,reason:"disposed"};let r=e?.gateOperations([],a);if(r)return {ok:false,reason:r};let p=t.resolveStory(a);if(!p.ok)return {ok:false,reason:p.reason};let o=Mb(e?.identity.actorId,()=>$(t,n,a));return o.ok?l({ok:true,changed:o.change!==null}):{ok:false,reason:o.detail?`${o.reason}: ${o.detail}`:o.reason}},save:()=>s?dc(t.currentPackage()):null,subscribe:n=>t.subscribe(()=>n()),dispose(){i(),s=false;}}}export{N as SERVER_AUTOMATION_CAPABILITIES,U as createServerAutomationHost};
package/dist/binding.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkCDYVDQRI_cjs=require('./chunk-CDYVDQRI.cjs');require('./chunk-PMHGONET.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-PXKZUTHX.cjs'),require('./chunk-Q4AB7E4O.cjs'),require('./chunk-2YH4MSHX.cjs'),require('./chunk-YL4Q5LZP.cjs'),require('./chunk-24APKZAN.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkCDYVDQRI_cjs.e}});
1
+ 'use strict';var chunkOISZDVXT_cjs=require('./chunk-OISZDVXT.cjs');require('./chunk-PRNYSOQL.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-NPZX5O23.cjs'),require('./chunk-NO7U62I2.cjs'),require('./chunk-JP253KIZ.cjs'),require('./chunk-UIB2MDE3.cjs'),require('./chunk-ZFBNCHRP.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkOISZDVXT_cjs.e}});
package/dist/binding.d.ts CHANGED
@@ -1,25 +1,21 @@
1
1
  import { Node, Schema } from 'prosemirror-model';
2
- import { q as OoxmlProperty, g as OoxmlPackageRejection } from './tree-op-types-egdarvH_.js';
3
- import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CGOOgPjW.js';
4
- export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-CGOOgPjW.js';
2
+ import { q as OoxmlProperty, g as OoxmlPackageRejection } from './tree-op-types-C71G7rIv.js';
3
+ import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-Cp5W25RC.js';
4
+ export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-Cp5W25RC.js';
5
5
  import { ReviewModuleContribution } from './contracts/modules.js';
6
- export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-DjkH4ESI.js';
6
+ export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-DRJkmfTW.js';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
  import './contracts/types.js';
9
- import './hf-references-DTrHkktY.js';
10
- import './custom-node-writes-C9ArIlJh.js';
11
- import './tree-store-DKJB0IcA.js';
12
- import './headless-document-view-DELC4E5v.js';
13
- import './review-items-DYRx187i.js';
9
+ import './hf-references-kSSFMq9X.js';
10
+ import './custom-node-writes-ClTkWM7s.js';
11
+ import './tree-store-BRfhZceK.js';
12
+ import './headless-document-view-BDSeMGoK.js';
13
+ import './review-items-CiliAz8H.js';
14
14
  import './collaboration/replication.js';
15
- import './editor-sRxrFJd8.js';
16
- import './contracts/document.js';
17
- import './semantic-interaction-DZsDmPg5.js';
18
- import './semantic-records-EIdwId-a.js';
19
- import './revision-projection-DHRJH48u.js';
20
- import './omml-equation-BpRmfDAf.js';
21
- import './failure-BnGjoXf0.js';
15
+ import './editor-scope-DZJT4ukT.js';
22
16
  import './collaboration.js';
17
+ import './failure-BnGjoXf0.js';
18
+ import './revision-projection-JiDclAFU.js';
23
19
 
24
20
  /** Attributes carried by a projected paragraph. */
25
21
  interface ParagraphAttrs {
package/dist/binding.js CHANGED
@@ -1 +1 @@
1
- export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-Z4527AXR.js';import'./chunk-M52QXFKI.js';import'./chunk-VP7SDFCM.js';import'./chunk-PBOIGBDO.js';import'./chunk-QJYH6AYD.js';import'./chunk-KFELX7CN.js';import'./chunk-KXPVOPR5.js';import'./chunk-AREFLNUP.js';
1
+ export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-FRRMJK2G.js';import'./chunk-VYQTZIYH.js';import'./chunk-VP7SDFCM.js';import'./chunk-BML3CNUT.js';import'./chunk-UXAWPVH6.js';import'./chunk-W7GY2IJC.js';import'./chunk-XXLS6O6B.js';import'./chunk-MDMM3XVQ.js';