@docx-editor.dev/pro 2.31.0 → 2.32.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 +24 -0
- package/dist/chunk-3WTOHPAB.js +1 -0
- package/dist/chunk-AVZO5ZHZ.js +1 -0
- package/dist/chunk-GAGYRL3L.js +5 -0
- package/dist/chunk-HMSOWKXT.js +1 -0
- package/dist/chunk-I6HVINA4.cjs +1 -0
- package/dist/chunk-MHB6ID2P.cjs +1 -0
- package/dist/chunk-PMS3PGOE.cjs +1 -0
- package/dist/chunk-YOWEY5F3.cjs +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 +63 -7
- package/dist/collaboration/index.d.ts +63 -7
- 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/{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-B35ZX2W4.js +1 -0
- package/dist/document-session-V3O7XBJY.cjs +1 -0
- 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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react/hocuspocus.d.cts +2 -2
- package/dist/react/hocuspocus.d.ts +2 -2
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.cts +95 -12
- package/dist/react/index.d.ts +95 -12
- package/dist/react/index.js +2 -2
- package/dist/react/webrtc.d.cts +2 -2
- package/dist/react/webrtc.d.ts +2 -2
- 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.d.cts +2 -2
- package/dist/vue/hocuspocus.d.ts +2 -2
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.cts +89 -13
- package/dist/vue/index.d.ts +89 -13
- package/dist/vue/index.js +2 -2
- package/dist/vue/webrtc.d.cts +2 -2
- package/dist/vue/webrtc.d.ts +2 -2
- 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 +5 -4
- package/dist/chunk-32WEH2XH.cjs +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-Q5JTCGJI.js +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
|
@@ -19,8 +19,8 @@ import { ComputedRef, Ref, VNode, MaybeRefOrGetter as MaybeRefOrGetter$1, PropTy
|
|
|
19
19
|
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
20
|
export { ReviewActivationOptions, 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
|
|
|
@@ -169,10 +169,23 @@ interface UseReviewReturn {
|
|
|
169
169
|
* useEditorEvent('reviewItemReveal', ({ key, source }) => openMyCard(key, source));
|
|
170
170
|
* setActive(key); // fires nothing
|
|
171
171
|
* setActive(key, { announce: true }); // fires 'reviewItemReveal'
|
|
172
|
+
* setActive(key, { reveal: false }); // opens the item without scrolling
|
|
172
173
|
* ```
|
|
174
|
+
*
|
|
175
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
173
176
|
*/
|
|
174
177
|
readonly setActive: (key: string | null, options?: ReviewActivationOptions) => boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Accept a revision. Reports whether it landed. For headless or server use, see
|
|
180
|
+
* `Revision.accept()` in `@docx-editor.dev/editor-api`.
|
|
181
|
+
*
|
|
182
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
183
|
+
*/
|
|
175
184
|
readonly accept: (item: ReviewItemView) => boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Reject a revision. Reports whether it landed. For headless or server use, see
|
|
187
|
+
* `Revision.reject()` in `@docx-editor.dev/editor-api`.
|
|
188
|
+
*/
|
|
176
189
|
readonly reject: (item: ReviewItemView) => boolean;
|
|
177
190
|
/**
|
|
178
191
|
* Adopt tracked changes as the reviewer's own; they stay pending. Takes one item or a list,
|
|
@@ -185,8 +198,21 @@ interface UseReviewReturn {
|
|
|
185
198
|
readonly reopen: (item: ReviewItemView) => boolean;
|
|
186
199
|
readonly commentResolutionDisabledReason: ComputedRef<string | null>;
|
|
187
200
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Reply to a comment or a revision. The author is `DocxEditorConfig.author` unless you pass
|
|
203
|
+
* one. Reports whether the reply landed. For headless or server use, see `Comment.reply` in
|
|
204
|
+
* `@docx-editor.dev/editor-api`.
|
|
205
|
+
*/
|
|
188
206
|
readonly reply: (item: ReviewItemView, text: string, author?: string) => boolean;
|
|
207
|
+
/** Where a comment on the current selection would sit, in layout points, or null. */
|
|
189
208
|
readonly selectionAnchorY: ComputedRef<number | null>;
|
|
209
|
+
/**
|
|
210
|
+
* Comment on the current selection. Reports whether it landed, like `reply`. To comment
|
|
211
|
+
* on found text, select it first with `editor.findMatches` and `editor.selectMatch`. For
|
|
212
|
+
* headless or server use, see `Range.insertComment` in `@docx-editor.dev/editor-api`.
|
|
213
|
+
*
|
|
214
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/comment-on-found-text | Comment on found text}
|
|
215
|
+
*/
|
|
190
216
|
readonly comment: (text: string, author?: string) => boolean;
|
|
191
217
|
/**
|
|
192
218
|
* Why the last accept, reject, resolve, reopen, remove, reply or comment did not land, or null.
|
|
@@ -216,11 +242,14 @@ declare function useReviewOf(editorRef: Ref<Editor | null>, query?: MaybeRefOrGe
|
|
|
216
242
|
* Returns each card's top in layout points. `useReviewRailMetrics` supplies `scale` and the
|
|
217
243
|
* pixel offset of the first page: a card's CSS `top` is `metrics.top + position * metrics.scale`.
|
|
218
244
|
*
|
|
245
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
219
246
|
* @public
|
|
220
247
|
*/
|
|
221
248
|
declare function useStackedReviewPositions(items: MaybeRefOrGetter<readonly {
|
|
222
249
|
readonly key: string;
|
|
223
250
|
readonly anchorY: number | null;
|
|
251
|
+
/** Keep this entry at its own anchor; the entries before it move up. */
|
|
252
|
+
readonly isActive?: boolean;
|
|
224
253
|
}[]>, heights: MaybeRefOrGetter<ReadonlyMap<string, number>>, options?: MaybeRefOrGetter<{
|
|
225
254
|
readonly gap?: number;
|
|
226
255
|
readonly scale?: number;
|
|
@@ -254,6 +283,23 @@ interface ReviewBalloonProps {
|
|
|
254
283
|
*/
|
|
255
284
|
hidden?: boolean;
|
|
256
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Props of `DocxEditorReview.Draft`.
|
|
288
|
+
*
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
interface ReviewDraftProps extends ReviewPartProps {
|
|
292
|
+
/**
|
|
293
|
+
* Rail-local `top` in CSS pixels. Omit it to use the packaged card stack's position. Pass
|
|
294
|
+
* your own when you render your own cards, so the box stacks with them.
|
|
295
|
+
*/
|
|
296
|
+
top?: number;
|
|
297
|
+
/**
|
|
298
|
+
* Rail-local `left` for the compact rail. Omit it to use the compact card's position in the
|
|
299
|
+
* compact rail and the rail's own column otherwise. Null keeps the box in the rail's column.
|
|
300
|
+
*/
|
|
301
|
+
left?: number | null;
|
|
302
|
+
}
|
|
257
303
|
/** @public */
|
|
258
304
|
interface ReviewMarkersProps extends ReviewPartProps {
|
|
259
305
|
scale?: number;
|
|
@@ -294,6 +340,35 @@ declare function useReviewItem(): ComputedRef<ReviewItemView | null>;
|
|
|
294
340
|
*/
|
|
295
341
|
declare function useReviewAuthor(author: MaybeRefOrGetter$1<string | undefined>): ComputedRef<ReviewAuthorInfo | undefined>;
|
|
296
342
|
|
|
343
|
+
/**
|
|
344
|
+
* The review rail: comments and tracked changes as a compound component. Requires
|
|
345
|
+
* `reviewModule()` in the editor's modules.
|
|
346
|
+
*
|
|
347
|
+
* PARTS AND SCOPES. The rail reads its parts from its own children, by element type. There are
|
|
348
|
+
* two scopes:
|
|
349
|
+
*
|
|
350
|
+
* - Root parts: `List`, `Markers`, `AddComment`, `Draft`, and `Balloon`. Put them as DIRECT
|
|
351
|
+
* children of `DocxEditorReview` (fragments are transparent). The rail gives them the geometry
|
|
352
|
+
* only it can compute: the comment button's and the compose box's `top`, and the markers'
|
|
353
|
+
* scale and window. A root part inside a wrapper component is not seen as a part. It renders
|
|
354
|
+
* as ordinary content, without that wiring.
|
|
355
|
+
* - Card parts: `Card`, `Empty`, and the parts inside a card (`Author`, `Summary`, `Accept`,
|
|
356
|
+
* `Reject`, `Reply`, and the others). Put them inside `DocxEditorReview.List`, or as other
|
|
357
|
+
* direct children, which become the card template.
|
|
358
|
+
*
|
|
359
|
+
* `:preset="false"` drops the packaged defaults. Root parts you pass still get their wiring, and
|
|
360
|
+
* every other child renders as is inside the rail, where `useReviewRailMetrics()` reads the
|
|
361
|
+
* rail's own measurement. To render your own cards, use `useReview().items`,
|
|
362
|
+
* `useStackedReviewPositions`, and `useReviewRailMetrics`. `Draft` without `top` sits where the
|
|
363
|
+
* packaged card stack puts it, so pass `top` from your own stack.
|
|
364
|
+
*
|
|
365
|
+
* In a browser host, this rail and `useReview()` are the way to build a review UI. For headless,
|
|
366
|
+
* server, or agent pipelines, use `@docx-editor.dev/editor-api`.
|
|
367
|
+
*
|
|
368
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
369
|
+
*
|
|
370
|
+
* @public
|
|
371
|
+
*/
|
|
297
372
|
declare const DocxEditorReview: {
|
|
298
373
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<vue.ExtractPropTypes<{
|
|
299
374
|
className: StringConstructor;
|
|
@@ -875,12 +950,12 @@ declare const DocxEditorReview: {
|
|
|
875
950
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
876
951
|
Draft: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
877
952
|
top: {
|
|
878
|
-
type:
|
|
879
|
-
default:
|
|
953
|
+
type: PropType<number | undefined>;
|
|
954
|
+
default: undefined;
|
|
880
955
|
};
|
|
881
956
|
left: {
|
|
882
|
-
type: PropType<number | null>;
|
|
883
|
-
default:
|
|
957
|
+
type: PropType<number | null | undefined>;
|
|
958
|
+
default: undefined;
|
|
884
959
|
};
|
|
885
960
|
className: StringConstructor;
|
|
886
961
|
hidden: BooleanConstructor;
|
|
@@ -888,18 +963,18 @@ declare const DocxEditorReview: {
|
|
|
888
963
|
[key: string]: any;
|
|
889
964
|
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
890
965
|
top: {
|
|
891
|
-
type:
|
|
892
|
-
default:
|
|
966
|
+
type: PropType<number | undefined>;
|
|
967
|
+
default: undefined;
|
|
893
968
|
};
|
|
894
969
|
left: {
|
|
895
|
-
type: PropType<number | null>;
|
|
896
|
-
default:
|
|
970
|
+
type: PropType<number | null | undefined>;
|
|
971
|
+
default: undefined;
|
|
897
972
|
};
|
|
898
973
|
className: StringConstructor;
|
|
899
974
|
hidden: BooleanConstructor;
|
|
900
975
|
}>> & Readonly<{}>, {
|
|
901
|
-
top: number;
|
|
902
|
-
left: number | null;
|
|
976
|
+
top: number | undefined;
|
|
977
|
+
left: number | null | undefined;
|
|
903
978
|
hidden: boolean;
|
|
904
979
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
905
980
|
Balloon: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -1043,6 +1118,7 @@ interface UseReviewRailMetricsReturn {
|
|
|
1043
1118
|
* </template>
|
|
1044
1119
|
* ```
|
|
1045
1120
|
*
|
|
1121
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
1046
1122
|
* @public
|
|
1047
1123
|
*/
|
|
1048
1124
|
declare function useReviewRailMetrics(railRef?: MaybeRefOrGetter$1<HTMLElement | null> | null, options?: MaybeRefOrGetter$1<UseReviewRailMetricsOptions | undefined>): UseReviewRailMetricsReturn;
|
|
@@ -1924,4 +2000,4 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1924
2000
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1925
2001
|
|
|
1926
2002
|
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 };
|
|
2003
|
+
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, UseReviewReturn };
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ import { ComputedRef, Ref, VNode, MaybeRefOrGetter as MaybeRefOrGetter$1, PropTy
|
|
|
19
19
|
import { EditDiagnosticCode, ReviewItemPlacement, ReviewActivationOptions, ReviewItemQuery, Editor } from '@docx-editor.dev/core/contracts/editor';
|
|
20
20
|
export { ReviewActivationOptions, 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
|
|
|
@@ -169,10 +169,23 @@ interface UseReviewReturn {
|
|
|
169
169
|
* useEditorEvent('reviewItemReveal', ({ key, source }) => openMyCard(key, source));
|
|
170
170
|
* setActive(key); // fires nothing
|
|
171
171
|
* setActive(key, { announce: true }); // fires 'reviewItemReveal'
|
|
172
|
+
* setActive(key, { reveal: false }); // opens the item without scrolling
|
|
172
173
|
* ```
|
|
174
|
+
*
|
|
175
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
173
176
|
*/
|
|
174
177
|
readonly setActive: (key: string | null, options?: ReviewActivationOptions) => boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Accept a revision. Reports whether it landed. For headless or server use, see
|
|
180
|
+
* `Revision.accept()` in `@docx-editor.dev/editor-api`.
|
|
181
|
+
*
|
|
182
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
|
|
183
|
+
*/
|
|
175
184
|
readonly accept: (item: ReviewItemView) => boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Reject a revision. Reports whether it landed. For headless or server use, see
|
|
187
|
+
* `Revision.reject()` in `@docx-editor.dev/editor-api`.
|
|
188
|
+
*/
|
|
176
189
|
readonly reject: (item: ReviewItemView) => boolean;
|
|
177
190
|
/**
|
|
178
191
|
* Adopt tracked changes as the reviewer's own; they stay pending. Takes one item or a list,
|
|
@@ -185,8 +198,21 @@ interface UseReviewReturn {
|
|
|
185
198
|
readonly reopen: (item: ReviewItemView) => boolean;
|
|
186
199
|
readonly commentResolutionDisabledReason: ComputedRef<string | null>;
|
|
187
200
|
readonly remove: (item: ReviewItemView) => boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Reply to a comment or a revision. The author is `DocxEditorConfig.author` unless you pass
|
|
203
|
+
* one. Reports whether the reply landed. For headless or server use, see `Comment.reply` in
|
|
204
|
+
* `@docx-editor.dev/editor-api`.
|
|
205
|
+
*/
|
|
188
206
|
readonly reply: (item: ReviewItemView, text: string, author?: string) => boolean;
|
|
207
|
+
/** Where a comment on the current selection would sit, in layout points, or null. */
|
|
189
208
|
readonly selectionAnchorY: ComputedRef<number | null>;
|
|
209
|
+
/**
|
|
210
|
+
* Comment on the current selection. Reports whether it landed, like `reply`. To comment
|
|
211
|
+
* on found text, select it first with `editor.findMatches` and `editor.selectMatch`. For
|
|
212
|
+
* headless or server use, see `Range.insertComment` in `@docx-editor.dev/editor-api`.
|
|
213
|
+
*
|
|
214
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/comment-on-found-text | Comment on found text}
|
|
215
|
+
*/
|
|
190
216
|
readonly comment: (text: string, author?: string) => boolean;
|
|
191
217
|
/**
|
|
192
218
|
* Why the last accept, reject, resolve, reopen, remove, reply or comment did not land, or null.
|
|
@@ -216,11 +242,14 @@ declare function useReviewOf(editorRef: Ref<Editor | null>, query?: MaybeRefOrGe
|
|
|
216
242
|
* Returns each card's top in layout points. `useReviewRailMetrics` supplies `scale` and the
|
|
217
243
|
* pixel offset of the first page: a card's CSS `top` is `metrics.top + position * metrics.scale`.
|
|
218
244
|
*
|
|
245
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
219
246
|
* @public
|
|
220
247
|
*/
|
|
221
248
|
declare function useStackedReviewPositions(items: MaybeRefOrGetter<readonly {
|
|
222
249
|
readonly key: string;
|
|
223
250
|
readonly anchorY: number | null;
|
|
251
|
+
/** Keep this entry at its own anchor; the entries before it move up. */
|
|
252
|
+
readonly isActive?: boolean;
|
|
224
253
|
}[]>, heights: MaybeRefOrGetter<ReadonlyMap<string, number>>, options?: MaybeRefOrGetter<{
|
|
225
254
|
readonly gap?: number;
|
|
226
255
|
readonly scale?: number;
|
|
@@ -254,6 +283,23 @@ interface ReviewBalloonProps {
|
|
|
254
283
|
*/
|
|
255
284
|
hidden?: boolean;
|
|
256
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Props of `DocxEditorReview.Draft`.
|
|
288
|
+
*
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
interface ReviewDraftProps extends ReviewPartProps {
|
|
292
|
+
/**
|
|
293
|
+
* Rail-local `top` in CSS pixels. Omit it to use the packaged card stack's position. Pass
|
|
294
|
+
* your own when you render your own cards, so the box stacks with them.
|
|
295
|
+
*/
|
|
296
|
+
top?: number;
|
|
297
|
+
/**
|
|
298
|
+
* Rail-local `left` for the compact rail. Omit it to use the compact card's position in the
|
|
299
|
+
* compact rail and the rail's own column otherwise. Null keeps the box in the rail's column.
|
|
300
|
+
*/
|
|
301
|
+
left?: number | null;
|
|
302
|
+
}
|
|
257
303
|
/** @public */
|
|
258
304
|
interface ReviewMarkersProps extends ReviewPartProps {
|
|
259
305
|
scale?: number;
|
|
@@ -294,6 +340,35 @@ declare function useReviewItem(): ComputedRef<ReviewItemView | null>;
|
|
|
294
340
|
*/
|
|
295
341
|
declare function useReviewAuthor(author: MaybeRefOrGetter$1<string | undefined>): ComputedRef<ReviewAuthorInfo | undefined>;
|
|
296
342
|
|
|
343
|
+
/**
|
|
344
|
+
* The review rail: comments and tracked changes as a compound component. Requires
|
|
345
|
+
* `reviewModule()` in the editor's modules.
|
|
346
|
+
*
|
|
347
|
+
* PARTS AND SCOPES. The rail reads its parts from its own children, by element type. There are
|
|
348
|
+
* two scopes:
|
|
349
|
+
*
|
|
350
|
+
* - Root parts: `List`, `Markers`, `AddComment`, `Draft`, and `Balloon`. Put them as DIRECT
|
|
351
|
+
* children of `DocxEditorReview` (fragments are transparent). The rail gives them the geometry
|
|
352
|
+
* only it can compute: the comment button's and the compose box's `top`, and the markers'
|
|
353
|
+
* scale and window. A root part inside a wrapper component is not seen as a part. It renders
|
|
354
|
+
* as ordinary content, without that wiring.
|
|
355
|
+
* - Card parts: `Card`, `Empty`, and the parts inside a card (`Author`, `Summary`, `Accept`,
|
|
356
|
+
* `Reject`, `Reply`, and the others). Put them inside `DocxEditorReview.List`, or as other
|
|
357
|
+
* direct children, which become the card template.
|
|
358
|
+
*
|
|
359
|
+
* `:preset="false"` drops the packaged defaults. Root parts you pass still get their wiring, and
|
|
360
|
+
* every other child renders as is inside the rail, where `useReviewRailMetrics()` reads the
|
|
361
|
+
* rail's own measurement. To render your own cards, use `useReview().items`,
|
|
362
|
+
* `useStackedReviewPositions`, and `useReviewRailMetrics`. `Draft` without `top` sits where the
|
|
363
|
+
* packaged card stack puts it, so pass `top` from your own stack.
|
|
364
|
+
*
|
|
365
|
+
* In a browser host, this rail and `useReview()` are the way to build a review UI. For headless,
|
|
366
|
+
* server, or agent pipelines, use `@docx-editor.dev/editor-api`.
|
|
367
|
+
*
|
|
368
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
369
|
+
*
|
|
370
|
+
* @public
|
|
371
|
+
*/
|
|
297
372
|
declare const DocxEditorReview: {
|
|
298
373
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<vue.ExtractPropTypes<{
|
|
299
374
|
className: StringConstructor;
|
|
@@ -875,12 +950,12 @@ declare const DocxEditorReview: {
|
|
|
875
950
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
876
951
|
Draft: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
877
952
|
top: {
|
|
878
|
-
type:
|
|
879
|
-
default:
|
|
953
|
+
type: PropType<number | undefined>;
|
|
954
|
+
default: undefined;
|
|
880
955
|
};
|
|
881
956
|
left: {
|
|
882
|
-
type: PropType<number | null>;
|
|
883
|
-
default:
|
|
957
|
+
type: PropType<number | null | undefined>;
|
|
958
|
+
default: undefined;
|
|
884
959
|
};
|
|
885
960
|
className: StringConstructor;
|
|
886
961
|
hidden: BooleanConstructor;
|
|
@@ -888,18 +963,18 @@ declare const DocxEditorReview: {
|
|
|
888
963
|
[key: string]: any;
|
|
889
964
|
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
890
965
|
top: {
|
|
891
|
-
type:
|
|
892
|
-
default:
|
|
966
|
+
type: PropType<number | undefined>;
|
|
967
|
+
default: undefined;
|
|
893
968
|
};
|
|
894
969
|
left: {
|
|
895
|
-
type: PropType<number | null>;
|
|
896
|
-
default:
|
|
970
|
+
type: PropType<number | null | undefined>;
|
|
971
|
+
default: undefined;
|
|
897
972
|
};
|
|
898
973
|
className: StringConstructor;
|
|
899
974
|
hidden: BooleanConstructor;
|
|
900
975
|
}>> & Readonly<{}>, {
|
|
901
|
-
top: number;
|
|
902
|
-
left: number | null;
|
|
976
|
+
top: number | undefined;
|
|
977
|
+
left: number | null | undefined;
|
|
903
978
|
hidden: boolean;
|
|
904
979
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
905
980
|
Balloon: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -1043,6 +1118,7 @@ interface UseReviewRailMetricsReturn {
|
|
|
1043
1118
|
* </template>
|
|
1044
1119
|
* ```
|
|
1045
1120
|
*
|
|
1121
|
+
* @see {@link https://www.docx-editor.dev/docs/2.x/recipes/custom-review-cards | Custom cards in the review rail}
|
|
1046
1122
|
* @public
|
|
1047
1123
|
*/
|
|
1048
1124
|
declare function useReviewRailMetrics(railRef?: MaybeRefOrGetter$1<HTMLElement | null> | null, options?: MaybeRefOrGetter$1<UseReviewRailMetricsOptions | undefined>): UseReviewRailMetricsReturn;
|
|
@@ -1924,4 +2000,4 @@ declare function activatedCustomNodeOf(resolved: ResolvedCustomNodeActivation, e
|
|
|
1924
2000
|
declare function resolveCustomNodeActivation(target: EventTarget | null, nodes: readonly AnyCustomNodeDefinition[]): ResolvedCustomNodeActivation | null;
|
|
1925
2001
|
|
|
1926
2002
|
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 };
|
|
2003
|
+
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, UseReviewReturn };
|