@docx-editor.dev/pro 2.31.0 → 2.33.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 +41 -3
- package/dist/chunk-25A5N6OL.js +1 -0
- package/dist/chunk-3HW2VWFW.js +1 -0
- package/dist/chunk-3MIZFGHH.cjs +1 -0
- package/dist/chunk-46N5DWZV.cjs +1 -0
- package/dist/chunk-65JEI6FY.cjs +5 -0
- package/dist/chunk-ENMURXLJ.js +1 -0
- package/dist/chunk-EOZ44UA7.js +1 -0
- package/dist/chunk-GLYQ72LS.cjs +6 -0
- package/dist/{chunk-RYF4SNKX.cjs → chunk-GOUTDQFX.cjs} +1 -1
- package/dist/chunk-HMU7J34H.js +1 -0
- package/dist/chunk-IULA3QRZ.cjs +1 -0
- package/dist/chunk-QEULTKCT.cjs +1 -0
- package/dist/{chunk-OT5R3IYV.cjs → chunk-QOXYHVBM.cjs} +1 -1
- package/dist/chunk-SINNHH3H.js +1 -0
- package/dist/chunk-SL6K2CUL.js +6 -0
- package/dist/chunk-STTJA26X.js +1 -0
- package/dist/chunk-VY7374QP.cjs +1 -0
- package/dist/chunk-WGBOER6G.js +1 -0
- package/dist/chunk-WX43PF3Z.cjs +1 -0
- package/dist/chunk-WYVEFRAM.js +5 -0
- package/dist/collaboration/hocuspocus.cjs +1 -1
- package/dist/collaboration/hocuspocus.d.cts +3 -3
- package/dist/collaboration/hocuspocus.d.ts +3 -3
- package/dist/collaboration/hocuspocus.js +1 -1
- package/dist/collaboration/index.cjs +2 -2
- package/dist/collaboration/index.d.cts +65 -8
- package/dist/collaboration/index.d.ts +65 -8
- package/dist/collaboration/index.js +2 -2
- package/dist/collaboration/webrtc.cjs +1 -1
- package/dist/collaboration/webrtc.d.cts +3 -3
- package/dist/collaboration/webrtc.d.ts +3 -3
- 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-4NUOLWKQ.cjs +1 -0
- package/dist/document-session-5VAD24RH.js +1 -0
- package/dist/{document-session-_v9vqiSX.d.cts → document-session-B-MlORjE.d.cts} +105 -9
- package/dist/{document-session-Bxs4_GgX.d.ts → document-session-B-iH-YCU.d.ts} +105 -9
- package/dist/{document-session-options-DelOC7PX.d.ts → document-session-options-CdOH-TNn.d.ts} +1 -1
- package/dist/{document-session-options-CfKypp9c.d.cts → document-session-options-CxR0F5xT.d.cts} +1 -1
- 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-GHPEUR2W.js +1 -0
- package/dist/metafile-replay-NZWGGGZR.cjs +1 -0
- package/dist/react/hocuspocus.cjs +1 -1
- package/dist/react/hocuspocus.d.cts +2 -2
- package/dist/react/hocuspocus.d.ts +2 -2
- package/dist/react/hocuspocus.js +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.cts +176 -34
- package/dist/react/index.d.ts +176 -34
- package/dist/react/index.js +2 -2
- package/dist/react/webrtc.cjs +1 -1
- package/dist/react/webrtc.d.cts +2 -2
- package/dist/react/webrtc.d.ts +2 -2
- package/dist/react/webrtc.js +1 -1
- package/dist/{types-BQ1vBt5Q.d.ts → types-DvGpDOcZ.d.cts} +9 -1
- package/dist/{types-BQ1vBt5Q.d.cts → types-DvGpDOcZ.d.ts} +9 -1
- package/dist/{types-6EmrEn4n.d.cts → types-bt2k1VO0.d.cts} +9 -1
- package/dist/{types-6EmrEn4n.d.ts → types-bt2k1VO0.d.ts} +9 -1
- package/dist/vue/hocuspocus.cjs +1 -1
- package/dist/vue/hocuspocus.d.cts +2 -2
- package/dist/vue/hocuspocus.d.ts +2 -2
- package/dist/vue/hocuspocus.js +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.cts +149 -30
- package/dist/vue/index.d.ts +149 -30
- package/dist/vue/index.js +2 -2
- package/dist/vue/webrtc.cjs +1 -1
- package/dist/vue/webrtc.d.cts +2 -2
- package/dist/vue/webrtc.d.ts +2 -2
- package/dist/vue/webrtc.js +1 -1
- package/docs/accept-reject-without-scrolling.md +95 -0
- package/docs/comment-on-found-text.md +72 -0
- package/docs/custom-review-cards.md +178 -0
- package/docs/highlight-ranges.md +48 -0
- package/docs/index.md +36 -0
- package/docs/propose-rewrite.md +247 -0
- package/docs/tracked-replacement.md +68 -0
- package/package.json +12 -5
- package/dist/chunk-32WEH2XH.cjs +0 -1
- package/dist/chunk-DLYVBBO7.js +0 -1
- package/dist/chunk-FD2KDBHX.cjs +0 -1
- package/dist/chunk-L567WP3J.js +0 -5
- package/dist/chunk-MJECUVHQ.cjs +0 -5
- package/dist/chunk-MWO2ZUEJ.js +0 -1
- package/dist/chunk-Q2VBO66F.js +0 -1
- package/dist/chunk-Q5JTCGJI.js +0 -1
- package/dist/chunk-QLZH2Q2C.cjs +0 -1
- package/dist/chunk-SNQCYZLT.js +0 -1
- package/dist/chunk-UOAEJRVX.js +0 -1
- package/dist/chunk-ZSAAX6HV.cjs +0 -1
- package/dist/document-session-3VC43WNI.cjs +0 -1
- package/dist/document-session-J2YKWERI.js +0 -1
package/dist/vue/index.d.cts
CHANGED
|
@@ -16,11 +16,11 @@ export { CollaborationFailure, CollaborationFailureCode, CollaborationIdentity,
|
|
|
16
16
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
17
17
|
import * as vue from 'vue';
|
|
18
18
|
import { ComputedRef, Ref, VNode, MaybeRefOrGetter as MaybeRefOrGetter$1, PropType } from 'vue';
|
|
19
|
-
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
|
-
export { ReviewActivationOptions, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
19
|
+
import { EditDiagnosticCode, ReviewDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
|
+
export { ReviewActivationOptions, ReviewDiagnosticCode, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
21
21
|
import { MaybeRefOrGetter, ReviewAuthorInfo } from '@docx-editor.dev/vue';
|
|
22
|
-
import { C as CollaborationSession, a as CollaborationBootstrap } from '../types-
|
|
23
|
-
export { b as CollaborationIdentityUpdate } from '../types-
|
|
22
|
+
import { C as CollaborationSession, a as CollaborationBootstrap } from '../types-bt2k1VO0.cjs';
|
|
23
|
+
export { b as CollaborationIdentityUpdate } from '../types-bt2k1VO0.cjs';
|
|
24
24
|
import * as Y from 'yjs';
|
|
25
25
|
import { Awareness } from 'y-protocols/awareness';
|
|
26
26
|
|
|
@@ -50,7 +50,8 @@ interface ProLicenseOptions {
|
|
|
50
50
|
* Registering it is the whole enablement story: the review chrome slots light
|
|
51
51
|
* up through the same `toolbarCommandState` they were disabled by, suggesting
|
|
52
52
|
* mode becomes reachable, and the editor renders revisions in markup rather
|
|
53
|
-
* than the free tier's final-state projection.
|
|
53
|
+
* than the free tier's final-state projection. It also installs the drawing renderers, as
|
|
54
|
+
* `drawingModule()` from `@docx-editor.dev/pro/drawing` does.
|
|
54
55
|
*/
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -69,7 +70,11 @@ interface ReviewModuleOptions extends ProLicenseOptions {
|
|
|
69
70
|
*/
|
|
70
71
|
readonly pane?: ReviewPaneOptions;
|
|
71
72
|
}
|
|
72
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Build the review module. Construction never validates the key and never touches the network.
|
|
75
|
+
* It installs the drawing renderers process-wide, so charts, SmartArt layout, drawing effects,
|
|
76
|
+
* WordArt, and metafile pictures render without a separate `drawingModule()`.
|
|
77
|
+
*/
|
|
73
78
|
declare function reviewModule(options?: ReviewModuleOptions): EditorModule;
|
|
74
79
|
|
|
75
80
|
/**
|
|
@@ -119,12 +124,16 @@ type ReviewWriteAction = 'accept' | 'reject' | 'resolve' | 'reopen' | 'remove' |
|
|
|
119
124
|
* @public
|
|
120
125
|
*/
|
|
121
126
|
interface ReviewWriteRefusal {
|
|
122
|
-
/** Which write was refused. */
|
|
127
|
+
/** Which write was refused. A discarded tracked change reports `'reject'`. */
|
|
123
128
|
readonly action: ReviewWriteAction;
|
|
124
129
|
/** The card the write addressed, or null for a new comment on the selection. */
|
|
125
130
|
readonly key: string | null;
|
|
126
|
-
/**
|
|
127
|
-
|
|
131
|
+
/**
|
|
132
|
+
* The public diagnostic code, the same one `onDiagnostic` reports for the refusal. A tracked
|
|
133
|
+
* change the engine could not decide names its review code, such as
|
|
134
|
+
* `review.retained-structure` for a row that stays to keep a nested table.
|
|
135
|
+
*/
|
|
136
|
+
readonly code: EditDiagnosticCode | ReviewDiagnosticCode;
|
|
128
137
|
/**
|
|
129
138
|
* Rises with every refusal of this editor, so the same refusal twice still differs. Key a
|
|
130
139
|
* live announcement on it to announce a repeat.
|
|
@@ -169,10 +178,23 @@ interface UseReviewReturn {
|
|
|
169
178
|
* useEditorEvent('reviewItemReveal', ({ key, source }) => openMyCard(key, source));
|
|
170
179
|
* setActive(key); // fires nothing
|
|
171
180
|
* setActive(key, { announce: true }); // fires 'reviewItemReveal'
|
|
181
|
+
* setActive(key, { reveal: false }); // opens the item without scrolling
|
|
172
182
|
* ```
|
|
183
|
+
*
|
|
184
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
173
185
|
*/
|
|
174
186
|
readonly setActive: (key: string | null, options?: ReviewActivationOptions) => boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Accept a revision. Reports whether it landed. For headless or server use, see
|
|
189
|
+
* `Revision.accept()` in `@docx-editor.dev/editor-api`.
|
|
190
|
+
*
|
|
191
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
192
|
+
*/
|
|
175
193
|
readonly accept: (item: ReviewItemView) => boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Reject a revision. Reports whether it landed. For headless or server use, see
|
|
196
|
+
* `Revision.reject()` in `@docx-editor.dev/editor-api`.
|
|
197
|
+
*/
|
|
176
198
|
readonly reject: (item: ReviewItemView) => boolean;
|
|
177
199
|
/**
|
|
178
200
|
* Adopt tracked changes as the reviewer's own; they stay pending. Takes one item or a list,
|
|
@@ -185,8 +207,21 @@ interface UseReviewReturn {
|
|
|
185
207
|
readonly reopen: (item: ReviewItemView) => boolean;
|
|
186
208
|
readonly commentResolutionDisabledReason: ComputedRef<string | null>;
|
|
187
209
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Reply to a comment or a revision. The author is `DocxEditorConfig.author` unless you pass
|
|
212
|
+
* one. Reports whether the reply landed. For headless or server use, see `Comment.reply` in
|
|
213
|
+
* `@docx-editor.dev/editor-api`.
|
|
214
|
+
*/
|
|
188
215
|
readonly reply: (item: ReviewItemView, text: string, author?: string) => boolean;
|
|
216
|
+
/** Where a comment on the current selection would sit, in layout points, or null. */
|
|
189
217
|
readonly selectionAnchorY: ComputedRef<number | null>;
|
|
218
|
+
/**
|
|
219
|
+
* Comment on the current selection. Reports whether it landed, like `reply`. To comment
|
|
220
|
+
* on found text, select it first with `editor.findMatches` and `editor.selectMatch`. For
|
|
221
|
+
* headless or server use, see `Range.insertComment` in `@docx-editor.dev/editor-api`.
|
|
222
|
+
*
|
|
223
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/comment-on-found-text | Comment on found text}
|
|
224
|
+
*/
|
|
190
225
|
readonly comment: (text: string, author?: string) => boolean;
|
|
191
226
|
/**
|
|
192
227
|
* Why the last accept, reject, resolve, reopen, remove, reply or comment did not land, or null.
|
|
@@ -195,7 +230,8 @@ interface UseReviewReturn {
|
|
|
195
230
|
* packaged rail recorded. Cleared by the next write that lands and by a change to the
|
|
196
231
|
* document, the editing mode, editability, the collaboration status or the author filter; a
|
|
197
232
|
* caret move keeps it. The packaged cards show it as a sentence; a custom card reads `key` to
|
|
198
|
-
* place it and `code`, the public diagnostic code, to
|
|
233
|
+
* place it, `useReviewRefusalMessage()` to word it, and `code`, the public diagnostic code, to
|
|
234
|
+
* branch on the cause.
|
|
199
235
|
*/
|
|
200
236
|
readonly lastRefusal: ComputedRef<ReviewWriteRefusal | null>;
|
|
201
237
|
readonly paneOpen: ComputedRef<boolean>;
|
|
@@ -216,11 +252,14 @@ declare function useReviewOf(editorRef: Ref<Editor | null>, query?: MaybeRefOrGe
|
|
|
216
252
|
* Returns each card's top in layout points. `useReviewRailMetrics` supplies `scale` and the
|
|
217
253
|
* pixel offset of the first page: a card's CSS `top` is `metrics.top + position * metrics.scale`.
|
|
218
254
|
*
|
|
255
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
219
256
|
* @public
|
|
220
257
|
*/
|
|
221
258
|
declare function useStackedReviewPositions(items: MaybeRefOrGetter<readonly {
|
|
222
259
|
readonly key: string;
|
|
223
260
|
readonly anchorY: number | null;
|
|
261
|
+
/** Keep this entry at its own anchor; the entries before it move up. */
|
|
262
|
+
readonly isActive?: boolean;
|
|
224
263
|
}[]>, heights: MaybeRefOrGetter<ReadonlyMap<string, number>>, options?: MaybeRefOrGetter<{
|
|
225
264
|
readonly gap?: number;
|
|
226
265
|
readonly scale?: number;
|
|
@@ -254,6 +293,23 @@ interface ReviewBalloonProps {
|
|
|
254
293
|
*/
|
|
255
294
|
hidden?: boolean;
|
|
256
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Props of `DocxEditorReview.Draft`.
|
|
298
|
+
*
|
|
299
|
+
* @public
|
|
300
|
+
*/
|
|
301
|
+
interface ReviewDraftProps extends ReviewPartProps {
|
|
302
|
+
/**
|
|
303
|
+
* Rail-local `top` in CSS pixels. Omit it to use the packaged card stack's position. Pass
|
|
304
|
+
* your own when you render your own cards, so the box stacks with them.
|
|
305
|
+
*/
|
|
306
|
+
top?: number;
|
|
307
|
+
/**
|
|
308
|
+
* Rail-local `left` for the compact rail. Omit it to use the compact card's position in the
|
|
309
|
+
* compact rail and the rail's own column otherwise. Null keeps the box in the rail's column.
|
|
310
|
+
*/
|
|
311
|
+
left?: number | null;
|
|
312
|
+
}
|
|
257
313
|
/** @public */
|
|
258
314
|
interface ReviewMarkersProps extends ReviewPartProps {
|
|
259
315
|
scale?: number;
|
|
@@ -294,6 +350,35 @@ declare function useReviewItem(): ComputedRef<ReviewItemView | null>;
|
|
|
294
350
|
*/
|
|
295
351
|
declare function useReviewAuthor(author: MaybeRefOrGetter$1<string | undefined>): ComputedRef<ReviewAuthorInfo | undefined>;
|
|
296
352
|
|
|
353
|
+
/**
|
|
354
|
+
* The review rail: comments and tracked changes as a compound component. Requires
|
|
355
|
+
* `reviewModule()` in the editor's modules.
|
|
356
|
+
*
|
|
357
|
+
* PARTS AND SCOPES. The rail reads its parts from its own children, by element type. There are
|
|
358
|
+
* two scopes:
|
|
359
|
+
*
|
|
360
|
+
* - Root parts: `List`, `Markers`, `AddComment`, `Draft`, and `Balloon`. Put them as DIRECT
|
|
361
|
+
* children of `DocxEditorReview` (fragments are transparent). The rail gives them the geometry
|
|
362
|
+
* only it can compute: the comment button's and the compose box's `top`, and the markers'
|
|
363
|
+
* scale and window. A root part inside a wrapper component is not seen as a part. It renders
|
|
364
|
+
* as ordinary content, without that wiring.
|
|
365
|
+
* - Card parts: `Card`, `Empty`, and the parts inside a card (`Author`, `Summary`, `Accept`,
|
|
366
|
+
* `Reject`, `Reply`, and the others). Put them inside `DocxEditorReview.List`, or as other
|
|
367
|
+
* direct children, which become the card template.
|
|
368
|
+
*
|
|
369
|
+
* `:preset="false"` drops the packaged defaults. Root parts you pass still get their wiring, and
|
|
370
|
+
* every other child renders as is inside the rail, where `useReviewRailMetrics()` reads the
|
|
371
|
+
* rail's own measurement. To render your own cards, use `useReview().items`,
|
|
372
|
+
* `useStackedReviewPositions`, and `useReviewRailMetrics`. `Draft` without `top` sits where the
|
|
373
|
+
* packaged card stack puts it, so pass `top` from your own stack.
|
|
374
|
+
*
|
|
375
|
+
* In a browser host, this rail and `useReview()` are the way to build a review UI. For headless,
|
|
376
|
+
* server, or agent pipelines, use `@docx-editor.dev/editor-api`.
|
|
377
|
+
*
|
|
378
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
379
|
+
*
|
|
380
|
+
* @public
|
|
381
|
+
*/
|
|
297
382
|
declare const DocxEditorReview: {
|
|
298
383
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<vue.ExtractPropTypes<{
|
|
299
384
|
className: StringConstructor;
|
|
@@ -875,12 +960,12 @@ declare const DocxEditorReview: {
|
|
|
875
960
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
876
961
|
Draft: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
877
962
|
top: {
|
|
878
|
-
type:
|
|
879
|
-
default:
|
|
963
|
+
type: PropType<number | undefined>;
|
|
964
|
+
default: undefined;
|
|
880
965
|
};
|
|
881
966
|
left: {
|
|
882
|
-
type: PropType<number | null>;
|
|
883
|
-
default:
|
|
967
|
+
type: PropType<number | null | undefined>;
|
|
968
|
+
default: undefined;
|
|
884
969
|
};
|
|
885
970
|
className: StringConstructor;
|
|
886
971
|
hidden: BooleanConstructor;
|
|
@@ -888,18 +973,18 @@ declare const DocxEditorReview: {
|
|
|
888
973
|
[key: string]: any;
|
|
889
974
|
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
890
975
|
top: {
|
|
891
|
-
type:
|
|
892
|
-
default:
|
|
976
|
+
type: PropType<number | undefined>;
|
|
977
|
+
default: undefined;
|
|
893
978
|
};
|
|
894
979
|
left: {
|
|
895
|
-
type: PropType<number | null>;
|
|
896
|
-
default:
|
|
980
|
+
type: PropType<number | null | undefined>;
|
|
981
|
+
default: undefined;
|
|
897
982
|
};
|
|
898
983
|
className: StringConstructor;
|
|
899
984
|
hidden: BooleanConstructor;
|
|
900
985
|
}>> & Readonly<{}>, {
|
|
901
|
-
top: number;
|
|
902
|
-
left: number | null;
|
|
986
|
+
top: number | undefined;
|
|
987
|
+
left: number | null | undefined;
|
|
903
988
|
hidden: boolean;
|
|
904
989
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
905
990
|
Balloon: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -941,13 +1026,21 @@ interface ReviewRailMetrics {
|
|
|
941
1026
|
readonly top: number;
|
|
942
1027
|
/**
|
|
943
1028
|
* CSS pixels from the scroll container's left padding edge, in its scrolled content, to
|
|
944
|
-
* the column's left edge: one 16px gutter right of the page
|
|
945
|
-
*
|
|
1029
|
+
* the column's left edge: one 16px gutter right of the page, or, in a right-to-left
|
|
1030
|
+
* interface, one 16px gutter and the column's own width left of it. `null` until there is
|
|
1031
|
+
* a page to measure. Keep the column hidden while it is `null`.
|
|
946
1032
|
*/
|
|
947
1033
|
readonly left: number | null;
|
|
1034
|
+
/**
|
|
1035
|
+
* The page side the column stands on: `'left'` in a right-to-left interface, otherwise
|
|
1036
|
+
* `'right'`. On the left, give the column its width (300px for the packaged cards), because
|
|
1037
|
+
* `left` keeps the column's RIGHT edge one gutter off the page; and keep each card's air on
|
|
1038
|
+
* its left, away from the page.
|
|
1039
|
+
*/
|
|
1040
|
+
readonly side: 'left' | 'right';
|
|
948
1041
|
/**
|
|
949
1042
|
* The `left` value, relative to {@link ReviewRailMetrics.left}, that puts a 300px card
|
|
950
|
-
* fully inside the visible area with a 12px inset from its
|
|
1043
|
+
* fully inside the visible area with a 12px inset from its edge on the column's side. Use it while
|
|
951
1044
|
* {@link ReviewRailMetrics.compact} is true. `null` until there is a page to measure.
|
|
952
1045
|
*/
|
|
953
1046
|
readonly compactCardLeft: number | null;
|
|
@@ -968,11 +1061,11 @@ interface UseReviewRailMetricsOptions {
|
|
|
968
1061
|
readonly trackScroll?: boolean;
|
|
969
1062
|
/**
|
|
970
1063
|
* With a `railRef`, reserve the review gutter beside the page while the column element is
|
|
971
|
-
* mounted, as `DocxEditorReview` does. The viewport then shifts the page
|
|
972
|
-
* pane is open. The reservation does not show the comment controls in the
|
|
973
|
-
* context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
974
|
-
* mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
975
|
-
* page. Default: `true`.
|
|
1064
|
+
* mounted, as `DocxEditorReview` does. The viewport then shifts the page away from the
|
|
1065
|
+
* column while the pane is open. The reservation does not show the comment controls in the
|
|
1066
|
+
* toolbar and the context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
1067
|
+
* `false` when a mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
1068
|
+
* column overlays the page. Default: `true`.
|
|
976
1069
|
*/
|
|
977
1070
|
readonly reserveGutter?: boolean;
|
|
978
1071
|
}
|
|
@@ -1030,6 +1123,7 @@ interface UseReviewRailMetricsReturn {
|
|
|
1030
1123
|
* position: 'absolute',
|
|
1031
1124
|
* top: '0px',
|
|
1032
1125
|
* left: `${metrics.left ?? 0}px`,
|
|
1126
|
+
* width: '300px',
|
|
1033
1127
|
* visibility: metrics.left === null ? 'hidden' : 'visible',
|
|
1034
1128
|
* }"
|
|
1035
1129
|
* >
|
|
@@ -1043,10 +1137,35 @@ interface UseReviewRailMetricsReturn {
|
|
|
1043
1137
|
* </template>
|
|
1044
1138
|
* ```
|
|
1045
1139
|
*
|
|
1140
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
1046
1141
|
* @public
|
|
1047
1142
|
*/
|
|
1048
1143
|
declare function useReviewRailMetrics(railRef?: MaybeRefOrGetter$1<HTMLElement | null> | null, options?: MaybeRefOrGetter$1<UseReviewRailMetricsOptions | undefined>): UseReviewRailMetricsReturn;
|
|
1049
1144
|
|
|
1145
|
+
/**
|
|
1146
|
+
* The function {@link useReviewRefusalMessage} returns: the packaged sentence for a refusal.
|
|
1147
|
+
*
|
|
1148
|
+
* @public
|
|
1149
|
+
*/
|
|
1150
|
+
interface UseReviewRefusalMessageReturn {
|
|
1151
|
+
(refusal: ReviewWriteRefusal): string;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* The packaged sentence for a refused review write, in the reader's language, for a host's own
|
|
1155
|
+
* card or balloon. It honors the review pane's `t` overrides, as the packaged cards do. Call it
|
|
1156
|
+
* in `setup`.
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* ```ts
|
|
1160
|
+
* const { lastRefusal } = useReview();
|
|
1161
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
1162
|
+
* const notice = computed(() => (lastRefusal.value ? refusalMessage(lastRefusal.value) : ''));
|
|
1163
|
+
* ```
|
|
1164
|
+
*
|
|
1165
|
+
* @public
|
|
1166
|
+
*/
|
|
1167
|
+
declare function useReviewRefusalMessage(): UseReviewRefusalMessageReturn;
|
|
1168
|
+
|
|
1050
1169
|
/** Reactive collaboration status for Vue hosts. @public */
|
|
1051
1170
|
interface UseCollaborationStatusReturn {
|
|
1052
1171
|
/** Current lifecycle state, or `inactive` when no session is attached. */
|
|
@@ -1923,5 +2042,5 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1923
2042
|
/** Resolves a painted pointer target to a registered custom-node definition. @public */
|
|
1924
2043
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1925
2044
|
|
|
1926
|
-
export { CollaborationBootstrap, CollaborationSession, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, collaborationModule, resolveCustomNodeActivation, reviewModule, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useStackedReviewPositions };
|
|
1927
|
-
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationModuleOptions, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CreateDocumentCollaborationOptions, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ProLicenseOptions, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewItemView, ReviewMarkersProps, ReviewModuleOptions, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationParticipantsReturn, UseCollaborationSessionReturn, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewRailMetricsReturn, UseReviewReturn };
|
|
2045
|
+
export { CollaborationBootstrap, CollaborationSession, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, collaborationModule, resolveCustomNodeActivation, reviewModule, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useReviewRefusalMessage, useStackedReviewPositions };
|
|
2046
|
+
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationModuleOptions, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CreateDocumentCollaborationOptions, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ProLicenseOptions, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewDraftProps, ReviewItemView, ReviewMarkersProps, ReviewModuleOptions, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationParticipantsReturn, UseCollaborationSessionReturn, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewRailMetricsReturn, UseReviewRefusalMessageReturn, UseReviewReturn };
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -16,11 +16,11 @@ export { CollaborationFailure, CollaborationFailureCode, CollaborationIdentity,
|
|
|
16
16
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
17
17
|
import * as vue from 'vue';
|
|
18
18
|
import { ComputedRef, Ref, VNode, MaybeRefOrGetter as MaybeRefOrGetter$1, PropType } from 'vue';
|
|
19
|
-
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
|
-
export { ReviewActivationOptions, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
19
|
+
import { EditDiagnosticCode, ReviewDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
|
+
export { ReviewActivationOptions, ReviewDiagnosticCode, ReviewItemRevealEvent, ReviewItemRevealSource, ScrollPlacement } from '@docx-editor.dev/core/contracts/editor';
|
|
21
21
|
import { MaybeRefOrGetter, ReviewAuthorInfo } from '@docx-editor.dev/vue';
|
|
22
|
-
import { C as CollaborationSession, a as CollaborationBootstrap } from '../types-
|
|
23
|
-
export { b as CollaborationIdentityUpdate } from '../types-
|
|
22
|
+
import { C as CollaborationSession, a as CollaborationBootstrap } from '../types-bt2k1VO0.js';
|
|
23
|
+
export { b as CollaborationIdentityUpdate } from '../types-bt2k1VO0.js';
|
|
24
24
|
import * as Y from 'yjs';
|
|
25
25
|
import { Awareness } from 'y-protocols/awareness';
|
|
26
26
|
|
|
@@ -50,7 +50,8 @@ interface ProLicenseOptions {
|
|
|
50
50
|
* Registering it is the whole enablement story: the review chrome slots light
|
|
51
51
|
* up through the same `toolbarCommandState` they were disabled by, suggesting
|
|
52
52
|
* mode becomes reachable, and the editor renders revisions in markup rather
|
|
53
|
-
* than the free tier's final-state projection.
|
|
53
|
+
* than the free tier's final-state projection. It also installs the drawing renderers, as
|
|
54
|
+
* `drawingModule()` from `@docx-editor.dev/pro/drawing` does.
|
|
54
55
|
*/
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -69,7 +70,11 @@ interface ReviewModuleOptions extends ProLicenseOptions {
|
|
|
69
70
|
*/
|
|
70
71
|
readonly pane?: ReviewPaneOptions;
|
|
71
72
|
}
|
|
72
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Build the review module. Construction never validates the key and never touches the network.
|
|
75
|
+
* It installs the drawing renderers process-wide, so charts, SmartArt layout, drawing effects,
|
|
76
|
+
* WordArt, and metafile pictures render without a separate `drawingModule()`.
|
|
77
|
+
*/
|
|
73
78
|
declare function reviewModule(options?: ReviewModuleOptions): EditorModule;
|
|
74
79
|
|
|
75
80
|
/**
|
|
@@ -119,12 +124,16 @@ type ReviewWriteAction = 'accept' | 'reject' | 'resolve' | 'reopen' | 'remove' |
|
|
|
119
124
|
* @public
|
|
120
125
|
*/
|
|
121
126
|
interface ReviewWriteRefusal {
|
|
122
|
-
/** Which write was refused. */
|
|
127
|
+
/** Which write was refused. A discarded tracked change reports `'reject'`. */
|
|
123
128
|
readonly action: ReviewWriteAction;
|
|
124
129
|
/** The card the write addressed, or null for a new comment on the selection. */
|
|
125
130
|
readonly key: string | null;
|
|
126
|
-
/**
|
|
127
|
-
|
|
131
|
+
/**
|
|
132
|
+
* The public diagnostic code, the same one `onDiagnostic` reports for the refusal. A tracked
|
|
133
|
+
* change the engine could not decide names its review code, such as
|
|
134
|
+
* `review.retained-structure` for a row that stays to keep a nested table.
|
|
135
|
+
*/
|
|
136
|
+
readonly code: EditDiagnosticCode | ReviewDiagnosticCode;
|
|
128
137
|
/**
|
|
129
138
|
* Rises with every refusal of this editor, so the same refusal twice still differs. Key a
|
|
130
139
|
* live announcement on it to announce a repeat.
|
|
@@ -169,10 +178,23 @@ interface UseReviewReturn {
|
|
|
169
178
|
* useEditorEvent('reviewItemReveal', ({ key, source }) => openMyCard(key, source));
|
|
170
179
|
* setActive(key); // fires nothing
|
|
171
180
|
* setActive(key, { announce: true }); // fires 'reviewItemReveal'
|
|
181
|
+
* setActive(key, { reveal: false }); // opens the item without scrolling
|
|
172
182
|
* ```
|
|
183
|
+
*
|
|
184
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
173
185
|
*/
|
|
174
186
|
readonly setActive: (key: string | null, options?: ReviewActivationOptions) => boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Accept a revision. Reports whether it landed. For headless or server use, see
|
|
189
|
+
* `Revision.accept()` in `@docx-editor.dev/editor-api`.
|
|
190
|
+
*
|
|
191
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
192
|
+
*/
|
|
175
193
|
readonly accept: (item: ReviewItemView) => boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Reject a revision. Reports whether it landed. For headless or server use, see
|
|
196
|
+
* `Revision.reject()` in `@docx-editor.dev/editor-api`.
|
|
197
|
+
*/
|
|
176
198
|
readonly reject: (item: ReviewItemView) => boolean;
|
|
177
199
|
/**
|
|
178
200
|
* Adopt tracked changes as the reviewer's own; they stay pending. Takes one item or a list,
|
|
@@ -185,8 +207,21 @@ interface UseReviewReturn {
|
|
|
185
207
|
readonly reopen: (item: ReviewItemView) => boolean;
|
|
186
208
|
readonly commentResolutionDisabledReason: ComputedRef<string | null>;
|
|
187
209
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Reply to a comment or a revision. The author is `DocxEditorConfig.author` unless you pass
|
|
212
|
+
* one. Reports whether the reply landed. For headless or server use, see `Comment.reply` in
|
|
213
|
+
* `@docx-editor.dev/editor-api`.
|
|
214
|
+
*/
|
|
188
215
|
readonly reply: (item: ReviewItemView, text: string, author?: string) => boolean;
|
|
216
|
+
/** Where a comment on the current selection would sit, in layout points, or null. */
|
|
189
217
|
readonly selectionAnchorY: ComputedRef<number | null>;
|
|
218
|
+
/**
|
|
219
|
+
* Comment on the current selection. Reports whether it landed, like `reply`. To comment
|
|
220
|
+
* on found text, select it first with `editor.findMatches` and `editor.selectMatch`. For
|
|
221
|
+
* headless or server use, see `Range.insertComment` in `@docx-editor.dev/editor-api`.
|
|
222
|
+
*
|
|
223
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/comment-on-found-text | Comment on found text}
|
|
224
|
+
*/
|
|
190
225
|
readonly comment: (text: string, author?: string) => boolean;
|
|
191
226
|
/**
|
|
192
227
|
* Why the last accept, reject, resolve, reopen, remove, reply or comment did not land, or null.
|
|
@@ -195,7 +230,8 @@ interface UseReviewReturn {
|
|
|
195
230
|
* packaged rail recorded. Cleared by the next write that lands and by a change to the
|
|
196
231
|
* document, the editing mode, editability, the collaboration status or the author filter; a
|
|
197
232
|
* caret move keeps it. The packaged cards show it as a sentence; a custom card reads `key` to
|
|
198
|
-
* place it and `code`, the public diagnostic code, to
|
|
233
|
+
* place it, `useReviewRefusalMessage()` to word it, and `code`, the public diagnostic code, to
|
|
234
|
+
* branch on the cause.
|
|
199
235
|
*/
|
|
200
236
|
readonly lastRefusal: ComputedRef<ReviewWriteRefusal | null>;
|
|
201
237
|
readonly paneOpen: ComputedRef<boolean>;
|
|
@@ -216,11 +252,14 @@ declare function useReviewOf(editorRef: Ref<Editor | null>, query?: MaybeRefOrGe
|
|
|
216
252
|
* Returns each card's top in layout points. `useReviewRailMetrics` supplies `scale` and the
|
|
217
253
|
* pixel offset of the first page: a card's CSS `top` is `metrics.top + position * metrics.scale`.
|
|
218
254
|
*
|
|
255
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
219
256
|
* @public
|
|
220
257
|
*/
|
|
221
258
|
declare function useStackedReviewPositions(items: MaybeRefOrGetter<readonly {
|
|
222
259
|
readonly key: string;
|
|
223
260
|
readonly anchorY: number | null;
|
|
261
|
+
/** Keep this entry at its own anchor; the entries before it move up. */
|
|
262
|
+
readonly isActive?: boolean;
|
|
224
263
|
}[]>, heights: MaybeRefOrGetter<ReadonlyMap<string, number>>, options?: MaybeRefOrGetter<{
|
|
225
264
|
readonly gap?: number;
|
|
226
265
|
readonly scale?: number;
|
|
@@ -254,6 +293,23 @@ interface ReviewBalloonProps {
|
|
|
254
293
|
*/
|
|
255
294
|
hidden?: boolean;
|
|
256
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Props of `DocxEditorReview.Draft`.
|
|
298
|
+
*
|
|
299
|
+
* @public
|
|
300
|
+
*/
|
|
301
|
+
interface ReviewDraftProps extends ReviewPartProps {
|
|
302
|
+
/**
|
|
303
|
+
* Rail-local `top` in CSS pixels. Omit it to use the packaged card stack's position. Pass
|
|
304
|
+
* your own when you render your own cards, so the box stacks with them.
|
|
305
|
+
*/
|
|
306
|
+
top?: number;
|
|
307
|
+
/**
|
|
308
|
+
* Rail-local `left` for the compact rail. Omit it to use the compact card's position in the
|
|
309
|
+
* compact rail and the rail's own column otherwise. Null keeps the box in the rail's column.
|
|
310
|
+
*/
|
|
311
|
+
left?: number | null;
|
|
312
|
+
}
|
|
257
313
|
/** @public */
|
|
258
314
|
interface ReviewMarkersProps extends ReviewPartProps {
|
|
259
315
|
scale?: number;
|
|
@@ -294,6 +350,35 @@ declare function useReviewItem(): ComputedRef<ReviewItemView | null>;
|
|
|
294
350
|
*/
|
|
295
351
|
declare function useReviewAuthor(author: MaybeRefOrGetter$1<string | undefined>): ComputedRef<ReviewAuthorInfo | undefined>;
|
|
296
352
|
|
|
353
|
+
/**
|
|
354
|
+
* The review rail: comments and tracked changes as a compound component. Requires
|
|
355
|
+
* `reviewModule()` in the editor's modules.
|
|
356
|
+
*
|
|
357
|
+
* PARTS AND SCOPES. The rail reads its parts from its own children, by element type. There are
|
|
358
|
+
* two scopes:
|
|
359
|
+
*
|
|
360
|
+
* - Root parts: `List`, `Markers`, `AddComment`, `Draft`, and `Balloon`. Put them as DIRECT
|
|
361
|
+
* children of `DocxEditorReview` (fragments are transparent). The rail gives them the geometry
|
|
362
|
+
* only it can compute: the comment button's and the compose box's `top`, and the markers'
|
|
363
|
+
* scale and window. A root part inside a wrapper component is not seen as a part. It renders
|
|
364
|
+
* as ordinary content, without that wiring.
|
|
365
|
+
* - Card parts: `Card`, `Empty`, and the parts inside a card (`Author`, `Summary`, `Accept`,
|
|
366
|
+
* `Reject`, `Reply`, and the others). Put them inside `DocxEditorReview.List`, or as other
|
|
367
|
+
* direct children, which become the card template.
|
|
368
|
+
*
|
|
369
|
+
* `:preset="false"` drops the packaged defaults. Root parts you pass still get their wiring, and
|
|
370
|
+
* every other child renders as is inside the rail, where `useReviewRailMetrics()` reads the
|
|
371
|
+
* rail's own measurement. To render your own cards, use `useReview().items`,
|
|
372
|
+
* `useStackedReviewPositions`, and `useReviewRailMetrics`. `Draft` without `top` sits where the
|
|
373
|
+
* packaged card stack puts it, so pass `top` from your own stack.
|
|
374
|
+
*
|
|
375
|
+
* In a browser host, this rail and `useReview()` are the way to build a review UI. For headless,
|
|
376
|
+
* server, or agent pipelines, use `@docx-editor.dev/editor-api`.
|
|
377
|
+
*
|
|
378
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
379
|
+
*
|
|
380
|
+
* @public
|
|
381
|
+
*/
|
|
297
382
|
declare const DocxEditorReview: {
|
|
298
383
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<vue.ExtractPropTypes<{
|
|
299
384
|
className: StringConstructor;
|
|
@@ -875,12 +960,12 @@ declare const DocxEditorReview: {
|
|
|
875
960
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
876
961
|
Draft: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
877
962
|
top: {
|
|
878
|
-
type:
|
|
879
|
-
default:
|
|
963
|
+
type: PropType<number | undefined>;
|
|
964
|
+
default: undefined;
|
|
880
965
|
};
|
|
881
966
|
left: {
|
|
882
|
-
type: PropType<number | null>;
|
|
883
|
-
default:
|
|
967
|
+
type: PropType<number | null | undefined>;
|
|
968
|
+
default: undefined;
|
|
884
969
|
};
|
|
885
970
|
className: StringConstructor;
|
|
886
971
|
hidden: BooleanConstructor;
|
|
@@ -888,18 +973,18 @@ declare const DocxEditorReview: {
|
|
|
888
973
|
[key: string]: any;
|
|
889
974
|
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
890
975
|
top: {
|
|
891
|
-
type:
|
|
892
|
-
default:
|
|
976
|
+
type: PropType<number | undefined>;
|
|
977
|
+
default: undefined;
|
|
893
978
|
};
|
|
894
979
|
left: {
|
|
895
|
-
type: PropType<number | null>;
|
|
896
|
-
default:
|
|
980
|
+
type: PropType<number | null | undefined>;
|
|
981
|
+
default: undefined;
|
|
897
982
|
};
|
|
898
983
|
className: StringConstructor;
|
|
899
984
|
hidden: BooleanConstructor;
|
|
900
985
|
}>> & Readonly<{}>, {
|
|
901
|
-
top: number;
|
|
902
|
-
left: number | null;
|
|
986
|
+
top: number | undefined;
|
|
987
|
+
left: number | null | undefined;
|
|
903
988
|
hidden: boolean;
|
|
904
989
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
905
990
|
Balloon: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -941,13 +1026,21 @@ interface ReviewRailMetrics {
|
|
|
941
1026
|
readonly top: number;
|
|
942
1027
|
/**
|
|
943
1028
|
* CSS pixels from the scroll container's left padding edge, in its scrolled content, to
|
|
944
|
-
* the column's left edge: one 16px gutter right of the page
|
|
945
|
-
*
|
|
1029
|
+
* the column's left edge: one 16px gutter right of the page, or, in a right-to-left
|
|
1030
|
+
* interface, one 16px gutter and the column's own width left of it. `null` until there is
|
|
1031
|
+
* a page to measure. Keep the column hidden while it is `null`.
|
|
946
1032
|
*/
|
|
947
1033
|
readonly left: number | null;
|
|
1034
|
+
/**
|
|
1035
|
+
* The page side the column stands on: `'left'` in a right-to-left interface, otherwise
|
|
1036
|
+
* `'right'`. On the left, give the column its width (300px for the packaged cards), because
|
|
1037
|
+
* `left` keeps the column's RIGHT edge one gutter off the page; and keep each card's air on
|
|
1038
|
+
* its left, away from the page.
|
|
1039
|
+
*/
|
|
1040
|
+
readonly side: 'left' | 'right';
|
|
948
1041
|
/**
|
|
949
1042
|
* The `left` value, relative to {@link ReviewRailMetrics.left}, that puts a 300px card
|
|
950
|
-
* fully inside the visible area with a 12px inset from its
|
|
1043
|
+
* fully inside the visible area with a 12px inset from its edge on the column's side. Use it while
|
|
951
1044
|
* {@link ReviewRailMetrics.compact} is true. `null` until there is a page to measure.
|
|
952
1045
|
*/
|
|
953
1046
|
readonly compactCardLeft: number | null;
|
|
@@ -968,11 +1061,11 @@ interface UseReviewRailMetricsOptions {
|
|
|
968
1061
|
readonly trackScroll?: boolean;
|
|
969
1062
|
/**
|
|
970
1063
|
* With a `railRef`, reserve the review gutter beside the page while the column element is
|
|
971
|
-
* mounted, as `DocxEditorReview` does. The viewport then shifts the page
|
|
972
|
-
* pane is open. The reservation does not show the comment controls in the
|
|
973
|
-
* context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
974
|
-
* mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
975
|
-
* page. Default: `true`.
|
|
1064
|
+
* mounted, as `DocxEditorReview` does. The viewport then shifts the page away from the
|
|
1065
|
+
* column while the pane is open. The reservation does not show the comment controls in the
|
|
1066
|
+
* toolbar and the context menu; see `ReviewRailContext` to serve them from your column. Set
|
|
1067
|
+
* `false` when a mounted `DocxEditorReview` already reserves the gutter, or when your
|
|
1068
|
+
* column overlays the page. Default: `true`.
|
|
976
1069
|
*/
|
|
977
1070
|
readonly reserveGutter?: boolean;
|
|
978
1071
|
}
|
|
@@ -1030,6 +1123,7 @@ interface UseReviewRailMetricsReturn {
|
|
|
1030
1123
|
* position: 'absolute',
|
|
1031
1124
|
* top: '0px',
|
|
1032
1125
|
* left: `${metrics.left ?? 0}px`,
|
|
1126
|
+
* width: '300px',
|
|
1033
1127
|
* visibility: metrics.left === null ? 'hidden' : 'visible',
|
|
1034
1128
|
* }"
|
|
1035
1129
|
* >
|
|
@@ -1043,10 +1137,35 @@ interface UseReviewRailMetricsReturn {
|
|
|
1043
1137
|
* </template>
|
|
1044
1138
|
* ```
|
|
1045
1139
|
*
|
|
1140
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
1046
1141
|
* @public
|
|
1047
1142
|
*/
|
|
1048
1143
|
declare function useReviewRailMetrics(railRef?: MaybeRefOrGetter$1<HTMLElement | null> | null, options?: MaybeRefOrGetter$1<UseReviewRailMetricsOptions | undefined>): UseReviewRailMetricsReturn;
|
|
1049
1144
|
|
|
1145
|
+
/**
|
|
1146
|
+
* The function {@link useReviewRefusalMessage} returns: the packaged sentence for a refusal.
|
|
1147
|
+
*
|
|
1148
|
+
* @public
|
|
1149
|
+
*/
|
|
1150
|
+
interface UseReviewRefusalMessageReturn {
|
|
1151
|
+
(refusal: ReviewWriteRefusal): string;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* The packaged sentence for a refused review write, in the reader's language, for a host's own
|
|
1155
|
+
* card or balloon. It honors the review pane's `t` overrides, as the packaged cards do. Call it
|
|
1156
|
+
* in `setup`.
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* ```ts
|
|
1160
|
+
* const { lastRefusal } = useReview();
|
|
1161
|
+
* const refusalMessage = useReviewRefusalMessage();
|
|
1162
|
+
* const notice = computed(() => (lastRefusal.value ? refusalMessage(lastRefusal.value) : ''));
|
|
1163
|
+
* ```
|
|
1164
|
+
*
|
|
1165
|
+
* @public
|
|
1166
|
+
*/
|
|
1167
|
+
declare function useReviewRefusalMessage(): UseReviewRefusalMessageReturn;
|
|
1168
|
+
|
|
1050
1169
|
/** Reactive collaboration status for Vue hosts. @public */
|
|
1051
1170
|
interface UseCollaborationStatusReturn {
|
|
1052
1171
|
/** Current lifecycle state, or `inactive` when no session is attached. */
|
|
@@ -1923,5 +2042,5 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1923
2042
|
/** Resolves a painted pointer target to a registered custom-node definition. @public */
|
|
1924
2043
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1925
2044
|
|
|
1926
|
-
export { CollaborationBootstrap, CollaborationSession, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, collaborationModule, resolveCustomNodeActivation, reviewModule, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useStackedReviewPositions };
|
|
1927
|
-
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationModuleOptions, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CreateDocumentCollaborationOptions, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ProLicenseOptions, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewItemView, ReviewMarkersProps, ReviewModuleOptions, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationParticipantsReturn, UseCollaborationSessionReturn, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewRailMetricsReturn, UseReviewReturn };
|
|
2045
|
+
export { CollaborationBootstrap, CollaborationSession, CustomNodeChrome, CustomNodeContextMenu, DocxEditorCollaboration, DocxEditorCollaborationRoot, DocxEditorReview, activatedCustomNodeOf, collaborationModule, resolveCustomNodeActivation, reviewModule, useCollaborationParticipants, useCollaborationSession, useCollaborationStatus, useCustomNodeDefinitions, useDocumentCollaboration, useReview, useReviewAuthor, useReviewItem, useReviewOf, useReviewRailMetrics, useReviewRefusalMessage, useStackedReviewPositions };
|
|
2046
|
+
export type { CollaborationAvatarProps, CollaborationAvatarRenderProps, CollaborationAvatarsProps, CollaborationCaretLabelRenderProps, CollaborationCaretLabelsProps, CollaborationModuleOptions, CollaborationNoticeKind, CollaborationRootSource, CollaborationStatusNoticeProps, CollaborationStatusNoticeRenderProps, CreateDocumentCollaborationOptions, CustomNodeChromeProps, CustomNodeContextMenuProps, DocxEditorCollaborationNamespace, DocxEditorCollaborationRootProps, DocxEditorReviewNamespace, ProLicenseOptions, ResolvedCustomNodeActivation, ReviewActionProps, ReviewAdoptOptions, ReviewBalloonProps, ReviewDraftProps, ReviewItemView, ReviewMarkersProps, ReviewModuleOptions, ReviewPartProps, ReviewProps, ReviewRailMetrics, ReviewWriteAction, ReviewWriteRefusal, UseCollaborationParticipantsReturn, UseCollaborationSessionReturn, UseCollaborationStatusReturn, UseDocumentCollaborationConnectOptions, UseDocumentCollaborationOptions, UseDocumentCollaborationReturn, UseReviewRailMetricsOptions, UseReviewRailMetricsReturn, UseReviewRefusalMessageReturn, UseReviewReturn };
|