@docx-editor.dev/pro 2.32.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/chunk-3HW2VWFW.js +1 -0
- package/dist/chunk-3MIZFGHH.cjs +1 -0
- package/dist/chunk-4TS2D6OV.js +11 -0
- package/dist/chunk-5HK5RAD7.cjs +11 -0
- package/dist/chunk-ENMURXLJ.js +1 -0
- package/dist/chunk-EOZ44UA7.js +1 -0
- package/dist/{chunk-RYF4SNKX.cjs → chunk-GOUTDQFX.cjs} +1 -1
- package/dist/chunk-GSBQ5AHL.cjs +1 -0
- package/dist/chunk-HMU7J34H.js +1 -0
- package/dist/chunk-IFDU5O5J.js +1 -0
- package/dist/chunk-IULA3QRZ.cjs +1 -0
- package/dist/chunk-L6ZMFFBX.cjs +1 -0
- package/dist/chunk-NTBGYQX4.js +1 -0
- package/dist/chunk-QEULTKCT.cjs +1 -0
- package/dist/{chunk-OT5R3IYV.cjs → chunk-QOXYHVBM.cjs} +1 -1
- package/dist/chunk-STTJA26X.js +1 -0
- package/dist/chunk-UPKBD6AH.cjs +1 -0
- package/dist/chunk-VQOLBCW6.js +1 -0
- package/dist/chunk-ZMBZ7CWZ.js +6 -0
- package/dist/chunk-ZZ33FL6V.cjs +6 -0
- package/dist/collaboration/hocuspocus.cjs +1 -1
- package/dist/collaboration/hocuspocus.d.cts +1 -1
- package/dist/collaboration/hocuspocus.d.ts +1 -1
- package/dist/collaboration/hocuspocus.js +1 -1
- package/dist/collaboration/index.cjs +2 -2
- package/dist/collaboration/index.d.cts +3 -2
- package/dist/collaboration/index.d.ts +3 -2
- package/dist/collaboration/index.js +2 -2
- package/dist/collaboration/webrtc.cjs +1 -1
- package/dist/collaboration/webrtc.d.cts +1 -1
- package/dist/collaboration/webrtc.d.ts +1 -1
- package/dist/collaboration/webrtc.js +1 -1
- package/dist/{collaboration-module-DWn2heE1.d.cts → collaboration-module-02CIP5sN.d.cts} +2 -20
- package/dist/{collaboration-module-DWn2heE1.d.ts → collaboration-module-COZAgqwg.d.ts} +2 -20
- package/dist/{define-custom-node-D0c36PpZ.d.ts → define-custom-node-CISpZvVB.d.cts} +8 -3
- package/dist/{define-custom-node-CNRQG1TI.d.cts → define-custom-node-DE1KjR1r.d.ts} +8 -3
- package/dist/{document-session-B-iH-YCU.d.ts → document-session-B6v5LZIK.d.ts} +94 -9
- package/dist/{document-session-B-MlORjE.d.cts → document-session-DZK2tAr4.d.cts} +94 -9
- package/dist/document-session-RPP3WEJ7.cjs +1 -0
- package/dist/document-session-S2N54WP6.js +1 -0
- package/dist/drawing/index.cjs +1 -0
- package/dist/drawing/index.d.cts +112 -0
- package/dist/drawing/index.d.ts +112 -0
- package/dist/drawing/index.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/license-D-ds5Y7c.d.cts +20 -0
- package/dist/license-D-ds5Y7c.d.ts +20 -0
- package/dist/metafile-raster-3MCAHWYO.js +1 -0
- package/dist/metafile-raster-DWGCWQTU.cjs +1 -0
- package/dist/metafile-replay-SDHSTWYT.js +1 -0
- package/dist/metafile-replay-YZ2LHLBT.cjs +1 -0
- package/dist/react/hocuspocus.cjs +1 -1
- package/dist/react/hocuspocus.js +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.cts +81 -22
- package/dist/react/index.d.ts +81 -22
- package/dist/react/index.js +2 -2
- package/dist/react/webrtc.cjs +1 -1
- package/dist/react/webrtc.js +1 -1
- package/dist/vue/hocuspocus.cjs +1 -1
- package/dist/vue/hocuspocus.js +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.cts +61 -18
- package/dist/vue/index.d.ts +61 -18
- package/dist/vue/index.js +2 -2
- package/dist/vue/webrtc.cjs +1 -1
- package/dist/vue/webrtc.js +1 -1
- package/package.json +11 -5
- package/dist/chunk-3WTOHPAB.js +0 -1
- package/dist/chunk-AVZO5ZHZ.js +0 -1
- package/dist/chunk-DLYVBBO7.js +0 -1
- package/dist/chunk-GAGYRL3L.js +0 -5
- package/dist/chunk-HMSOWKXT.js +0 -1
- package/dist/chunk-I6HVINA4.cjs +0 -1
- package/dist/chunk-MHB6ID2P.cjs +0 -1
- package/dist/chunk-MWO2ZUEJ.js +0 -1
- package/dist/chunk-PMS3PGOE.cjs +0 -1
- package/dist/chunk-Q2VBO66F.js +0 -1
- package/dist/chunk-QLZH2Q2C.cjs +0 -1
- package/dist/chunk-YOWEY5F3.cjs +0 -5
- package/dist/document-session-B35ZX2W4.js +0 -1
- package/dist/document-session-V3O7XBJY.cjs +0 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
* @packageDocumentation
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
30
|
-
import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-
|
|
31
|
-
export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-
|
|
32
|
-
export { C as CollaborationModuleOptions,
|
|
30
|
+
import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-CISpZvVB.cjs';
|
|
31
|
+
export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-CISpZvVB.cjs';
|
|
32
|
+
export { C as CollaborationModuleOptions, c as collaborationModule } from '../collaboration-module-02CIP5sN.cjs';
|
|
33
|
+
export { P as ProLicenseOptions } from '../license-D-ds5Y7c.cjs';
|
|
33
34
|
import * as react from 'react';
|
|
34
35
|
import { ReactNode, RefObject } from 'react';
|
|
35
36
|
import { ToolbarTranslate, ReviewAuthorInfo, DocxEditorRootProps } from '@docx-editor.dev/react';
|
|
36
|
-
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
37
|
-
export { ReviewActivationOptions, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
37
|
+
import { EditDiagnosticCode, ReviewDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
38
|
+
export { ReviewActivationOptions, ReviewDiagnosticCode, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
38
39
|
import { CollaborationParticipant, CollaborationRemoteSelection, CollaborationStatus, CollaborationFailure } from '@docx-editor.dev/core/collaboration';
|
|
39
40
|
export { CollaborationFailure, CollaborationFailureCode, CollaborationIdentity, CollaborationParticipant, CollaborationRemoteSelection, CollaborationRemoteSelectionAddress, CollaborationSelectionKind, CollaborationStatus, CollaborationStatusSnapshot } from '@docx-editor.dev/core/collaboration';
|
|
40
41
|
import { C as CollaborationSession } from '../types-DvGpDOcZ.cjs';
|
|
@@ -70,12 +71,16 @@ type ReviewWriteAction = 'accept' | 'reject' | 'resolve' | 'reopen' | 'remove' |
|
|
|
70
71
|
* @public
|
|
71
72
|
*/
|
|
72
73
|
interface ReviewWriteRefusal {
|
|
73
|
-
/** Which write was refused. */
|
|
74
|
+
/** Which write was refused. A discarded tracked change reports `'reject'`. */
|
|
74
75
|
readonly action: ReviewWriteAction;
|
|
75
76
|
/** The card the write addressed, or null for a new comment on the selection. */
|
|
76
77
|
readonly key: string | null;
|
|
77
|
-
/**
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The public diagnostic code, the same one `onDiagnostic` reports for the refusal. A tracked
|
|
80
|
+
* change the engine could not decide names its review code, such as
|
|
81
|
+
* `review.retained-structure` for a row that stays to keep a nested table.
|
|
82
|
+
*/
|
|
83
|
+
readonly code: EditDiagnosticCode | ReviewDiagnosticCode;
|
|
79
84
|
/**
|
|
80
85
|
* Rises with every refusal of this editor, so the same refusal twice still differs. Key a
|
|
81
86
|
* live announcement on it to announce a repeat.
|
|
@@ -104,7 +109,23 @@ type ReviewItemView = ReviewItemPlacement;
|
|
|
104
109
|
* @public
|
|
105
110
|
*/
|
|
106
111
|
interface UseReviewReturn {
|
|
107
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Every pending decision in the document, in reading order.
|
|
114
|
+
*
|
|
115
|
+
* Follows an edit in one paragraph, such as typing, at background priority. The document
|
|
116
|
+
* paints first, and the cards follow in the next render, which a further keystroke can
|
|
117
|
+
* interrupt. These update the cards at once:
|
|
118
|
+
*
|
|
119
|
+
* - the actions below
|
|
120
|
+
* - a decision made elsewhere, such as from the toolbar or the editor API
|
|
121
|
+
* - a new document
|
|
122
|
+
* - a structural edit
|
|
123
|
+
* - a selection change on its own
|
|
124
|
+
*
|
|
125
|
+
* A comment added another way, through `editor.addComment` or by a remote peer, changes one
|
|
126
|
+
* paragraph. Its card follows at background priority too. The actions always act on the
|
|
127
|
+
* document as it is.
|
|
128
|
+
*/
|
|
108
129
|
readonly items: readonly ReviewItemView[];
|
|
109
130
|
/** The CARET-ACTIVE item: the one the caret is in, or null. */
|
|
110
131
|
readonly activeKey: string | null;
|
|
@@ -192,7 +213,8 @@ interface UseReviewReturn {
|
|
|
192
213
|
*
|
|
193
214
|
* One verb for both, so a card can carry one "remove this" control whatever it holds.
|
|
194
215
|
* Reports whether it landed — a comment the engine refused to delete must not vanish from
|
|
195
|
-
* the caller's own state while the document still holds it.
|
|
216
|
+
* the caller's own state while the document still holds it. A refused discard of a tracked
|
|
217
|
+
* change is recorded in `lastRefusal` with `action: 'reject'`, as a refused reject is.
|
|
196
218
|
*/
|
|
197
219
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
198
220
|
/**
|
|
@@ -236,13 +258,15 @@ interface UseReviewReturn {
|
|
|
236
258
|
* packaged rail recorded. Set by a refused write and cleared by the next one that lands, and
|
|
237
259
|
* by a change to the document, the editing mode, editability, the collaboration status or
|
|
238
260
|
* the author filter. A caret move keeps it. The packaged cards show it as a sentence; a
|
|
239
|
-
* custom card reads `key` to place it
|
|
261
|
+
* custom card reads `key` to place it, `useReviewRefusalMessage()` to word it, and `code`, the
|
|
262
|
+
* public diagnostic code, to branch on the cause.
|
|
240
263
|
*
|
|
241
264
|
* @example
|
|
242
265
|
* ```tsx
|
|
243
266
|
* const { lastRefusal } = useReview();
|
|
267
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
244
268
|
* // The packaged rail announces it; this only shows it.
|
|
245
|
-
* return lastRefusal?.key === item.key ? <p>{lastRefusal
|
|
269
|
+
* return lastRefusal?.key === item.key ? <p>{refusalMessage(lastRefusal)}</p> : null;
|
|
246
270
|
* ```
|
|
247
271
|
*/
|
|
248
272
|
readonly lastRefusal: ReviewWriteRefusal | null;
|
|
@@ -572,7 +596,17 @@ interface ReviewListProps {
|
|
|
572
596
|
collapsed?: ReadonlySet<string>;
|
|
573
597
|
scale?: number;
|
|
574
598
|
offset?: number;
|
|
575
|
-
/**
|
|
599
|
+
/**
|
|
600
|
+
* Visible band of the scroller, in the rail's coordinates; cards outside it are not mounted.
|
|
601
|
+
* Before the rail measures its scroller the band is empty (`top` greater than `bottom`, both
|
|
602
|
+
* infinite), so no positioned card renders.
|
|
603
|
+
*
|
|
604
|
+
* Null, or leaving it out, mounts every card. That is correct but costs one card per pending
|
|
605
|
+
* change on each render. Inside the packaged review rail the band arrives on its own, including
|
|
606
|
+
* for a `List` override. A list mounted elsewhere measures its own scroller and passes the
|
|
607
|
+
* part of it in view, widened by a margin above and below (the rail uses 600 px) so cards
|
|
608
|
+
* mount before they scroll into view.
|
|
609
|
+
*/
|
|
576
610
|
window?: {
|
|
577
611
|
top: number;
|
|
578
612
|
bottom: number;
|
|
@@ -708,13 +742,21 @@ interface ReviewRailMetrics {
|
|
|
708
742
|
readonly top: number;
|
|
709
743
|
/**
|
|
710
744
|
* CSS pixels from the scroll container's left padding edge, in its scrolled content, to
|
|
711
|
-
* the column's left edge: one 16px gutter right of the page
|
|
712
|
-
*
|
|
745
|
+
* the column's left edge: one 16px gutter right of the page, or, in a right-to-left
|
|
746
|
+
* interface, one 16px gutter and the column's own width left of it. `null` until there is
|
|
747
|
+
* a page to measure. Keep the column hidden while it is `null`.
|
|
713
748
|
*/
|
|
714
749
|
readonly left: number | null;
|
|
750
|
+
/**
|
|
751
|
+
* The page side the column stands on: `'left'` in a right-to-left interface, otherwise
|
|
752
|
+
* `'right'`. On the left, give the column its width (300px for the packaged cards), because
|
|
753
|
+
* `left` keeps the column's RIGHT edge one gutter off the page; and keep each card's air on
|
|
754
|
+
* its left, away from the page.
|
|
755
|
+
*/
|
|
756
|
+
readonly side: 'left' | 'right';
|
|
715
757
|
/**
|
|
716
758
|
* The `left` value, relative to {@link ReviewRailMetrics.left}, that puts a 300px card
|
|
717
|
-
* fully inside the visible area with a 12px inset from its
|
|
759
|
+
* fully inside the visible area with a 12px inset from its edge on the column's side. Use it while
|
|
718
760
|
* {@link ReviewRailMetrics.compact} is true. `null` until there is a page to measure.
|
|
719
761
|
*/
|
|
720
762
|
readonly compactCardLeft: number | null;
|
|
@@ -735,11 +777,11 @@ interface UseReviewRailMetricsOptions {
|
|
|
735
777
|
readonly trackScroll?: boolean;
|
|
736
778
|
/**
|
|
737
779
|
* With a `railRef`, reserve the review gutter beside the page while the column element is
|
|
738
|
-
* mounted, as `DocxEditorReview` does. The viewport then shifts the page
|
|
739
|
-
* pane is open. The reservation does not show the comment controls in the
|
|
740
|
-
* context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
741
|
-
* mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
742
|
-
* page. Default: `true`.
|
|
780
|
+
* mounted, as `DocxEditorReview` does. The viewport then shifts the page away from the
|
|
781
|
+
* column while the pane is open. The reservation does not show the comment controls in the
|
|
782
|
+
* toolbar and the context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
783
|
+
* `false` when a mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
784
|
+
* column overlays the page. Default: `true`.
|
|
743
785
|
*/
|
|
744
786
|
readonly reserveGutter?: boolean;
|
|
745
787
|
}
|
|
@@ -778,6 +820,8 @@ interface UseReviewRailMetricsOptions {
|
|
|
778
820
|
* position: 'absolute',
|
|
779
821
|
* top: 0,
|
|
780
822
|
* left: metrics.left ?? 0,
|
|
823
|
+
* // The column's width places it when `metrics.side` is 'left'.
|
|
824
|
+
* width: 300,
|
|
781
825
|
* visibility: metrics.left === null ? 'hidden' : 'visible',
|
|
782
826
|
* }}
|
|
783
827
|
* >
|
|
@@ -1237,6 +1281,21 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1237
1281
|
*/
|
|
1238
1282
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1239
1283
|
|
|
1284
|
+
/**
|
|
1285
|
+
* The packaged sentence for a refused review write, in the reader's language, for a host's own
|
|
1286
|
+
* card or balloon. It honors the review pane's `t` overrides, as the packaged cards do.
|
|
1287
|
+
*
|
|
1288
|
+
* @example
|
|
1289
|
+
* ```tsx
|
|
1290
|
+
* const { lastRefusal } = useReview();
|
|
1291
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
1292
|
+
* return lastRefusal?.key === item.key ? <p role="alert">{refusalMessage(lastRefusal)}</p> : null;
|
|
1293
|
+
* ```
|
|
1294
|
+
*
|
|
1295
|
+
* @public
|
|
1296
|
+
*/
|
|
1297
|
+
declare function useReviewRefusalMessage(): (refusal: ReviewWriteRefusal) => string;
|
|
1298
|
+
|
|
1240
1299
|
/** Status returned by {@link useCollaborationStatus}. @public */
|
|
1241
1300
|
interface UseCollaborationStatusReturn {
|
|
1242
1301
|
/** Current lifecycle state, or `inactive` when no session is attached. */
|
|
@@ -1442,5 +1501,5 @@ interface UseDocumentCollaborationReturn {
|
|
|
1442
1501
|
*/
|
|
1443
1502
|
declare function useDocumentCollaboration(options?: UseDocumentCollaborationOptions): UseDocumentCollaborationReturn;
|
|
1444
1503
|
|
|
1445
|
-
export { CollaborationSession, CreateDocumentCollaborationOptions, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, resolveCustomNodeActivation, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useStackedReviewPositions };
|
|
1504
|
+
export { CollaborationSession, CreateDocumentCollaborationOptions, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, resolveCustomNodeActivation, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useReviewRefusalMessage, useStackedReviewPositions };
|
|
1446
1505
|
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewDraftProps, ReviewItemView, ReviewMarkersProps, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewReturn };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -27,14 +27,15 @@
|
|
|
27
27
|
* @packageDocumentation
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
30
|
-
import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-
|
|
31
|
-
export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-
|
|
32
|
-
export { C as CollaborationModuleOptions,
|
|
30
|
+
import { a as CustomNodeDefinition, b as ActivatedCustomNode, A as AnyCustomNodeDefinition } from '../define-custom-node-DE1KjR1r.js';
|
|
31
|
+
export { j as ReviewModuleOptions, q as reviewModule } from '../define-custom-node-DE1KjR1r.js';
|
|
32
|
+
export { C as CollaborationModuleOptions, c as collaborationModule } from '../collaboration-module-COZAgqwg.js';
|
|
33
|
+
export { P as ProLicenseOptions } from '../license-D-ds5Y7c.js';
|
|
33
34
|
import * as react from 'react';
|
|
34
35
|
import { ReactNode, RefObject } from 'react';
|
|
35
36
|
import { ToolbarTranslate, ReviewAuthorInfo, DocxEditorRootProps } from '@docx-editor.dev/react';
|
|
36
|
-
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
37
|
-
export { ReviewActivationOptions, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
37
|
+
import { EditDiagnosticCode, ReviewDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
38
|
+
export { ReviewActivationOptions, ReviewDiagnosticCode, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
38
39
|
import { CollaborationParticipant, CollaborationRemoteSelection, CollaborationStatus, CollaborationFailure } from '@docx-editor.dev/core/collaboration';
|
|
39
40
|
export { CollaborationFailure, CollaborationFailureCode, CollaborationIdentity, CollaborationParticipant, CollaborationRemoteSelection, CollaborationRemoteSelectionAddress, CollaborationSelectionKind, CollaborationStatus, CollaborationStatusSnapshot } from '@docx-editor.dev/core/collaboration';
|
|
40
41
|
import { C as CollaborationSession } from '../types-DvGpDOcZ.js';
|
|
@@ -70,12 +71,16 @@ type ReviewWriteAction = 'accept' | 'reject' | 'resolve' | 'reopen' | 'remove' |
|
|
|
70
71
|
* @public
|
|
71
72
|
*/
|
|
72
73
|
interface ReviewWriteRefusal {
|
|
73
|
-
/** Which write was refused. */
|
|
74
|
+
/** Which write was refused. A discarded tracked change reports `'reject'`. */
|
|
74
75
|
readonly action: ReviewWriteAction;
|
|
75
76
|
/** The card the write addressed, or null for a new comment on the selection. */
|
|
76
77
|
readonly key: string | null;
|
|
77
|
-
/**
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The public diagnostic code, the same one `onDiagnostic` reports for the refusal. A tracked
|
|
80
|
+
* change the engine could not decide names its review code, such as
|
|
81
|
+
* `review.retained-structure` for a row that stays to keep a nested table.
|
|
82
|
+
*/
|
|
83
|
+
readonly code: EditDiagnosticCode | ReviewDiagnosticCode;
|
|
79
84
|
/**
|
|
80
85
|
* Rises with every refusal of this editor, so the same refusal twice still differs. Key a
|
|
81
86
|
* live announcement on it to announce a repeat.
|
|
@@ -104,7 +109,23 @@ type ReviewItemView = ReviewItemPlacement;
|
|
|
104
109
|
* @public
|
|
105
110
|
*/
|
|
106
111
|
interface UseReviewReturn {
|
|
107
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Every pending decision in the document, in reading order.
|
|
114
|
+
*
|
|
115
|
+
* Follows an edit in one paragraph, such as typing, at background priority. The document
|
|
116
|
+
* paints first, and the cards follow in the next render, which a further keystroke can
|
|
117
|
+
* interrupt. These update the cards at once:
|
|
118
|
+
*
|
|
119
|
+
* - the actions below
|
|
120
|
+
* - a decision made elsewhere, such as from the toolbar or the editor API
|
|
121
|
+
* - a new document
|
|
122
|
+
* - a structural edit
|
|
123
|
+
* - a selection change on its own
|
|
124
|
+
*
|
|
125
|
+
* A comment added another way, through `editor.addComment` or by a remote peer, changes one
|
|
126
|
+
* paragraph. Its card follows at background priority too. The actions always act on the
|
|
127
|
+
* document as it is.
|
|
128
|
+
*/
|
|
108
129
|
readonly items: readonly ReviewItemView[];
|
|
109
130
|
/** The CARET-ACTIVE item: the one the caret is in, or null. */
|
|
110
131
|
readonly activeKey: string | null;
|
|
@@ -192,7 +213,8 @@ interface UseReviewReturn {
|
|
|
192
213
|
*
|
|
193
214
|
* One verb for both, so a card can carry one "remove this" control whatever it holds.
|
|
194
215
|
* Reports whether it landed — a comment the engine refused to delete must not vanish from
|
|
195
|
-
* the caller's own state while the document still holds it.
|
|
216
|
+
* the caller's own state while the document still holds it. A refused discard of a tracked
|
|
217
|
+
* change is recorded in `lastRefusal` with `action: 'reject'`, as a refused reject is.
|
|
196
218
|
*/
|
|
197
219
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
198
220
|
/**
|
|
@@ -236,13 +258,15 @@ interface UseReviewReturn {
|
|
|
236
258
|
* packaged rail recorded. Set by a refused write and cleared by the next one that lands, and
|
|
237
259
|
* by a change to the document, the editing mode, editability, the collaboration status or
|
|
238
260
|
* the author filter. A caret move keeps it. The packaged cards show it as a sentence; a
|
|
239
|
-
* custom card reads `key` to place it
|
|
261
|
+
* custom card reads `key` to place it, `useReviewRefusalMessage()` to word it, and `code`, the
|
|
262
|
+
* public diagnostic code, to branch on the cause.
|
|
240
263
|
*
|
|
241
264
|
* @example
|
|
242
265
|
* ```tsx
|
|
243
266
|
* const { lastRefusal } = useReview();
|
|
267
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
244
268
|
* // The packaged rail announces it; this only shows it.
|
|
245
|
-
* return lastRefusal?.key === item.key ? <p>{lastRefusal
|
|
269
|
+
* return lastRefusal?.key === item.key ? <p>{refusalMessage(lastRefusal)}</p> : null;
|
|
246
270
|
* ```
|
|
247
271
|
*/
|
|
248
272
|
readonly lastRefusal: ReviewWriteRefusal | null;
|
|
@@ -572,7 +596,17 @@ interface ReviewListProps {
|
|
|
572
596
|
collapsed?: ReadonlySet<string>;
|
|
573
597
|
scale?: number;
|
|
574
598
|
offset?: number;
|
|
575
|
-
/**
|
|
599
|
+
/**
|
|
600
|
+
* Visible band of the scroller, in the rail's coordinates; cards outside it are not mounted.
|
|
601
|
+
* Before the rail measures its scroller the band is empty (`top` greater than `bottom`, both
|
|
602
|
+
* infinite), so no positioned card renders.
|
|
603
|
+
*
|
|
604
|
+
* Null, or leaving it out, mounts every card. That is correct but costs one card per pending
|
|
605
|
+
* change on each render. Inside the packaged review rail the band arrives on its own, including
|
|
606
|
+
* for a `List` override. A list mounted elsewhere measures its own scroller and passes the
|
|
607
|
+
* part of it in view, widened by a margin above and below (the rail uses 600 px) so cards
|
|
608
|
+
* mount before they scroll into view.
|
|
609
|
+
*/
|
|
576
610
|
window?: {
|
|
577
611
|
top: number;
|
|
578
612
|
bottom: number;
|
|
@@ -708,13 +742,21 @@ interface ReviewRailMetrics {
|
|
|
708
742
|
readonly top: number;
|
|
709
743
|
/**
|
|
710
744
|
* CSS pixels from the scroll container's left padding edge, in its scrolled content, to
|
|
711
|
-
* the column's left edge: one 16px gutter right of the page
|
|
712
|
-
*
|
|
745
|
+
* the column's left edge: one 16px gutter right of the page, or, in a right-to-left
|
|
746
|
+
* interface, one 16px gutter and the column's own width left of it. `null` until there is
|
|
747
|
+
* a page to measure. Keep the column hidden while it is `null`.
|
|
713
748
|
*/
|
|
714
749
|
readonly left: number | null;
|
|
750
|
+
/**
|
|
751
|
+
* The page side the column stands on: `'left'` in a right-to-left interface, otherwise
|
|
752
|
+
* `'right'`. On the left, give the column its width (300px for the packaged cards), because
|
|
753
|
+
* `left` keeps the column's RIGHT edge one gutter off the page; and keep each card's air on
|
|
754
|
+
* its left, away from the page.
|
|
755
|
+
*/
|
|
756
|
+
readonly side: 'left' | 'right';
|
|
715
757
|
/**
|
|
716
758
|
* The `left` value, relative to {@link ReviewRailMetrics.left}, that puts a 300px card
|
|
717
|
-
* fully inside the visible area with a 12px inset from its
|
|
759
|
+
* fully inside the visible area with a 12px inset from its edge on the column's side. Use it while
|
|
718
760
|
* {@link ReviewRailMetrics.compact} is true. `null` until there is a page to measure.
|
|
719
761
|
*/
|
|
720
762
|
readonly compactCardLeft: number | null;
|
|
@@ -735,11 +777,11 @@ interface UseReviewRailMetricsOptions {
|
|
|
735
777
|
readonly trackScroll?: boolean;
|
|
736
778
|
/**
|
|
737
779
|
* With a `railRef`, reserve the review gutter beside the page while the column element is
|
|
738
|
-
* mounted, as `DocxEditorReview` does. The viewport then shifts the page
|
|
739
|
-
* pane is open. The reservation does not show the comment controls in the
|
|
740
|
-
* context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
741
|
-
* mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
742
|
-
* page. Default: `true`.
|
|
780
|
+
* mounted, as `DocxEditorReview` does. The viewport then shifts the page away from the
|
|
781
|
+
* column while the pane is open. The reservation does not show the comment controls in the
|
|
782
|
+
* toolbar and the context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
783
|
+
* `false` when a mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
784
|
+
* column overlays the page. Default: `true`.
|
|
743
785
|
*/
|
|
744
786
|
readonly reserveGutter?: boolean;
|
|
745
787
|
}
|
|
@@ -778,6 +820,8 @@ interface UseReviewRailMetricsOptions {
|
|
|
778
820
|
* position: 'absolute',
|
|
779
821
|
* top: 0,
|
|
780
822
|
* left: metrics.left ?? 0,
|
|
823
|
+
* // The column's width places it when `metrics.side` is 'left'.
|
|
824
|
+
* width: 300,
|
|
781
825
|
* visibility: metrics.left === null ? 'hidden' : 'visible',
|
|
782
826
|
* }}
|
|
783
827
|
* >
|
|
@@ -1237,6 +1281,21 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1237
1281
|
*/
|
|
1238
1282
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1239
1283
|
|
|
1284
|
+
/**
|
|
1285
|
+
* The packaged sentence for a refused review write, in the reader's language, for a host's own
|
|
1286
|
+
* card or balloon. It honors the review pane's `t` overrides, as the packaged cards do.
|
|
1287
|
+
*
|
|
1288
|
+
* @example
|
|
1289
|
+
* ```tsx
|
|
1290
|
+
* const { lastRefusal } = useReview();
|
|
1291
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
1292
|
+
* return lastRefusal?.key === item.key ? <p role="alert">{refusalMessage(lastRefusal)}</p> : null;
|
|
1293
|
+
* ```
|
|
1294
|
+
*
|
|
1295
|
+
* @public
|
|
1296
|
+
*/
|
|
1297
|
+
declare function useReviewRefusalMessage(): (refusal: ReviewWriteRefusal) => string;
|
|
1298
|
+
|
|
1240
1299
|
/** Status returned by {@link useCollaborationStatus}. @public */
|
|
1241
1300
|
interface UseCollaborationStatusReturn {
|
|
1242
1301
|
/** Current lifecycle state, or `inactive` when no session is attached. */
|
|
@@ -1442,5 +1501,5 @@ interface UseDocumentCollaborationReturn {
|
|
|
1442
1501
|
*/
|
|
1443
1502
|
declare function useDocumentCollaboration(options?: UseDocumentCollaborationOptions): UseDocumentCollaborationReturn;
|
|
1444
1503
|
|
|
1445
|
-
export { CollaborationSession, CreateDocumentCollaborationOptions, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, resolveCustomNodeActivation, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useStackedReviewPositions };
|
|
1504
|
+
export { CollaborationSession, CreateDocumentCollaborationOptions, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, resolveCustomNodeActivation, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useReviewRefusalMessage, useStackedReviewPositions };
|
|
1446
1505
|
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewDraftProps, ReviewItemView, ReviewMarkersProps, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewReturn };
|