@docx-editor.dev/core 0.0.1 → 2.1.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.
Files changed (116) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +91 -2
  3. package/THIRD_PARTY_NOTICES.md +18 -0
  4. package/dist/automation.cjs +1 -0
  5. package/dist/automation.d.cts +74 -0
  6. package/dist/automation.d.ts +74 -0
  7. package/dist/automation.js +1 -0
  8. package/dist/binding.cjs +1 -0
  9. package/dist/binding.d.cts +88 -0
  10. package/dist/binding.d.ts +88 -0
  11. package/dist/binding.js +1 -0
  12. package/dist/chunk-2DTQDAN7.js +2 -0
  13. package/dist/chunk-3JKQE4QJ.cjs +2 -0
  14. package/dist/chunk-4WWEDTTE.js +2 -0
  15. package/dist/chunk-6WIIHJFY.js +1 -0
  16. package/dist/chunk-7VQ7YLW3.cjs +1 -0
  17. package/dist/chunk-BS554B6D.cjs +2 -0
  18. package/dist/chunk-BZK64YU3.cjs +10 -0
  19. package/dist/chunk-CZFUMACF.cjs +12 -0
  20. package/dist/chunk-GQQOL4PV.js +1 -0
  21. package/dist/chunk-HBL3NNH5.cjs +1 -0
  22. package/dist/chunk-JQFDLZXQ.cjs +2 -0
  23. package/dist/chunk-O2WQY7IT.cjs +5 -0
  24. package/dist/chunk-PC76F2HR.cjs +1 -0
  25. package/dist/chunk-QRAUDDVY.js +2 -0
  26. package/dist/chunk-REZUWYB7.js +1 -0
  27. package/dist/chunk-STCITBJK.js +12 -0
  28. package/dist/chunk-TBBXCC7D.js +5 -0
  29. package/dist/chunk-TSXT537P.cjs +12 -0
  30. package/dist/chunk-WOGYVM3W.js +12 -0
  31. package/dist/chunk-Y7TA7TPF.js +10 -0
  32. package/dist/content-control-walk-CbTqHq6O.d.cts +56 -0
  33. package/dist/content-control-walk-D06GijR0.d.ts +56 -0
  34. package/dist/contracts/document.cjs +1 -0
  35. package/dist/contracts/document.d.cts +246 -0
  36. package/dist/contracts/document.d.ts +246 -0
  37. package/dist/contracts/document.js +0 -0
  38. package/dist/contracts/editor.cjs +1 -0
  39. package/dist/contracts/editor.d.cts +11 -0
  40. package/dist/contracts/editor.d.ts +11 -0
  41. package/dist/contracts/editor.js +1 -0
  42. package/dist/contracts/interaction.cjs +1 -0
  43. package/dist/contracts/interaction.d.cts +11 -0
  44. package/dist/contracts/interaction.d.ts +11 -0
  45. package/dist/contracts/interaction.js +0 -0
  46. package/dist/contracts/modules.cjs +1 -0
  47. package/dist/contracts/modules.d.cts +117 -0
  48. package/dist/contracts/modules.d.ts +117 -0
  49. package/dist/contracts/modules.js +1 -0
  50. package/dist/contracts/types.cjs +1 -0
  51. package/dist/contracts/types.d.cts +452 -0
  52. package/dist/contracts/types.d.ts +452 -0
  53. package/dist/contracts/types.js +0 -0
  54. package/dist/custom-node-writes-YqISlSRl.d.cts +885 -0
  55. package/dist/custom-node-writes-ttKuYd0M.d.ts +885 -0
  56. package/dist/editor-B93PggnR.d.cts +1690 -0
  57. package/dist/editor-CFsSrxGR.d.ts +1690 -0
  58. package/dist/editor.cjs +1 -0
  59. package/dist/editor.css +7106 -0
  60. package/dist/editor.d.cts +271 -0
  61. package/dist/editor.d.ts +271 -0
  62. package/dist/editor.js +1 -0
  63. package/dist/hf-references-BdjsQNE_.d.ts +71 -0
  64. package/dist/hf-references-CgEOSw3i.d.cts +71 -0
  65. package/dist/image-resources-C_YnqPhn.d.ts +203 -0
  66. package/dist/image-resources-DwpNnTg3.d.cts +203 -0
  67. package/dist/index-BjZelfWL.d.cts +2532 -0
  68. package/dist/index-DP1yJJ3R.d.ts +2532 -0
  69. package/dist/index.cjs +1 -0
  70. package/dist/index.d.cts +22 -0
  71. package/dist/index.d.ts +22 -0
  72. package/dist/index.js +1 -0
  73. package/dist/layout.cjs +1 -0
  74. package/dist/layout.d.cts +2366 -0
  75. package/dist/layout.d.ts +2366 -0
  76. package/dist/layout.js +1 -0
  77. package/dist/note-nodes-BPSTVDMr.d.ts +108 -0
  78. package/dist/note-nodes-C6DLxlvj.d.cts +108 -0
  79. package/dist/ooxml-package-CR5us6ad.d.cts +354 -0
  80. package/dist/ooxml-package-D_CtywTW.d.ts +354 -0
  81. package/dist/ooxml-tree-BU0e3DVi.d.cts +871 -0
  82. package/dist/ooxml-tree-BU0e3DVi.d.ts +871 -0
  83. package/dist/output.cjs +1 -0
  84. package/dist/output.d.cts +158 -0
  85. package/dist/output.d.ts +158 -0
  86. package/dist/output.js +1 -0
  87. package/dist/protocol-BWVA3Q1p.d.ts +1255 -0
  88. package/dist/protocol-FAz_nPm_.d.cts +1255 -0
  89. package/dist/review-reads-CsoXSvUg.d.ts +401 -0
  90. package/dist/review-reads-qW0jvdF1.d.cts +401 -0
  91. package/dist/review-support-D64Wu236.d.cts +358 -0
  92. package/dist/review-support-nsLXC9jf.d.ts +358 -0
  93. package/dist/revision-projection-72ZApe-g.d.cts +84 -0
  94. package/dist/revision-projection-DHAkcD_L.d.ts +84 -0
  95. package/dist/semantic-cell-selection-D_8RbPII.d.ts +427 -0
  96. package/dist/semantic-cell-selection-DwLB71fF.d.cts +427 -0
  97. package/dist/semantic-interaction-CXH2wFqi.d.ts +187 -0
  98. package/dist/semantic-interaction-DqcEonqD.d.cts +187 -0
  99. package/dist/semantic-paint-drawings-B5Wk2so5.d.ts +21 -0
  100. package/dist/semantic-paint-drawings-x8g44lD_.d.cts +21 -0
  101. package/dist/semantic-records-COVFW5aS.d.cts +1505 -0
  102. package/dist/semantic-records-zTC0_1zi.d.ts +1505 -0
  103. package/dist/shaped-measurer-AFnFxoot.d.cts +613 -0
  104. package/dist/shaped-measurer-CZXL-a6v.d.ts +613 -0
  105. package/dist/store.cjs +1 -0
  106. package/dist/store.d.cts +2153 -0
  107. package/dist/store.d.ts +2153 -0
  108. package/dist/store.js +1 -0
  109. package/dist/tree-op-types-DWLCllG7.d.ts +1486 -0
  110. package/dist/tree-op-types-UOXlRUqQ.d.cts +1486 -0
  111. package/dist/tree-session-BtVFXsF6.d.ts +580 -0
  112. package/dist/tree-session-DxIOHUOD.d.cts +580 -0
  113. package/dist/tree-store-B1lEkdXc.d.cts +273 -0
  114. package/dist/tree-store-BscFPB7x.d.ts +273 -0
  115. package/package.json +110 -8
  116. package/index.js +0 -1
@@ -0,0 +1,358 @@
1
+ import { e as OoxmlPart, a as OoxmlElement } from './ooxml-tree-BU0e3DVi.js';
2
+ import { R as RevisionAddress } from './tree-op-types-DWLCllG7.js';
3
+
4
+ /** The `w15` namespace: `commentsExtended.xml` — thread parent and resolved state. */
5
+ declare const W15_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2012/wordml";
6
+ /** A position in one story: a paragraph node id plus a UTF-16 offset inside it. */
7
+ interface CommentPosition {
8
+ readonly paragraphId: string;
9
+ readonly offset: number;
10
+ }
11
+ /**
12
+ * Where a comment is anchored, as a range.
13
+ *
14
+ * `orphaned` records that the file did not give this comment a usable range — a reference with
15
+ * no range markers, or a start with no end. The comment is still listed, marked orphaned,
16
+ * rather than dropped: a reviewer's remark disappearing silently is worse than one that says
17
+ * it lost its text.
18
+ */
19
+ interface CommentAnchor {
20
+ readonly commentId: string;
21
+ /** Canonical name of the part the range lives in, so a header comment is attributable. */
22
+ readonly partName: string;
23
+ readonly start: CommentPosition;
24
+ readonly end: CommentPosition;
25
+ readonly orphaned: boolean;
26
+ }
27
+ /** One comment as authored in `word/comments.xml`. */
28
+ interface CommentRecord {
29
+ readonly id: string;
30
+ readonly author: string;
31
+ readonly initials?: string;
32
+ readonly date?: string;
33
+ /** Body paragraphs, as tree nodes, so the surface renders measured text rather than a string. */
34
+ readonly blocks: readonly OoxmlElement[];
35
+ /** `w14:paraId` of the first body paragraph — the key thread state is stored under. */
36
+ readonly paraId?: string;
37
+ /** `@w16cid:parentId` — the `w:id` of the comment this replies to, when the file names it. */
38
+ readonly parentCommentId?: string;
39
+ }
40
+ /** Thread state for one comment, read from `commentsExtended.xml`. */
41
+ interface CommentThreadState {
42
+ /** `@w15:paraIdParent` — the comment this one replies to, absent for a top-level comment. */
43
+ readonly parentParaId?: string;
44
+ readonly done: boolean;
45
+ }
46
+ /** A position in the model offset space of one story. */
47
+ interface ReviewPosition {
48
+ readonly paragraphId: string;
49
+ readonly offset: number;
50
+ }
51
+ /** Where an item is anchored: a range in one story. */
52
+ interface ReviewRange {
53
+ readonly partName: string;
54
+ readonly start: ReviewPosition;
55
+ readonly end: ReviewPosition;
56
+ }
57
+ /**
58
+ * What kind of decision a revision card represents.
59
+ *
60
+ * Wider than the four content wrappers, because a reviewer has to be shown every pending
61
+ * decision, including the ones that decorate no characters. A card the surface cannot show is
62
+ * a change the reviewer never learns about — and `acceptAllRevisions` refuses if ANY revision
63
+ * in the document is one the engine cannot resolve, so an invisible one makes Accept All fail
64
+ * for a reason nothing on screen explains.
65
+ */
66
+ type ReviewRevisionKind = 'insert' | 'delete'
67
+ /**
68
+ * A deletion and an insertion that are one edit: text typed over a selection.
69
+ *
70
+ * Word shows these as a single `Replaced "x" with "y"` card, and resolving one half
71
+ * without the other is never what the reviewer meant — accepting the deletion alone
72
+ * leaves the replacement text unproposed, rejecting it alone leaves both.
73
+ */
74
+ | 'replace' | 'moveFrom' | 'moveTo'
75
+ /** `w:rPrChange` / `w:pPrChange` — the words are unchanged, their formatting is not. */
76
+ | 'format'
77
+ /** `w:pPr/w:rPr/w:ins|w:del` — a paragraph split or merge. */
78
+ | 'paragraphMark'
79
+ /** A row, cell, section or grid revision. Supported row revisions are resolvable. */
80
+ | 'structural';
81
+ /**
82
+ * One tracked change as a review card.
83
+ *
84
+ * Keyed per DECISION rather than per site: a revision spanning three ranges is one card, because
85
+ * accepting it accepts all three.
86
+ */
87
+ interface ReviewRevisionItem {
88
+ readonly kind: 'revision';
89
+ /** Stable across renders and unique per DECISION, not per site. */
90
+ readonly id: string;
91
+ /** The payload `acceptRevision` / `rejectRevision` take. */
92
+ readonly address: RevisionAddress;
93
+ /**
94
+ * EVERY address this decision covers, `address` first.
95
+ *
96
+ * More than one only for a replacement, whose halves a foreign editor may have written
97
+ * as two independent revisions. Accept and reject walk all of them in one transaction:
98
+ * resolving one half and leaving the other is a state no reviewer asked for.
99
+ */
100
+ readonly addresses: readonly RevisionAddress[];
101
+ /** The words a replacement removes. Empty for every other kind. */
102
+ readonly replacedText: string;
103
+ readonly revisionKind: ReviewRevisionKind;
104
+ readonly author: string;
105
+ readonly date?: string;
106
+ /** Text the revision covers, for the card summary. Empty for changes with no characters. */
107
+ readonly text: string;
108
+ /** Every site this decision touches, in document order. */
109
+ readonly ranges: readonly ReviewRange[];
110
+ /**
111
+ * How many leading `ranges` are the STRUCK half of a replacement.
112
+ *
113
+ * A replacement's card is one decision but its ranges are two colours — red over what is
114
+ * going, green over what takes its place. ABSENT when the halves do not split at a single
115
+ * point, which is what a file recording both under one revision id can produce; a surface
116
+ * then has no basis for two colours and should paint one neutral band rather than guess.
117
+ */
118
+ readonly replacedRangeCount?: number;
119
+ /**
120
+ * True when the engine cannot resolve this kind, so accept and reject must not be offered.
121
+ *
122
+ * Derived by the MODULE rather than from a caller-supplied predicate: the refusal list is
123
+ * internal, and a surface asked to compute it would have to guess. A card that offers a
124
+ * button the engine will refuse is worse than one that explains why it cannot.
125
+ */
126
+ readonly readOnly: boolean;
127
+ /** The other half of a move, or the other side of a delete/insert replacement. */
128
+ readonly pairedWith?: string;
129
+ /**
130
+ * Comments answering this change, in document order.
131
+ *
132
+ * A reply to a tracked change IS a comment: `w:ins` and `w:del` carry no body, so the text
133
+ * is written as a comment over the revision's own range and the range is what links them.
134
+ */
135
+ readonly replyIds: readonly string[];
136
+ }
137
+ /**
138
+ * One comment as a review card. A reply carries `parentId`; OOXML gives replies no separate
139
+ * element, so threads are reconstructed from that link.
140
+ */
141
+ interface ReviewCommentItem {
142
+ readonly kind: 'comment';
143
+ readonly id: string;
144
+ readonly comment: CommentRecord;
145
+ readonly range: ReviewRange | null;
146
+ readonly resolved: boolean;
147
+ /** The comment this replies to, absent for a top-level comment. */
148
+ readonly parentId?: string;
149
+ /** The REVISION this comment answers, when it covers exactly that change's characters. */
150
+ readonly parentRevisionId?: string;
151
+ /** Replies to this comment, in document order. Empty for a reply or a childless comment. */
152
+ readonly replyIds: readonly string[];
153
+ /** True when the file gave this comment no usable range. */
154
+ readonly orphaned: boolean;
155
+ }
156
+ /**
157
+ * A card contributed by a recognized custom node (`defineCustomNode` with a `reviewCard`
158
+ * hook), anchored at the node's range.
159
+ *
160
+ * Informational, never resolvable: there is nothing to accept or reject, so the engine
161
+ * refuses those verbs on it. `title` and `detail` are HOST-authored (the definition's hook
162
+ * produced them), but `attrs` and `text` originate in a file an attacker controls — a
163
+ * surface renders every one of these as text, never markup.
164
+ */
165
+ interface ReviewCustomItem {
166
+ readonly kind: 'custom';
167
+ /** The SDT node's stable id in the canonical tree. */
168
+ readonly id: string;
169
+ /** The definition's `name`. */
170
+ readonly name: string;
171
+ /** The raw `w:tag` the node was recognized from. Untrusted input. */
172
+ readonly tag: string;
173
+ /** Attrs decoded from the tag, after the definition's recognition hook. Untrusted input. */
174
+ readonly attrs: Readonly<Record<string, string>>;
175
+ /** The SDT's literal content text. Untrusted input. */
176
+ readonly text: string;
177
+ /**
178
+ * The payload the node's control binds to, after the definition validated it.
179
+ *
180
+ * Undefined when the node carries none or the payload did not match — see the pro package's
181
+ * `RecognizedCustomNode.data`, which this is carried from.
182
+ */
183
+ readonly data?: unknown;
184
+ /**
185
+ * Whether this node asked for a sidebar card.
186
+ *
187
+ * False for a definition with no `reviewCard`: the item exists so the chip's own surfaces can
188
+ * read `attrs`, `text` and `data` off it, and the rail leaves it out. A surface listing cards
189
+ * filters on this rather than on an empty `title`.
190
+ */
191
+ readonly carded: boolean;
192
+ /** Card title, from the definition's `reviewCard` hook. Empty when `carded` is false. */
193
+ readonly title: string;
194
+ /** Card body, from the definition's `reviewCard` hook. */
195
+ readonly detail?: string;
196
+ readonly range: ReviewRange | null;
197
+ }
198
+ /**
199
+ * One pending decision in the review queue: a tracked change, a comment thread, or a pro
200
+ * custom-node card. Discriminate on `kind`.
201
+ */
202
+ type ReviewItem = ReviewRevisionItem | ReviewCommentItem | ReviewCustomItem;
203
+ /** What the review queue derivation reads: one story part plus its comment parts. */
204
+ interface ReviewModelInput {
205
+ /** The story the ranges live in — the main document, a header, a note. */
206
+ readonly storyPart: OoxmlPart;
207
+ /**
208
+ * Header/footer story parts, in section order. Their revisions and comment anchors join
209
+ * the queue: a tracked change in a header is a pending decision like any other, and a
210
+ * queue that only walked the body silently hid it from the rail AND from Accept All.
211
+ */
212
+ readonly furnitureParts?: readonly OoxmlPart[] | undefined;
213
+ /** `word/comments.xml`, absent when the package has none. */
214
+ readonly commentsPart?: OoxmlPart | undefined;
215
+ /** `word/commentsExtended.xml`, absent when the package has none. */
216
+ readonly commentsExtendedPart?: OoxmlPart | undefined;
217
+ /**
218
+ * Custom node definitions from the module registry, forwarded OPAQUELY.
219
+ *
220
+ * Core carries them the way the registry does — as unknowns — so the definition shape
221
+ * stays a capability-package concern. The pro derivation narrows them and contributes
222
+ * `kind: 'custom'` cards for definitions that opted in.
223
+ */
224
+ readonly customNodes?: readonly unknown[] | undefined;
225
+ /**
226
+ * The payload each of the story's controls binds to, keyed by the control's node id.
227
+ *
228
+ * Resolved by the ENGINE and handed over, because a payload lives in a customXml data part
229
+ * and a derivation that only receives story parts has no way to reach one. Untrusted file
230
+ * input on both members; a capability package validates it against whatever shape it
231
+ * declared before handing it to a host.
232
+ */
233
+ /**
234
+ * Where a capability package reports a node it could not read. Supplied per editor, so a page
235
+ * with two of them keeps their diagnostics apart.
236
+ */
237
+ readonly reportCustomNodeDiagnostic?: ((diagnostic: unknown) => void) | undefined;
238
+ readonly customNodePayloads?: ReadonlyMap<string, {
239
+ readonly nodeId: string;
240
+ readonly label: string;
241
+ readonly data: string;
242
+ }> | undefined;
243
+ }
244
+ /** The stable key a surface uses for the active item and for a React list. */
245
+ declare function reviewItemKey(item: ReviewItem): string;
246
+ /** Plain text of a comment's body, so a card never re-implements the run walk. */
247
+ declare function commentBodyText(comment: CommentRecord): string;
248
+ /** Author initials for an avatar, from `@w:initials` or the name. */
249
+ declare function commentInitials(comment: CommentRecord): string;
250
+
251
+ /** Every range a decision touches. One card can cover several, in different paragraphs. */
252
+ declare function reviewItemRanges(item: ReviewItem): readonly ReviewRange[];
253
+ /** The first range of an item, in authored order, or null when it has none. */
254
+ declare function firstReviewRange(item: ReviewItem): ReviewRange | null;
255
+ /**
256
+ * A single comparable number for document order.
257
+ *
258
+ * Paragraph index dominates offset, so a revision spanning paragraphs still sorts by where it
259
+ * STARTS. An item with no resolvable range sorts last rather than to position zero, which is
260
+ * where an orphan used to land — tearing an orphaned reply out of its own thread.
261
+ */
262
+ declare function reviewItemPositionRank(item: ReviewItem, order: ReadonlyMap<string, number>): number;
263
+ /**
264
+ * Every item covering a position, innermost first.
265
+ *
266
+ * Returning the whole stack rather than one winner is what lets a surface offer cycling, a
267
+ * stacked card, or a "1 of 3" affordance. A comment wrapping a revision used to be unreachable
268
+ * because only the tightest range was ever returned.
269
+ */
270
+ declare function reviewItemsAt(items: readonly ReviewItem[], position: ReviewPosition, order: ReadonlyMap<string, number>): ReviewItem[];
271
+ /**
272
+ * The item the caret is in, or null.
273
+ *
274
+ * A resolved comment never activates: a settled thread must not reopen itself as the reviewer
275
+ * types near it.
276
+ *
277
+ * A REPLY resolves to the thread it belongs to. A reply is anchored over its parent's range,
278
+ * so both cover the caret — and the reply, being newer, wins the innermost test. It is not a
279
+ * card of its own (it renders inside its parent's), so the thread would have gone active with
280
+ * nothing on screen showing it: the reply box vanished from a comment the moment somebody
281
+ * replied to it.
282
+ */
283
+ declare function activeReviewItem(items: readonly ReviewItem[], position: ReviewPosition, order: ReadonlyMap<string, number>): ReviewItem | null;
284
+ /**
285
+ * Walk a reply up to the card that heads its thread. Guarded against a cyclic file.
286
+ *
287
+ * The head is not always a comment. A reply to a tracked change renders inside the REVISION's
288
+ * card, so resolving it to itself opened an item nothing on screen was drawing — the reply box
289
+ * vanished the moment somebody answered a change.
290
+ *
291
+ * EXPORTED because the paginated surface answers "which card is open" itself, against its own
292
+ * dismissed-key state, rather than through {@link activeReviewItem}. Two copies of the
293
+ * innermost-wins rule was survivable while a reply could only be a comment — the parent came
294
+ * first in `comments.xml` order and won the tie by accident. It stopped being survivable the
295
+ * moment a reply could answer a revision, which outranks it outright.
296
+ */
297
+ declare function reviewThreadRootOf(items: readonly ReviewItem[], comment: ReviewCommentItem): ReviewItem;
298
+ /** Where one paragraph sits, resolved once so a card is an O(1) lookup. */
299
+ interface ReviewParagraphAnchor {
300
+ readonly pageIndex: number;
301
+ /** Sheet-absolute y of the page's content box. */
302
+ readonly contentY: number;
303
+ /** The fragment's own y, measured from that content box. */
304
+ readonly fragmentY: number;
305
+ readonly lines?: readonly {
306
+ readonly range: {
307
+ readonly end: number;
308
+ };
309
+ readonly box: {
310
+ readonly y: number;
311
+ };
312
+ }[];
313
+ }
314
+ /**
315
+ * Paragraph id to its place on the page, in ONE pass over the layout.
316
+ *
317
+ * Built once per layout and reused by every card. The straightforward version — scan the
318
+ * pages until the paragraph turns up, per card — is a full-document walk per card, and a
319
+ * contract with two hundred comments walked the document two hundred times every time the
320
+ * caret moved. Toggling the pane was visibly slow for exactly that reason.
321
+ */
322
+ declare function reviewAnchorIndex<TPage extends {
323
+ readonly index: number;
324
+ readonly contentBox: {
325
+ readonly y: number;
326
+ };
327
+ }>(layout: {
328
+ readonly pages: readonly TPage[];
329
+ }, paragraphFragments: (page: TPage) => readonly {
330
+ readonly paragraphId: string;
331
+ readonly box: {
332
+ readonly y: number;
333
+ };
334
+ readonly lines?: readonly {
335
+ readonly range: {
336
+ readonly end: number;
337
+ };
338
+ readonly box: {
339
+ readonly y: number;
340
+ };
341
+ }[];
342
+ }[]): Map<string, ReviewParagraphAnchor>;
343
+ /**
344
+ * Where a card belongs beside the page, from LAYOUT RECORDS.
345
+ *
346
+ * The one question the tree cannot answer, and the one a surface must not answer for itself:
347
+ * measuring painted DOM puts the sidebar a repaint behind the document and breaks outright
348
+ * while pagination is in flight.
349
+ *
350
+ * Returns null when the item has no resolvable range, or when its paragraph is not in this
351
+ * layout — a comment anchored in a header belongs to a story the body layout never saw.
352
+ */
353
+ declare function reviewItemGeometry(item: ReviewItem, index: ReadonlyMap<string, ReviewParagraphAnchor>): {
354
+ readonly pageIndex: number;
355
+ readonly y: number;
356
+ } | null;
357
+
358
+ 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 CommentAnchor as h, type CommentPosition as i, type CommentThreadState as j, type ReviewParagraphAnchor as k, activeReviewItem as l, commentBodyText as m, commentInitials as n, firstReviewRange as o, reviewItemGeometry as p, reviewItemKey as q, reviewAnchorIndex as r, reviewItemPositionRank as s, reviewItemRanges as t, reviewItemsAt as u, reviewThreadRootOf as v };
@@ -0,0 +1,84 @@
1
+ import { O as OoxmlNode } from './ooxml-tree-BU0e3DVi.cjs';
2
+
3
+ /**
4
+ * What a revision wrapper asserts about the content inside it.
5
+ *
6
+ * `moveFrom` / `moveTo` are deliberately distinct from `delete` / `insert`: a move is one
7
+ * decision with two halves, and presenting it as an unrelated deletion and insertion invites
8
+ * resolving one without the other, which duplicates or loses the content.
9
+ */
10
+ type RevisionKind = 'insert' | 'delete' | 'moveFrom' | 'moveTo' | 'format';
11
+ /**
12
+ * One revision wrapper's provenance, as authored.
13
+ *
14
+ * `id` is the verbatim `@w:id` string rather than a number: `ST_DecimalNumber` restricts
15
+ * `xsd:integer` with no bounds, so a file may carry a value outside the safe integer range, and
16
+ * parsing it to a number would silently merge two distinct revisions.
17
+ *
18
+ * `date` is absent when the file omits it. `@w:date` is optional on `CT_TrackChange`, and
19
+ * inventing one is a silent content change.
20
+ */
21
+ interface RevisionAttribution {
22
+ readonly kind: RevisionKind;
23
+ readonly id: string;
24
+ readonly author: string;
25
+ readonly date?: string;
26
+ /** The wrapper's node id, so a surface can address this exact site. */
27
+ readonly nodeId: string;
28
+ }
29
+ /**
30
+ * Which revisions layout resolves before producing pages.
31
+ *
32
+ * - `all-markup` shows both halves of every change.
33
+ * - `proposed` shows what the document becomes if every change is accepted.
34
+ * - `original` shows what it was before any of them.
35
+ *
36
+ * The last two are specified as equal to accept-all and reject-all OUTPUT, which is what makes
37
+ * them testable, without either applying an op.
38
+ */
39
+ type RevisionDisplayMode = 'all-markup' | 'proposed' | 'original';
40
+ /**
41
+ * How a document renders tracked changes when nothing says otherwise.
42
+ *
43
+ * `all-markup` matches Word's own default: a reader who opens a document with pending changes
44
+ * sees them, rather than a clean-looking document hiding edits nobody has accepted.
45
+ */
46
+ declare const DEFAULT_REVISION_DISPLAY_MODE: RevisionDisplayMode;
47
+ /**
48
+ * Whether content under this stack of revisions is laid out in the given mode.
49
+ *
50
+ * Containment governs, so a single enclosing wrapper the mode resolves away suppresses
51
+ * everything inside it regardless of what the inner wrappers say. An insertion inside a
52
+ * deletion does not survive the proposed result: the deletion it sits in was accepted.
53
+ */
54
+ declare function revisionsVisible(revisions: readonly RevisionAttribution[], mode: RevisionDisplayMode): boolean;
55
+ /**
56
+ * The revision on a paragraph's own MARK, from `w:pPr/w:rPr/w:ins|w:del`.
57
+ *
58
+ * `EG_ParaRPrTrackChanges` records that the pilcrow itself was inserted or deleted, which is how
59
+ * Word writes a paragraph split or merge. It is not content — there is no text to decorate — so
60
+ * a surface shows it as a mark of its own beside the paragraph, the way Word draws a struck-
61
+ * through ¶.
62
+ *
63
+ * Property-position `w:ins`/`w:del` stay `generic` in the tree deliberately, so this reads them
64
+ * by name rather than by kind.
65
+ */
66
+ declare function paragraphMarkRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
67
+ /**
68
+ * The tracked FORMAT change on a property list, from `w:rPrChange` or `w:pPrChange`.
69
+ *
70
+ * A property change alters no characters, so it has no span of its own to strike or underline.
71
+ * Word marks the affected text and says what changed; the minimum a reader needs is to see that
72
+ * this text's formatting is itself a pending decision.
73
+ *
74
+ * Read from the flattened property list because that is what layout already carries — the
75
+ * change wrapper is a `w:rPr`/`w:pPr` child like any other.
76
+ */
77
+ declare function formatRevisionOf(properties: readonly {
78
+ readonly localName: string;
79
+ readonly attributes?: Readonly<Record<string, string>>;
80
+ }[]): RevisionAttribution | null;
81
+ /** True when this stack of revisions marks its content as deleted from the live document. */
82
+ declare function revisionsAreDeletion(revisions: readonly RevisionAttribution[]): boolean;
83
+
84
+ export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b, revisionsVisible as c, formatRevisionOf as f, paragraphMarkRevisionOf as p, revisionsAreDeletion as r };
@@ -0,0 +1,84 @@
1
+ import { O as OoxmlNode } from './ooxml-tree-BU0e3DVi.js';
2
+
3
+ /**
4
+ * What a revision wrapper asserts about the content inside it.
5
+ *
6
+ * `moveFrom` / `moveTo` are deliberately distinct from `delete` / `insert`: a move is one
7
+ * decision with two halves, and presenting it as an unrelated deletion and insertion invites
8
+ * resolving one without the other, which duplicates or loses the content.
9
+ */
10
+ type RevisionKind = 'insert' | 'delete' | 'moveFrom' | 'moveTo' | 'format';
11
+ /**
12
+ * One revision wrapper's provenance, as authored.
13
+ *
14
+ * `id` is the verbatim `@w:id` string rather than a number: `ST_DecimalNumber` restricts
15
+ * `xsd:integer` with no bounds, so a file may carry a value outside the safe integer range, and
16
+ * parsing it to a number would silently merge two distinct revisions.
17
+ *
18
+ * `date` is absent when the file omits it. `@w:date` is optional on `CT_TrackChange`, and
19
+ * inventing one is a silent content change.
20
+ */
21
+ interface RevisionAttribution {
22
+ readonly kind: RevisionKind;
23
+ readonly id: string;
24
+ readonly author: string;
25
+ readonly date?: string;
26
+ /** The wrapper's node id, so a surface can address this exact site. */
27
+ readonly nodeId: string;
28
+ }
29
+ /**
30
+ * Which revisions layout resolves before producing pages.
31
+ *
32
+ * - `all-markup` shows both halves of every change.
33
+ * - `proposed` shows what the document becomes if every change is accepted.
34
+ * - `original` shows what it was before any of them.
35
+ *
36
+ * The last two are specified as equal to accept-all and reject-all OUTPUT, which is what makes
37
+ * them testable, without either applying an op.
38
+ */
39
+ type RevisionDisplayMode = 'all-markup' | 'proposed' | 'original';
40
+ /**
41
+ * How a document renders tracked changes when nothing says otherwise.
42
+ *
43
+ * `all-markup` matches Word's own default: a reader who opens a document with pending changes
44
+ * sees them, rather than a clean-looking document hiding edits nobody has accepted.
45
+ */
46
+ declare const DEFAULT_REVISION_DISPLAY_MODE: RevisionDisplayMode;
47
+ /**
48
+ * Whether content under this stack of revisions is laid out in the given mode.
49
+ *
50
+ * Containment governs, so a single enclosing wrapper the mode resolves away suppresses
51
+ * everything inside it regardless of what the inner wrappers say. An insertion inside a
52
+ * deletion does not survive the proposed result: the deletion it sits in was accepted.
53
+ */
54
+ declare function revisionsVisible(revisions: readonly RevisionAttribution[], mode: RevisionDisplayMode): boolean;
55
+ /**
56
+ * The revision on a paragraph's own MARK, from `w:pPr/w:rPr/w:ins|w:del`.
57
+ *
58
+ * `EG_ParaRPrTrackChanges` records that the pilcrow itself was inserted or deleted, which is how
59
+ * Word writes a paragraph split or merge. It is not content — there is no text to decorate — so
60
+ * a surface shows it as a mark of its own beside the paragraph, the way Word draws a struck-
61
+ * through ¶.
62
+ *
63
+ * Property-position `w:ins`/`w:del` stay `generic` in the tree deliberately, so this reads them
64
+ * by name rather than by kind.
65
+ */
66
+ declare function paragraphMarkRevisionOf(paragraph: OoxmlNode): RevisionAttribution | null;
67
+ /**
68
+ * The tracked FORMAT change on a property list, from `w:rPrChange` or `w:pPrChange`.
69
+ *
70
+ * A property change alters no characters, so it has no span of its own to strike or underline.
71
+ * Word marks the affected text and says what changed; the minimum a reader needs is to see that
72
+ * this text's formatting is itself a pending decision.
73
+ *
74
+ * Read from the flattened property list because that is what layout already carries — the
75
+ * change wrapper is a `w:rPr`/`w:pPr` child like any other.
76
+ */
77
+ declare function formatRevisionOf(properties: readonly {
78
+ readonly localName: string;
79
+ readonly attributes?: Readonly<Record<string, string>>;
80
+ }[]): RevisionAttribution | null;
81
+ /** True when this stack of revisions marks its content as deleted from the live document. */
82
+ declare function revisionsAreDeletion(revisions: readonly RevisionAttribution[]): boolean;
83
+
84
+ export { DEFAULT_REVISION_DISPLAY_MODE as D, type RevisionDisplayMode as R, type RevisionAttribution as a, type RevisionKind as b, revisionsVisible as c, formatRevisionOf as f, paragraphMarkRevisionOf as p, revisionsAreDeletion as r };