@docx-editor.dev/pro 2.27.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/chunk-CNXDNDD3.js +1 -0
  2. package/dist/{chunk-PVRTSPHN.cjs → chunk-FD2KDBHX.cjs} +1 -1
  3. package/dist/chunk-JRHEYVVY.cjs +1 -0
  4. package/dist/chunk-L567WP3J.js +5 -0
  5. package/dist/chunk-MJECUVHQ.cjs +5 -0
  6. package/dist/chunk-MWO2ZUEJ.js +1 -0
  7. package/dist/chunk-N34IUO36.cjs +1 -0
  8. package/dist/chunk-OT5R3IYV.cjs +1 -0
  9. package/dist/chunk-P2EF7WMV.js +1 -0
  10. package/dist/chunk-Q5JTCGJI.js +1 -0
  11. package/dist/chunk-SNQCYZLT.js +1 -0
  12. package/dist/chunk-ZSAAX6HV.cjs +1 -0
  13. package/dist/collaboration/hocuspocus.cjs +1 -1
  14. package/dist/collaboration/hocuspocus.d.cts +18 -11
  15. package/dist/collaboration/hocuspocus.d.ts +18 -11
  16. package/dist/collaboration/hocuspocus.js +1 -1
  17. package/dist/collaboration/index.cjs +2 -2
  18. package/dist/collaboration/index.d.cts +333 -18
  19. package/dist/collaboration/index.d.ts +333 -18
  20. package/dist/collaboration/index.js +2 -2
  21. package/dist/collaboration/webrtc.cjs +2 -2
  22. package/dist/collaboration/webrtc.d.cts +26 -3
  23. package/dist/collaboration/webrtc.d.ts +26 -3
  24. package/dist/collaboration/webrtc.js +2 -2
  25. package/dist/{collaboration-module-DlSv0oAd.d.cts → collaboration-module-DWn2heE1.d.cts} +1 -0
  26. package/dist/{collaboration-module-DlSv0oAd.d.ts → collaboration-module-DWn2heE1.d.ts} +1 -0
  27. package/dist/{define-custom-node-DUJ4ZZdo.d.ts → define-custom-node-CNRQG1TI.d.cts} +12 -4
  28. package/dist/{define-custom-node-DG5gpRa5.d.cts → define-custom-node-D0c36PpZ.d.ts} +12 -4
  29. package/dist/document-session-3VC43WNI.cjs +1 -0
  30. package/dist/{document-session-BKKfJzKB.d.cts → document-session-Bxs4_GgX.d.ts} +55 -33
  31. package/dist/document-session-J2YKWERI.js +1 -0
  32. package/dist/{document-session-BQ4nBDTd.d.ts → document-session-_v9vqiSX.d.cts} +55 -33
  33. package/dist/document-session-options-CfKypp9c.d.cts +37 -0
  34. package/dist/document-session-options-DelOC7PX.d.ts +37 -0
  35. package/dist/index.cjs +1 -1
  36. package/dist/index.d.cts +29 -4
  37. package/dist/index.d.ts +29 -4
  38. package/dist/index.js +1 -1
  39. package/dist/react/hocuspocus.cjs +1 -1
  40. package/dist/react/hocuspocus.d.cts +52 -8
  41. package/dist/react/hocuspocus.d.ts +52 -8
  42. package/dist/react/hocuspocus.js +1 -1
  43. package/dist/react/index.cjs +2 -2
  44. package/dist/react/index.d.cts +354 -156
  45. package/dist/react/index.d.ts +354 -156
  46. package/dist/react/index.js +2 -2
  47. package/dist/react/webrtc.cjs +1 -1
  48. package/dist/react/webrtc.d.cts +35 -7
  49. package/dist/react/webrtc.d.ts +35 -7
  50. package/dist/react/webrtc.js +1 -1
  51. package/dist/{session-okdqygLg.d.cts → types-6EmrEn4n.d.cts} +26 -4
  52. package/dist/{session-okdqygLg.d.ts → types-6EmrEn4n.d.ts} +26 -4
  53. package/dist/{session-B-ds4k64.d.cts → types-BQ1vBt5Q.d.cts} +32 -54
  54. package/dist/{session-B-ds4k64.d.ts → types-BQ1vBt5Q.d.ts} +32 -54
  55. package/dist/vue/hocuspocus.cjs +1 -1
  56. package/dist/vue/hocuspocus.d.cts +52 -7
  57. package/dist/vue/hocuspocus.d.ts +52 -7
  58. package/dist/vue/hocuspocus.js +1 -1
  59. package/dist/vue/index.cjs +2 -2
  60. package/dist/vue/index.d.cts +235 -24
  61. package/dist/vue/index.d.ts +235 -24
  62. package/dist/vue/index.js +2 -2
  63. package/dist/vue/webrtc.cjs +1 -1
  64. package/dist/vue/webrtc.d.cts +36 -6
  65. package/dist/vue/webrtc.d.ts +36 -6
  66. package/dist/vue/webrtc.js +1 -1
  67. package/package.json +5 -5
  68. package/dist/chunk-6CDC4KCE.js +0 -4
  69. package/dist/chunk-6SR5OK66.cjs +0 -4
  70. package/dist/chunk-GDTCNTK7.cjs +0 -1
  71. package/dist/chunk-HJB77VBO.js +0 -1
  72. package/dist/chunk-HZEWGK5A.cjs +0 -4
  73. package/dist/chunk-Q4YPX2DT.cjs +0 -1
  74. package/dist/chunk-Q7P2DQ33.js +0 -1
  75. package/dist/chunk-RGR2BLZD.js +0 -4
  76. package/dist/chunk-W3V54DWZ.js +0 -1
  77. package/dist/document-session-32FPPQHT.js +0 -1
  78. package/dist/document-session-32ULDU2C.js +0 -1
  79. package/dist/document-session-HCU2O55L.cjs +0 -1
  80. package/dist/document-session-ZOM2KHHX.cjs +0 -1
  81. package/dist/hocuspocus-BMF7MTMJ.js +0 -1
  82. package/dist/hocuspocus-JPJOC6ZV.cjs +0 -1
  83. package/dist/webrtc-MM3LDVLU.cjs +0 -2
  84. package/dist/webrtc-RYONN7E7.js +0 -2
@@ -1,21 +1,63 @@
1
- import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-DUJ4ZZdo.js';
2
- export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-DUJ4ZZdo.js';
3
- export { C as CollaborationModuleOptions, P as ProLicenseOptions, c as collaborationModule } from '../collaboration-module-DlSv0oAd.js';
1
+ /**
2
+ * `@docx-editor.dev/pro/react` — React chrome for the review rail and custom nodes.
3
+ *
4
+ * Compound components over the pro modules: arrange the parts you want rather than accepting one
5
+ * fixed layout. Requires the matching module to be registered on the editor — without it there
6
+ * is nothing to derive cards or chips from.
7
+ *
8
+ * @example Render the review rail
9
+ * ```tsx
10
+ * import { DocxEditorReview } from '@docx-editor.dev/pro/react';
11
+ *
12
+ * <DocxEditorReview>
13
+ * <DocxEditorReview.List>
14
+ * <DocxEditorReview.Card>
15
+ * <DocxEditorReview.Author />
16
+ * <DocxEditorReview.Summary />
17
+ * </DocxEditorReview.Card>
18
+ * </DocxEditorReview.List>
19
+ * </DocxEditorReview>
20
+ * ```
21
+ *
22
+ *
23
+ * The review pane and its headless hook, plus the module factory re-exported so
24
+ * a React host imports one path. Compose inside `DocxEditor.Root` from
25
+ * `@docx-editor.dev/react` with the review module registered.
26
+ *
27
+ * @packageDocumentation
28
+ * @public
29
+ */
30
+ import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-D0c36PpZ.js';
31
+ export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-D0c36PpZ.js';
32
+ export { C as CollaborationModuleOptions, P as ProLicenseOptions, c as collaborationModule } from '../collaboration-module-DWn2heE1.js';
4
33
  import * as react from 'react';
5
34
  import { ReactNode } from 'react';
6
35
  import { ToolbarTranslate, ReviewAuthorInfo, DocxEditorRootProps } from '@docx-editor.dev/react';
7
36
  import { ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
8
- export { ReviewActivationOptions } from '@docx-editor.dev/core/contracts/editor';
37
+ export { ReviewActivationOptions, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
9
38
  import { CollaborationParticipant, CollaborationRemoteSelection, CollaborationStatus, CollaborationFailure } from '@docx-editor.dev/core/collaboration';
10
39
  export { CollaborationFailure, CollaborationFailureCode, CollaborationIdentity, CollaborationParticipant, CollaborationRemoteSelection, CollaborationRemoteSelectionAddress, CollaborationSelectionKind, CollaborationStatus, CollaborationStatusSnapshot } from '@docx-editor.dev/core/collaboration';
11
- import { C as CollaborationSession } from '../session-B-ds4k64.js';
12
- export { a as CollaborationBootstrap, b as CollaborationIdentityUpdate } from '../session-B-ds4k64.js';
40
+ import { C as CollaborationSession } from '../types-BQ1vBt5Q.js';
41
+ export { a as CollaborationBootstrap, b as CollaborationIdentityUpdate } from '../types-BQ1vBt5Q.js';
13
42
  import { EditorModule } from '@docx-editor.dev/core/editor';
14
- import { C as CreateDocumentCollaborationOptions } from '../document-session-BQ4nBDTd.js';
43
+ export { CommentMarkerStyle, ResolvedReviewPane, ReviewPaneOpening, ReviewPaneOptions, ReviewPaneOverflow, RevisionDisplay } from '@docx-editor.dev/core/editor';
44
+ import { C as CreateDocumentCollaborationOptions } from '../document-session-options-DelOC7PX.js';
15
45
  import '@docx-editor.dev/core/store';
16
46
  import 'yjs';
17
47
  import 'y-protocols/awareness';
18
48
 
49
+ /**
50
+ * Who and when an adopted change records.
51
+ *
52
+ * @public
53
+ */
54
+ interface ReviewAdoptOptions {
55
+ /** The author to record. Defaults to the editor's `author`, the person reviewing. */
56
+ readonly author?: string;
57
+ /** The date to record. Omit it to keep each change's own date. */
58
+ readonly date?: Date;
59
+ }
60
+
19
61
  /**
20
62
  * One card's data plus where it belongs on screen.
21
63
  *
@@ -34,8 +76,17 @@ type ReviewItemView = ReviewItemPlacement;
34
76
  interface UseReviewReturn {
35
77
  /** Every pending decision in the document, in reading order. */
36
78
  readonly items: readonly ReviewItemView[];
37
- /** The item the caret is in, or null. */
79
+ /** The CARET-ACTIVE item: the one the caret is in, or null. */
38
80
  readonly activeKey: string | null;
81
+ /**
82
+ * The key of the ACTIVATED item: the one {@link setActive}, Next Change, or Previous Change
83
+ * made active, while the caret stays in it. `null` when only a caret move made an item
84
+ * active. {@link activeKey} is the caret-active item instead: the one the caret is in,
85
+ * however it got there. The key follows this hook's query, so a paired replacement reports
86
+ * the pair's key under `pairReplacements: true`. The same value as the editor's
87
+ * `getActivatedReviewItemKey(query)`, read on every selection change.
88
+ */
89
+ readonly activatedKey: string | null;
39
90
  /**
40
91
  * Card to document: puts the caret at the start of the item's range and scrolls to it. Nothing is selected; the open item draws its own highlight.
41
92
  *
@@ -48,6 +99,19 @@ interface UseReviewReturn {
48
99
  * `options.reveal` picks where the item lands, or turns the engine's scroll off entirely
49
100
  * for a host whose own list already drives it. Default is centred when it has to travel,
50
101
  * still when it is already on screen.
102
+ *
103
+ * With `{ announce: true }`, a call that lands fires the editor's `reviewItemReveal` event
104
+ * with `source: 'host'`, also when the item was already active. The packaged review UI then
105
+ * opens the item's balloon, or opens a closed pane at its card when the pane's `opening`
106
+ * setting is `'auto'`. Without it, the call fires no event. A `null` key closes the card.
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * const { setActive } = useReview();
111
+ * useEditorEvent('reviewItemReveal', ({ key, source }) => openMyCard(key, source));
112
+ * setActive(key); // fires nothing
113
+ * setActive(key, { announce: true }); // fires 'reviewItemReveal'
114
+ * ```
51
115
  */
52
116
  readonly setActive: (key: string | null, options?: ReviewActivationOptions) => boolean;
53
117
  /**
@@ -60,6 +124,17 @@ interface UseReviewReturn {
60
124
  readonly accept: (item: ReviewItemView) => boolean;
61
125
  /** Reject a revision. Reports whether it landed, on the same terms as {@link accept}. */
62
126
  readonly reject: (item: ReviewItemView) => boolean;
127
+ /**
128
+ * Adopt tracked changes as the reviewer's own: they record the reviewer as their author
129
+ * and stay pending for the next reviewer.
130
+ *
131
+ * Takes one item or a list, and ignores comment items. The default author is
132
+ * `DocxEditorConfig.author`; `options.author` records someone else, and `options.date`
133
+ * records a new date. All the changes update in one undo step. Reports whether it landed:
134
+ * false when no revision was passed, when no author is known, or when the editor refuses
135
+ * the write, as it does in viewing mode or under document protection.
136
+ */
137
+ readonly adopt: (items: ReviewItemView | readonly ReviewItemView[], options?: ReviewAdoptOptions) => boolean;
63
138
  /** Resolve a comment thread. Repeating this on a resolved thread succeeds without a write. */
64
139
  readonly resolve: (item: ReviewItemView) => boolean;
65
140
  /** Reopen a resolved comment thread. Repeating this on an open thread is likewise idempotent. */
@@ -139,60 +214,6 @@ declare function useStackedReviewPositions(items: readonly {
139
214
  readonly defaultHeight?: number;
140
215
  }): ReadonlyMap<string, number>;
141
216
 
142
- /**
143
- * The review item the surrounding card (or balloon) renders, or null outside one.
144
- *
145
- * The hook a host's own card content is built from: children passed into the rail's cards
146
- * — extra actions, a custom body — read the CURRENT item here rather than receiving props,
147
- * exactly the way the packaged parts do.
148
- *
149
- * @public
150
- */
151
- declare function useReviewItem(): ReviewItemView | null;
152
- /**
153
- * The resolved presentation of one author — colour, ramp slot, and any declared style —
154
- * or `undefined` when no argument is given, or when the author is in neither the
155
- * document's roster nor the review queue.
156
- *
157
- * COMMENT AUTHORS INCLUDED. The document's revision roster does not carry someone who only
158
- * left comments, so this resolves their declaration directly; their card draws in the
159
- * colour the host declared, exactly as a reviewer's does.
160
- *
161
- * The link between a CUSTOM card and the author styling system: a `List` render callback
162
- * or card child reads the item's author here and draws with the same colours the painted
163
- * document and the packaged cards use. Live: a `setRevisionStyles` call re-renders the
164
- * rail, and this answer with it. Works anywhere under `DocxEditorReview`.
165
- *
166
- * ```tsx
167
- * function MyCard({ item }: { item: ReviewItemView }) {
168
- * const author = useReviewAuthor(item.author);
169
- * return <div style={{ borderColor: author?.color }}>…</div>;
170
- * }
171
- * <DocxEditorReview.List>{(item) => <MyCard item={item} />}</DocxEditorReview.List>;
172
- * ```
173
- *
174
- * @public
175
- */
176
- declare function useReviewAuthor(author: string | undefined): ReviewAuthorInfo | undefined;
177
- declare const ReviewResolve: {
178
- ({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
179
- docxReviewPart: "Resolve";
180
- };
181
- declare const ReviewReopen: {
182
- ({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
183
- docxReviewPart: "Reopen";
184
- };
185
- declare const ReviewDraft: {
186
- ({ top, left, className, hidden, }: ReviewPartProps & {
187
- top?: number;
188
- left?: number | null;
189
- }): react.JSX.Element | null;
190
- docxReviewPart: "Draft";
191
- };
192
- declare const ReviewReply: {
193
- ({ className, hidden, children }: ReviewPartProps): react.JSX.Element | null;
194
- docxReviewPart: "Reply";
195
- };
196
217
  /** Shared props for every part. @public */
197
218
  interface ReviewPartProps {
198
219
  className?: string;
@@ -268,47 +289,21 @@ interface ReviewProps extends Omit<ReviewPartProps, 'children'> {
268
289
  formatting?: boolean;
269
290
  }
270
291
  /**
271
- * The review rail.
272
- *
273
- * Positions absolutely inside the nearest positioned ancestor — put it in
274
- * `DocxEditor.Viewport` beside `DocxEditor.Content`, which is what makes the cards scroll
275
- * with the pages without a scroll listener.
292
+ * Props for `DocxEditorReview.Balloon`, the balloon that opens a review item at its text:
293
+ * each tracked change under `revisionsIn: 'balloons'`, and format and structural changes in
294
+ * every mode.
276
295
  *
277
296
  * @public
278
297
  */
279
- declare function ReviewRoot({ className, furniture, asChild, hidden, children, t: hostT, card, preset, stack, gap, filter, structural, formatting, }: ReviewProps): react.JSX.Element | null;
280
- interface ReviewListProps {
281
- stack?: boolean;
282
- positions?: ReadonlyMap<string, number>;
283
- /** Cards the stacking pass collapsed to a header — pushed too far from their text. */
284
- collapsed?: ReadonlySet<string>;
285
- scale?: number;
286
- offset?: number;
287
- /** Visible band of the scroller; cards outside it are not mounted. Null renders all. */
288
- window?: {
289
- top: number;
290
- bottom: number;
291
- } | null;
298
+ interface ReviewBalloonProps {
299
+ /** A class added to the balloon element. */
300
+ className?: string;
292
301
  /**
293
- * A render prop takes over the card entirely, keeping the rail's subscription, anchoring
294
- * and stacking. Nodes are treated as part overrides for the packaged card.
302
+ * Remove the built-in balloon, for example to render your own. Format and structural
303
+ * change balloons go with it.
295
304
  */
296
- children?: ReactNode | ((item: ReviewItemView) => ReactNode);
297
- className?: string;
298
305
  hidden?: boolean;
299
306
  }
300
- /**
301
- * The cards, each positioned at its anchor.
302
- *
303
- * REPLIES are not cards. A threaded reply belongs inside the comment it answers, and giving
304
- * it a card of its own would put two entries in the rail for one conversation.
305
- *
306
- * @public
307
- */
308
- declare function ReviewList({ stack, positions, collapsed, scale, offset, window: visible, children, className, hidden, }: ReviewListProps): string | number | bigint | boolean | react.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | react.ReactPortal | null | undefined> | null;
309
- declare namespace ReviewList {
310
- var docxReviewPart: "List";
311
- }
312
307
  /**
313
308
  * Props for the collapsed rail's gutter markers. @public
314
309
  *
@@ -333,55 +328,26 @@ interface ReviewMarkersProps {
333
328
  */
334
329
  icon?: ReactNode | ((item: ReviewItemView) => ReactNode);
335
330
  }
336
- /**
337
- * The collapsed rail: one marker per item, at its anchor — or just below the previous
338
- * marker, when the anchors are closer than a marker is tall.
339
- *
340
- * @public
341
- */
342
- declare function ReviewMarkers({ scale, offset, window: visible, className, hidden, icon: iconOverride, }: ReviewMarkersProps): react.JSX.Element | null;
343
- declare namespace ReviewMarkers {
344
- var docxReviewPart: "Markers";
345
- }
346
- /**
347
- * The "comment on this" button, beside the selected text.
348
- *
349
- * Appears only for a RANGE. A comment on a caret has nothing to point at, and Word writes
350
- * none, so the affordance is absent rather than present-and-refusing.
351
- *
352
- * @public
353
- */
354
- declare function ReviewAddComment({ top, drafting, className, hidden, children, }: ReviewPartProps & {
355
- top?: number | null;
356
- drafting?: boolean;
357
- }): react.JSX.Element | null;
358
- declare namespace ReviewAddComment {
359
- var docxReviewPart: "AddComment";
360
- }
361
- /**
362
- * The decision balloon: CLICKING a format or structural change in the PAGE opens its card
363
- * beside the text — author, what changed, when, and accept/reject where the engine can
364
- * resolve it — and the card stays until a press lands somewhere that is neither a tracked
365
- * change nor the balloon itself. Click-opened on purpose: a hover-opened card vanished
366
- * under the pointer travelling toward its own buttons.
367
- *
368
- * ONLY the kinds whose rail cards are hidden by default. Content changes and comments are
369
- * the rail's — a balloon over "added" text repeats a card already beside the page — while
370
- * a format or structural change has nothing but its grey/washed marking, so the click on
371
- * that marking is where its decision lives.
372
- *
373
- * Matches the pressed element against the UNFILTERED queue, attribution first and POSITION
374
- * last: the `(id, author, date)` triple, then `(id, author)`, then the id, then the span's
375
- * own paragraph range against the items' ranges — real files drift on attribution, and the
376
- * range is the one thing the painter and the review model cannot disagree about. An
377
- * element matching nothing still shows what its DOM carries, just without actions.
378
- *
379
- * @public
380
- */
381
- declare function ReviewBalloon({ className, hidden }: ReviewPartProps): react.JSX.Element | null;
382
- declare namespace ReviewBalloon {
383
- var docxReviewPart: "Balloon";
384
- }
331
+
332
+ declare const ReviewResolve: {
333
+ ({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
334
+ docxReviewPart: "Resolve";
335
+ };
336
+ declare const ReviewReopen: {
337
+ ({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
338
+ docxReviewPart: "Reopen";
339
+ };
340
+ declare const ReviewDraft: {
341
+ ({ top, left, className, hidden, }: ReviewPartProps & {
342
+ top?: number;
343
+ left?: number | null;
344
+ }): react.JSX.Element | null;
345
+ docxReviewPart: "Draft";
346
+ };
347
+ declare const ReviewReply: {
348
+ ({ className, hidden, children }: ReviewPartProps): react.JSX.Element | null;
349
+ docxReviewPart: "Reply";
350
+ };
385
351
  /** Shown when nothing is pending. @public */
386
352
  declare function ReviewEmpty({ className, hidden, children }: ReviewPartProps): react.JSX.Element | null;
387
353
  declare namespace ReviewEmpty {
@@ -413,7 +379,7 @@ declare namespace ReviewAuthor {
413
379
  /**
414
380
  * When the change was made.
415
381
  *
416
- * `@w:date` is optional in `CT_TrackChange` and Word omits it when the author turned off
382
+ * `@w:date` is optional in `CT_TrackChange` and files omit it when the author turned off
417
383
  * "store randomized IDs"/date stamping, so a missing date renders nothing rather than an
418
384
  * "Invalid Date".
419
385
  *
@@ -427,7 +393,7 @@ declare namespace ReviewTime {
427
393
  * What the card is about: the comment's text, or what the revision did.
428
394
  *
429
395
  * A revision that carries no characters — a formatting change, a paragraph mark, a row
430
- * insertion — still gets a sentence. Word shows one, and a card reading only "Ada Lovelace"
396
+ * insertion — still gets a sentence. A card reading only "Ada Lovelace"
431
397
  * tells the reviewer nothing they can decide on.
432
398
  *
433
399
  * @public
@@ -437,12 +403,12 @@ declare namespace ReviewSummary {
437
403
  var docxReviewPart: "Summary";
438
404
  }
439
405
  /** Accept the revision behind this card. @public */
440
- declare function ReviewAccept({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
406
+ declare function ReviewAccept({ className, asChild, hidden, children, icon: glyph, }: ReviewActionProps): react.JSX.Element | null;
441
407
  declare namespace ReviewAccept {
442
408
  var docxReviewPart: "Accept";
443
409
  }
444
410
  /** Reject the revision behind this card. @public */
445
- declare function ReviewReject({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
411
+ declare function ReviewReject({ className, asChild, hidden, children, icon: glyph, }: ReviewActionProps): react.JSX.Element | null;
446
412
  declare namespace ReviewReject {
447
413
  var docxReviewPart: "Reject";
448
414
  }
@@ -470,7 +436,7 @@ declare namespace ReviewReject {
470
436
  *
471
437
  * @public
472
438
  */
473
- declare function ReviewDelete({ className, asChild, hidden, children, icon: glyph }: ReviewActionProps): react.JSX.Element | null;
439
+ declare function ReviewDelete({ className, asChild, hidden, children, icon: glyph, }: ReviewActionProps): react.JSX.Element | null;
474
440
  declare namespace ReviewDelete {
475
441
  var docxReviewPart: "Delete";
476
442
  }
@@ -479,6 +445,136 @@ declare function ReviewReplies({ className, hidden }: ReviewPartProps): react.JS
479
445
  declare namespace ReviewReplies {
480
446
  var docxReviewPart: "Replies";
481
447
  }
448
+
449
+ interface ReviewListProps {
450
+ stack?: boolean;
451
+ positions?: ReadonlyMap<string, number>;
452
+ /** Cards the stacking pass collapsed to a header — pushed too far from their text. */
453
+ collapsed?: ReadonlySet<string>;
454
+ scale?: number;
455
+ offset?: number;
456
+ /** Visible band of the scroller; cards outside it are not mounted. Null renders all. */
457
+ window?: {
458
+ top: number;
459
+ bottom: number;
460
+ } | null;
461
+ /**
462
+ * A render prop takes over the card entirely, keeping the rail's subscription, anchoring
463
+ * and stacking. Nodes are treated as part overrides for the packaged card.
464
+ */
465
+ children?: ReactNode | ((item: ReviewItemView) => ReactNode);
466
+ className?: string;
467
+ hidden?: boolean;
468
+ }
469
+ /**
470
+ * The cards, each positioned at its anchor.
471
+ *
472
+ * REPLIES are not cards. A threaded reply belongs inside the comment it answers, and giving
473
+ * it a card of its own would put two entries in the rail for one conversation.
474
+ *
475
+ * @public
476
+ */
477
+ declare function ReviewList({ stack, positions, collapsed, scale, offset, window: visible, children, className, hidden, }: ReviewListProps): string | number | bigint | boolean | react.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | react.ReactPortal | null | undefined> | null;
478
+ declare namespace ReviewList {
479
+ var docxReviewPart: "List";
480
+ }
481
+ /**
482
+ * The collapsed rail: one marker per item, at its anchor — or just below the previous
483
+ * marker, when the anchors are closer than a marker is tall.
484
+ *
485
+ * @public
486
+ */
487
+ declare function ReviewMarkers({ scale, offset, window: visible, className, hidden, icon: iconOverride, }: ReviewMarkersProps): react.JSX.Element | null;
488
+ declare namespace ReviewMarkers {
489
+ var docxReviewPart: "Markers";
490
+ }
491
+ /**
492
+ * The "comment on this" button, beside the selected text.
493
+ *
494
+ * Appears only for a RANGE. A comment on a caret has nothing to point at, and the file format writes
495
+ * none, so the affordance is absent rather than present-and-refusing.
496
+ *
497
+ * @public
498
+ */
499
+ declare function ReviewAddComment({ top, drafting, className, hidden, children, }: ReviewPartProps & {
500
+ top?: number | null;
501
+ drafting?: boolean;
502
+ }): react.JSX.Element | null;
503
+ declare namespace ReviewAddComment {
504
+ var docxReviewPart: "AddComment";
505
+ }
506
+ /**
507
+ * The decision balloon: CLICKING a tracked change in the PAGE opens its card beside the
508
+ * text — author, what changed, when, and accept/reject where the engine can resolve it —
509
+ * and the card stays until a press lands somewhere that is neither a tracked change nor the
510
+ * balloon itself. Click-opened on purpose: a hover-opened card vanished under the pointer
511
+ * travelling toward its own buttons.
512
+ *
513
+ * WHICH KINDS depends on the `revisionsIn` review pane setting. Under `'pane'` only the kinds
514
+ * whose rail cards are hidden by default: a format or structural change has nothing but its
515
+ * grey/washed marking, so the click on that marking is where its decision lives. Under
516
+ * `'balloons'` every tracked change, because the rail then lists comments only; the balloon
517
+ * adds the change's replies and a reply line, and it also closes on Escape and on typing.
518
+ *
519
+ * Matches the pressed element against the UNFILTERED queue, attribution first and POSITION
520
+ * last: the `(id, author, date)` triple, then `(id, author)`, then the id, then the span's
521
+ * own paragraph range against the items' ranges — real files drift on attribution, and the
522
+ * range is the one thing the painter and the review model cannot disagree about. A format or
523
+ * structural element matching nothing still shows what its DOM carries, without actions.
524
+ *
525
+ * @public
526
+ */
527
+ declare function ReviewBalloon({ className, hidden }: ReviewBalloonProps): react.JSX.Element | null;
528
+ declare namespace ReviewBalloon {
529
+ var docxReviewPart: "Balloon";
530
+ }
531
+
532
+ /**
533
+ * The review item the surrounding card (or balloon) renders, or null outside one.
534
+ *
535
+ * The hook a host's own card content is built from: children passed into the rail's cards
536
+ * — extra actions, a custom body — read the CURRENT item here rather than receiving props,
537
+ * exactly the way the packaged parts do.
538
+ *
539
+ * @public
540
+ */
541
+ declare function useReviewItem(): ReviewItemView | null;
542
+ /**
543
+ * The resolved presentation of one author — colour, ramp slot, and any declared style —
544
+ * or `undefined` when no argument is given, or when the author is in neither the
545
+ * document's roster nor the review queue.
546
+ *
547
+ * COMMENT AUTHORS INCLUDED. The document's revision roster does not carry someone who only
548
+ * left comments, so this resolves their declaration directly; their card draws in the
549
+ * colour the host declared, exactly as a reviewer's does.
550
+ *
551
+ * The link between a CUSTOM card and the author styling system: a `List` render callback
552
+ * or card child reads the item's author here and draws with the same colours the painted
553
+ * document and the packaged cards use. Live: a `setRevisionStyles` call re-renders the
554
+ * rail, and this answer with it. Outside the rail it reads the editor's author roster.
555
+ *
556
+ * ```tsx
557
+ * function MyCard({ item }: { item: ReviewItemView }) {
558
+ * const author = useReviewAuthor(item.author);
559
+ * return <div style={{ borderColor: author?.color }}>…</div>;
560
+ * }
561
+ * <DocxEditorReview.List>{(item) => <MyCard item={item} />}</DocxEditorReview.List>;
562
+ * ```
563
+ *
564
+ * @public
565
+ */
566
+ declare function useReviewAuthor(author: string | undefined): ReviewAuthorInfo | undefined;
567
+
568
+ /**
569
+ * The review rail.
570
+ *
571
+ * Positions absolutely inside the nearest positioned ancestor — put it in
572
+ * `DocxEditor.Viewport` beside `DocxEditor.Content`, which is what makes the cards scroll
573
+ * with the pages without a scroll listener.
574
+ *
575
+ * @public
576
+ */
577
+ declare function ReviewRoot({ className, furniture, asChild, hidden, children, t: hostT, card, preset, stack, gap, filter, structural, formatting, }: ReviewProps): react.JSX.Element | null;
482
578
  /**
483
579
  * The review rail compound.
484
580
  *
@@ -507,7 +603,10 @@ interface DocxEditorReviewNamespace {
507
603
  readonly AddComment: typeof ReviewAddComment;
508
604
  /** The compose box a new comment is written in. */
509
605
  readonly Draft: typeof ReviewDraft;
510
- /** The decision balloon opened by clicking a format or structural change in the page. */
606
+ /**
607
+ * The decision balloon opened by clicking a tracked change in the page: format and
608
+ * structural changes always, every change under `revisionsIn: 'balloons'`.
609
+ */
511
610
  readonly Balloon: typeof ReviewBalloon;
512
611
  }
513
612
  /**
@@ -536,6 +635,69 @@ interface DocxEditorReviewNamespace {
536
635
  */
537
636
  declare const DocxEditorReview: DocxEditorReviewNamespace;
538
637
 
638
+ /**
639
+ * What the collaboration status part tells the user, from the session's status snapshot.
640
+ * Shared by the React and Vue parts so the two say the same thing.
641
+ */
642
+
643
+ /**
644
+ * The notice the status part shows, or none while everything is in order.
645
+ *
646
+ * - `connecting`: the session is joining the room.
647
+ * - `offline`: the transport is down and edits continue; they sync on reconnect.
648
+ * - `offlinePaused`: the transport is down and the session refuses edits until reconnect
649
+ * (`offlineEditing: false`).
650
+ * - `syncing`: the session hit an update it could not apply yet and heals on the next one.
651
+ * - `waiting`: edits wait until an update the room sent can apply.
652
+ * - `stalled`: edits have waited longer than `STALLED_AFTER_MS`; rejoining loads the room.
653
+ * - `editRefused`: the room refused the last edit, and the editor undid it.
654
+ * - `outOfSync`: this copy no longer agrees with the room; rejoining loads the room's copy.
655
+ * - `upgradeRequired`: this client and the room use different collaboration formats, and either
656
+ * side can be the older one. A rejoin cannot fix it; an upgrade of the older side can.
657
+ * - `newRoomRequired`: the room itself cannot continue (two seeds merged, a damaged blob, or
658
+ * a resource limit); a rejoin cannot fix it. Save a copy and share it in a new room.
659
+ *
660
+ * @public
661
+ */
662
+ type CollaborationNoticeKind = 'connecting' | 'offline' | 'offlinePaused' | 'syncing' | 'waiting' | 'stalled' | 'editRefused' | 'outOfSync' | 'upgradeRequired' | 'newRoomRequired';
663
+
664
+ /** What a custom {@link DocxEditorCollaboration}.Status renders with. @public */
665
+ interface CollaborationStatusNoticeRenderProps {
666
+ /** Which notice to show. */
667
+ readonly kind: CollaborationNoticeKind;
668
+ /** The packaged message for `kind`, in the editor's language. */
669
+ readonly message: string;
670
+ /** Calls `onRejoin`; present for `outOfSync` and `stalled` when the part has one. */
671
+ readonly rejoin?: () => void;
672
+ }
673
+ /** Props for {@link DocxEditorCollaboration}.Status. @public */
674
+ interface CollaborationStatusNoticeProps {
675
+ /**
676
+ * The session to report on. Omit it and the part uses the one the editor above holds;
677
+ * `null` renders nothing.
678
+ */
679
+ readonly session?: CollaborationSession | null;
680
+ /**
681
+ * Called from the part's "Rejoin" button when this copy is out of sync, or when edits
682
+ * have waited too long for the room. Save the editor
683
+ * and pass the bytes to your provider hook's `rejoin`. Without it the part shows the
684
+ * message only.
685
+ */
686
+ readonly onRejoin?: () => void;
687
+ /** Classes added to the notice region. */
688
+ readonly className?: string;
689
+ /** Renders the notice in place of the packaged one. */
690
+ readonly children?: (props: CollaborationStatusNoticeRenderProps) => ReactNode;
691
+ }
692
+ /**
693
+ * The room's state in one line, shown only when the user needs to know: while connecting,
694
+ * offline, catching up, waiting, out of sync, or when the room refused an edit.
695
+ *
696
+ * The `role="status"` region stays mounted while a session exists, so screen readers
697
+ * announce each message as it appears; it is empty while everything is in order.
698
+ */
699
+ declare function CollaborationStatusNotice({ session, onRejoin, className, children, }: CollaborationStatusNoticeProps): react.JSX.Element | null;
700
+
539
701
  /**
540
702
  * What a custom remote-caret label renders with.
541
703
  *
@@ -588,6 +750,7 @@ interface CollaborationCaretLabelsProps {
588
750
  }
589
751
  /** Render props for {@link DocxEditorCollaboration}.Avatars' per-participant override. @public */
590
752
  interface CollaborationAvatarRenderProps {
753
+ /** The participant this avatar shows. */
591
754
  readonly participant: CollaborationParticipant;
592
755
  /** The resolved accent — published colour, or the review roster's colour for the name. */
593
756
  readonly color: string;
@@ -605,13 +768,16 @@ interface CollaborationAvatarsProps {
605
768
  readonly session?: CollaborationSession | null;
606
769
  /** Avatars shown before the rest collapse into one "+N" chip. Omit to show everyone. */
607
770
  readonly max?: number;
771
+ /** Classes added to the part's root element. */
608
772
  readonly className?: string;
609
773
  /** Renders one participant's avatar in place of the packaged disc. */
610
774
  readonly children?: (props: CollaborationAvatarRenderProps) => ReactNode;
611
775
  }
612
776
  /** Props for {@link DocxEditorCollaboration}.Avatar. @public */
613
777
  interface CollaborationAvatarProps {
778
+ /** The participant to show. */
614
779
  readonly participant: CollaborationParticipant;
780
+ /** Classes added to the part's root element. */
615
781
  readonly className?: string;
616
782
  /** Replaces the initials inside the disc; the accent background stays. */
617
783
  readonly children?: ReactNode;
@@ -649,6 +815,8 @@ interface DocxEditorCollaborationNamespace {
649
815
  readonly Avatars: typeof CollaborationAvatars;
650
816
  /** One participant's avatar, for hosts arranging their own presence chrome. */
651
817
  readonly Avatar: typeof CollaborationAvatar;
818
+ /** The room's state in one line, shown only when the user needs to know. */
819
+ readonly Status: typeof CollaborationStatusNotice;
652
820
  }
653
821
  /**
654
822
  * Presence chrome over a live collaboration session.
@@ -658,6 +826,7 @@ interface DocxEditorCollaborationNamespace {
658
826
  * @example
659
827
  * ```tsx
660
828
  * <DocxEditorCollaboration.Avatars session={session} max={4} />
829
+ * <DocxEditorCollaboration.Status session={session} onRejoin={rejoin} />
661
830
  * <DocxEditorCollaboration.CaretLabels session={session}>
662
831
  * {({ selection, color }) => <MyLabel name={selection.name} color={color} />}
663
832
  * </DocxEditorCollaboration.CaretLabels>
@@ -803,8 +972,11 @@ declare function resolveCustomNodeActivation(target: EventTarget | null, nodes:
803
972
 
804
973
  /** Status returned by {@link useCollaborationStatus}. @public */
805
974
  interface UseCollaborationStatusReturn {
975
+ /** Current lifecycle state, or `inactive` when no session is attached. */
806
976
  readonly status: CollaborationStatus | 'inactive';
977
+ /** Why the session holds `status`, or `undefined` when nothing is wrong. */
807
978
  readonly reason: CollaborationFailure | undefined;
979
+ /** The most recent `error` reason. Kept after the session recovers. */
808
980
  readonly lastFailure: CollaborationFailure | undefined;
809
981
  /**
810
982
  * Edits made now reach the room.
@@ -817,12 +989,28 @@ interface UseCollaborationStatusReturn {
817
989
  /**
818
990
  * This replica no longer agrees with the room, and waiting will not fix it.
819
991
  *
820
- * `error` and `destroyed`. The replica refused an update and kept the copy it had, so it is
821
- * now editing a document the others do not have. The way out is
822
- * {@link UseHocuspocusCollaborationReturn.rejoin}, not time — which is why this is separate
823
- * from "not live" rather than folded into it.
992
+ * `destroyed`, or an `error` that is not `recovering`. The replica refused an update and
993
+ * kept the copy it had, so it is now editing a document the others do not have. The way
994
+ * out is {@link UseHocuspocusCollaborationReturn.rejoin}, not time — which is why this is
995
+ * separate from "not live" rather than folded into it.
824
996
  */
825
997
  readonly diverged: boolean;
998
+ /**
999
+ * The session is in `error` but heals by itself on the next clean update: show a passing
1000
+ * notice, not a rejoin action.
1001
+ */
1002
+ readonly recovering: boolean;
1003
+ /**
1004
+ * Edits wait for the room: an update arrived that depends on one still on its way. The
1005
+ * editor refuses edits until it arrives or the wait times out.
1006
+ */
1007
+ readonly waiting: boolean;
1008
+ /**
1009
+ * How many failures the session has recorded. It changes with each new failure, also when
1010
+ * `lastFailure` repeats the same code, so a host can tell a user each time an edit is
1011
+ * refused.
1012
+ */
1013
+ readonly failureCount: number;
826
1014
  /**
827
1015
  * An editor has attached its document port to this replica.
828
1016
  *
@@ -877,8 +1065,11 @@ declare function useCollaborationSession(): CollaborationSession | null;
877
1065
  * @public
878
1066
  */
879
1067
  interface CollaborationRootSource {
1068
+ /** The document bytes to mount, or null while none is ready. */
880
1069
  readonly document: Uint8Array | null;
1070
+ /** The editor modules to register, the collaboration module among them. */
881
1071
  readonly modules: readonly EditorModule[];
1072
+ /** The collaboration session, or null while none is connected. */
882
1073
  readonly session: CollaborationSession | null;
883
1074
  }
884
1075
  /**
@@ -938,15 +1129,22 @@ interface UseDocumentCollaborationOptions {
938
1129
  /**
939
1130
  * Connect this room on mount. Omit it and call
940
1131
  * {@link UseDocumentCollaborationReturn.connect} after the host has a `ydoc` and a room.
1132
+ * A different room, server, bootstrap kind, or `actorId` leaves the old room and
1133
+ * connects the new one, and `null` leaves. A room opened with `connect` stays.
941
1134
  */
942
1135
  readonly room?: UseDocumentCollaborationConnectOptions | null;
943
1136
  }
944
1137
  /** Values {@link useDocumentCollaboration} returns. @public */
945
1138
  interface UseDocumentCollaborationReturn {
1139
+ /** The room's document as `.docx` bytes to mount. Null until the room is ready. */
946
1140
  readonly document: Uint8Array | null;
1141
+ /** Modules to pass to the editor. They include the collaboration module once ready. */
947
1142
  readonly modules: readonly EditorModule[];
1143
+ /** The live session for status and presence. Null while no room is connected. */
948
1144
  readonly session: CollaborationSession | null;
1145
+ /** True while a connect is in progress. */
949
1146
  readonly pending: boolean;
1147
+ /** The connect failure or session failure, or null. Check it before `document`. */
950
1148
  readonly error: CollaborationFailure | null;
951
1149
  /**
952
1150
  * Connect a room. RESOLVES with the failure, or null on success — it does not reject.
@@ -978,4 +1176,4 @@ interface UseDocumentCollaborationReturn {
978
1176
  declare function useDocumentCollaboration(options?: UseDocumentCollaborationOptions): UseDocumentCollaborationReturn;
979
1177
 
980
1178
  export { CollaborationSession, CreateDocumentCollaborationOptions, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, resolveCustomNodeActivation, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useStackedReviewPositions };
981
- export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationRootSource, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ResolvedCustomNodeActivation, ReviewActionProps, ReviewItemView, ReviewMarkersProps, ReviewPartProps, ReviewProps, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewReturn };
1179
+ export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewItemView, ReviewMarkersProps, ReviewPartProps, ReviewProps, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewReturn };