@docx-editor.dev/core 2.14.1 → 2.15.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 +42 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +6 -5
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +16 -10
- package/dist/binding.js +1 -1
- package/dist/chunk-24APKZAN.cjs +11 -0
- package/dist/chunk-2YH4MSHX.cjs +2 -0
- package/dist/chunk-5Y7AADI6.js +1 -0
- package/dist/chunk-AREFLNUP.js +11 -0
- package/dist/chunk-AS7YZNQE.cjs +2 -0
- package/dist/chunk-AVGCKH6A.cjs +20 -0
- package/dist/chunk-CDYVDQRI.cjs +5 -0
- package/dist/chunk-FGBADUSK.cjs +1 -0
- package/dist/chunk-HOEWFH5U.cjs +1 -0
- package/dist/chunk-KFELX7CN.js +2 -0
- package/dist/{chunk-OKEDGR65.js → chunk-KXPVOPR5.js} +1 -1
- package/dist/chunk-LGFKIF4M.cjs +1 -0
- package/dist/chunk-M52QXFKI.js +1 -0
- package/dist/chunk-MNUKSXRO.js +1 -0
- package/dist/chunk-PBOIGBDO.js +2 -0
- package/dist/chunk-PMHGONET.cjs +1 -0
- package/dist/chunk-PXKZUTHX.cjs +2 -0
- package/dist/chunk-Q4AB7E4O.cjs +1 -0
- package/dist/chunk-QJYH6AYD.js +1 -0
- package/dist/chunk-QRC37MWG.cjs +20 -0
- package/dist/chunk-RJSB6RJ7.js +20 -0
- package/dist/chunk-SB54HLFJ.js +20 -0
- package/dist/chunk-VP7SDFCM.js +1 -0
- package/dist/chunk-XCESLTJL.js +2 -0
- package/dist/{chunk-KIAP7PFQ.cjs → chunk-YL4Q5LZP.cjs} +1 -1
- package/dist/chunk-Z4527AXR.js +5 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -3
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -3
- package/dist/contracts/editor.d.ts +7 -7
- package/dist/contracts/interaction.d.ts +7 -7
- package/dist/contracts/modules.d.ts +8 -7
- package/dist/{custom-node-writes-DntmaAVW.d.ts → custom-node-writes-C9ArIlJh.d.ts} +2 -2
- package/dist/{editor-a6VvsfYU.d.ts → editor-sRxrFJd8.d.ts} +29 -21
- package/dist/editor.cjs +1 -1
- package/dist/editor.d.ts +27 -58
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -0
- package/dist/export.d.ts +337 -0
- package/dist/export.js +2 -0
- package/dist/font-resolver-BYEHQGTw.d.ts +251 -0
- package/dist/headless-document-view-DELC4E5v.d.ts +134 -0
- package/dist/hf-references-DTrHkktY.d.ts +70 -0
- package/dist/{index-C5ZnSRkF.d.ts → index-C3Gvq4jN.d.ts} +55 -246
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -16
- package/dist/index.js +1 -1
- package/dist/{shaped-measurer-CFPnXFs9.d.cts → layout-shaping-DoGR5cf8.d.ts} +86 -12
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +1106 -729
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CDFiNXcD.d.ts → note-properties-DSe8igrz.d.ts} +2 -2
- package/dist/{omml-equation-BY49UOIF.d.ts → omml-equation-BpRmfDAf.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-gOY5GA8K.d.cts → protocol-DZzKxH5r.d.ts} +18 -12
- package/dist/{review-items-CCS1h93f.d.ts → review-items-DYRx187i.d.ts} +2 -2
- package/dist/{review-reads-BjZYeMd4.d.ts → review-reads-LbGUdNzn.d.ts} +22 -25
- package/dist/{revision-projection-BeXVrSSV.d.ts → revision-projection-DHRJH48u.d.ts} +1 -1
- package/dist/{semantic-cell-selection-BK91NCCG.d.ts → semantic-cell-selection-BXVWCBYm.d.ts} +4 -4
- package/dist/{semantic-interaction-BmQ7h2cq.d.ts → semantic-interaction-DZsDmPg5.d.ts} +1 -1
- package/dist/{semantic-paint-WJD2KeG1.d.ts → semantic-paint-f7SqN4oW.d.ts} +2 -2
- package/dist/{semantic-records-BpozY7-j.d.cts → semantic-records-EIdwId-a.d.ts} +301 -205
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +15 -65
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-D6HzlPR4.d.ts → tree-op-types-egdarvH_.d.ts} +7 -3
- package/dist/{tree-package-fragment-CWFjgH6a.d.ts → tree-package-fragment-DjkH4ESI.d.ts} +4 -70
- package/dist/{tree-session-contract-B2HfGt79.d.ts → tree-session-contract-CGOOgPjW.d.ts} +29 -23
- package/dist/{tree-store-APgWx6qn.d.ts → tree-store-DKJB0IcA.d.ts} +2 -2
- package/package.json +7 -2
- package/dist/automation.d.cts +0 -82
- package/dist/binding.d.cts +0 -153
- package/dist/chunk-2PIHW2QM.cjs +0 -1
- package/dist/chunk-2QTY5S6T.js +0 -1
- package/dist/chunk-4Z5MODAE.cjs +0 -2
- package/dist/chunk-5TKAPFZT.cjs +0 -2
- package/dist/chunk-DRQHIQ4R.cjs +0 -1
- package/dist/chunk-F2K6SDHA.cjs +0 -20
- package/dist/chunk-FBA57EUJ.js +0 -2
- package/dist/chunk-KTAQ7BRQ.js +0 -20
- package/dist/chunk-LBAHXZCU.cjs +0 -5
- package/dist/chunk-MCDUQYWP.js +0 -5
- package/dist/chunk-MQP26KCF.js +0 -1
- package/dist/chunk-NDJGSR6M.cjs +0 -19
- package/dist/chunk-NJNFJPGB.cjs +0 -11
- package/dist/chunk-O5M4CR4P.cjs +0 -2
- package/dist/chunk-UKUOZXUD.js +0 -19
- package/dist/chunk-VQ4R5LTU.js +0 -2
- package/dist/chunk-ZBEJHJN2.js +0 -11
- package/dist/chunk-ZVTW7RGD.js +0 -2
- package/dist/collaboration/replication.d.cts +0 -216
- package/dist/collaboration.d.cts +0 -176
- package/dist/contracts/document.d.cts +0 -273
- package/dist/contracts/editor.d.cts +0 -10
- package/dist/contracts/interaction.d.cts +0 -10
- package/dist/contracts/modules.d.cts +0 -130
- package/dist/contracts/types.d.cts +0 -562
- package/dist/custom-node-writes-C46r3_5O.d.cts +0 -310
- package/dist/document-properties-D6Ahr8D6.d.cts +0 -28
- package/dist/document-properties-D6Ahr8D6.d.ts +0 -28
- package/dist/editor-AJ06hyyg.d.cts +0 -1994
- package/dist/editor.d.cts +0 -393
- package/dist/failure-BnGjoXf0.d.cts +0 -64
- package/dist/index-Cbw4lkOt.d.cts +0 -3391
- package/dist/index.d.cts +0 -23
- package/dist/layout.d.cts +0 -2486
- package/dist/note-properties-Y6qYh2Hv.d.cts +0 -67
- package/dist/omml-equation-DB8d-jCq.d.cts +0 -84
- package/dist/output.d.cts +0 -74
- package/dist/protocol-BsmQgblT.d.ts +0 -1358
- package/dist/review-items-CaAkgi5s.d.cts +0 -360
- package/dist/review-reads-DEsV0OOW.d.cts +0 -163
- package/dist/revision-projection-DXbrfNGD.d.cts +0 -156
- package/dist/semantic-cell-selection-BMhku3B1.d.cts +0 -451
- package/dist/semantic-interaction-DUAnxbgf.d.cts +0 -160
- package/dist/semantic-paint-DufNL1Zr.d.cts +0 -247
- package/dist/semantic-records-92UnKeU_.d.ts +0 -2821
- package/dist/shaped-measurer-BWbindlI.d.ts +0 -168
- package/dist/store.d.cts +0 -2500
- package/dist/tree-op-types-BUulYD5y.d.cts +0 -3099
- package/dist/tree-package-fragment-Dhyw7oPm.d.cts +0 -732
- package/dist/tree-session-contract-BY9xd7s_.d.cts +0 -613
- package/dist/tree-store-DEEQ9wz_.d.cts +0 -416
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import { g as OoxmlElement, O as OoxmlPart, b as OoxmlPackage, R as RevisionAddress } from './tree-op-types-BUulYD5y.cjs';
|
|
2
|
-
|
|
3
|
-
/** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
|
|
4
|
-
declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
5
|
-
/** A position in one story: a paragraph node id plus a UTF-16 offset inside it. */
|
|
6
|
-
interface CommentPosition {
|
|
7
|
-
readonly paragraphId: string;
|
|
8
|
-
readonly offset: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Where a comment is anchored, as a range.
|
|
12
|
-
*
|
|
13
|
-
* `orphaned` records that the file did not give this comment a usable range — a reference with
|
|
14
|
-
* no range markers, or a start with no end. The comment is still listed, marked orphaned,
|
|
15
|
-
* rather than dropped: a reviewer's remark disappearing silently is worse than one that says
|
|
16
|
-
* it lost its text.
|
|
17
|
-
*/
|
|
18
|
-
interface CommentAnchor {
|
|
19
|
-
readonly commentId: string;
|
|
20
|
-
/** Canonical name of the part the range lives in, so a header comment is attributable. */
|
|
21
|
-
readonly partName: string;
|
|
22
|
-
readonly start: CommentPosition;
|
|
23
|
-
readonly end: CommentPosition;
|
|
24
|
-
readonly orphaned: boolean;
|
|
25
|
-
}
|
|
26
|
-
/** One comment as authored in `word/comments.xml`. */
|
|
27
|
-
interface CommentRecord {
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly author: string;
|
|
30
|
-
readonly initials?: string;
|
|
31
|
-
readonly date?: string;
|
|
32
|
-
/** Body paragraphs, as tree nodes, so the surface renders measured text rather than a string. */
|
|
33
|
-
readonly blocks: readonly OoxmlElement[];
|
|
34
|
-
/** `w14:paraId` of the last body paragraph — the key thread state is stored under. */
|
|
35
|
-
readonly paraId?: string;
|
|
36
|
-
/** `@w16cid:parentId` — the `w:id` of the comment this replies to, when the file names it. */
|
|
37
|
-
readonly parentCommentId?: string;
|
|
38
|
-
}
|
|
39
|
-
/** Thread state for one comment, read from `commentsExtended.xml`. */
|
|
40
|
-
interface CommentThreadState {
|
|
41
|
-
/** `@w15:paraIdParent` — the comment this one replies to, absent for a top-level comment. */
|
|
42
|
-
readonly parentParaId?: string;
|
|
43
|
-
readonly done: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Every comment anchor in one story, in document order.
|
|
47
|
-
*
|
|
48
|
-
* Overlapping and nested ranges are supported because each anchor is resolved independently —
|
|
49
|
-
* Word produces both, and a model that assumed ranges nest cleanly would mis-anchor them.
|
|
50
|
-
*
|
|
51
|
-
* A start with no matching end anchors to the end of its own paragraph and is reported orphaned
|
|
52
|
-
* rather than guessed at: extending it to the next end marker would attach a reviewer's remark
|
|
53
|
-
* to text they never saw.
|
|
54
|
-
*/
|
|
55
|
-
declare function commentAnchorsOfStory(part: OoxmlPart): CommentAnchor[];
|
|
56
|
-
/**
|
|
57
|
-
* The comments in `word/comments.xml`, in authored order.
|
|
58
|
-
*
|
|
59
|
-
* Every value here comes from a file an attacker fully controls, so nothing is interpreted:
|
|
60
|
-
* author, initials and date are carried verbatim for a surface that will set them as TEXT.
|
|
61
|
-
*/
|
|
62
|
-
declare function commentsOfPart(part: OoxmlPart): CommentRecord[];
|
|
63
|
-
/**
|
|
64
|
-
* Thread state by `w14:paraId`, from `commentsExtended.xml`.
|
|
65
|
-
*
|
|
66
|
-
* The part being PRESENT is not evidence of threading. `issue-68-large-comments-suggestions.docx`
|
|
67
|
-
* ships it with 212 entries carrying `@w15:done` and not one `@w15:paraIdParent`, so it records
|
|
68
|
-
* resolved state for a flat list. Absent parent means top-level, and that is a fact about the
|
|
69
|
-
* file rather than a default this code chose.
|
|
70
|
-
*/
|
|
71
|
-
declare function threadStateOfPart(part: OoxmlPart): Map<string, CommentThreadState>;
|
|
72
|
-
/**
|
|
73
|
-
* Whether the package holds any `w:comment` record — the cheap gate before a reap.
|
|
74
|
-
*
|
|
75
|
-
* Overflow cannot prove the package is comment-free, so it returns true and the reap still
|
|
76
|
-
* runs rather than skipping cleanup.
|
|
77
|
-
*/
|
|
78
|
-
declare function hasAnyComment(pkg: OoxmlPackage): boolean;
|
|
79
|
-
|
|
80
|
-
/** A position in the model offset space of one story. */
|
|
81
|
-
interface ReviewPosition {
|
|
82
|
-
readonly paragraphId: string;
|
|
83
|
-
readonly offset: number;
|
|
84
|
-
}
|
|
85
|
-
/** Where an item is anchored: a range in one story. */
|
|
86
|
-
interface ReviewRange {
|
|
87
|
-
readonly partName: string;
|
|
88
|
-
readonly start: ReviewPosition;
|
|
89
|
-
readonly end: ReviewPosition;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* What kind of decision a revision card represents.
|
|
93
|
-
*
|
|
94
|
-
* Wider than the four content wrappers, because a reviewer has to be shown every pending
|
|
95
|
-
* decision, including the ones that decorate no characters. A card the surface cannot show is
|
|
96
|
-
* a change the reviewer never learns about — and `acceptAllRevisions` refuses if ANY revision
|
|
97
|
-
* in the document is one the engine cannot resolve, so an invisible one makes Accept All fail
|
|
98
|
-
* for a reason nothing on screen explains.
|
|
99
|
-
*/
|
|
100
|
-
type ReviewRevisionKind = 'insert' | 'delete'
|
|
101
|
-
/**
|
|
102
|
-
* A deletion and an insertion that are one edit: text typed over a selection.
|
|
103
|
-
*
|
|
104
|
-
* Word shows these as a single `Replaced "x" with "y"` card, and resolving one half
|
|
105
|
-
* without the other is never what the reviewer meant — accepting the deletion alone
|
|
106
|
-
* leaves the replacement text unproposed, rejecting it alone leaves both.
|
|
107
|
-
*/
|
|
108
|
-
| 'replace' | 'moveFrom' | 'moveTo'
|
|
109
|
-
/** `w:rPrChange` / `w:pPrChange` — the words are unchanged, their formatting is not. */
|
|
110
|
-
| 'format'
|
|
111
|
-
/** `w:pPr/w:rPr/w:ins|w:del` — a paragraph split or merge. */
|
|
112
|
-
| 'paragraphMark'
|
|
113
|
-
/** A row, cell, section or grid revision. Supported row revisions are resolvable. */
|
|
114
|
-
| 'structural';
|
|
115
|
-
/**
|
|
116
|
-
* One tracked change as a review card.
|
|
117
|
-
*
|
|
118
|
-
* Keyed per DECISION rather than per site: a revision spanning three ranges is one card, because
|
|
119
|
-
* accepting it accepts all three.
|
|
120
|
-
*/
|
|
121
|
-
interface ReviewRevisionItem {
|
|
122
|
-
readonly kind: 'revision';
|
|
123
|
-
/** Stable across renders and unique per DECISION, not per site. */
|
|
124
|
-
readonly id: string;
|
|
125
|
-
/** The payload `acceptRevision` / `rejectRevision` take. */
|
|
126
|
-
readonly address: RevisionAddress;
|
|
127
|
-
/**
|
|
128
|
-
* EVERY address this decision covers, `address` first.
|
|
129
|
-
*
|
|
130
|
-
* More than one only for a replacement, whose halves a foreign editor may have written
|
|
131
|
-
* as two independent revisions. Accept and reject walk all of them in one transaction:
|
|
132
|
-
* resolving one half and leaving the other is a state no reviewer asked for.
|
|
133
|
-
*/
|
|
134
|
-
readonly addresses: readonly RevisionAddress[];
|
|
135
|
-
/** The words a replacement removes. Empty for every other kind. */
|
|
136
|
-
readonly replacedText: string;
|
|
137
|
-
readonly revisionKind: ReviewRevisionKind;
|
|
138
|
-
/**
|
|
139
|
-
* WHICH decision a `paragraphMark` records, absent for every other kind.
|
|
140
|
-
*
|
|
141
|
-
* `EG_ParaRPrTrackChanges` is `ins? del? moveFrom? moveTo?`, and the four say opposite
|
|
142
|
-
* things about one break. Without this a card called a deleted break an inserted one, which
|
|
143
|
-
* is the reverse of what Accept on that card does.
|
|
144
|
-
*/
|
|
145
|
-
readonly markDirection?: 'insert' | 'delete' | 'moveFrom' | 'moveTo';
|
|
146
|
-
readonly author: string;
|
|
147
|
-
readonly date?: string;
|
|
148
|
-
/** Text the revision covers, for the card summary. Empty for changes with no characters. */
|
|
149
|
-
readonly text: string;
|
|
150
|
-
/** Every site this decision touches, in document order. */
|
|
151
|
-
readonly ranges: readonly ReviewRange[];
|
|
152
|
-
/**
|
|
153
|
-
* How deeply this change is NESTED inside other changes, 0 for an unenclosed one.
|
|
154
|
-
*
|
|
155
|
-
* `w:ins` wrapping `w:del` is content one reviewer added and another struck. Both stay
|
|
156
|
-
* pending, so both are cards, over one identical range — and a range then cannot say which
|
|
157
|
-
* change a caret is in. Word treats the innermost as the operative one, so it wins the caret
|
|
158
|
-
* and the change enclosing it stays listed and reachable.
|
|
159
|
-
*/
|
|
160
|
-
readonly nesting: number;
|
|
161
|
-
/**
|
|
162
|
-
* How many leading `ranges` are the STRUCK half of a replacement.
|
|
163
|
-
*
|
|
164
|
-
* A replacement's card is one decision but its ranges are two colours — red over what is
|
|
165
|
-
* going, green over what takes its place. ABSENT when the halves do not split at a single
|
|
166
|
-
* point, which is what a file recording both under one revision id can produce; a surface
|
|
167
|
-
* then has no basis for two colours and should paint one neutral band rather than guess.
|
|
168
|
-
*/
|
|
169
|
-
readonly replacedRangeCount?: number;
|
|
170
|
-
/**
|
|
171
|
-
* True when the engine cannot resolve this kind, so accept and reject must not be offered.
|
|
172
|
-
*
|
|
173
|
-
* Derived by the DERIVATION rather than from a caller-supplied predicate: the refusal list
|
|
174
|
-
* is internal, and a surface asked to compute it would have to guess. A card that offers a
|
|
175
|
-
* button the engine will refuse is worse than one that explains why it cannot.
|
|
176
|
-
*/
|
|
177
|
-
readonly readOnly: boolean;
|
|
178
|
-
/** The other half of a move, or the other side of a delete/insert replacement. */
|
|
179
|
-
readonly pairedWith?: string;
|
|
180
|
-
/**
|
|
181
|
-
* Comments answering this change, in document order.
|
|
182
|
-
*
|
|
183
|
-
* A reply to a tracked change IS a comment: `w:ins` and `w:del` carry no body, so the text
|
|
184
|
-
* is written as a comment over the revision's own range and the range is what links them.
|
|
185
|
-
*/
|
|
186
|
-
readonly replyIds: readonly string[];
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* One comment as a review card. A reply carries `parentId`; OOXML gives replies no separate
|
|
190
|
-
* element, so threads are reconstructed from that link.
|
|
191
|
-
*/
|
|
192
|
-
interface ReviewCommentItem {
|
|
193
|
-
readonly kind: 'comment';
|
|
194
|
-
readonly id: string;
|
|
195
|
-
readonly comment: CommentRecord;
|
|
196
|
-
readonly range: ReviewRange | null;
|
|
197
|
-
readonly resolved: boolean;
|
|
198
|
-
/** The comment this replies to, absent for a top-level comment. */
|
|
199
|
-
readonly parentId?: string;
|
|
200
|
-
/** The REVISION this comment answers, when it covers exactly that change's characters. */
|
|
201
|
-
readonly parentRevisionId?: string;
|
|
202
|
-
/** Replies to this comment, in document order. Empty for a reply or a childless comment. */
|
|
203
|
-
readonly replyIds: readonly string[];
|
|
204
|
-
/** True when the file gave this comment no usable range. */
|
|
205
|
-
readonly orphaned: boolean;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* A card contributed by a recognized custom node (`defineCustomNode` with a `reviewCard`
|
|
209
|
-
* hook), anchored at the node's range.
|
|
210
|
-
*
|
|
211
|
-
* Informational, never resolvable: there is nothing to accept or reject, so the engine
|
|
212
|
-
* refuses those verbs on it. `title` and `detail` are HOST-authored (the definition's hook
|
|
213
|
-
* produced them), but `attrs` and `text` originate in a file an attacker controls — a
|
|
214
|
-
* surface renders every one of these as text, never markup.
|
|
215
|
-
*/
|
|
216
|
-
interface ReviewCustomItem {
|
|
217
|
-
readonly kind: 'custom';
|
|
218
|
-
/** The SDT node's stable id in the canonical tree. */
|
|
219
|
-
readonly id: string;
|
|
220
|
-
/** The definition's `name`. */
|
|
221
|
-
readonly name: string;
|
|
222
|
-
/** The raw `w:tag` the node was recognized from. Untrusted input. */
|
|
223
|
-
readonly tag: string;
|
|
224
|
-
/** Attrs decoded from the tag, after the definition's recognition hook. Untrusted input. */
|
|
225
|
-
readonly attrs: Readonly<Record<string, string>>;
|
|
226
|
-
/** The SDT's literal content text. Untrusted input. */
|
|
227
|
-
readonly text: string;
|
|
228
|
-
/**
|
|
229
|
-
* The payload the node's control binds to, after the definition validated it.
|
|
230
|
-
*
|
|
231
|
-
* Undefined when the node carries none or the payload did not match — see the pro package's
|
|
232
|
-
* `RecognizedCustomNode.data`, which this is carried from.
|
|
233
|
-
*/
|
|
234
|
-
readonly data?: unknown;
|
|
235
|
-
/**
|
|
236
|
-
* Whether this node asked for a sidebar card.
|
|
237
|
-
*
|
|
238
|
-
* False for a definition with no `reviewCard`: the item exists so the chip's own surfaces can
|
|
239
|
-
* read `attrs`, `text` and `data` off it, and the rail leaves it out. A surface listing cards
|
|
240
|
-
* filters on this rather than on an empty `title`.
|
|
241
|
-
*/
|
|
242
|
-
readonly carded: boolean;
|
|
243
|
-
/** Card title, from the definition's `reviewCard` hook. Empty when `carded` is false. */
|
|
244
|
-
readonly title: string;
|
|
245
|
-
/** Card body, from the definition's `reviewCard` hook. */
|
|
246
|
-
readonly detail?: string;
|
|
247
|
-
/**
|
|
248
|
-
* Glyph for this node in the collapsed rail, as an SVG path in a `0 -960 960 960` viewBox.
|
|
249
|
-
*
|
|
250
|
-
* A PATH rather than a rendered node because this item crosses core, which is DOM-free and
|
|
251
|
-
* React-free — the same reason `title` and `detail` are strings. A host that wants arbitrary
|
|
252
|
-
* markup overrides the `Markers` part's `icon` instead, which lives in the adapter where JSX
|
|
253
|
-
* belongs. Absent falls back to the generic custom-node glyph.
|
|
254
|
-
*
|
|
255
|
-
* HOST-AUTHORED, never file data: it is interpolated into an SVG `d` attribute, and a path
|
|
256
|
-
* taken from a document would be attacker-controlled markup.
|
|
257
|
-
*/
|
|
258
|
-
readonly icon?: string;
|
|
259
|
-
readonly range: ReviewRange | null;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* One pending decision in the review queue: a tracked change, a comment thread, or a pro
|
|
263
|
-
* custom-node card. Discriminate on `kind`.
|
|
264
|
-
*
|
|
265
|
-
* The store's own derivation (`collectReviewItems`) only ever produces the first two; the
|
|
266
|
-
* `kind: 'custom'` card is contributed by the pro review module, which recognizes the node.
|
|
267
|
-
*/
|
|
268
|
-
type ReviewItem = ReviewRevisionItem | ReviewCommentItem | ReviewCustomItem;
|
|
269
|
-
/** What the review queue derivation reads: one story part plus its comment parts. */
|
|
270
|
-
interface ReviewModelInput {
|
|
271
|
-
/** The story the ranges live in — the main document, a header, a note. */
|
|
272
|
-
readonly storyPart: OoxmlPart;
|
|
273
|
-
/**
|
|
274
|
-
* Header/footer story parts, in section order. Their revisions and comment anchors join
|
|
275
|
-
* the queue: a tracked change in a header is a pending decision like any other, and a
|
|
276
|
-
* queue that only walked the body silently hid it from the rail AND from Accept All.
|
|
277
|
-
*/
|
|
278
|
-
readonly furnitureParts?: readonly OoxmlPart[] | undefined;
|
|
279
|
-
/** `word/comments.xml`, absent when the package has none. */
|
|
280
|
-
readonly commentsPart?: OoxmlPart | undefined;
|
|
281
|
-
/** `word/commentsExtended.xml`, absent when the package has none. */
|
|
282
|
-
readonly commentsExtendedPart?: OoxmlPart | undefined;
|
|
283
|
-
/**
|
|
284
|
-
* Custom node definitions from the module registry, forwarded OPAQUELY.
|
|
285
|
-
*
|
|
286
|
-
* Core carries them the way the registry does — as unknowns — so the definition shape
|
|
287
|
-
* stays a capability-package concern. The pro derivation narrows them and contributes
|
|
288
|
-
* `kind: 'custom'` cards for definitions that opted in.
|
|
289
|
-
*/
|
|
290
|
-
readonly customNodes?: readonly unknown[] | undefined;
|
|
291
|
-
/**
|
|
292
|
-
* Where a capability package reports a node it could not read. Supplied per editor, so a page
|
|
293
|
-
* with two of them keeps their diagnostics apart.
|
|
294
|
-
*/
|
|
295
|
-
readonly reportCustomNodeDiagnostic?: ((diagnostic: unknown) => void) | undefined;
|
|
296
|
-
/**
|
|
297
|
-
* The payload each of the story's controls binds to, keyed by the control's node id.
|
|
298
|
-
*
|
|
299
|
-
* Resolved by the ENGINE and handed over, because a payload lives in a customXml data part
|
|
300
|
-
* and a derivation that only receives story parts has no way to reach one. Untrusted file
|
|
301
|
-
* input on both members; a capability package validates it against whatever shape it
|
|
302
|
-
* declared before handing it to a host.
|
|
303
|
-
*/
|
|
304
|
-
readonly customNodePayloads?: ReadonlyMap<string, {
|
|
305
|
-
readonly nodeId: string;
|
|
306
|
-
readonly label: string;
|
|
307
|
-
readonly data: string;
|
|
308
|
-
}> | undefined;
|
|
309
|
-
}
|
|
310
|
-
/** The stable key a surface uses for the active item and for a React list. */
|
|
311
|
-
declare function reviewItemKey(item: ReviewItem): string;
|
|
312
|
-
/** Every range a decision touches. One card can cover several, in different paragraphs. */
|
|
313
|
-
declare function reviewItemRanges(item: ReviewItem): readonly ReviewRange[];
|
|
314
|
-
/** The first range of an item, in authored order, or null when it has none. */
|
|
315
|
-
declare function firstReviewRange(item: ReviewItem): ReviewRange | null;
|
|
316
|
-
/**
|
|
317
|
-
* A single comparable number for document order.
|
|
318
|
-
*
|
|
319
|
-
* Paragraph index dominates offset, so a revision spanning paragraphs still sorts by where it
|
|
320
|
-
* STARTS. An item with no resolvable range sorts last rather than to position zero, which is
|
|
321
|
-
* where an orphan used to land — tearing an orphaned reply out of its own thread.
|
|
322
|
-
*/
|
|
323
|
-
declare function reviewItemPositionRank(item: ReviewItem, order: ReadonlyMap<string, number>): number;
|
|
324
|
-
/**
|
|
325
|
-
* Every item covering a position, innermost first.
|
|
326
|
-
*
|
|
327
|
-
* Returning the whole stack rather than one winner is what lets a surface offer cycling, a
|
|
328
|
-
* stacked card, or a "1 of 3" affordance. A comment wrapping a revision used to be unreachable
|
|
329
|
-
* because only the tightest range was ever returned.
|
|
330
|
-
*/
|
|
331
|
-
declare function reviewItemsAt(items: readonly ReviewItem[], position: ReviewPosition, order: ReadonlyMap<string, number>): ReviewItem[];
|
|
332
|
-
/**
|
|
333
|
-
* The item the caret is in, or null.
|
|
334
|
-
*
|
|
335
|
-
* A resolved comment never activates: a settled thread must not reopen itself as the reviewer
|
|
336
|
-
* types near it.
|
|
337
|
-
*
|
|
338
|
-
* A REPLY resolves to the thread it belongs to. A reply is anchored over its parent's range,
|
|
339
|
-
* so both cover the caret — and the reply, being newer, wins the innermost test. It is not a
|
|
340
|
-
* card of its own (it renders inside its parent's), so the thread would have gone active with
|
|
341
|
-
* nothing on screen showing it: the reply box vanished from a comment the moment somebody
|
|
342
|
-
* replied to it.
|
|
343
|
-
*/
|
|
344
|
-
declare function activeReviewItem(items: readonly ReviewItem[], position: ReviewPosition, order: ReadonlyMap<string, number>): ReviewItem | null;
|
|
345
|
-
/**
|
|
346
|
-
* Walk a reply up to the card that heads its thread. Guarded against a cyclic file.
|
|
347
|
-
*
|
|
348
|
-
* The head is not always a comment. A reply to a tracked change renders inside the REVISION's
|
|
349
|
-
* card, so resolving it to itself opened an item nothing on screen was drawing — the reply box
|
|
350
|
-
* vanished the moment somebody answered a change.
|
|
351
|
-
*
|
|
352
|
-
* EXPORTED because the paginated surface answers "which card is open" itself, against its own
|
|
353
|
-
* dismissed-key state, rather than through {@link activeReviewItem}. Two copies of the
|
|
354
|
-
* innermost-wins rule was survivable while a reply could only be a comment — the parent came
|
|
355
|
-
* first in `comments.xml` order and won the tie by accident. It stopped being survivable the
|
|
356
|
-
* moment a reply could answer a revision, which outranks it outright.
|
|
357
|
-
*/
|
|
358
|
-
declare function reviewThreadRootOf(items: readonly ReviewItem[], comment: ReviewCommentItem): ReviewItem;
|
|
359
|
-
|
|
360
|
-
export { type CommentRecord as C, type ReviewModelInput as R, W15_NAMESPACE_URI as W, type ReviewItem as a, type ReviewRevisionItem as b, type ReviewCommentItem as c, type ReviewCustomItem as d, type ReviewPosition as e, type ReviewRange as f, type ReviewRevisionKind as g, type CommentThreadState as h, type CommentAnchor as i, type CommentPosition as j, activeReviewItem as k, firstReviewRange as l, reviewItemPositionRank as m, reviewItemRanges as n, reviewItemsAt as o, reviewThreadRootOf as p, commentAnchorsOfStory as q, reviewItemKey as r, commentsOfPart as s, hasAnyComment as t, threadStateOfPart as u };
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { a as OoxmlNode, g as OoxmlElement, h as OoxmlContentControlNode, d as OoxmlGenericElementNode, i as OoxmlContentControlContentNode, O as OoxmlPart } from './tree-op-types-BUulYD5y.cjs';
|
|
2
|
-
import { C as CommentRecord, f as ReviewRange, R as ReviewModelInput, a as ReviewItem, e as ReviewPosition, h as CommentThreadState, c as ReviewCommentItem, b as ReviewRevisionItem } from './review-items-CaAkgi5s.cjs';
|
|
3
|
-
|
|
4
|
-
/** Nested content-control wrappers deeper than this stop flattening; content stays preserved. */
|
|
5
|
-
declare const MAX_CONTENT_CONTROL_NESTING = 32;
|
|
6
|
-
type ContentControlLike = OoxmlContentControlNode | OoxmlGenericElementNode;
|
|
7
|
-
type ContentControlContentLike = OoxmlContentControlContentNode | OoxmlGenericElementNode;
|
|
8
|
-
/**
|
|
9
|
-
* Block or inline structured-document-tag wrapper — typed or generic during migration.
|
|
10
|
-
*
|
|
11
|
-
* Generic fallback requires the WordprocessingML namespace so foreign-namespace
|
|
12
|
-
* `<x:sdt>` elements stay opaque wrappers and are never treated as Word controls.
|
|
13
|
-
*/
|
|
14
|
-
declare function isContentControl(node: OoxmlNode): node is ContentControlLike;
|
|
15
|
-
/**
|
|
16
|
-
* True when `node` is the control's content container (`w:sdtContent`).
|
|
17
|
-
*
|
|
18
|
-
* Generic `sdtContent` requires the WML namespace — same foreign-namespace rule as
|
|
19
|
-
* {@link isContentControl}.
|
|
20
|
-
*/
|
|
21
|
-
declare function isContentControlContent(node: OoxmlNode): node is ContentControlContentLike;
|
|
22
|
-
/** Children of the first `w:sdtContent` under a control, or null when absent or not a control. */
|
|
23
|
-
declare function contentControlContentOf(node: OoxmlNode): readonly OoxmlNode[] | null;
|
|
24
|
-
/**
|
|
25
|
-
* Children of every `w:sdtContent` under a control, in document order.
|
|
26
|
-
*
|
|
27
|
-
* Does not recurse into nested controls — callers that flatten blocks or inline runs do that
|
|
28
|
-
* with their own depth counter against {@link MAX_CONTENT_CONTROL_NESTING}.
|
|
29
|
-
*/
|
|
30
|
-
declare function contentControlContentChildren(control: OoxmlNode): readonly OoxmlNode[];
|
|
31
|
-
/**
|
|
32
|
-
* Collect paragraph and table blocks from a sibling list, flattening through content-control
|
|
33
|
-
* wrappers up to {@link MAX_CONTENT_CONTROL_NESTING}.
|
|
34
|
-
*
|
|
35
|
-
* `accept` filters which typed blocks are kept (e.g. skip revision-removed paragraphs). When
|
|
36
|
-
* nesting exceeds the bound the wrapper is skipped entirely — same fail-closed rule as the
|
|
37
|
-
* historical `storyBlocks` walk.
|
|
38
|
-
*/
|
|
39
|
-
declare function collectFlowBlocks(children: readonly OoxmlNode[], depth?: number, accept?: (block: OoxmlElement) => boolean): OoxmlElement[];
|
|
40
|
-
/**
|
|
41
|
-
* Story blocks in document order, flattening block-level content controls — same shape as
|
|
42
|
-
* layout's `storyBlocks` and store `bodyBlocks`.
|
|
43
|
-
*/
|
|
44
|
-
declare function walkStoryBlocks(children: readonly OoxmlNode[], depth: number, visit: (block: OoxmlElement) => void): void;
|
|
45
|
-
/**
|
|
46
|
-
* Every story paragraph in reading order — body, table cells, and flattened block controls.
|
|
47
|
-
*/
|
|
48
|
-
declare function walkAllStoryParagraphs(children: readonly OoxmlNode[], sdtDepth: number, visit: (paragraph: OoxmlElement) => void): void;
|
|
49
|
-
/**
|
|
50
|
-
* Paragraph-level inline sequence — runs, hyperlinks, and inline content controls in order.
|
|
51
|
-
*
|
|
52
|
-
* `visit` receives each direct `w:r` and any other inline node the caller treats as opaque
|
|
53
|
-
* (bookmarks, drawings, …). Hyperlinks and content controls are descended transparently.
|
|
54
|
-
*/
|
|
55
|
-
declare function walkParagraphInline(children: readonly OoxmlNode[], depth: number, visit: (child: OoxmlNode) => void): void;
|
|
56
|
-
|
|
57
|
-
/** Plain text of a comment's body, so a card never re-implements the run walk. */
|
|
58
|
-
declare function commentBodyText(comment: CommentRecord): string;
|
|
59
|
-
/** Author initials for an avatar, from `@w:initials` or the name. */
|
|
60
|
-
declare function commentInitials(comment: CommentRecord): string;
|
|
61
|
-
/**
|
|
62
|
-
* Every revision in one story, one card per DECISION.
|
|
63
|
-
*
|
|
64
|
-
* Sites sharing an `(id, author, date)` triple are ONE revision — a tracked row insertion is
|
|
65
|
-
* `w:trPr/w:ins` plus `w:cellIns` on every cell — so they coalesce into one card listing every
|
|
66
|
-
* range it touches. Keying per site would show the reviewer four decisions where there is one,
|
|
67
|
-
* and accepting any of them would make the other three vanish.
|
|
68
|
-
*
|
|
69
|
-
* Memoized per part root like the indexes it reads, and for the same reason: a heavily
|
|
70
|
-
* tracked document produces tens of thousands of cards, and rebuilding them per read cost
|
|
71
|
-
* more than everything the memos above saved. The paragraph-scoped view the local review
|
|
72
|
-
* patch derives (`revisionItemsOfParagraph`'s synthetic paragraph-root part) is NOT cached:
|
|
73
|
-
* each keystroke would insert a fresh root and churn the bounded ring. The instance is
|
|
74
|
-
* SHARED, so the return type is readonly.
|
|
75
|
-
*/
|
|
76
|
-
declare function revisionItemsOf(part: OoxmlPart): readonly ReviewRevisionItem[];
|
|
77
|
-
/**
|
|
78
|
-
* Comment cards, threaded however the file says so and flat when nothing says so.
|
|
79
|
-
*
|
|
80
|
-
* ECMA-376 §17.13.4.2 gives `CT_Comment` no parent pointer, so threading is never something
|
|
81
|
-
* the standard states outright. Three sources, strongest first: `@w15:paraIdParent`, then
|
|
82
|
-
* `@w16cid:parentId` — both in namespaces outside Part 1 — and finally a COINCIDENT anchor, a
|
|
83
|
-
* comment whose `w:commentRangeStart`/`End` cover exactly the characters an earlier comment's
|
|
84
|
-
* cover. The ranges are Part 1's own vocabulary and the only part of a thread that survives a
|
|
85
|
-
* producer dropping the extension parts. Coincidence is the last resort and never overrides a
|
|
86
|
-
* stated link.
|
|
87
|
-
*
|
|
88
|
-
* Deliberately not containment. A remark on one word inside another remark's sentence nests
|
|
89
|
-
* without being a reply, and reading that as a thread would bury an independent comment inside
|
|
90
|
-
* someone else's.
|
|
91
|
-
*/
|
|
92
|
-
declare function commentItemsOf(comments: readonly CommentRecord[], anchors: readonly {
|
|
93
|
-
commentId: string;
|
|
94
|
-
partName: string;
|
|
95
|
-
start: ReviewPosition;
|
|
96
|
-
end: ReviewPosition;
|
|
97
|
-
orphaned: boolean;
|
|
98
|
-
}[], threadState: ReadonlyMap<string, CommentThreadState>): ReviewCommentItem[];
|
|
99
|
-
/**
|
|
100
|
-
* Everything the review surface lists, in document order.
|
|
101
|
-
*
|
|
102
|
-
* Order is by paragraph position within the story, then by offset. A comment and the revision
|
|
103
|
-
* it covers therefore arrive together, which is what lets a surface group them. Furniture
|
|
104
|
-
* stories rank after the body in one merged order — their geometry (the page they first paint
|
|
105
|
-
* on) is a layout question the queue deliberately does not answer.
|
|
106
|
-
*/
|
|
107
|
-
declare function collectReviewItems(input: ReviewModelInput): ReviewItem[];
|
|
108
|
-
/**
|
|
109
|
-
* The shape {@link linkRevisionReplies} needs, stated STRUCTURALLY.
|
|
110
|
-
*
|
|
111
|
-
* The store's queue is revisions and comments; the layout lane's adds a third kind for custom
|
|
112
|
-
* nodes, and neither union is assignable to the other. Both lanes have to run this pass — the
|
|
113
|
-
* store on the full derivation, the session on the locally patched list — so the pass is
|
|
114
|
-
* written against the fields it actually reads rather than against either union, and hands
|
|
115
|
-
* back the caller's own item type.
|
|
116
|
-
*/
|
|
117
|
-
interface LinkableReviewItem {
|
|
118
|
-
readonly kind: string;
|
|
119
|
-
readonly id: string;
|
|
120
|
-
readonly ranges?: readonly ReviewRange[];
|
|
121
|
-
readonly range?: ReviewRange | null;
|
|
122
|
-
readonly parentId?: string;
|
|
123
|
-
readonly parentRevisionId?: string;
|
|
124
|
-
readonly replyIds?: readonly string[];
|
|
125
|
-
readonly orphaned?: boolean;
|
|
126
|
-
/** How deeply a revision is nested; absent on the kinds that cannot nest. */
|
|
127
|
-
readonly nesting?: number;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Attach each comment that answers a tracked change to the change it answers.
|
|
131
|
-
*
|
|
132
|
-
* A matching non-empty RANGE is the evidence. A stated comment reply beats an inferred revision
|
|
133
|
-
* link, and the deepest revision on a shared span wins to match click targeting.
|
|
134
|
-
*
|
|
135
|
-
* The WHOLE conversation moves, not its head. A change's card renders `replyIds` as a flat list,
|
|
136
|
-
* so linking only the top comment of a thread left every answer to that answer rendered by
|
|
137
|
-
* nobody. Descendants ride along in authoring order.
|
|
138
|
-
*
|
|
139
|
-
* The pass is idempotent: every link is rebuilt from ranges, so locally patched queues cannot
|
|
140
|
-
* retain stale `parentRevisionId` values after edits move a revision.
|
|
141
|
-
*/
|
|
142
|
-
declare function linkRevisionReplies<T extends LinkableReviewItem>(items: readonly T[]): T[];
|
|
143
|
-
/**
|
|
144
|
-
* Paragraph node id → document position, from the TREE rather than from a layout.
|
|
145
|
-
*
|
|
146
|
-
* Memoized on the immutable root: one full derivation pass asks this question three times
|
|
147
|
-
* (replacement pairing, the queue's merged order, the session's cached order), and each
|
|
148
|
-
* answer was a fresh full-tree walk. The instance is SHARED, so the return type is
|
|
149
|
-
* ReadonlyMap: a caller mutating it would poison every later reader of this root.
|
|
150
|
-
*/
|
|
151
|
-
declare function paragraphOrderOfPart(part: OoxmlPart): ReadonlyMap<string, number>;
|
|
152
|
-
/**
|
|
153
|
-
* Like {@link paragraphOrderOfPart}, but descends INTO paragraphs, so paragraphs nested
|
|
154
|
-
* in a run's content — a textbox's `w:txbxContent` — rank right after their host.
|
|
155
|
-
*
|
|
156
|
-
* A separate function on purpose: the shallow order feeds the review queue's card
|
|
157
|
-
* ordering, and re-ranking nested paragraphs there would move cards. This one exists for
|
|
158
|
-
* position containment tests ("is the caret inside this range"), where a paragraph the
|
|
159
|
-
* shallow order cannot see is a position that can never match.
|
|
160
|
-
*/
|
|
161
|
-
declare function deepParagraphOrderOfPart(part: OoxmlPart): ReadonlyMap<string, number>;
|
|
162
|
-
|
|
163
|
-
export { type LinkableReviewItem as L, MAX_CONTENT_CONTROL_NESTING as M, commentBodyText as a, commentInitials as b, collectFlowBlocks as c, contentControlContentChildren as d, isContentControlContent as e, collectReviewItems as f, commentItemsOf as g, contentControlContentOf as h, isContentControl as i, deepParagraphOrderOfPart as j, walkParagraphInline as k, linkRevisionReplies as l, walkStoryBlocks as m, paragraphOrderOfPart as p, revisionItemsOf as r, walkAllStoryParagraphs as w };
|