@docx-editor.dev/core 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +5 -6
  3. package/dist/automation.d.ts +5 -6
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +11 -12
  7. package/dist/binding.d.ts +11 -12
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-5VC5HGJA.js +2 -0
  10. package/dist/chunk-A2JIBG75.js +1 -0
  11. package/dist/chunk-DKMKH77K.cjs +5 -0
  12. package/dist/chunk-FWUI7EXG.cjs +15 -0
  13. package/dist/chunk-GZWMLQJO.js +18 -0
  14. package/dist/chunk-IEXDXWTA.cjs +1 -0
  15. package/dist/chunk-IMMAG4QP.cjs +10 -0
  16. package/dist/chunk-JTSNJQFO.js +15 -0
  17. package/dist/chunk-KBCC66CI.js +5 -0
  18. package/dist/chunk-LJ6BY6IU.cjs +18 -0
  19. package/dist/chunk-QDBAXFIK.js +2 -0
  20. package/dist/chunk-RD266XSK.cjs +2 -0
  21. package/dist/chunk-VUJGPCPU.js +10 -0
  22. package/dist/chunk-XMHWBL3K.cjs +2 -0
  23. package/dist/contracts/editor.d.cts +9 -9
  24. package/dist/contracts/editor.d.ts +9 -9
  25. package/dist/contracts/interaction.d.cts +9 -9
  26. package/dist/contracts/interaction.d.ts +9 -9
  27. package/dist/contracts/modules.d.cts +5 -5
  28. package/dist/contracts/modules.d.ts +5 -5
  29. package/dist/{custom-node-writes-BdVl-LAC.d.ts → custom-node-writes-7ERv0f_X.d.cts} +9 -10
  30. package/dist/{custom-node-writes-Bu8JIqfA.d.cts → custom-node-writes-QyVZdTUA.d.ts} +9 -10
  31. package/dist/{editor-CWlj33GH.d.cts → editor-CojjwMmF.d.cts} +4 -4
  32. package/dist/{editor-D52SD4jG.d.ts → editor-PUlv5Pp7.d.ts} +4 -4
  33. package/dist/editor.cjs +1 -1
  34. package/dist/editor.css +129 -14
  35. package/dist/editor.d.cts +25 -25
  36. package/dist/editor.d.ts +25 -25
  37. package/dist/editor.js +1 -1
  38. package/dist/{hf-references-BdjsQNE_.d.ts → hf-references-Dvk6De4Q.d.cts} +1 -2
  39. package/dist/{hf-references-CgEOSw3i.d.cts → hf-references-z5Y4N1ab.d.ts} +1 -2
  40. package/dist/{image-resources-BveffuKp.d.cts → image-resources-DQOiwOuE.d.cts} +2 -2
  41. package/dist/{image-resources-D63k8w5f.d.ts → image-resources-eZqD_-vC.d.ts} +2 -2
  42. package/dist/{index-39yzaZO_.d.cts → index-DGPSeLI0.d.cts} +66 -13
  43. package/dist/{index-ZuqIj0b9.d.ts → index-oN-v8DQ5.d.ts} +66 -13
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.d.cts +18 -18
  46. package/dist/index.d.ts +18 -18
  47. package/dist/index.js +1 -1
  48. package/dist/layout.cjs +1 -1
  49. package/dist/layout.d.cts +353 -272
  50. package/dist/layout.d.ts +353 -272
  51. package/dist/layout.js +1 -1
  52. package/dist/{note-nodes-BPSTVDMr.d.ts → note-nodes-BNCANoGN.d.ts} +1 -1
  53. package/dist/{note-nodes-C6DLxlvj.d.cts → note-nodes-DL-Au22P.d.cts} +1 -1
  54. package/dist/note-properties-CQlxjic_.d.cts +67 -0
  55. package/dist/note-properties-jvnw_DGG.d.ts +67 -0
  56. package/dist/omml-equation-BD-LsmWE.d.cts +84 -0
  57. package/dist/omml-equation-Dd3mBep-.d.ts +84 -0
  58. package/dist/{ooxml-tree-BU0e3DVi.d.cts → ooxml-package-CdEy9ufK.d.cts} +352 -1
  59. package/dist/{ooxml-tree-BU0e3DVi.d.ts → ooxml-package-CdEy9ufK.d.ts} +352 -1
  60. package/dist/output.cjs +1 -1
  61. package/dist/output.d.cts +8 -8
  62. package/dist/output.d.ts +8 -8
  63. package/dist/output.js +1 -1
  64. package/dist/{protocol-CD7slqvl.d.cts → protocol-C7ahrdUx.d.ts} +28 -4
  65. package/dist/{protocol-DsbfgBwA.d.ts → protocol-UuZOcOp7.d.cts} +28 -4
  66. package/dist/{review-support--I4ChuzF.d.ts → review-items-D5SPFtsO.d.ts} +49 -102
  67. package/dist/{review-support-CG7aVSPh.d.cts → review-items-DpsqTHio.d.cts} +49 -102
  68. package/dist/review-reads-B2Ji3fVU.d.ts +176 -0
  69. package/dist/review-reads-CP106AHp.d.cts +176 -0
  70. package/dist/{revision-projection-UKqvPa4-.d.ts → revision-projection-CILpvv4M.d.ts} +1 -1
  71. package/dist/{revision-projection-WzlQGBJx.d.cts → revision-projection-Cc4wz30g.d.cts} +1 -1
  72. package/dist/{semantic-cell-selection-I-uAmi0q.d.ts → semantic-cell-selection-BWhVAk5B.d.ts} +4 -4
  73. package/dist/{semantic-cell-selection-C45Gn4K-.d.cts → semantic-cell-selection-DJPjBWzf.d.cts} +4 -4
  74. package/dist/{semantic-interaction-DVUqu_47.d.cts → semantic-interaction-BjOcDB06.d.cts} +1 -1
  75. package/dist/{semantic-interaction-Bu_3IPaV.d.ts → semantic-interaction-Cca1-X_a.d.ts} +1 -1
  76. package/dist/{semantic-paint-BKiiDJol.d.ts → semantic-paint-CufpIQFw.d.ts} +7 -7
  77. package/dist/{semantic-paint-COQY0Lnq.d.cts → semantic-paint-Ur7pAINj.d.cts} +7 -7
  78. package/dist/{semantic-records-rAKWaD-1.d.cts → semantic-records-C3Z76KeN.d.cts} +59 -5
  79. package/dist/{semantic-records-DHcMZM2-.d.ts → semantic-records-Cc1MJrhM.d.ts} +59 -5
  80. package/dist/{shaped-measurer-Cw45Nu5R.d.ts → shaped-measurer-CYSK20E2.d.cts} +2 -4
  81. package/dist/{shaped-measurer-BRL__nm2.d.cts → shaped-measurer-CwlTPDJO.d.ts} +2 -4
  82. package/dist/store.cjs +1 -1
  83. package/dist/store.d.cts +78 -18
  84. package/dist/store.d.ts +78 -18
  85. package/dist/store.js +1 -1
  86. package/dist/{tree-op-types-A-SLSKzK.d.cts → tree-op-types-B0-sCtw-.d.cts} +27 -3
  87. package/dist/{tree-op-types-BbzrA-kg.d.ts → tree-op-types-XMVsJSpe.d.ts} +27 -3
  88. package/dist/{tree-session-C2NsEgfW.d.cts → tree-session-D945D43B.d.cts} +9 -18
  89. package/dist/{tree-session-DeNJa86l.d.ts → tree-session-DBJgmdmc.d.ts} +9 -18
  90. package/dist/{tree-store-CKswbQl3.d.ts → tree-store-C6vc8E_2.d.cts} +2 -3
  91. package/dist/{tree-store-Dob9Us6Y.d.cts → tree-store-ClA-qng4.d.ts} +2 -3
  92. package/package.json +2 -2
  93. package/dist/chunk-2WIXJ7CW.js +0 -10
  94. package/dist/chunk-42PRWWVE.js +0 -2
  95. package/dist/chunk-5XKD3VFP.js +0 -18
  96. package/dist/chunk-HCSWWXS2.cjs +0 -2
  97. package/dist/chunk-HTJLSGBH.cjs +0 -18
  98. package/dist/chunk-JEHWQPXS.cjs +0 -1
  99. package/dist/chunk-KCJLRAKT.js +0 -5
  100. package/dist/chunk-KTL3UMPK.js +0 -2
  101. package/dist/chunk-M6ZIVJUA.cjs +0 -2
  102. package/dist/chunk-NU57YOQE.js +0 -15
  103. package/dist/chunk-RUS2YBWU.cjs +0 -10
  104. package/dist/chunk-TJEWP7MX.cjs +0 -15
  105. package/dist/chunk-UGUPVZDY.cjs +0 -5
  106. package/dist/chunk-XJRMFS6O.js +0 -1
  107. package/dist/chunk-XN634HAC.js +0 -2
  108. package/dist/chunk-XRDTD4X3.cjs +0 -2
  109. package/dist/content-control-walk-CbTqHq6O.d.cts +0 -56
  110. package/dist/content-control-walk-D06GijR0.d.ts +0 -56
  111. package/dist/ooxml-package-CR5us6ad.d.cts +0 -354
  112. package/dist/ooxml-package-D_CtywTW.d.ts +0 -354
  113. package/dist/review-reads-B_pXe43J.d.ts +0 -432
  114. package/dist/review-reads-Bn7aZU4u.d.cts +0 -432
@@ -1,432 +0,0 @@
1
- import { e as OoxmlPart, O as OoxmlNode, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.cjs';
2
- import { O as OoxmlPackage } from './ooxml-package-CR5us6ad.cjs';
3
- import { R as RevisionAddress } from './tree-op-types-A-SLSKzK.cjs';
4
-
5
- /** `w:pos` — where a section's footnotes are laid out. */
6
- type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
7
- /** `w:pos` for endnotes — only the two document-level placements are legal. */
8
- type EndnotePosition = 'sectEnd' | 'docEnd';
9
- /** `w:numRestart` — when note numbering starts over. `eachPage` needs the reference's page. */
10
- type NoteNumRestart = 'continuous' | 'eachSect' | 'eachPage';
11
- /** Authored subset — only keys present in the file appear. */
12
- interface AuthoredNoteProperties {
13
- readonly pos?: string;
14
- readonly numFmt?: string;
15
- readonly numStart?: number;
16
- readonly numRestart?: string;
17
- }
18
- /** Fully resolved footnote properties (defaults filled). */
19
- interface ResolvedFootnoteProperties {
20
- readonly pos: FootnotePosition;
21
- readonly numFmt: string;
22
- readonly numStart: number;
23
- readonly numRestart: NoteNumRestart;
24
- }
25
- /** Fully resolved endnote properties (defaults filled). */
26
- interface ResolvedEndnoteProperties {
27
- readonly pos: EndnotePosition;
28
- readonly numFmt: string;
29
- readonly numStart: number;
30
- readonly numRestart: NoteNumRestart;
31
- }
32
- /** Word's own footnote defaults, applied where a section declares no `w:footnotePr`. */
33
- declare const DEFAULT_FOOTNOTE_PROPERTIES: ResolvedFootnoteProperties;
34
- /**
35
- * Word-compatible defaults. ECMA-376 says omitted endnote `numFmt` is decimal;
36
- * MS-OE376 / MS-OI29500 document that Word’s default is `lowerRoman` instead.
37
- * Resolved (not authored) — unedited packages still invent nothing on save.
38
- */
39
- declare const DEFAULT_ENDNOTE_PROPERTIES: ResolvedEndnoteProperties;
40
- /** Parse authored CT_FtnProps / CT_EdnProps without inventing defaults. */
41
- declare function parseAuthoredNoteProperties(propsNode: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
42
- /** Authored footnotePr on a sectPr node. */
43
- declare function authoredFootnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
44
- /** Authored endnotePr on a sectPr node. */
45
- declare function authoredEndnotePropertiesFromSectPr(sectPr: OoxmlNode | null | undefined): AuthoredNoteProperties | undefined;
46
- /** Locate settings.xml via the main document relationship when present. */
47
- declare function settingsPartOf(pkg: OoxmlPackage): OoxmlPart | null;
48
- /** Authored document-level footnotePr from settings. */
49
- declare function authoredDocumentFootnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
50
- /** Authored document-level endnotePr from settings. */
51
- declare function authoredDocumentEndnoteProperties(settings: OoxmlPart | null | undefined): AuthoredNoteProperties | undefined;
52
- /**
53
- * Resolve footnote properties: section → document → defaults.
54
- * Illegal position strings fall through to the next layer / default.
55
- */
56
- declare function resolveFootnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedFootnoteProperties;
57
- /**
58
- * Resolve endnote properties: section → document → defaults.
59
- * `pageBottom` is never a legal endnote position — falls back.
60
- */
61
- declare function resolveEndnoteProperties(section?: AuthoredNoteProperties, document?: AuthoredNoteProperties): ResolvedEndnoteProperties;
62
- /** Validate an authored endnote position write — refuse `pageBottom`. */
63
- declare function isLegalEndnotePosition(pos: string): pos is EndnotePosition;
64
- /** Validate an authored footnote position write. */
65
- declare function isLegalFootnotePosition(pos: string): pos is FootnotePosition;
66
- /** Whether a file-supplied string is a legal `w:numRestart` value. Narrows the type. */
67
- declare function isLegalNumRestart(value: string): value is NoteNumRestart;
68
-
69
- /** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
70
- declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
71
- /** A position in one story: a paragraph node id plus a UTF-16 offset inside it. */
72
- interface CommentPosition {
73
- readonly paragraphId: string;
74
- readonly offset: number;
75
- }
76
- /**
77
- * Where a comment is anchored, as a range.
78
- *
79
- * `orphaned` records that the file did not give this comment a usable range — a reference with
80
- * no range markers, or a start with no end. The comment is still listed, marked orphaned,
81
- * rather than dropped: a reviewer's remark disappearing silently is worse than one that says
82
- * it lost its text.
83
- */
84
- interface CommentAnchor {
85
- readonly commentId: string;
86
- /** Canonical name of the part the range lives in, so a header comment is attributable. */
87
- readonly partName: string;
88
- readonly start: CommentPosition;
89
- readonly end: CommentPosition;
90
- readonly orphaned: boolean;
91
- }
92
- /** One comment as authored in `word/comments.xml`. */
93
- interface CommentRecord {
94
- readonly id: string;
95
- readonly author: string;
96
- readonly initials?: string;
97
- readonly date?: string;
98
- /** Body paragraphs, as tree nodes, so the surface renders measured text rather than a string. */
99
- readonly blocks: readonly OoxmlElement[];
100
- /** `w14:paraId` of the last body paragraph — the key thread state is stored under. */
101
- readonly paraId?: string;
102
- /** `@w16cid:parentId` — the `w:id` of the comment this replies to, when the file names it. */
103
- readonly parentCommentId?: string;
104
- }
105
- /** Thread state for one comment, read from `commentsExtended.xml`. */
106
- interface CommentThreadState {
107
- /** `@w15:paraIdParent` — the comment this one replies to, absent for a top-level comment. */
108
- readonly parentParaId?: string;
109
- readonly done: boolean;
110
- }
111
- /**
112
- * Every comment anchor in one story, in document order.
113
- *
114
- * Overlapping and nested ranges are supported because each anchor is resolved independently —
115
- * Word produces both, and a model that assumed ranges nest cleanly would mis-anchor them.
116
- *
117
- * A start with no matching end anchors to the end of its own paragraph and is reported orphaned
118
- * rather than guessed at: extending it to the next end marker would attach a reviewer's remark
119
- * to text they never saw.
120
- */
121
- declare function commentAnchorsOfStory(part: OoxmlPart): CommentAnchor[];
122
- /**
123
- * The comments in `word/comments.xml`, in authored order.
124
- *
125
- * Every value here comes from a file an attacker fully controls, so nothing is interpreted:
126
- * author, initials and date are carried verbatim for a surface that will set them as TEXT.
127
- */
128
- declare function commentsOfPart(part: OoxmlPart): CommentRecord[];
129
- /**
130
- * Thread state by `w14:paraId`, from `commentsExtended.xml`.
131
- *
132
- * The part being PRESENT is not evidence of threading. `issue-68-large-comments-suggestions.docx`
133
- * ships it with 212 entries carrying `@w15:done` and not one `@w15:paraIdParent`, so it records
134
- * resolved state for a flat list. Absent parent means top-level, and that is a fact about the
135
- * file rather than a default this code chose.
136
- */
137
- declare function threadStateOfPart(part: OoxmlPart): Map<string, CommentThreadState>;
138
- /**
139
- * Whether the package holds any `w:comment` record — the cheap gate before a reap.
140
- *
141
- * Overflow cannot prove the package is comment-free, so it returns true and the reap still
142
- * runs rather than skipping cleanup.
143
- */
144
- declare function hasAnyComment(pkg: OoxmlPackage): boolean;
145
-
146
- /** A position in the model offset space of one story. */
147
- interface ReviewPosition {
148
- readonly paragraphId: string;
149
- readonly offset: number;
150
- }
151
- /** Where an item is anchored: a range in one story. */
152
- interface ReviewRange {
153
- readonly partName: string;
154
- readonly start: ReviewPosition;
155
- readonly end: ReviewPosition;
156
- }
157
- /**
158
- * What kind of decision a revision card represents.
159
- *
160
- * Wider than the four content wrappers, because a reviewer has to be shown every pending
161
- * decision, including the ones that decorate no characters. A card the surface cannot show is
162
- * a change the reviewer never learns about — and `acceptAllRevisions` refuses if ANY revision
163
- * in the document is one the engine cannot resolve, so an invisible one makes Accept All fail
164
- * for a reason nothing on screen explains.
165
- */
166
- type ReviewRevisionKind = 'insert' | 'delete'
167
- /**
168
- * A deletion and an insertion that are one edit: text typed over a selection.
169
- *
170
- * Word shows these as a single `Replaced "x" with "y"` card, and resolving one half
171
- * without the other is never what the reviewer meant — accepting the deletion alone
172
- * leaves the replacement text unproposed, rejecting it alone leaves both.
173
- */
174
- | 'replace' | 'moveFrom' | 'moveTo'
175
- /** `w:rPrChange` / `w:pPrChange` — the words are unchanged, their formatting is not. */
176
- | 'format'
177
- /** `w:pPr/w:rPr/w:ins|w:del` — a paragraph split or merge. */
178
- | 'paragraphMark'
179
- /** A row, cell, section or grid revision. Supported row revisions are resolvable. */
180
- | 'structural';
181
- /** One tracked change as the store derives it, keyed per decision rather than per site. */
182
- interface ReviewRevisionItem {
183
- readonly kind: 'revision';
184
- /** Stable across renders and unique per DECISION, not per site. */
185
- readonly id: string;
186
- /** The payload `acceptRevision` / `rejectRevision` take. */
187
- readonly address: RevisionAddress;
188
- /**
189
- * EVERY address this decision covers, `address` first.
190
- *
191
- * More than one only for a replacement, whose halves a foreign editor may have written
192
- * as two independent revisions. Accept and reject walk all of them in one transaction:
193
- * resolving one half and leaving the other is a state no reviewer asked for.
194
- */
195
- readonly addresses: readonly RevisionAddress[];
196
- /** The words a replacement removes. Empty for every other kind. */
197
- readonly replacedText: string;
198
- readonly revisionKind: ReviewRevisionKind;
199
- /**
200
- * WHICH decision a `paragraphMark` records, absent for every other kind.
201
- *
202
- * `EG_ParaRPrTrackChanges` is `ins? del? moveFrom? moveTo?`, and the four say opposite
203
- * things about the same break: one proposes it, another proposes taking it away. Collapsing
204
- * them into the single kind lost that, and a card then described a deleted break as an
205
- * inserted one — the reverse of what Accept on that card does.
206
- */
207
- readonly markDirection?: 'insert' | 'delete' | 'moveFrom' | 'moveTo';
208
- readonly author: string;
209
- readonly date?: string;
210
- /** Text the revision covers, for the card summary. Empty for changes with no characters. */
211
- readonly text: string;
212
- /** Every site this decision touches, in document order. */
213
- readonly ranges: readonly ReviewRange[];
214
- /**
215
- * How deeply this change is NESTED inside other changes, 0 for an unenclosed one.
216
- *
217
- * Revisions nest for real, and OOXML has no other way to say what happened: `w:ins` wrapping
218
- * `w:del` is content one reviewer added and another struck. Both stay pending, because each
219
- * author has to be answered separately, so both are cards — over one identical range.
220
- *
221
- * A range therefore cannot say which change a position is "in", and this is what settles it.
222
- * Word treats the innermost change as the operative one: the words are struck on the page
223
- * because of the deletion, and accepting the change under them performs that deletion. So the
224
- * deepest card wins the caret, and the one enclosing it stays listed and reachable.
225
- */
226
- readonly nesting: number;
227
- /**
228
- * How many leading `ranges` are the STRUCK half of a replacement.
229
- *
230
- * A replacement's card is one decision but its ranges are two colours — red over what is
231
- * going, green over what takes its place. ABSENT when the halves do not split at a single
232
- * point, which is what a file recording both under one revision id can produce; a surface
233
- * then has no basis for two colours and should paint one neutral band rather than guess.
234
- */
235
- readonly replacedRangeCount?: number;
236
- /**
237
- * True when the engine cannot resolve this kind, so accept and reject must not be offered.
238
- *
239
- * Derived HERE rather than from a caller-supplied predicate: the refusal list is internal,
240
- * and a surface asked to compute it would have to guess. A card that offers a button the
241
- * engine will refuse is worse than one that explains why it cannot.
242
- */
243
- readonly readOnly: boolean;
244
- /** The other half of a move, or the other side of a delete/insert replacement. */
245
- readonly pairedWith?: string;
246
- /**
247
- * Comments answering this change, in document order.
248
- *
249
- * A reply to a tracked change IS a comment: `w:ins` and `w:del` carry `(@w:id, @w:author,
250
- * @w:date)` and no body, so `replyToReviewItem` writes the text as a comment over the
251
- * revision's own range. Nothing recorded the link, so the reply came back as a separate
252
- * card — the reader saw their answer detach from the change it answered. The range is the
253
- * link, and it is the same evidence `commentItemsOf` threads coincident comments on.
254
- */
255
- readonly replyIds: readonly string[];
256
- }
257
- /** One comment as the store derives it, with its thread links resolved. */
258
- interface ReviewCommentItem {
259
- readonly kind: 'comment';
260
- readonly id: string;
261
- readonly comment: CommentRecord;
262
- readonly range: ReviewRange | null;
263
- readonly resolved: boolean;
264
- /** The comment this replies to, absent for a top-level comment. */
265
- readonly parentId?: string;
266
- /**
267
- * The REVISION this comment answers, when it covers exactly that change's characters.
268
- *
269
- * Separate from {@link parentId} rather than folded into it: the two name different item
270
- * kinds, and a surface resolving one id against the comment index would find nothing.
271
- */
272
- readonly parentRevisionId?: string;
273
- /** Replies to this comment, in document order. Empty for a reply or a childless comment. */
274
- readonly replyIds: readonly string[];
275
- /** True when the file gave this comment no usable range. */
276
- readonly orphaned: boolean;
277
- }
278
- /**
279
- * One pending decision as the STORE derives it: a tracked change or a comment. Discriminate on
280
- * `kind`.
281
- *
282
- * The layout layer's own `ReviewItem` widens this with the pro custom-node card, which has no
283
- * store representation.
284
- */
285
- type ReviewItem = ReviewRevisionItem | ReviewCommentItem;
286
- /** The stable key a surface uses for the active item and for a React list. */
287
- declare function reviewItemKey(item: ReviewItem): string;
288
- /** Plain text of a comment's body, so a card never re-implements the run walk. */
289
- declare function commentBodyText(comment: CommentRecord): string;
290
- /** Author initials for an avatar, from `@w:initials` or the name. */
291
- declare function commentInitials(comment: CommentRecord): string;
292
- /**
293
- * Every revision in one story, one card per DECISION.
294
- *
295
- * Sites sharing an `(id, author, date)` triple are ONE revision — a tracked row insertion is
296
- * `w:trPr/w:ins` plus `w:cellIns` on every cell — so they coalesce into one card listing every
297
- * range it touches. Keying per site would show the reviewer four decisions where there is one,
298
- * and accepting any of them would make the other three vanish.
299
- *
300
- * Memoized per part root like the indexes it reads, and for the same reason: a heavily
301
- * tracked document produces tens of thousands of cards, and rebuilding them per read cost
302
- * more than everything the memos above saved. The paragraph-scoped view the local review
303
- * patch derives (`revisionItemsOfParagraph`'s synthetic paragraph-root part) is NOT cached:
304
- * each keystroke would insert a fresh root and churn the bounded ring. The instance is
305
- * SHARED, so the return type is readonly.
306
- */
307
- declare function revisionItemsOf(part: OoxmlPart): readonly ReviewRevisionItem[];
308
- /**
309
- * Comment cards, threaded however the file says so and flat when nothing says so.
310
- *
311
- * ECMA-376 §17.13.4.2 gives `CT_Comment` no parent pointer, so threading is never something
312
- * the standard states outright. Three sources, strongest first: `@w15:paraIdParent`, then
313
- * `@w16cid:parentId` — both in namespaces outside Part 1 — and finally a COINCIDENT anchor, a
314
- * comment whose `w:commentRangeStart`/`End` cover exactly the characters an earlier comment's
315
- * cover. The ranges are Part 1's own vocabulary and the only part of a thread that survives a
316
- * producer dropping the extension parts. Coincidence is the last resort and never overrides a
317
- * stated link.
318
- *
319
- * Deliberately not containment. A remark on one word inside another remark's sentence nests
320
- * without being a reply, and reading that as a thread would bury an independent comment inside
321
- * someone else's.
322
- */
323
- declare function commentItemsOf(comments: readonly CommentRecord[], anchors: readonly {
324
- commentId: string;
325
- partName: string;
326
- start: ReviewPosition;
327
- end: ReviewPosition;
328
- orphaned: boolean;
329
- }[], threadState: ReadonlyMap<string, CommentThreadState>): ReviewCommentItem[];
330
- /** What review derivation reads: one story part plus its comment parts. */
331
- interface ReviewModelInput {
332
- /** The story the ranges live in — the main document, a header, a note. */
333
- readonly storyPart: OoxmlPart;
334
- /**
335
- * Header/footer story parts, in section order. Their revisions and comment anchors join
336
- * the queue: a tracked change in a header is a pending decision like any other, and a
337
- * queue that only walked the body silently hid it from the rail AND from Accept All.
338
- */
339
- readonly furnitureParts?: readonly OoxmlPart[] | undefined;
340
- /** `word/comments.xml`, absent when the package has none. */
341
- readonly commentsPart?: OoxmlPart | undefined;
342
- /** `word/commentsExtended.xml`, absent when the package has none. */
343
- readonly commentsExtendedPart?: OoxmlPart | undefined;
344
- }
345
- /**
346
- * Everything the review surface lists, in document order.
347
- *
348
- * Order is by paragraph position within the story, then by offset. A comment and the revision
349
- * it covers therefore arrive together, which is what lets a surface group them. Furniture
350
- * stories rank after the body in one merged order — their geometry (the page they first paint
351
- * on) is a layout question the queue deliberately does not answer.
352
- */
353
- declare function collectReviewItems(input: ReviewModelInput): ReviewItem[];
354
- /**
355
- * The shape {@link linkRevisionReplies} needs, stated STRUCTURALLY.
356
- *
357
- * The store's queue is revisions and comments; the layout lane's adds a third kind for custom
358
- * nodes, and neither union is assignable to the other. Both lanes have to run this pass — the
359
- * store on the full derivation, the session on the locally patched list — so the pass is
360
- * written against the fields it actually reads rather than against either union, and hands
361
- * back the caller's own item type.
362
- */
363
- interface LinkableReviewItem {
364
- readonly kind: string;
365
- readonly id: string;
366
- readonly ranges?: readonly ReviewRange[];
367
- readonly range?: ReviewRange | null;
368
- readonly parentId?: string;
369
- readonly parentRevisionId?: string;
370
- readonly replyIds?: readonly string[];
371
- readonly orphaned?: boolean;
372
- /** How deeply a revision is nested; absent on the kinds that cannot nest. */
373
- readonly nesting?: number;
374
- }
375
- /**
376
- * Attach each comment that answers a tracked change to the change it answers.
377
- *
378
- * The evidence is the RANGE, exactly as it is for a coincident comment thread: replying to a
379
- * revision writes a comment over that revision's own characters, because OOXML gives `w:ins`
380
- * and `w:del` nowhere else to put the text. Without this the reply came back as an independent
381
- * card in the rail, sitting beside the change rather than inside it, and the reader had no way
382
- * to see which change their answer belonged to.
383
- *
384
- * Three things keep it from over-claiming. A ZERO-WIDTH range is evidence of nothing — the same
385
- * rule the comment threading uses, and a format or paragraph-mark revision decorates no
386
- * characters at all. A comment already stated to be a REPLY to another comment is not claimed
387
- * directly, because a stated link always beats an inferred one. And the FIRST revision on a span
388
- * wins, so a card cannot claim a reply another card already holds.
389
- *
390
- * The WHOLE conversation moves, not its head. A change's card renders `replyIds` as a flat list,
391
- * so linking only the top comment of a thread left every answer to that answer rendered by
392
- * nobody: reply twice to one change and the second reply existed in `comments.xml` and appeared
393
- * nowhere on screen. Descendants ride along, in the order they were authored.
394
- *
395
- * IDEMPOTENT, and that is load-bearing. The session re-runs this over a list whose comments are
396
- * ALREADY linked, so a pass that only ever added links left a stale `parentRevisionId` behind
397
- * when a keystroke shifted the revision's offsets out from under it — the rail filters such a
398
- * comment out of its roots, and with no revision claiming it any more the card vanished until
399
- * the next full re-derivation. Every link is rebuilt from the ranges on every pass.
400
- */
401
- declare function linkRevisionReplies<T extends LinkableReviewItem>(items: readonly T[]): T[];
402
- /**
403
- * Paragraph node id → document position, from the TREE rather than from a layout.
404
- *
405
- * Memoized on the immutable root: one full derivation pass asks this question three times
406
- * (replacement pairing, the queue's merged order, the session's cached order), and each
407
- * answer was a fresh full-tree walk. The instance is SHARED, so the return type is
408
- * ReadonlyMap: a caller mutating it would poison every later reader of this root.
409
- */
410
- declare function paragraphOrderOfPart(part: OoxmlPart): ReadonlyMap<string, number>;
411
- /**
412
- * Like {@link paragraphOrderOfPart}, but descends INTO paragraphs, so paragraphs nested
413
- * in a run's content — a textbox's `w:txbxContent` — rank right after their host.
414
- *
415
- * A separate function on purpose: the shallow order feeds the review queue's card
416
- * ordering, and re-ranking nested paragraphs there would move cards. This one exists for
417
- * position containment tests ("is the caret inside this range"), where a paragraph the
418
- * shallow order cannot see is a position that can never match.
419
- */
420
- declare function deepParagraphOrderOfPart(part: OoxmlPart): ReadonlyMap<string, number>;
421
- /**
422
- * Every range a decision touches. One card can cover several, in different paragraphs.
423
- *
424
- * Exported because the geometry half in the layout lane asks the same question, and a second
425
- * copy of "which ranges does this item cover" is how a card comes to be painted over one range
426
- * and activated by another.
427
- */
428
- declare function reviewItemRanges(item: ReviewItem): readonly ReviewRange[];
429
- /** The range an item is anchored at — where its card belongs and how it sorts. */
430
- declare function firstReviewRange(item: ReviewItem): ReviewRange | null;
431
-
432
- export { type AuthoredNoteProperties as A, isLegalEndnotePosition as B, type CommentAnchor as C, DEFAULT_ENDNOTE_PROPERTIES as D, type EndnotePosition as E, type FootnotePosition as F, isLegalFootnotePosition as G, isLegalNumRestart as H, linkRevisionReplies as I, parseAuthoredNoteProperties as J, resolveEndnoteProperties as K, type LinkableReviewItem as L, resolveFootnoteProperties as M, type NoteNumRestart as N, reviewItemKey as O, reviewItemRanges as P, revisionItemsOf as Q, type ResolvedFootnoteProperties as R, settingsPartOf as S, threadStateOfPart as T, W15_NAMESPACE_URI as W, type ResolvedEndnoteProperties as a, type CommentPosition as b, type CommentRecord as c, type CommentThreadState as d, DEFAULT_FOOTNOTE_PROPERTIES as e, type ReviewCommentItem as f, type ReviewItem as g, type ReviewModelInput as h, type ReviewPosition as i, type ReviewRange as j, type ReviewRevisionItem as k, type ReviewRevisionKind as l, authoredDocumentEndnoteProperties as m, authoredDocumentFootnoteProperties as n, authoredEndnotePropertiesFromSectPr as o, paragraphOrderOfPart as p, authoredFootnotePropertiesFromSectPr as q, collectReviewItems as r, commentAnchorsOfStory as s, commentBodyText as t, commentInitials as u, commentItemsOf as v, commentsOfPart as w, deepParagraphOrderOfPart as x, firstReviewRange as y, hasAnyComment as z };