@docx-editor.dev/core 2.19.1 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -32
- 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 +9 -10
- package/dist/binding.js +1 -1
- package/dist/chunk-44LQJIKH.cjs +20 -0
- package/dist/chunk-4EHMMSFR.cjs +1 -0
- package/dist/chunk-AFG7Q622.cjs +2 -0
- package/dist/chunk-AJCCS53D.js +1 -0
- package/dist/chunk-AYMSP25Q.js +4 -0
- package/dist/{chunk-GWW5FOLJ.cjs → chunk-B4KZSKF7.cjs} +5 -5
- package/dist/chunk-BDAY2ETZ.js +1 -0
- package/dist/chunk-BNZF6DYC.cjs +18 -0
- package/dist/chunk-BQXF2PFF.js +2 -0
- package/dist/chunk-GIHKVXEO.js +2 -0
- package/dist/chunk-ITNK6C5M.cjs +3 -0
- package/dist/chunk-MP3K4LC5.js +1 -0
- package/dist/chunk-MXOO7KRI.cjs +11 -0
- package/dist/chunk-NG6IQ4SI.js +11 -0
- package/dist/{chunk-NIVIC7PA.cjs → chunk-PYXMAUNR.cjs} +1 -1
- package/dist/chunk-Q2B6HX3R.js +1 -0
- package/dist/chunk-Q5JPPUNR.js +5 -0
- package/dist/chunk-S35UK656.cjs +2 -0
- package/dist/chunk-S6J4O5XP.js +1 -0
- package/dist/chunk-TE43S3LX.cjs +1 -0
- package/dist/chunk-TKQH7BNE.cjs +1 -0
- package/dist/chunk-UKVVUHZL.cjs +1 -0
- package/dist/chunk-VH2DLEZK.js +20 -0
- package/dist/{chunk-BUNY5MRX.js → chunk-VUNFWXHF.js} +1 -1
- package/dist/{chunk-JWHXOJEU.cjs → chunk-WQFNWLNY.cjs} +3 -3
- package/dist/chunk-WZX4UGRQ.js +3 -0
- package/dist/{chunk-2QU7QTM7.js → chunk-X5QNSISI.js} +1 -1
- package/dist/chunk-XS4FOHH6.js +18 -0
- package/dist/{chunk-7VO6BLKV.cjs → chunk-XZY4Q6PJ.cjs} +1 -1
- package/dist/{chunk-76F73CY6.cjs → chunk-Z2ETEZRU.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +13 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -3
- package/dist/contracts/document.d.ts +3 -2
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.ts +9 -10
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +9 -9
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +2 -562
- package/dist/{custom-node-writes-BqIv94ei.d.ts → custom-node-writes-05qS32px.d.ts} +2 -2
- package/dist/{document-protection-BL5zp8cU.d.ts → document-protection-Cr59VKLO.d.ts} +1 -1
- package/dist/{editor-WXbTSXx1.d.ts → editor-BsLSz_7y.d.ts} +43 -39
- package/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +130 -29
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +13 -14
- package/dist/export.js +1 -1
- package/dist/{font-resolver-BSrKnTeR.d.ts → font-resolver-CzwdBJDE.d.ts} +1 -1
- package/dist/{headless-document-view-C4ttQJ5H.d.ts → headless-document-view-B7nAiR7P.d.ts} +2 -2
- package/dist/image-resources-C4ilLzog.d.ts +210 -0
- package/dist/{index-C3As-Xxp.d.ts → index-zkvqBQ9o.d.ts} +117 -27
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -19
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-Dqu3JW3p.d.ts → layout-shaping-BJKVTI6i.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +72 -20
- package/dist/layout.js +1 -1
- package/dist/{note-properties-RjYgbmXe.d.ts → note-properties-MNztEj5s.d.ts} +2 -2
- package/dist/{omml-equation-hcP9AUFX.d.ts → omml-equation-CbnW9yXd.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +8 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-OdRd17KZ.d.ts → protocol-Co_r0SZQ.d.ts} +14 -4
- package/dist/{review-paragraph-order--jLHXIcd.d.ts → review-paragraph-order-EFaU7TqH.d.ts} +2 -3
- package/dist/{revision-projection-BIHO_qvw.d.ts → revision-projection-DEIvpxiq.d.ts} +16 -2
- package/dist/{semantic-cell-selection-lCYAVCCF.d.ts → semantic-cell-selection-DXmfnDCw.d.ts} +9 -4
- package/dist/{semantic-interaction-0vQXcMZk.d.ts → semantic-interaction-BLu3M6Nn.d.ts} +1 -1
- package/dist/{semantic-paint-BSan4pBk.d.ts → semantic-paint-CPsihA6k.d.ts} +18 -2
- package/dist/{semantic-records-ZcYuB4-H.d.ts → semantic-records-CqD0b5Ex.d.ts} +147 -6
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +462 -428
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-1pdDnhZ_.d.ts → tree-package-fragment-CwJDixNs.d.ts} +44 -3
- package/dist/{tree-session-contract-Cgn6fQ-M.d.ts → tree-session-contract-D9RRWE0C.d.ts} +8 -8
- package/dist/{tree-op-types-DbdM7fJV.d.ts → types-barrel-DLB11iSY.d.ts} +1455 -660
- package/package.json +2 -2
- package/dist/chunk-3JKOZBQ3.cjs +0 -1
- package/dist/chunk-3SU7UWCR.js +0 -1
- package/dist/chunk-5BI4SIHO.cjs +0 -1
- package/dist/chunk-6ESSCMXL.js +0 -2
- package/dist/chunk-6W4DIR4X.cjs +0 -2
- package/dist/chunk-AKQRKR2H.js +0 -1
- package/dist/chunk-BJQDNKEX.js +0 -5
- package/dist/chunk-D5EHDHYV.js +0 -1
- package/dist/chunk-FBWBSHC4.cjs +0 -11
- package/dist/chunk-GOEBQ26R.js +0 -1
- package/dist/chunk-IA7WTZHI.js +0 -11
- package/dist/chunk-IXGUCLER.js +0 -20
- package/dist/chunk-NDPLQG4Y.cjs +0 -18
- package/dist/chunk-NLGUL6QL.js +0 -3
- package/dist/chunk-OHJQ7GPZ.cjs +0 -1
- package/dist/chunk-OWUSDS3L.cjs +0 -20
- package/dist/chunk-RDKPMNN6.cjs +0 -2
- package/dist/chunk-TSDGKNV7.js +0 -2
- package/dist/chunk-TUCDPXBD.js +0 -18
- package/dist/chunk-UOE4WKL7.js +0 -1
- package/dist/chunk-VSCPFHTD.cjs +0 -3
- package/dist/chunk-ZKWRCLT2.cjs +0 -1
- package/dist/chunk-ZUGTEKLM.js +0 -4
- package/dist/editor-scope-DZJT4ukT.d.ts +0 -53
- package/dist/review-items-CJz-kAW8.d.ts +0 -370
package/README.md
CHANGED
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
# @docx-editor.dev/core
|
|
15
15
|
|
|
16
|
-
The engine behind [docx-editor.dev](https://docx-editor.dev). It reads a `.docx` into a
|
|
17
|
-
canonical document tree, lays that tree out into pages, paints them, and writes the tree back
|
|
18
|
-
to OOXML. No framework dependency and no UI.
|
|
16
|
+
The engine behind [docx-editor.dev](https://docx-editor.dev). It reads a `.docx` into a canonical document tree, lays that tree out into pages, paints them, and writes the tree back to OOXML. No framework dependency and no UI.
|
|
19
17
|
|
|
20
|
-
Most apps never install this directly — [`@docx-editor.dev/react`](https://www.npmjs.com/package/@docx-editor.dev/react)
|
|
21
|
-
carries it. Reach for it when you are writing your own adapter, or when you need the contract
|
|
22
|
-
types to write a function signature.
|
|
18
|
+
Most apps never install this directly — [`@docx-editor.dev/react`](https://www.npmjs.com/package/@docx-editor.dev/react) carries it. Reach for it when you are writing your own adapter, or when you need the contract types to write a function signature.
|
|
23
19
|
|
|
24
20
|
```bash
|
|
25
21
|
npm install @docx-editor.dev/core
|
|
@@ -34,9 +30,7 @@ import { createDocxEditor, loadFonts, WORD_DEFAULT_FONT } from '@docx-editor.dev
|
|
|
34
30
|
import type { Editor, EditorSnapshot } from '@docx-editor.dev/core';
|
|
35
31
|
```
|
|
36
32
|
|
|
37
|
-
The root covers most uses: creating an editor, the `Editor` contract it implements, fonts,
|
|
38
|
-
the chrome registry, and the document model types. Subpaths expose the canonical tree, the
|
|
39
|
-
layout pass, and the paint step directly.
|
|
33
|
+
The root covers most uses: creating an editor, the `Editor` contract it implements, fonts, the chrome registry, and the document model types. Subpaths expose the canonical tree, the layout pass, and the paint step directly.
|
|
40
34
|
|
|
41
35
|
| Subpath | What's there |
|
|
42
36
|
| ----------------------------- | -------------------------------------------------------------------------------------------- |
|
|
@@ -62,22 +56,15 @@ layout pass, and the paint step directly.
|
|
|
62
56
|
bytes → bounded OPC/XML read → canonical OOXML tree → layout → painted pages → serialize
|
|
63
57
|
```
|
|
64
58
|
|
|
65
|
-
There is one document model. The painted pages are the editable surface: they are
|
|
66
|
-
`contenteditable`, but the DOM is a picture. Browser mutations are prevented and re-expressed
|
|
67
|
-
as tree operations, so the browser never invents markup inside your document.
|
|
59
|
+
There is one document model. The painted pages are the editable surface: they are `contenteditable`, but the DOM is a picture. Browser mutations are prevented and re-expressed as tree operations, so the browser never invents markup inside your document.
|
|
68
60
|
|
|
69
|
-
Nodes are typed where layout needs them and generic everywhere else, preserving the element
|
|
70
|
-
verbatim. Content the engine does not model is carried rather than dropped, so a document full
|
|
71
|
-
of unknown extensions still opens, edits, and saves.
|
|
61
|
+
Nodes are typed where layout needs them and generic everywhere else, preserving the element verbatim. Content the engine does not model is carried rather than dropped, so a document full of unknown extensions still opens, edits, and saves.
|
|
72
62
|
|
|
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.
|
|
63
|
+
Export sessions default to `all-markup`, which shows inserted and deleted text. Use `displayMode: 'proposed'` for the accepted view or `displayMode: 'original'` for the rejected view.
|
|
75
64
|
|
|
76
65
|
### Build a paginated exporter
|
|
77
66
|
|
|
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.
|
|
67
|
+
For exports that need accurate page breaks, use `openFontBackedDocumentForExport`. It resolves the fonts used throughout the document before layout. Without a measurer, `openDocumentForExport(bytes)` uses a fixed-width approximation.
|
|
81
68
|
|
|
82
69
|
```ts
|
|
83
70
|
import { readFile } from 'node:fs/promises';
|
|
@@ -102,25 +89,17 @@ try {
|
|
|
102
89
|
}
|
|
103
90
|
```
|
|
104
91
|
|
|
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.
|
|
92
|
+
Let Core manage fonts, resources, and layout. Build your output from the returned pages. For a live `HeadlessDocumentView`, pass the editor's revision-stable measurer.
|
|
107
93
|
|
|
108
94
|
## Fidelity
|
|
109
95
|
|
|
110
|
-
Untouched content, unsupported OOXML, and package payloads survive editing and save. The
|
|
111
|
-
canonical tree preserves document structure while embedded fonts, macros, media, and other
|
|
112
|
-
payloads pass through untouched. Two oracles gate this in CI: a canonical fingerprint over the
|
|
113
|
-
tree, and a save-and-reopen semantic digest.
|
|
96
|
+
Untouched content, unsupported OOXML, and package payloads survive editing and save. The canonical tree preserves document structure while embedded fonts, macros, media, and other payloads pass through untouched. Two oracles gate this in CI: a canonical fingerprint over the tree, and a save-and-reopen semantic digest.
|
|
114
97
|
|
|
115
98
|
## Untrusted input
|
|
116
99
|
|
|
117
|
-
A `.docx` is a zip of XML that whoever sent it controls end to end. The engine sanitizes at the
|
|
118
|
-
parse boundary: URL allowlisting, entity and zip-bomb limits, recursion and element caps, no
|
|
119
|
-
zero-click external fetches, escaping on the way back out.
|
|
100
|
+
A `.docx` is a zip of XML that whoever sent it controls end to end. The engine sanitizes at the parse boundary: URL allowlisting, entity and zip-bomb limits, recursion and element caps, no zero-click external fetches, escaping on the way back out.
|
|
120
101
|
|
|
121
|
-
Anything you render from document data (a font name, a hyperlink target, a comment body) is
|
|
122
|
-
still attacker-controlled at your boundary. Render it as text; do not build markup or URLs
|
|
123
|
-
from it.
|
|
102
|
+
Anything you render from document data (a font name, a hyperlink target, a comment body) is still attacker-controlled at your boundary. Render it as text; do not build markup or URLs from it.
|
|
124
103
|
|
|
125
104
|
## Documentation
|
|
126
105
|
|
package/dist/automation.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkAFG7Q622_cjs=require('./chunk-AFG7Q622.cjs');require('./chunk-TE43S3LX.cjs'),require('./chunk-BNZF6DYC.cjs'),require('./chunk-PYXMAUNR.cjs'),require('./chunk-FGBADUSK.cjs');var chunkITNK6C5M_cjs=require('./chunk-ITNK6C5M.cjs'),chunk4EHMMSFR_cjs=require('./chunk-4EHMMSFR.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs');var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m=chunkMXOO7KRI_cjs.ec(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new chunkITNK6C5M_cjs.O(m.package,chunkITNK6C5M_cjs.Za(m.package,chunkMXOO7KRI_cjs.Lb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(chunkITNK6C5M_cjs.ab(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=chunkAFG7Q622_cjs.e(u.currentPackage()).story(f);return s?chunkAFG7Q622_cjs.b(i,s.part,a,d):null};}let r=chunkAFG7Q622_cjs.k({port:n,capabilities:j});return y&&(c=y.attach(chunk4EHMMSFR_cjs.b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?chunkMXOO7KRI_cjs.Ca(o,()=>{let u=chunkMXOO7KRI_cjs.zf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?chunkMXOO7KRI_cjs.b.mutationAgent:chunkMXOO7KRI_cjs.b.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>chunk4EHMMSFR_cjs.a(s,f,l));},y());return a.ok?c({ok:true,changed:a.change!==null}):{ok:false,reason:a.detail?`${a.reason}: ${a.detail}`:a.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>chunkITNK6C5M_cjs.$(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>chunkITNK6C5M_cjs.Z(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>chunkITNK6C5M_cjs._(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=chunkMXOO7KRI_cjs.Nb(t?.identity.actorId,()=>chunkITNK6C5M_cjs.ha(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?chunkMXOO7KRI_cjs.fc(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.g}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.f}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.h}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.d}});Object.defineProperty(exports,"createAutomationPaginationProvider",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.c}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.j}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.i}});Object.defineProperty(exports,"paginationSnapshotOf",{enumerable:true,get:function(){return chunkAFG7Q622_cjs.a}});exports.SERVER_AUTOMATION_CAPABILITIES=j;exports.createServerAutomationHost=Y;
|
package/dist/automation.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
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, N as NoteKind } from './tree-package-fragment-
|
|
4
|
-
import { T as TextMeasurer, S as SemanticLayout } from './semantic-records-
|
|
5
|
-
import { H as HeadlessDocumentView } from './headless-document-view-
|
|
6
|
-
import {
|
|
1
|
+
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-Co_r0SZQ.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-Co_r0SZQ.js';
|
|
3
|
+
import { H as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-CwJDixNs.js';
|
|
4
|
+
import { T as TextMeasurer, S as SemanticLayout } from './semantic-records-CqD0b5Ex.js';
|
|
5
|
+
import { H as HeadlessDocumentView } from './headless-document-view-B7nAiR7P.js';
|
|
6
|
+
import { X as OoxmlPackageLimits, Y as OoxmlPackageRejection } from './types-barrel-DLB11iSY.js';
|
|
7
|
+
export { Z as RevisionBatchEntry, _ as RevisionBatchResult, $ as RevisionBatchSkipReason } from './types-barrel-DLB11iSY.js';
|
|
7
8
|
import { CollaborationModuleContribution } from './collaboration.js';
|
|
8
|
-
import './
|
|
9
|
-
import './
|
|
10
|
-
import './
|
|
9
|
+
import './image-resources-C4ilLzog.js';
|
|
10
|
+
import './revision-projection-DEIvpxiq.js';
|
|
11
|
+
import './omml-equation-CbnW9yXd.js';
|
|
12
|
+
import './editor-scope-OHPwVQ5l.js';
|
|
11
13
|
import './collaboration/replication.js';
|
|
12
14
|
import './failure-DNNmwsgD.js';
|
|
13
15
|
|
package/dist/automation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {k,e,b as b$1}from'./chunk-
|
|
1
|
+
import {k,e,b as b$1}from'./chunk-GIHKVXEO.js';export{g as AUTOMATION_COMMAND_OPERATIONS,f as AUTOMATION_QUERY_OPERATIONS,h as AUTOMATION_SOLITARY_OPERATIONS,d as HEADER_FOOTER_VARIANTS,c as createAutomationPaginationProvider,j as isAutomationCommand,i as isSolitaryAutomationCommand,a as paginationSnapshotOf}from'./chunk-GIHKVXEO.js';import'./chunk-MP3K4LC5.js';import'./chunk-XS4FOHH6.js';import'./chunk-BDAY2ETZ.js';import'./chunk-VP7SDFCM.js';import {O,Za,ab,ha,$,Z,_}from'./chunk-WZX4UGRQ.js';import {b,a}from'./chunk-Q2B6HX3R.js';import {ec,Lb,fc,Nb,Ca,zf,b as b$2}from'./chunk-NG6IQ4SI.js';var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m=ec(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new O(m.package,Za(m.package,Lb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e$1=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e$1(ab(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=e(u.currentPackage()).story(f);return s?b$1(i,s.part,a,d):null};}let r=k({port:n,capabilities:j});return y&&(c=y.attach(b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?Ca(o,()=>{let u=zf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?b$2.mutationAgent:b$2.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>Nb(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a$1=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>a(s,f,l));},y());return a$1.ok?c({ok:true,changed:a$1.change!==null}):{ok:false,reason:a$1.detail?`${a$1.reason}: ${a$1.detail}`:a$1.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=Nb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=Nb(t?.identity.actorId,()=>$(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=Nb(t?.identity.actorId,()=>Z(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=Nb(t?.identity.actorId,()=>_(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=Nb(t?.identity.actorId,()=>ha(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?fc(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}export{j as SERVER_AUTOMATION_CAPABILITIES,Y as createServerAutomationHost};
|
package/dist/binding.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkB4KZSKF7_cjs=require('./chunk-B4KZSKF7.cjs');require('./chunk-Z2ETEZRU.cjs'),require('./chunk-PYXMAUNR.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-ITNK6C5M.cjs'),require('./chunk-4EHMMSFR.cjs'),require('./chunk-MXOO7KRI.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkB4KZSKF7_cjs.e}});
|
package/dist/binding.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { Node, Schema } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
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 { a0 as OoxmlProperty, Y as OoxmlPackageRejection } from './types-barrel-DLB11iSY.js';
|
|
3
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-D9RRWE0C.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-D9RRWE0C.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-CwJDixNs.js';
|
|
7
7
|
import { EditorView } from 'prosemirror-view';
|
|
8
|
-
import './
|
|
9
|
-
import './
|
|
10
|
-
import './
|
|
11
|
-
import './
|
|
8
|
+
import './editor-scope-OHPwVQ5l.js';
|
|
9
|
+
import './image-resources-C4ilLzog.js';
|
|
10
|
+
import './custom-node-writes-05qS32px.js';
|
|
11
|
+
import './headless-document-view-B7nAiR7P.js';
|
|
12
12
|
import './collaboration/replication.js';
|
|
13
|
-
import './
|
|
13
|
+
import './revision-projection-DEIvpxiq.js';
|
|
14
14
|
import './collaboration.js';
|
|
15
15
|
import './failure-DNNmwsgD.js';
|
|
16
|
-
import './revision-projection-BIHO_qvw.js';
|
|
17
16
|
|
|
18
17
|
/** Attributes carried by a projected paragraph. */
|
|
19
18
|
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-Q5JPPUNR.js';import'./chunk-X5QNSISI.js';import'./chunk-BDAY2ETZ.js';import'./chunk-VP7SDFCM.js';import'./chunk-WZX4UGRQ.js';import'./chunk-Q2B6HX3R.js';import'./chunk-NG6IQ4SI.js';
|