@docx-editor.dev/core 2.27.0 → 2.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +76 -16
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +31 -12
- package/dist/binding.js +1 -1
- package/dist/{index-CkQVRJtJ.d.ts → chrome-print-CAs51cpq.d.ts} +248 -115
- package/dist/chunk-236O4YQW.js +2 -0
- package/dist/chunk-4HENIAFG.js +1 -0
- package/dist/chunk-6JPL6ZAS.cjs +5 -0
- package/dist/chunk-6ZQP4HQ7.js +3 -0
- package/dist/{chunk-2GK7YQB2.cjs → chunk-7WQ7AAHW.cjs} +1 -1
- package/dist/chunk-BCXH4BXB.js +5 -0
- package/dist/chunk-BY2ACZZ6.cjs +1 -0
- package/dist/chunk-CAJEXXVG.cjs +4 -0
- package/dist/chunk-CPWLFPWC.js +30 -0
- package/dist/chunk-D7ZMDMPX.cjs +3 -0
- package/dist/chunk-DOHF6FA7.cjs +30 -0
- package/dist/chunk-DVX32P2P.js +27 -0
- package/dist/chunk-E4LOMDNL.js +1 -0
- package/dist/chunk-EKLM7NWB.cjs +7 -0
- package/dist/chunk-G3K63G7P.cjs +27 -0
- package/dist/chunk-G4HOFIKJ.js +1 -0
- package/dist/chunk-JLVBDYVQ.cjs +2 -0
- package/dist/chunk-LQX36Z5P.js +7 -0
- package/dist/chunk-LSZ6KPKK.js +1 -0
- package/dist/chunk-MM5QBMTE.cjs +1 -0
- package/dist/chunk-OMCG63ZF.js +1 -0
- package/dist/chunk-OSFOJTHU.cjs +18 -0
- package/dist/chunk-RCLZXP3B.js +2 -0
- package/dist/chunk-T6K2QYNZ.cjs +2 -0
- package/dist/chunk-TRGAVV2Y.js +4 -0
- package/dist/chunk-U4JZVSOE.js +2 -0
- package/dist/chunk-UHHYFIDT.cjs +1 -0
- package/dist/chunk-V3N4SOAK.cjs +1 -0
- package/dist/chunk-W35WTWAO.cjs +1 -0
- package/dist/chunk-YQ5G6LC7.js +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +42 -6
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +99 -7
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +18 -3
- package/dist/contracts/editor.d.ts +19 -10
- package/dist/contracts/interaction.d.ts +31 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +56 -8
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +11 -2
- package/dist/{custom-node-writes-Vzpq9I8_.d.ts → custom-node-writes-Bn6uciLb.d.ts} +2 -2
- package/dist/diagnostic-context-B8M79cfK.d.ts +30 -0
- package/dist/diagnostic-hints-BeVjfNOv.d.ts +113 -0
- package/dist/{document-protection-9zpIHWTE.d.ts → document-protection-CUb55pl_.d.ts} +2 -2
- package/dist/{editor-B3OBYNrF.d.ts → editor-CZQZmTIU.d.ts} +770 -141
- package/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +5 -5
- package/dist/editor.d.ts +439 -33
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +23 -14
- package/dist/export.js +2 -2
- package/dist/failure-NS2lsya4.d.ts +115 -0
- package/dist/{font-resolver-DN0xNOf_.d.ts → font-resolver-lSBLirLR.d.ts} +3 -3
- package/dist/{headless-document-view-ICYqNkQ1.d.ts → headless-document-view-pp3q7wIh.d.ts} +2 -2
- package/dist/{image-resources-BDFxcu7W.d.ts → image-resources-tXLQShoC.d.ts} +10 -10
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +92 -20
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BvZD_VKP.d.ts → layout-shaping-BD-dF_rn.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +168 -79
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CkAk7g-n.d.ts → note-properties-qQUjO1GQ.d.ts} +3 -3
- package/dist/{omml-equation-DuczgG5o.d.ts → omml-equation-BUbU0utM.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +18 -9
- package/dist/output.js +1 -1
- package/dist/{protocol-aKYr8r3u.d.ts → protocol-DYzzz2ej.d.ts} +44 -4
- package/dist/{review-paragraph-order-Ddj5d6rp.d.ts → review-paragraph-order-CN_0l2Cb.d.ts} +5 -2
- package/dist/{semantic-cell-selection-DoqYCz_F.d.ts → semantic-cell-selection-eYag3P47.d.ts} +8 -213
- package/dist/{semantic-interaction-G0bjmmmk.d.ts → semantic-interaction-kR_QB845.d.ts} +25 -34
- package/dist/{semantic-paint-CsMzF8-O.d.ts → semantic-paint-ZayFF3tD.d.ts} +17 -5
- package/dist/{semantic-record-queries-1du6lQqS.d.ts → semantic-record-queries-Bsgth6lv.d.ts} +1 -1
- package/dist/{semantic-records-B9OolWGN.d.ts → semantic-records-DQmumPgL.d.ts} +1367 -884
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +1611 -1586
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-DYZIk1rY.d.ts → tree-package-store-CovjNARF.d.ts} +157 -137
- package/dist/{tree-session-contract-DQVJOOkv.d.ts → tree-session-contract-CZVAGl51.d.ts} +8 -6
- package/dist/{types-barrel-BFKR8Pzp.d.ts → types-barrel-DuC5QBNC.d.ts} +352 -231
- package/package.json +3 -3
- package/dist/chunk-4KZ6L5YF.cjs +0 -15
- package/dist/chunk-55AT3MOU.cjs +0 -25
- package/dist/chunk-6ZQMII6V.js +0 -1
- package/dist/chunk-7IGCWG4H.js +0 -2
- package/dist/chunk-7MYITTAH.js +0 -5
- package/dist/chunk-AVKVRU7Z.cjs +0 -5
- package/dist/chunk-CWRBFNK5.cjs +0 -5
- package/dist/chunk-DGPA3TST.cjs +0 -27
- package/dist/chunk-DNXVNQEO.js +0 -1
- package/dist/chunk-FQN4KSFL.cjs +0 -7
- package/dist/chunk-GVUOWHTO.cjs +0 -1
- package/dist/chunk-GWQJ5774.js +0 -5
- package/dist/chunk-HAQ72KD7.js +0 -1
- package/dist/chunk-HO5XFO32.cjs +0 -3
- package/dist/chunk-IGR23DV2.js +0 -1
- package/dist/chunk-JSIX2EOH.js +0 -3
- package/dist/chunk-K246T47S.cjs +0 -1
- package/dist/chunk-KAXOGCGA.js +0 -1
- package/dist/chunk-LZLTN5A3.cjs +0 -1
- package/dist/chunk-NBCVVZOM.cjs +0 -1
- package/dist/chunk-O5INAWZQ.js +0 -1
- package/dist/chunk-OHAXVTWG.cjs +0 -1
- package/dist/chunk-S74GRBNE.js +0 -7
- package/dist/chunk-UBLUVNZR.js +0 -27
- package/dist/chunk-UMRSBLO7.js +0 -15
- package/dist/chunk-VIPMGGUT.js +0 -25
- package/dist/chunk-WG4KMSX2.cjs +0 -2
- package/dist/chunk-WRLKVNNR.cjs +0 -1
- package/dist/chunk-ZU7IVN6G.js +0 -2
- package/dist/failure-BIPVQbRm.d.ts +0 -65
- package/dist/revision-projection-CSNFudZY.d.ts +0 -242
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkUHHYFIDT_cjs=require('../chunk-UHHYFIDT.cjs'),chunkOSFOJTHU_cjs=require('../chunk-OSFOJTHU.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkUHHYFIDT_cjs.b}});Object.defineProperty(exports,"mapOffsetAcrossText",{enumerable:true,get:function(){return chunkUHHYFIDT_cjs.c}});Object.defineProperty(exports,"historyGroupOfJournal",{enumerable:true,get:function(){return chunkOSFOJTHU_cjs.Ja}});Object.defineProperty(exports,"registerUndoHistoryPosition",{enumerable:true,get:function(){return chunkOSFOJTHU_cjs.jl}});Object.defineProperty(exports,"reportHistoryGroup",{enumerable:true,get:function(){return chunkOSFOJTHU_cjs.il}});
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/collaboration/replication` — the seam a replication implementation
|
|
3
|
+
* binds to, not the surface a host consumes.
|
|
4
|
+
*
|
|
5
|
+
* Everything here exists for the layer BETWEEN a CRDT and the canonical tree: the document
|
|
6
|
+
* port an adapter writes through, the primitive journal it reads, and the descriptors that
|
|
7
|
+
* journal is made of. A host that renders presence and reads a status needs none of it, which
|
|
8
|
+
* is why it lives behind its own subpath — autocomplete on
|
|
9
|
+
* `@docx-editor.dev/core/collaboration` should not offer `putXmlPart` and `spliceChildren` to
|
|
10
|
+
* somebody wiring up an avatar stack.
|
|
11
|
+
*
|
|
12
|
+
* Reach for this when you are writing a provider. `@docx-editor.dev/pro` is one.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
import { d as HistoryGroup, T as TreePackageStore, e as TreeModelChange } from '../tree-package-store-CovjNARF.js';
|
|
18
|
+
export { r as reportHistoryGroup } from '../tree-package-store-CovjNARF.js';
|
|
19
|
+
import { ak as OoxmlElement, Q as OoxmlPackage } from '../types-barrel-DuC5QBNC.js';
|
|
20
|
+
import '../image-resources-tXLQShoC.js';
|
|
21
|
+
import '../editor-scope-7o9xweiJ.js';
|
|
6
22
|
|
|
7
23
|
/** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
|
|
8
24
|
interface CanonicalAttributeName {
|
|
@@ -119,6 +135,21 @@ interface CreateCollaborationDocumentPortOptions {
|
|
|
119
135
|
/** Create the narrow collaboration view over one canonical package store. @public */
|
|
120
136
|
declare function createCollaborationDocumentPort(store: TreePackageStore, options: CreateCollaborationDocumentPortOptions): CollaborationDocumentPort;
|
|
121
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Offsets carried across changes to a paragraph's text, for the local caret and the carets
|
|
140
|
+
* peers show.
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* An offset carried across one change to a paragraph's text.
|
|
144
|
+
*
|
|
145
|
+
* The local caret and the carets peers show both stay next to the same character this way,
|
|
146
|
+
* whatever a peer typed or deleted around it, even when one remote update changed text on
|
|
147
|
+
* both sides of the offset.
|
|
148
|
+
*
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
declare function mapOffsetAcrossText(offset: number, before: string, after: string): number;
|
|
152
|
+
|
|
122
153
|
/** An editor-local view action must stay between the same document undo entries. */
|
|
123
154
|
interface UndoHistoryPosition {
|
|
124
155
|
current(): object | null;
|
|
@@ -185,6 +216,11 @@ interface CollaborationDocumentPort {
|
|
|
185
216
|
readonly documentId: string;
|
|
186
217
|
paragraphs(): readonly CollaborationParagraph[];
|
|
187
218
|
paragraphByNodeId(nodeId: string): CollaborationParagraph | null;
|
|
219
|
+
/**
|
|
220
|
+
* The model text of the paragraph with this node id in any story, or null when the editor
|
|
221
|
+
* shows none. A lookup by node id, whatever the paragraph's `w14:paraId`. Optional.
|
|
222
|
+
*/
|
|
223
|
+
paragraphTextOf?(nodeId: string): string | null;
|
|
188
224
|
/**
|
|
189
225
|
* Resolve a stable `w14:paraId` in any story this replica holds.
|
|
190
226
|
*
|
|
@@ -230,5 +266,5 @@ interface CollaborationDocumentPort {
|
|
|
230
266
|
binaryPart(storageKey: string): Uint8Array | null;
|
|
231
267
|
}
|
|
232
268
|
|
|
233
|
-
export { HistoryGroup, createCollaborationDocumentPort, historyGroupOfJournal, registerUndoHistoryPosition };
|
|
269
|
+
export { HistoryGroup, createCollaborationDocumentPort, historyGroupOfJournal, mapOffsetAcrossText, registerUndoHistoryPosition };
|
|
234
270
|
export type { CanonicalAttributeName, CanonicalBinaryDescriptor, CanonicalElementNodeDescriptor, CanonicalNodeDescriptor, CanonicalPrimitiveEffect, CanonicalPrimitiveJournal, CanonicalRelationshipRecord, CanonicalTextNodeDescriptor, CollaborationApplyResult, CollaborationDocumentPort, CollaborationMutation, CollaborationParagraph, CollaborationParagraphTextUpdate, CreateCollaborationDocumentPortOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as createCollaborationDocumentPort}from'../chunk-
|
|
1
|
+
export{b as createCollaborationDocumentPort,c as mapOffsetAcrossText}from'../chunk-OMCG63ZF.js';export{Ja as historyGroupOfJournal,jl as registerUndoHistoryPosition,il as reportHistoryGroup}from'../chunk-YQ5G6LC7.js';
|
package/dist/collaboration.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs');var
|
|
1
|
+
'use strict';var chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs');var C={"already-initialized":true,"authentication-failed":true,"baseline-digest-mismatch":true,"baseline-too-large":true,"blob-digest-mismatch":true,"blob-read":true,"blob-store-full":true,"blob-too-large":true,"collaboration-format-mismatch":true,"collaboration-session-destroyed":true,"collaboration-session-not-attached":true,"collaboration-session-not-ready":true,"collaboration-text-limit":true,"concurrent-seed":true,"document-id-mismatch":true,"duplicate-paragraph-id":true,"experimental-collaboration-body-text-only":true,"experimental-collaboration-existing-paragraphs-only":true,"experimental-collaboration-text-only":true,"experimental-collaboration-untracked-text-only":true,"immutable-baseline-changed":true,"immutable-metadata-changed":true,"initialization-aborted":true,"initialization-timeout":true,"invalid-baseline":true,"invalid-blob-descriptor":true,"invalid-bound":true,"invalid-document-id":true,"invalid-identity":true,"invalid-identity-color":true,"invalid-logical-id":true,"invalid-relationships":true,"invalid-saved-room":true,"invalid-session-id":true,"invalid-shared-metadata":true,"invalid-string":true,"local-mirror-failed":true,"materialize-dropped-content":true,"missing-blob":true,"missing-local-blob":true,"missing-root":true,"no-main-document-part":true,"not-initialized":true,"paragraph-set-mismatch":true,"port-already-attached":true,"protocol-version-mismatch":true,"prototype-key":true,"remote-apply-failed":true,"room-generation-changed":true,"saved-room-unavailable":true,"schema-version-mismatch":true,"shared-schema-invalid":true,"text-too-long":true,"too-many-attributes":true,"too-many-children":true,"too-many-nodes":true,"too-many-parts":true,"too-many-relationships":true,transport:true,"transport-disconnected":true,"tree-too-deep":true,"unknown-logical-id":true,"unknown-paragraph-id":true,"unsafe-part-name":true,"unsupported-root-key":true};function g(e){return Object.hasOwn(C,e)}function f(e,o){return e===o?true:!e||!o?false:e.code===o.code&&e.detail===o.detail}function h(e,o){return Object.freeze(o!==void 0&&o.length>0?{code:e,detail:o}:{code:e})}function S(e="initializing"){let o=e,a,l,s=0,r=false,i=false,d=Object.freeze({status:o,reason:a,lastFailure:l,failureCount:s,recovering:r,waiting:i}),u=()=>{d=Object.freeze({status:o,reason:a,lastFailure:l,failureCount:s,recovering:r,waiting:i});};return {status:()=>o,snapshot:()=>d,set(t,c,p,m=false){let n=c===void 0?void 0:h(c,p),b=t==="error"&&m;return o===t&&f(a,n)&&r===b?false:(o=t,a=n,r=b,t==="error"&&n&&(l=n,s+=1),u(),true)},setWaiting(t){return i===t?false:(i=t,u(),true)}}}Object.defineProperty(exports,"safeParticipantColor",{enumerable:true,get:function(){return chunkBTQKU64Q_cjs.a}});exports.createCollaborationStatusTracker=S;exports.isCollaborationFailureCode=g;
|
package/dist/collaboration.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/collaboration` — provider-neutral collaboration contracts.
|
|
3
|
+
*
|
|
4
|
+
* This lane names the attachment between the canonical tree and an optional replication
|
|
5
|
+
* implementation. It performs no networking and imports no CRDT.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
import { S as StoryScope } from './tree-package-store-CovjNARF.js';
|
|
11
|
+
import { ag as TreeDocOp } from './types-barrel-DuC5QBNC.js';
|
|
3
12
|
import { CollaborationDocumentPort } from './collaboration/replication.js';
|
|
4
|
-
import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-
|
|
5
|
-
export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-
|
|
6
|
-
import './image-resources-
|
|
7
|
-
import './editor-scope-
|
|
13
|
+
import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-NS2lsya4.js';
|
|
14
|
+
export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-NS2lsya4.js';
|
|
15
|
+
import './image-resources-tXLQShoC.js';
|
|
16
|
+
import './editor-scope-7o9xweiJ.js';
|
|
8
17
|
|
|
9
18
|
/**
|
|
10
19
|
* A peer's presence color is attacker-controlled: it arrives over awareness from whoever is in
|
|
@@ -36,13 +45,18 @@ declare function safeParticipantColor(value: string | undefined): string | undef
|
|
|
36
45
|
|
|
37
46
|
/** Human or automation identity attached to authored collaboration transactions. @public */
|
|
38
47
|
interface CollaborationIdentity {
|
|
48
|
+
/** Stable author id, 1 to 256 characters after trimming. Recorded on authored changes. */
|
|
39
49
|
readonly actorId: string;
|
|
50
|
+
/** Display name, 1 to 256 characters after trimming. */
|
|
40
51
|
readonly name: string;
|
|
52
|
+
/** Presence color, at most 64 characters. An unsafe CSS color falls back to the accent. */
|
|
41
53
|
readonly color?: string;
|
|
54
|
+
/** `agent` for automation. Defaults to `human`. */
|
|
42
55
|
readonly role?: 'human' | 'agent';
|
|
43
56
|
}
|
|
44
57
|
/** One validated identity visible through ephemeral collaboration presence. @public */
|
|
45
58
|
interface CollaborationParticipant extends CollaborationIdentity {
|
|
59
|
+
/** True for this replica's own participant. */
|
|
46
60
|
readonly isLocal: boolean;
|
|
47
61
|
}
|
|
48
62
|
/**
|
|
@@ -54,7 +68,9 @@ interface CollaborationParticipant extends CollaborationIdentity {
|
|
|
54
68
|
* @public
|
|
55
69
|
*/
|
|
56
70
|
interface CollaborationSelectionAddress {
|
|
71
|
+
/** The stable `w14:paraId` of the paragraph. */
|
|
57
72
|
readonly paragraphId: string;
|
|
73
|
+
/** A UTF-16 offset in the paragraph's text. */
|
|
58
74
|
readonly offset: number;
|
|
59
75
|
}
|
|
60
76
|
/**
|
|
@@ -75,8 +91,11 @@ type CollaborationSelectionKind = 'cells';
|
|
|
75
91
|
* @public
|
|
76
92
|
*/
|
|
77
93
|
interface CollaborationRemoteSelectionAddress {
|
|
94
|
+
/** The stable `w14:paraId` of the paragraph. */
|
|
78
95
|
readonly paragraphId: string;
|
|
96
|
+
/** The paragraph's node id in this replica's editor tree. */
|
|
79
97
|
readonly nodeId: string;
|
|
98
|
+
/** A UTF-16 offset in the paragraph's text. */
|
|
80
99
|
readonly offset: number;
|
|
81
100
|
}
|
|
82
101
|
/**
|
|
@@ -87,11 +106,17 @@ interface CollaborationRemoteSelectionAddress {
|
|
|
87
106
|
* @public
|
|
88
107
|
*/
|
|
89
108
|
interface CollaborationRemoteSelection {
|
|
109
|
+
/** The participant's `actorId`. */
|
|
90
110
|
readonly actorId: string;
|
|
111
|
+
/** The participant's display name. */
|
|
91
112
|
readonly name: string;
|
|
113
|
+
/** The participant's presence color, when it published a safe one. */
|
|
92
114
|
readonly color?: string;
|
|
115
|
+
/** Where the selection starts. */
|
|
93
116
|
readonly anchor: CollaborationRemoteSelectionAddress;
|
|
117
|
+
/** Where the selection ends: the remote caret. */
|
|
94
118
|
readonly head: CollaborationRemoteSelectionAddress;
|
|
119
|
+
/** `cells` for a table cell rectangle; absent for a character range. */
|
|
95
120
|
readonly kind?: CollaborationSelectionKind;
|
|
96
121
|
}
|
|
97
122
|
/**
|
|
@@ -102,10 +127,42 @@ interface CollaborationRemoteSelection {
|
|
|
102
127
|
* @public
|
|
103
128
|
*/
|
|
104
129
|
interface CollaborationLocalSelection {
|
|
130
|
+
/** Where the selection starts. */
|
|
105
131
|
readonly anchor: CollaborationSelectionAddress;
|
|
132
|
+
/** Where the selection ends: the caret. */
|
|
106
133
|
readonly head: CollaborationSelectionAddress;
|
|
134
|
+
/** `cells` for a table cell rectangle; absent for a character range. */
|
|
107
135
|
readonly kind?: CollaborationSelectionKind;
|
|
108
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Where a collaboration session carried the local selection across the last remote change.
|
|
139
|
+
*
|
|
140
|
+
* The editor uses `to` only while its selection still equals `from`: a selection the user
|
|
141
|
+
* moved since is the user's. @public
|
|
142
|
+
*/
|
|
143
|
+
interface CollaborationSelectionMove {
|
|
144
|
+
/** The selection the session carried, as the editor last published it. */
|
|
145
|
+
readonly from: CollaborationEditorSelection;
|
|
146
|
+
/** Where it stands now: beside the same characters, wherever they show. */
|
|
147
|
+
readonly to: CollaborationEditorSelection;
|
|
148
|
+
}
|
|
149
|
+
/** A selection in this replica's editor. @public */
|
|
150
|
+
interface CollaborationEditorSelection {
|
|
151
|
+
/** Where the selection starts: it stays put when the selection extends. */
|
|
152
|
+
readonly anchor: CollaborationEditorPosition;
|
|
153
|
+
/** Where the selection ends: the caret. */
|
|
154
|
+
readonly head: CollaborationEditorPosition;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* A position in this replica's editor tree. Unlike a stable paragraph id, which a remote
|
|
158
|
+
* change can rename on one replica, a node id names one paragraph of this editor. @public
|
|
159
|
+
*/
|
|
160
|
+
interface CollaborationEditorPosition {
|
|
161
|
+
/** The node id of the paragraph in this replica's editor tree. */
|
|
162
|
+
readonly nodeId: string;
|
|
163
|
+
/** A UTF-16 offset in the paragraph's text. */
|
|
164
|
+
readonly offset: number;
|
|
165
|
+
}
|
|
109
166
|
/**
|
|
110
167
|
* Optional replication session attached to an editor or headless automation host.
|
|
111
168
|
*
|
|
@@ -115,10 +172,13 @@ interface CollaborationLocalSelection {
|
|
|
115
172
|
* @public
|
|
116
173
|
*/
|
|
117
174
|
interface EditorCollaborationSession {
|
|
175
|
+
/** The room's document id. An attached port must carry the same id. */
|
|
118
176
|
readonly documentId: string;
|
|
119
177
|
/** Unique identity for this attachment lifetime. It prevents operation ID reuse after reconnect. */
|
|
120
178
|
readonly sessionId: string;
|
|
179
|
+
/** The validated local identity. */
|
|
121
180
|
readonly identity: CollaborationIdentity;
|
|
181
|
+
/** Current lifecycle state. */
|
|
122
182
|
status(): CollaborationStatus;
|
|
123
183
|
/**
|
|
124
184
|
* Cached status, current reason, and last failure.
|
|
@@ -127,7 +187,12 @@ interface EditorCollaborationSession {
|
|
|
127
187
|
* recovered error still reads {@link CollaborationStatusSnapshot.lastFailure}.
|
|
128
188
|
*/
|
|
129
189
|
statusSnapshot(): CollaborationStatusSnapshot;
|
|
190
|
+
/** Call `listener` on each status or reason change. Returns the unsubscribe function. */
|
|
130
191
|
subscribeStatus(listener: (status: CollaborationStatus, reason?: CollaborationFailureCode, detail?: string) => void): () => void;
|
|
192
|
+
/**
|
|
193
|
+
* Attach the editor's document port and start replicating. Returns the detach function.
|
|
194
|
+
* A second, different port moves the session to `error` with `port-already-attached`.
|
|
195
|
+
*/
|
|
131
196
|
attach(port: CollaborationDocumentPort): () => void;
|
|
132
197
|
/**
|
|
133
198
|
* Whether an editor has attached its document port to this replica.
|
|
@@ -138,15 +203,41 @@ interface EditorCollaborationSession {
|
|
|
138
203
|
* production build discards; this is the same fact as a value a host can render.
|
|
139
204
|
*/
|
|
140
205
|
readonly attached: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Check whether `ops` may commit now. Returns `null` to admit them, or the refusal code.
|
|
208
|
+
* Call it before every store transaction a custom port commits.
|
|
209
|
+
*/
|
|
141
210
|
gateOperations(ops: readonly TreeDocOp[], scope: StoryScope): CollaborationFailureCode | null;
|
|
211
|
+
/** Whether the shared undo history holds a local step to undo. */
|
|
142
212
|
canUndo(): boolean;
|
|
213
|
+
/** Whether the shared undo history holds a local step to redo. */
|
|
143
214
|
canRedo(): boolean;
|
|
215
|
+
/** Undo this participant's last step; others' edits stay. Returns false when refused. */
|
|
144
216
|
undo(): boolean;
|
|
217
|
+
/** Redo this participant's last undone step. Returns false when refused. */
|
|
145
218
|
redo(): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* The selection the last `undo` or `redo` restored: the one its author had before the
|
|
221
|
+
* undone change. Null when the step recorded none. Optional; a session without it leaves
|
|
222
|
+
* the editor to place the caret at the change.
|
|
223
|
+
*/
|
|
224
|
+
historySelection?(): CollaborationLocalSelection | null;
|
|
225
|
+
/**
|
|
226
|
+
* Where the last remote change carried the local selection, on the shared characters
|
|
227
|
+
* beside its endpoints, and the selection it was carried from, both in the editor's
|
|
228
|
+
* paragraph node ids. Null when the session could not carry it. Optional; without it the
|
|
229
|
+
* editor maps the selection by text.
|
|
230
|
+
*/
|
|
231
|
+
remoteSelectionMove?(): CollaborationSelectionMove | null;
|
|
232
|
+
/** Publish the local selection through presence. `null` clears it. */
|
|
146
233
|
setLocalSelection(selection: CollaborationLocalSelection | null): void;
|
|
234
|
+
/** Participants in presence, this replica included. Capped at 256. */
|
|
147
235
|
participants(): readonly CollaborationParticipant[];
|
|
236
|
+
/** Call `listener` when the participant list changes. Returns the unsubscribe function. */
|
|
148
237
|
subscribeParticipants(listener: (participants: readonly CollaborationParticipant[]) => void): () => void;
|
|
238
|
+
/** Other participants' selections, resolved into this replica's addresses. */
|
|
149
239
|
remoteSelections(): readonly CollaborationRemoteSelection[];
|
|
240
|
+
/** Call `listener` when a remote selection changes. Returns the unsubscribe function. */
|
|
150
241
|
subscribeRemoteSelections(listener: (selections: readonly CollaborationRemoteSelection[]) => void): () => void;
|
|
151
242
|
/**
|
|
152
243
|
* Publish queued local journals to shared state.
|
|
@@ -155,6 +246,7 @@ interface EditorCollaborationSession {
|
|
|
155
246
|
* so a queued journal is never dropped.
|
|
156
247
|
*/
|
|
157
248
|
flushPendingJournals(): void;
|
|
249
|
+
/** Stop replicating and release listeners. The status becomes `destroyed`. */
|
|
158
250
|
destroy(): void;
|
|
159
251
|
}
|
|
160
252
|
/**
|
|
@@ -174,4 +266,4 @@ interface CollaborationModuleContribution {
|
|
|
174
266
|
}
|
|
175
267
|
|
|
176
268
|
export { CollaborationFailureCode, CollaborationStatus, CollaborationStatusSnapshot, safeParticipantColor };
|
|
177
|
-
export type { CollaborationIdentity, CollaborationLocalSelection, CollaborationModuleContribution, CollaborationParticipant, CollaborationRemoteSelection, CollaborationRemoteSelectionAddress, CollaborationSelectionAddress, CollaborationSelectionKind, EditorCollaborationSession };
|
|
269
|
+
export type { CollaborationEditorPosition, CollaborationEditorSelection, CollaborationIdentity, CollaborationLocalSelection, CollaborationModuleContribution, CollaborationParticipant, CollaborationRemoteSelection, CollaborationRemoteSelectionAddress, CollaborationSelectionAddress, CollaborationSelectionKind, CollaborationSelectionMove, EditorCollaborationSession };
|
package/dist/collaboration.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as safeParticipantColor}from'./chunk-6JIJOZDW.js';var
|
|
1
|
+
export{a as safeParticipantColor}from'./chunk-6JIJOZDW.js';var C={"already-initialized":true,"authentication-failed":true,"baseline-digest-mismatch":true,"baseline-too-large":true,"blob-digest-mismatch":true,"blob-read":true,"blob-store-full":true,"blob-too-large":true,"collaboration-format-mismatch":true,"collaboration-session-destroyed":true,"collaboration-session-not-attached":true,"collaboration-session-not-ready":true,"collaboration-text-limit":true,"concurrent-seed":true,"document-id-mismatch":true,"duplicate-paragraph-id":true,"experimental-collaboration-body-text-only":true,"experimental-collaboration-existing-paragraphs-only":true,"experimental-collaboration-text-only":true,"experimental-collaboration-untracked-text-only":true,"immutable-baseline-changed":true,"immutable-metadata-changed":true,"initialization-aborted":true,"initialization-timeout":true,"invalid-baseline":true,"invalid-blob-descriptor":true,"invalid-bound":true,"invalid-document-id":true,"invalid-identity":true,"invalid-identity-color":true,"invalid-logical-id":true,"invalid-relationships":true,"invalid-saved-room":true,"invalid-session-id":true,"invalid-shared-metadata":true,"invalid-string":true,"local-mirror-failed":true,"materialize-dropped-content":true,"missing-blob":true,"missing-local-blob":true,"missing-root":true,"no-main-document-part":true,"not-initialized":true,"paragraph-set-mismatch":true,"port-already-attached":true,"protocol-version-mismatch":true,"prototype-key":true,"remote-apply-failed":true,"room-generation-changed":true,"saved-room-unavailable":true,"schema-version-mismatch":true,"shared-schema-invalid":true,"text-too-long":true,"too-many-attributes":true,"too-many-children":true,"too-many-nodes":true,"too-many-parts":true,"too-many-relationships":true,transport:true,"transport-disconnected":true,"tree-too-deep":true,"unknown-logical-id":true,"unknown-paragraph-id":true,"unsafe-part-name":true,"unsupported-root-key":true};function g(e){return Object.hasOwn(C,e)}function f(e,o){return e===o?true:!e||!o?false:e.code===o.code&&e.detail===o.detail}function h(e,o){return Object.freeze(o!==void 0&&o.length>0?{code:e,detail:o}:{code:e})}function S(e="initializing"){let o=e,a,l,s=0,r=false,i=false,d=Object.freeze({status:o,reason:a,lastFailure:l,failureCount:s,recovering:r,waiting:i}),u=()=>{d=Object.freeze({status:o,reason:a,lastFailure:l,failureCount:s,recovering:r,waiting:i});};return {status:()=>o,snapshot:()=>d,set(t,c,p,m=false){let n=c===void 0?void 0:h(c,p),b=t==="error"&&m;return o===t&&f(a,n)&&r===b?false:(o=t,a=n,r=b,t==="error"&&n&&(l=n,s+=1),u(),true)},setWaiting(t){return i===t?false:(i=t,u(),true)}}}export{S as createCollaborationStatusTracker,g as isCollaborationFailureCode};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/contracts/document` — the document-level edit and query vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The subset that means something without a live editor: what an automation host or an LLM tool
|
|
5
|
+
* can ask for and change.
|
|
6
|
+
*
|
|
7
|
+
* A CONTRACT module, not a barrel. `contracts/editor` builds the `Editor` command and query
|
|
8
|
+
* surfaces on top of these, so they cannot live in the package root: the root re-exports
|
|
9
|
+
* runtime from `../editor`, and a contract importing the root would invert the dependency —
|
|
10
|
+
* safe today only because that import is type-only, and one accidental value import away from
|
|
11
|
+
* pulling the painted engine into a server bundle.
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
import { D as DocxDocument, E as ExecResult, i as ContentControlType, j as DocTarget, k as RunFormatting, l as Extent, I as InsertableContentControlType, m as ContainerRef, n as ContentControlFilter, o as DocRange, p as Revision, q as DocComment, S as StyleDefinitions } from '../types-barrel-DuC5QBNC.js';
|
|
17
|
+
export { B as Block, r as ColorValue, s as ContentControl, t as DocAnchor, u as DocAnchorRange, v as DocLocation, w as DocumentBody, x as ExecErrorCode, H as HeaderFooterSet, y as IndentFormatting, P as Paragraph, z as ParagraphFlags, A as ParagraphTabStop, F as RevisionType, G as Section, J as SectionProperties, K as StyleDefinition, T as Table, L as Theme, M as ThemeColorScheme } from '../types-barrel-DuC5QBNC.js';
|
|
18
|
+
import '../editor-scope-7o9xweiJ.js';
|
|
4
19
|
|
|
5
20
|
/**
|
|
6
21
|
* `@docx-editor.dev/core/contracts/document` — the document-level edit and query vocabulary.
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/contracts/editor` — the `Editor` contract adapters are written against.
|
|
3
|
+
*
|
|
4
|
+
* Commands go through `can` before `exec`; queries answer against the live, laid-out document.
|
|
5
|
+
* Type-only declarations let adapters name the surface without importing the engine.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export { a as ReviewDisplayMode } from '../semantic-records-DQmumPgL.js';
|
|
11
|
+
export { A as AnchorHighlightAnimation, c as AnchorHighlightOptions, d as AuthoredNoteNumbering, C as CanResult, e as ClearAnchorHighlightOptions, f as CollaborationParticipantsDiagnostic, g as CollaborationStatusDiagnostic, h as CustomNodeDiagnosticEvent, D as DIAGNOSTIC_SCHEMA_VERSION, i as DiagnosticBase, j as DiagnosticFailureDetail, k as DocumentChange, l as DocumentEditingMode, m as DocumentHandle, n as DocumentOpenDiagnostic, o as DocumentShape, p as DocumentSource, q as EditRejectedDiagnostic, r as EditRejectionOrigin, s as Editor, t as EditorAnchorNavigation, b as EditorCommand, u as EditorCommandShape, v as EditorCommands, E as EditorDiagnostic, a as EditorDiagnosticKind, w as EditorError, x as EditorEvents, y as EditorFontError, z as EditorFontErrorCode, B as EditorFormatPainterCommands, F as EditorHeaderFooterCommands, G as EditorHighlights, H as EditorNoteCommands, I as EditorPosition, J as EditorQueries, K as EditorQuery, L as EditorQueryResults, M as EditorReviewHits, N as EditorSelection, O as EditorSnapshot, P as FontConfiguration, Q as FontFaceRequest, S as FontFailedDiagnostic, T as FontSource, U as FontSourceSubstitution, V as FormatPainterLevel, W as FormatPainterMode, X as FormatPainterSurfaceState, Y as FurnitureVariant, Z as HeaderFooterSlotArgs, _ as HeaderFooterState, $ as HighlightHit, a0 as HighlightOptions, a1 as HighlightRange, a2 as HighlightRect, a3 as HighlightResult, a4 as HistoryDiagnosticEvent, a5 as HyperlinkInfo, a6 as ImageContext, a7 as ImageCropPercent, a8 as NoteKind, a9 as NotePropertiesSide, aa as NotePropertiesState, ab as PageSetup, ac as PerformanceDiagnostic, ad as ResolveReviewChangesOptions, ae as ResolvedNoteNumbering, af as ReviewActivationOptions, ag as ReviewChangesAttribution, ah as ReviewCommentPlacement, ai as ReviewCustomPlacement, aj as ReviewItemHit, ak as ReviewItemPlacement, al as ReviewItemPlacementBase, am as ReviewItemQuery, an as ReviewItemRevealEvent, ao as ReviewItemRevealSource, ap as ReviewRevisionPlacement, aq as ReviewSkippedDiagnostic, ar as ScrollPlacement, as as ScrollToAnchorOptions, at as SelectedImageState, au as SetReviewChangesAuthorOptions, av as TableBorderEdgeTarget, aw as TableBorderSpec, ax as TableBorderStyle, ay as TableBorderTarget, az as TableCellVerticalAlignment, aA as TableColumnDividerResizeTarget, aB as TableColumnOccurrenceTarget, aC as TableContext, aD as TableRightEdgeResizeTarget, aE as TableRowOccurrenceTarget, aF as TextMatch, aG as TimingSummary, aH as TrackedChangeFilterMode, aI as TrackedChangePredicate, aJ as ZoomFitTarget, aK as ZoomMode } from '../editor-CZQZmTIU.js';
|
|
12
|
+
export { B as Block, r as ColorValue, C as CommentRecord, m as ContainerRef, s as ContentControl, n as ContentControlFilter, i as ContentControlType, t as DocAnchor, u as DocAnchorRange, q as DocComment, v as DocLocation, o as DocRange, j as DocTarget, w as DocumentBody, D as DocxDocument, W as DocxDocumentJSON, X as DrawingHorizontalReferenceFrame, Y as DrawingKind, Z as DrawingLocks, _ as DrawingPositionInput, $ as DrawingVerticalReferenceFrame, x as ExecErrorCode, E as ExecResult, l as Extent, a0 as FontDefinition, H as HeaderFooterSet, a1 as ImageWrapTarget, y as IndentFormatting, I as InsertableContentControlType, a2 as NumberingRef, a3 as PageMargins, P as Paragraph, a4 as ParagraphDisagreements, z as ParagraphFlags, a5 as ParagraphFormatCommand, A as ParagraphTabStop, a6 as Point, a7 as Rect, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, p as Revision, h as RevisionAddress, a8 as RevisionAuthorResult, a9 as RevisionBatchResult, F as RevisionType, aa as Run, k as RunFormatting, G as Section, J as SectionProperties, ab as SelectionPin, K as StyleDefinition, S as StyleDefinitions, T as Table, ac as TableCell, ad as TableRow, L as Theme, M as ThemeColorScheme, ae as Unsubscribe, af as Watermark } from '../types-barrel-DuC5QBNC.js';
|
|
4
13
|
export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.js';
|
|
5
|
-
export {
|
|
14
|
+
export { a as EditorExecOptions, E as EditorScope, H as HistoryDiagnostic, b as HistoryGroup, c as HistoryGroupOutcome, V as ViewScope } from '../editor-scope-7o9xweiJ.js';
|
|
6
15
|
export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './interaction.js';
|
|
7
|
-
export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-
|
|
8
|
-
export {
|
|
9
|
-
import '../document-protection-
|
|
10
|
-
import '../failure-
|
|
11
|
-
|
|
12
|
-
import '../omml-equation-
|
|
16
|
+
export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-kR_QB845.js';
|
|
17
|
+
export { I as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, a as VectorImageMime } from '../image-resources-tXLQShoC.js';
|
|
18
|
+
import '../document-protection-CUb55pl_.js';
|
|
19
|
+
import '../failure-NS2lsya4.js';
|
|
20
|
+
export { B as ByteSizeBucket, C as CollaborationDiagnosticCode, b as CountBucket, c as CustomNodeDiagnosticCode, d as DiagnosticCode, D as DiagnosticErrorName, e as DiagnosticExplanation, f as DocumentOpenDiagnosticCode, a as DocumentPartKind, E as EditDiagnosticCode, F as FailureStage, g as FontDiagnosticCode, h as FormattingChangeKind, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode, R as ReviewChangeKind, i as ReviewDiagnosticCode, j as ReviewOperation } from '../diagnostic-hints-BeVjfNOv.js';
|
|
21
|
+
import '../omml-equation-BUbU0utM.js';
|
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/contracts/interaction` — semantic addressing and interaction outcomes.
|
|
3
|
+
*
|
|
4
|
+
* Semantic identities and targets: the vocabulary a caller uses to say WHICH text it means,
|
|
5
|
+
* independent of layout, DOM or any editing engine's positions. Plus the outcome type an
|
|
6
|
+
* interaction attempt answers with. That is the whole module.
|
|
7
|
+
*
|
|
8
|
+
* It used to be 599 lines. An "interaction frame" lived here — a revision-tagged projection
|
|
9
|
+
* of display, page geometry, caret and selection overlays, focus, composition and
|
|
10
|
+
* accessibility, plus a typed pointer-intent dispatch protocol and a render IR of glyph
|
|
11
|
+
* runs — and every one of those declarations was consumed by exactly nothing. They
|
|
12
|
+
* described an architecture the engine does not use: the paginated surface owns pointer
|
|
13
|
+
* interaction internally and paints through `Editor.attach`, so no frame was ever published
|
|
14
|
+
* and no intent ever dispatched.
|
|
15
|
+
* THREE of them (`CaretGeometry`, `HitTestOptions`, `ShapedCluster`) also collided by name
|
|
16
|
+
* with the REAL, differently-shaped types in `layout/`, so the published contract carried a
|
|
17
|
+
* second definition of a live concept and `import { ShapedCluster }` meant different things
|
|
18
|
+
* depending on which module you reached for.
|
|
19
|
+
* `InteractionFrameId` and a frame-tagged `SemanticSelection` outlived that cut. Both were
|
|
20
|
+
* the same mistake: the id was a placeholder nothing ever minted (`focus` returned a literal
|
|
21
|
+
* `{ value: 0 }`), and the selection could not be CONSTRUCTED without one, which made it a
|
|
22
|
+
* fourth name-collision with the real `SemanticSelection` in `layout/` that a caller could
|
|
23
|
+
* never actually satisfy.
|
|
24
|
+
*
|
|
25
|
+
* CONTRACT ONLY — declarations, not an implementation.
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
import { V as ViewScope } from '../editor-scope-7o9xweiJ.js';
|
|
31
|
+
export { E as EditorScope } from '../editor-scope-7o9xweiJ.js';
|
|
3
32
|
|
|
4
33
|
/**
|
|
5
34
|
* `@docx-editor.dev/core/contracts/interaction` — semantic addressing and interaction outcomes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkV3N4SOAK_cjs=require('../chunk-V3N4SOAK.cjs');Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunkV3N4SOAK_cjs.a}});
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/contracts/modules` — the `EditorModule` seam.
|
|
3
|
+
*
|
|
4
|
+
* How a paid or optional capability contributes to the engine without the free tier importing
|
|
5
|
+
* it: the review module and custom nodes both arrive through here, and their absence leaves the
|
|
6
|
+
* corresponding chrome disabled with the engine's own reason.
|
|
7
|
+
*
|
|
8
|
+
* NOT a plugin system. The shape is closed: every contribution point is named
|
|
9
|
+
* here, core iterates registered modules at its existing dispatch points, and
|
|
10
|
+
* core never imports a capability package. A capability absent from this file
|
|
11
|
+
* is not extendable from outside — deliberately, so the one-pipeline principle
|
|
12
|
+
* survives the packaging boundary.
|
|
13
|
+
* The free engine behaves identically with an empty registry: documents
|
|
14
|
+
* round-trip losslessly, revisions render in their final-state projection, and
|
|
15
|
+
* the review chrome slots stay disabled with the engine's own reason.
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
import { R as RevisionMarkupDialogSession, a as ReviewDisplayMode } from '../semantic-records-DQmumPgL.js';
|
|
21
|
+
export { b as RevisionDisplayMode } from '../semantic-records-DQmumPgL.js';
|
|
22
|
+
import { R as ReviewPaneOptions, E as EditorDiagnostic, a as EditorDiagnosticKind } from '../editor-CZQZmTIU.js';
|
|
23
|
+
import { R as ReviewModelInput, a as ReviewItem, O as OoxmlPart, b as ReviewRevisionItem } from '../types-barrel-DuC5QBNC.js';
|
|
24
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind, h as RevisionAddress } from '../types-barrel-DuC5QBNC.js';
|
|
5
25
|
import { CollaborationModuleContribution } from '../collaboration.js';
|
|
6
|
-
import '../
|
|
7
|
-
import '../
|
|
8
|
-
import '../
|
|
26
|
+
import '../image-resources-tXLQShoC.js';
|
|
27
|
+
import '../omml-equation-BUbU0utM.js';
|
|
28
|
+
import '../editor-scope-7o9xweiJ.js';
|
|
29
|
+
import './document.js';
|
|
30
|
+
import './interaction.js';
|
|
31
|
+
import '../semantic-interaction-kR_QB845.js';
|
|
32
|
+
import '../document-protection-CUb55pl_.js';
|
|
33
|
+
import '../failure-NS2lsya4.js';
|
|
34
|
+
import '../diagnostic-hints-BeVjfNOv.js';
|
|
35
|
+
import '../tree-package-store-CovjNARF.js';
|
|
9
36
|
import '../collaboration/replication.js';
|
|
10
|
-
import '../failure-BIPVQbRm.js';
|
|
11
37
|
|
|
12
38
|
/**
|
|
13
39
|
* Derives the review queue — every pending revision decision and comment
|
|
@@ -44,6 +70,10 @@ interface ReviewModuleContribution {
|
|
|
44
70
|
* The module enables the listed review projections.
|
|
45
71
|
*/
|
|
46
72
|
readonly displayModes: readonly ReviewDisplayMode[];
|
|
73
|
+
/**
|
|
74
|
+
* The review pane settings the editor starts with. `setReviewPaneOptions` changes them later.
|
|
75
|
+
*/
|
|
76
|
+
readonly pane?: ReviewPaneOptions;
|
|
47
77
|
/** The review queue derivation. */
|
|
48
78
|
readonly collectReviewItems: CollectReviewItems;
|
|
49
79
|
/**
|
|
@@ -97,6 +127,20 @@ interface EditorModule {
|
|
|
97
127
|
* package that raised it.
|
|
98
128
|
*/
|
|
99
129
|
readonly onCustomNodeDiagnostic?: (diagnostic: unknown) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Told about every anonymous diagnostic of this editor, from its first open on.
|
|
132
|
+
*
|
|
133
|
+
* The same events as `editor.on('diagnostic')`, but registered before the editor exists, so
|
|
134
|
+
* a document passed at construction is observed too. A listener that throws is ignored: an
|
|
135
|
+
* observer must never break the editor it observes.
|
|
136
|
+
*/
|
|
137
|
+
readonly onDiagnostic?: (event: EditorDiagnostic) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Whether `onDiagnostic` wants events of `kind` now. Absent, it wants every kind. The editor
|
|
140
|
+
* asks before work that only a diagnostic needs, such as timing key presses for
|
|
141
|
+
* `performance`, and skips that work when no listener wants it. Read often: keep it cheap.
|
|
142
|
+
*/
|
|
143
|
+
readonly wantsDiagnostic?: (kind: EditorDiagnosticKind) => boolean;
|
|
100
144
|
}
|
|
101
145
|
/**
|
|
102
146
|
* The resolved registry the editor instance holds: at most one review
|
|
@@ -111,6 +155,10 @@ interface EditorModuleRegistry {
|
|
|
111
155
|
readonly customNodePayloadNamespaces: readonly string[];
|
|
112
156
|
/** Every registered diagnostic listener, in registration order. */
|
|
113
157
|
readonly customNodeDiagnostics: readonly ((diagnostic: unknown) => void)[];
|
|
158
|
+
/** Every registered `onDiagnostic` listener, in registration order. */
|
|
159
|
+
readonly diagnosticListeners: readonly ((event: EditorDiagnostic) => void)[];
|
|
160
|
+
/** Whether any module with `onDiagnostic` wants events of `kind` now. */
|
|
161
|
+
readonly wantsDiagnostic: (kind: EditorDiagnosticKind) => boolean;
|
|
114
162
|
}
|
|
115
163
|
/** Resolve construction-time modules into the registry the instance dispatches over. */
|
|
116
164
|
declare function resolveEditorModules(modules: readonly EditorModule[] | undefined): EditorModuleRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as resolveEditorModules}from'../chunk-
|
|
1
|
+
export{a as resolveEditorModules}from'../chunk-4HENIAFG.js';
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@docx-editor.dev/core/contracts/types` — the shared type vocabulary. Zero runtime.
|
|
3
|
+
*
|
|
4
|
+
* Addressing (`DocAnchor`, `DocTarget`), the document model, and the geometry primitives every
|
|
5
|
+
* other contract is written in terms of.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export { B as Block, r as ColorValue, m as ContainerRef, s as ContentControl, n as ContentControlFilter, i as ContentControlType, t as DocAnchor, u as DocAnchorRange, q as DocComment, v as DocLocation, o as DocRange, j as DocTarget, w as DocumentBody, D as DocxDocument, W as DocxDocumentJSON, x as ExecErrorCode, E as ExecResult, l as Extent, a0 as FontDefinition, H as HeaderFooterSet, y as IndentFormatting, I as InsertableContentControlType, a2 as NumberingRef, a3 as PageMargins, P as Paragraph, a4 as ParagraphDisagreements, z as ParagraphFlags, a5 as ParagraphFormatCommand, A as ParagraphTabStop, a6 as Point, a7 as Rect, p as Revision, F as RevisionType, aa as Run, k as RunFormatting, G as Section, J as SectionProperties, ab as SelectionPin, K as StyleDefinition, S as StyleDefinitions, T as Table, ac as TableCell, ad as TableRow, L as Theme, M as ThemeColorScheme, ae as Unsubscribe, af as Watermark } from '../types-barrel-DuC5QBNC.js';
|
|
11
|
+
import '../editor-scope-7o9xweiJ.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as OoxmlPackage, O as OoxmlPart, N as OoxmlNode,
|
|
2
|
-
import { e as TreeModelChange, f as TreeDocumentStore } from './tree-package-
|
|
1
|
+
import { Q as OoxmlPackage, O as OoxmlPart, N as OoxmlNode, av as TreeOpRejection } from './types-barrel-DuC5QBNC.js';
|
|
2
|
+
import { e as TreeModelChange, f as TreeDocumentStore } from './tree-package-store-CovjNARF.js';
|
|
3
3
|
|
|
4
4
|
/** Which of a family's four faces an embedded font relationship supplies. */
|
|
5
5
|
type FontStyleKey = 'regular' | 'bold' | 'italic' | 'boldItalic';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { D as DiagnosticErrorName, a as DocumentPartKind } from './diagnostic-hints-BeVjfNOv.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Every engine reason a diagnostic can carry as its `cause`. Causes are the engine's own
|
|
5
|
+
* reasons and can change between engine versions; match on the public `code`, and read the
|
|
6
|
+
* `cause` when you report or fix a failure.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
declare function diagnosticCauses(): readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* The engine reason token in a refusal reason, or undefined when the reason is not one the
|
|
13
|
+
* engine knows, such as a sentence. Only the token before a colon counts; the detail after it
|
|
14
|
+
* can name parts of the file and is never returned.
|
|
15
|
+
*/
|
|
16
|
+
declare function diagnosticCause(reason: string | undefined): string | undefined;
|
|
17
|
+
/** The cause of a failure the engine did not name: an exception. */
|
|
18
|
+
declare function exceptionCause(): string;
|
|
19
|
+
/**
|
|
20
|
+
* The class of an exception, never its message. A subclass with its own name, which a host or a
|
|
21
|
+
* file could shape, reports `'other'`.
|
|
22
|
+
*/
|
|
23
|
+
declare function diagnosticErrorName(error: unknown): DiagnosticErrorName;
|
|
24
|
+
/**
|
|
25
|
+
* The role of the part a failure names, from the part name at the start of a refusal detail.
|
|
26
|
+
* The name itself never leaves this function. Undefined when there is no detail.
|
|
27
|
+
*/
|
|
28
|
+
declare function documentPartKind(detail: string | undefined): DocumentPartKind | undefined;
|
|
29
|
+
|
|
30
|
+
export { diagnosticCause as a, diagnosticErrorName as b, documentPartKind as c, diagnosticCauses as d, exceptionCause as e };
|