@fileverse-dev/ddoc 3.2.2-sg-4 → 3.2.2-sg-6
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/package/components/inline-comment/comment-card.d.ts +19 -1
- package/dist/package/extensions/suggestion/suggestion-tracking-extension.d.ts +13 -0
- package/dist/package/stores/comment-store.d.ts +13 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.es.js +0 -191972
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { CommentCardProps, CommentReplyProps, EnsStatus } from './types';
|
|
2
3
|
|
|
4
|
+
export declare const CommentReply: ({ commentId, replyId, reply, username, createdAt, isThreadResolved, }: CommentReplyProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
interface CommentRepliesThreadProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
displayedReplies: CommentCardProps['replies'];
|
|
8
|
+
ensStatus: EnsStatus;
|
|
9
|
+
handleReplyToggleClick: (event: MouseEvent<HTMLElement>) => void;
|
|
10
|
+
isCommentDrawerContext?: boolean;
|
|
11
|
+
isResolved?: boolean;
|
|
12
|
+
replyToggleLabel: string;
|
|
13
|
+
shouldShowReplyThread: boolean;
|
|
14
|
+
shouldShowReplyToggle: boolean;
|
|
15
|
+
shouldShowResolvedMobileReplyCount: boolean;
|
|
16
|
+
showAllReplies: boolean;
|
|
17
|
+
visibleReplies: CommentCardProps['replies'];
|
|
18
|
+
}
|
|
19
|
+
export declare const CommentRepliesThread: ({ id, displayedReplies, ensStatus, handleReplyToggleClick, isCommentDrawerContext, isResolved, replyToggleLabel, shouldShowReplyThread, shouldShowReplyToggle, shouldShowResolvedMobileReplyCount, showAllReplies, visibleReplies, }: CommentRepliesThreadProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
20
|
export declare const CommentCard: (props: CommentCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
21
|
export declare const UserDisplaySkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -21,6 +21,19 @@ export interface SuggestionTrackingOptions {
|
|
|
21
21
|
onReplaceTyping: (from: number, to: number, text: string) => void;
|
|
22
22
|
/** Viewer presses Backspace/Delete with a non-empty selection. */
|
|
23
23
|
onDeleteSelection: (from: number, to: number) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Viewer presses Backspace/Delete with a collapsed cursor.
|
|
26
|
+
* The consumer decides whether this should shrink an active draft or create
|
|
27
|
+
* a new one-character delete suggestion at the caret.
|
|
28
|
+
*/
|
|
29
|
+
onDeleteAtCursor: (direction: 'backward' | 'forward') => void;
|
|
30
|
+
/**
|
|
31
|
+
* Browser attempted to delete a concrete range without an explicit
|
|
32
|
+
* user selection (for example, a beforeinput/IME path that bypassed
|
|
33
|
+
* keydown). Lets the consumer preserve "undo active draft" semantics
|
|
34
|
+
* while still creating delete drafts for normal text.
|
|
35
|
+
*/
|
|
36
|
+
onDeleteRangeWithoutSelection: (from: number, to: number) => void;
|
|
24
37
|
/** Viewer presses Cmd+Z (or Ctrl+Z). Shrinks the active draft by one keystroke. */
|
|
25
38
|
onUndo: () => void;
|
|
26
39
|
onLiveSuggestion?: ((anchor: CommentAnchor) => void) | null;
|
|
@@ -57,6 +57,7 @@ export interface DraftSuggestion {
|
|
|
57
57
|
/** True when the draft was created via select+delete or select+type. */
|
|
58
58
|
hadDeletion: boolean;
|
|
59
59
|
}
|
|
60
|
+
type SuggestionDeleteDirection = 'backward' | 'forward';
|
|
60
61
|
type FloatingCardsUpdater = React.SetStateAction<CommentFloatingCard[]>;
|
|
61
62
|
type InlineCommentDataUpdater = Partial<InlineCommentData> | ((prev: InlineCommentData) => Partial<InlineCommentData> | InlineCommentData);
|
|
62
63
|
type InlineDraftRecordMap = Record<string, InlineCommentDraft>;
|
|
@@ -217,7 +218,18 @@ export interface CommentStoreState {
|
|
|
217
218
|
* Captures originalContent, leaves insertedText empty; type becomes 'replace'
|
|
218
219
|
* as soon as the viewer types.
|
|
219
220
|
*/
|
|
220
|
-
startDeleteDraft: (from: number, to: number) => void;
|
|
221
|
+
startDeleteDraft: (from: number, to: number, collapseTo?: number) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Convert a collapsed-caret Backspace/Delete into a delete draft when the
|
|
224
|
+
* caret is adjacent to text, or shrink the active draft if the caret is
|
|
225
|
+
* already inside one.
|
|
226
|
+
*/
|
|
227
|
+
deleteAtCursorOrUndoActiveDraft: (direction: SuggestionDeleteDirection) => void;
|
|
228
|
+
/**
|
|
229
|
+
* Handle browser deletion paths that resolved to a concrete range even
|
|
230
|
+
* though the user had no explicit selection.
|
|
231
|
+
*/
|
|
232
|
+
deleteRangeOrUndoActiveDraft: (from: number, to: number) => void;
|
|
221
233
|
/**
|
|
222
234
|
* Undo the last keystroke in the draft at the current cursor position.
|
|
223
235
|
* When the draft has no keystrokes left, it is discarded.
|