@fileverse-dev/ddoc 3.1.7-comment-re-arch-6 → 3.1.7-comment-re-arch-10
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/dist/index.es.js +21097 -20810
- package/dist/package/components/inline-comment/comment-floating-layout.d.ts +5 -2
- package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +1 -0
- package/dist/package/stores/comment-store.d.ts +10 -4
- package/dist/package/utils/comment-scroll-into-view.d.ts +21 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FLOATING_COMMENT_CARD_GAP =
|
|
1
|
+
export declare const FLOATING_COMMENT_CARD_GAP = 8;
|
|
2
2
|
export declare const enum FloatingLayoutInvalidationFlag {
|
|
3
3
|
None = 0,
|
|
4
4
|
Anchor = 1,
|
|
@@ -21,11 +21,14 @@ export interface FloatingLayoutResult {
|
|
|
21
21
|
isVisible: boolean;
|
|
22
22
|
}>;
|
|
23
23
|
stopIndex: number;
|
|
24
|
+
usedFocusedLayout: boolean;
|
|
24
25
|
}
|
|
25
26
|
export declare const roundFloatingTranslateY: (translateY: number | null) => number | null;
|
|
26
|
-
export declare const computeFloatingCommentLayout: ({ floatingCards, recomputeStartIndex, lastInvalidatedIndex, gap, }: {
|
|
27
|
+
export declare const computeFloatingCommentLayout: ({ floatingCards, recomputeStartIndex, firstInvalidatedIndex, lastInvalidatedIndex, gap, focusedFloatingCardId, }: {
|
|
27
28
|
floatingCards: FloatingCardLayoutInput[];
|
|
28
29
|
recomputeStartIndex: number;
|
|
30
|
+
firstInvalidatedIndex?: number;
|
|
29
31
|
lastInvalidatedIndex: number;
|
|
30
32
|
gap?: number;
|
|
33
|
+
focusedFloatingCardId?: string | null;
|
|
31
34
|
}) => FloatingLayoutResult;
|
|
@@ -55,6 +55,7 @@ export declare function resolveCommentAnchorRangeForAnalysis(anchor: Pick<Commen
|
|
|
55
55
|
export declare function analyzeCommentAnchorTransactionChanges(anchors: CommentAnchor[], oldState: EditorState, newState: EditorState, transform: Transform): CommentAnchorTransactionChange[];
|
|
56
56
|
export interface CommentDecorationOptions {
|
|
57
57
|
getAnchors: () => CommentAnchor[];
|
|
58
|
+
getActiveCommentId: () => string | null;
|
|
58
59
|
}
|
|
59
60
|
export declare const CommentDecorationExtension: Extension<CommentDecorationOptions, any>;
|
|
60
61
|
/**
|
|
@@ -57,6 +57,13 @@ type CommentEditCompletion = {
|
|
|
57
57
|
commentId: string;
|
|
58
58
|
replyId?: string;
|
|
59
59
|
};
|
|
60
|
+
type FocusCommentInEditorOptions = {
|
|
61
|
+
source?: 'explicit-ui' | 'passive';
|
|
62
|
+
};
|
|
63
|
+
type ReconcileFloatingThreadsForActiveTabOptions = {
|
|
64
|
+
hydrationReady: boolean;
|
|
65
|
+
};
|
|
66
|
+
export declare const EXPLICIT_COMMENT_FOCUS_META = "inlineCommentExplicitFocus";
|
|
60
67
|
export interface CommentStoreState {
|
|
61
68
|
initialComments: IComment[];
|
|
62
69
|
tabComments: IComment[];
|
|
@@ -150,9 +157,8 @@ export interface CommentStoreState {
|
|
|
150
157
|
closeFloatingCard: (floatingCardId: string) => void;
|
|
151
158
|
blurFloatingCard: (floatingCardId: string) => void;
|
|
152
159
|
focusFloatingCard: (floatingCardId: string) => void;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
syncFloatingThreadsForActiveTab: () => void;
|
|
160
|
+
removeInvalidFloatingDrafts: () => void;
|
|
161
|
+
reconcileFloatingThreadsForActiveTab: (options: ReconcileFloatingThreadsForActiveTabOptions) => void;
|
|
156
162
|
syncFloatingThreadCardWithActiveComment: () => void;
|
|
157
163
|
submitPendingFloatingDrafts: () => void;
|
|
158
164
|
/**
|
|
@@ -176,7 +182,7 @@ export interface CommentStoreState {
|
|
|
176
182
|
editCommentContent: (commentId: string, content: string) => void;
|
|
177
183
|
editReplyContent: (commentId: string, replyId: string, content: string) => void;
|
|
178
184
|
handleAddReply: (activeCommentId: string, replyContent: string, replyCallback?: (activeCommentId: string, reply: IComment) => void) => void;
|
|
179
|
-
focusCommentInEditor: (commentId: string) => void;
|
|
185
|
+
focusCommentInEditor: (commentId: string, options?: FocusCommentInEditorOptions) => void;
|
|
180
186
|
onPrevComment: () => void;
|
|
181
187
|
onNextComment: () => void;
|
|
182
188
|
getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin';
|
|
4
|
+
|
|
5
|
+
export declare const MOBILE_COMMENT_DRAWER_CANVAS_OFFSET_VAR = "--mobile-comment-drawer-canvas-offset";
|
|
6
|
+
type CommentSelectionRange = {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const clearMobileCommentDrawerCanvasOffset: (editorRoot?: HTMLElement | null) => void;
|
|
11
|
+
export declare const resolveCommentSelectionRange: ({ editor, commentId, commentAnchorsRef, }: {
|
|
12
|
+
editor: Editor;
|
|
13
|
+
commentId: string;
|
|
14
|
+
commentAnchorsRef?: MutableRefObject<CommentAnchor[]>;
|
|
15
|
+
}) => CommentSelectionRange | null;
|
|
16
|
+
export declare const scrollCommentSelectionRangeIntoView: ({ editor, selectionRange, behavior, }: {
|
|
17
|
+
editor: Editor;
|
|
18
|
+
selectionRange: CommentSelectionRange;
|
|
19
|
+
behavior?: ScrollBehavior;
|
|
20
|
+
}) => void;
|
|
21
|
+
export {};
|