@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.
- package/README.md +9 -15
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +11 -9
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +12 -16
- package/dist/binding.js +1 -1
- package/dist/chunk-3XTHXWEB.js +20 -0
- package/dist/chunk-7QG5FJ4X.js +1 -0
- package/dist/chunk-B2HDVIGY.cjs +2 -0
- package/dist/chunk-BML3CNUT.js +2 -0
- package/dist/chunk-DD7ETSGW.cjs +20 -0
- package/dist/chunk-FRRMJK2G.js +5 -0
- package/dist/chunk-G5GLQ4SX.cjs +1 -0
- package/dist/chunk-JP253KIZ.cjs +2 -0
- package/dist/chunk-JROG4U3Z.cjs +21 -0
- package/dist/chunk-L7MVY3DW.js +2 -0
- package/dist/chunk-MBXGQN6J.js +1 -0
- package/dist/chunk-MDMM3XVQ.js +11 -0
- package/dist/{chunk-Q4AB7E4O.cjs → chunk-NO7U62I2.cjs} +1 -1
- package/dist/{chunk-PXKZUTHX.cjs → chunk-NPZX5O23.cjs} +2 -2
- package/dist/chunk-OISZDVXT.cjs +5 -0
- package/dist/chunk-PRNYSOQL.cjs +1 -0
- package/dist/chunk-RXPOTTQQ.js +21 -0
- package/dist/chunk-TDMGSCCL.cjs +1 -0
- package/dist/{chunk-YL4Q5LZP.cjs → chunk-UIB2MDE3.cjs} +1 -1
- package/dist/chunk-UXAWPVH6.js +1 -0
- package/dist/chunk-VYQTZIYH.js +1 -0
- package/dist/chunk-W7GY2IJC.js +2 -0
- package/dist/{chunk-KXPVOPR5.js → chunk-XXLS6O6B.js} +1 -1
- package/dist/chunk-ZFBNCHRP.cjs +11 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -4
- package/dist/contracts/editor.d.ts +9 -7
- package/dist/contracts/interaction.d.ts +73 -10
- package/dist/contracts/modules.d.ts +8 -8
- package/dist/{custom-node-writes-C9ArIlJh.d.ts → custom-node-writes-ClTkWM7s.d.ts} +2 -2
- package/dist/{editor-sRxrFJd8.d.ts → editor-BlerWPyk.d.ts} +44 -125
- package/dist/editor-scope-DZJT4ukT.d.ts +53 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +32 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +24 -12
- package/dist/export.js +2 -2
- package/dist/{font-resolver-BYEHQGTw.d.ts → font-resolver-DtADJcLL.d.ts} +2 -2
- package/dist/{headless-document-view-DELC4E5v.d.ts → headless-document-view-BDSeMGoK.d.ts} +2 -2
- package/dist/{hf-references-DTrHkktY.d.ts → hf-references-kSSFMq9X.d.ts} +1 -1
- package/dist/{index-C3Gvq4jN.d.ts → index-D51bUVBE.d.ts} +157 -30
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DoGR5cf8.d.ts → layout-shaping-rTElghj2.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +272 -459
- package/dist/layout.js +1 -1
- package/dist/{note-properties-DSe8igrz.d.ts → note-properties-D5_fXW9K.d.ts} +1 -1
- package/dist/{omml-equation-BpRmfDAf.d.ts → omml-equation-C9AJfWy5.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +6 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-DZzKxH5r.d.ts → protocol-K-Djpjjw.d.ts} +28 -6
- package/dist/{review-items-DYRx187i.d.ts → review-items-CiliAz8H.d.ts} +11 -1
- package/dist/review-paragraph-order-BlSnyg9a.d.ts +79 -0
- package/dist/{revision-projection-DHRJH48u.d.ts → revision-projection-JiDclAFU.d.ts} +1 -1
- package/dist/{semantic-cell-selection-BXVWCBYm.d.ts → semantic-cell-selection-C-VsxNee.d.ts} +4 -4
- package/dist/{semantic-interaction-DZsDmPg5.d.ts → semantic-interaction-2vPh96Ey.d.ts} +1 -1
- package/dist/{semantic-paint-f7SqN4oW.d.ts → semantic-paint-BEjYcsPK.d.ts} +4 -2
- package/dist/{semantic-records-EIdwId-a.d.ts → semantic-records-Bc-MGXbM.d.ts} +1237 -947
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +164 -20
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-egdarvH_.d.ts → tree-op-types-C71G7rIv.d.ts} +137 -55
- package/dist/{tree-package-fragment-DjkH4ESI.d.ts → tree-package-fragment-DRJkmfTW.d.ts} +3 -3
- package/dist/{tree-session-contract-CGOOgPjW.d.ts → tree-session-contract-Cp5W25RC.d.ts} +18 -8
- package/dist/{tree-store-DKJB0IcA.d.ts → tree-store-BRfhZceK.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-24APKZAN.cjs +0 -11
- package/dist/chunk-2YH4MSHX.cjs +0 -2
- package/dist/chunk-5Y7AADI6.js +0 -1
- package/dist/chunk-AREFLNUP.js +0 -11
- package/dist/chunk-AS7YZNQE.cjs +0 -2
- package/dist/chunk-AVGCKH6A.cjs +0 -20
- package/dist/chunk-CDYVDQRI.cjs +0 -5
- package/dist/chunk-HOEWFH5U.cjs +0 -1
- package/dist/chunk-KFELX7CN.js +0 -2
- package/dist/chunk-LGFKIF4M.cjs +0 -1
- package/dist/chunk-M52QXFKI.js +0 -1
- package/dist/chunk-MNUKSXRO.js +0 -1
- package/dist/chunk-PBOIGBDO.js +0 -2
- package/dist/chunk-PMHGONET.cjs +0 -1
- package/dist/chunk-QJYH6AYD.js +0 -1
- package/dist/chunk-QRC37MWG.cjs +0 -20
- package/dist/chunk-RJSB6RJ7.js +0 -20
- package/dist/chunk-SB54HLFJ.js +0 -20
- package/dist/chunk-XCESLTJL.js +0 -2
- package/dist/chunk-Z4527AXR.js +0 -5
- 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` |
|
|
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
|
|
74
|
-
|
|
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
|
-
###
|
|
76
|
+
### Build a paginated exporter
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
fixed-width approximation.
|
|
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
|
-
|
|
109
|
-
|
|
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
|
|
package/dist/automation.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
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;
|
package/dist/automation.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-
|
|
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-
|
|
3
|
-
import { H as HeaderFooterVariant } from './hf-references-
|
|
4
|
-
import { N as NoteKind } from './tree-store-
|
|
5
|
-
import { f as OoxmlPackageLimits, g as OoxmlPackageRejection } from './tree-op-types-
|
|
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-
|
|
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
|
-
*
|
|
64
|
+
* Budgets for the bounded reader — archive size, part count, and XML elements.
|
|
64
65
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
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
|
/**
|
package/dist/automation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g}from'./chunk-
|
|
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
|
|
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-
|
|
3
|
-
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-
|
|
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-
|
|
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-
|
|
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-
|
|
10
|
-
import './custom-node-writes-
|
|
11
|
-
import './tree-store-
|
|
12
|
-
import './headless-document-view-
|
|
13
|
-
import './review-items-
|
|
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-
|
|
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-
|
|
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';
|