@fileverse-dev/ddoc 3.0.96-zustand-4 → 3.0.96-zustand-5
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.
|
@@ -1,93 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IComment } from '../../../extensions/comment';
|
|
1
|
+
import { CommentAccountProps } from '../../../types';
|
|
3
2
|
import { SetStateAction } from 'react';
|
|
4
|
-
import { CommentAccountProps, CommentMutationMeta } from '../../../types';
|
|
5
|
-
import { EnsStatus } from '../types';
|
|
6
3
|
|
|
7
|
-
import * as Y from 'yjs';
|
|
8
|
-
export interface CommentContextType extends CommentAccountProps {
|
|
9
|
-
comments: IComment[];
|
|
10
|
-
setComments: React.Dispatch<SetStateAction<IComment[]>>;
|
|
11
|
-
editor: Editor;
|
|
12
|
-
username?: string | null;
|
|
13
|
-
setUsername?: React.Dispatch<SetStateAction<string>>;
|
|
14
|
-
showResolved: boolean;
|
|
15
|
-
setShowResolved: (show: boolean) => void;
|
|
16
|
-
resolveComment: (commentId: string) => void;
|
|
17
|
-
unresolveComment: (commentId: string) => void;
|
|
18
|
-
deleteComment: (commentId: string) => void;
|
|
19
|
-
handleAddReply: (activeCommentId: string, replyContent: string, onCommentReply: (activeCommentId: string, reply: IComment) => void) => void;
|
|
20
|
-
focusCommentInEditor: (commentId: string) => void;
|
|
21
|
-
handleReplyChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
22
|
-
handleCommentChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
23
|
-
handleCommentKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
24
|
-
handleReplySubmit: () => void;
|
|
25
|
-
toggleResolved: () => void;
|
|
26
|
-
openReplyId: string | null;
|
|
27
|
-
setOpenReplyId: (id: string | null) => void;
|
|
28
|
-
handleReplyKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
29
|
-
commentsSectionRef: React.RefObject<HTMLDivElement>;
|
|
30
|
-
replySectionRef: React.RefObject<HTMLDivElement>;
|
|
31
|
-
addComment: (content?: string) => void;
|
|
32
|
-
handleCommentSubmit: () => void;
|
|
33
|
-
reply: string;
|
|
34
|
-
setReply: React.Dispatch<React.SetStateAction<string>>;
|
|
35
|
-
comment: string;
|
|
36
|
-
setComment: React.Dispatch<React.SetStateAction<string>>;
|
|
37
|
-
onPrevComment: () => void;
|
|
38
|
-
onNextComment: () => void;
|
|
39
|
-
activeCommentIndex: number;
|
|
40
|
-
activeComment: IComment | undefined;
|
|
41
|
-
selectedText: string;
|
|
42
|
-
isCommentOpen: boolean;
|
|
43
|
-
isBubbleMenuSuppressed: boolean;
|
|
44
|
-
setIsBubbleMenuSuppressed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
45
|
-
handleInlineComment: () => void;
|
|
46
|
-
portalRef: React.RefObject<HTMLDivElement>;
|
|
47
|
-
buttonRef: React.RefObject<HTMLDivElement>;
|
|
48
|
-
dropdownRef: React.RefObject<HTMLDivElement>;
|
|
49
|
-
activeComments: IComment[];
|
|
50
|
-
handleInput: (e: React.FormEvent<HTMLTextAreaElement>, content: string) => void;
|
|
51
|
-
isCommentActive: boolean;
|
|
52
|
-
isCommentResolved: boolean;
|
|
53
|
-
ensResolutionUrl: string;
|
|
54
|
-
activeTabId: string;
|
|
55
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
56
|
-
onComment?: () => void;
|
|
57
|
-
setCommentDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
58
|
-
inlineCommentData: {
|
|
59
|
-
inlineCommentText: string;
|
|
60
|
-
handleClick: boolean;
|
|
61
|
-
};
|
|
62
|
-
setInlineCommentData: React.Dispatch<React.SetStateAction<{
|
|
63
|
-
inlineCommentText: string;
|
|
64
|
-
handleClick: boolean;
|
|
65
|
-
}>>;
|
|
66
|
-
getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
|
|
67
|
-
ensCache: EnsCache;
|
|
68
|
-
}
|
|
69
|
-
export interface CommentProviderProps extends CommentAccountProps {
|
|
70
|
-
children: React.ReactNode;
|
|
71
|
-
editor: Editor;
|
|
72
|
-
ydoc: Y.Doc;
|
|
73
|
-
initialComments?: IComment[];
|
|
74
|
-
setInitialComments?: React.Dispatch<SetStateAction<IComment[]>>;
|
|
75
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
76
|
-
onNewComment?: (newComment: IComment, meta?: CommentMutationMeta) => void;
|
|
77
|
-
onResolveComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
|
|
78
|
-
onUnresolveComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
|
|
79
|
-
onDeleteComment?: (activeCommentId: string, meta?: CommentMutationMeta) => void;
|
|
80
|
-
username: string | null;
|
|
81
|
-
setUsername?: React.Dispatch<SetStateAction<string>>;
|
|
82
|
-
activeCommentId: string | null;
|
|
83
|
-
setActiveCommentId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
84
|
-
activeTabId: string;
|
|
85
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
86
|
-
ensResolutionUrl: string;
|
|
87
|
-
onInlineComment?: () => void;
|
|
88
|
-
onComment?: () => void;
|
|
89
|
-
setCommentDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
90
|
-
}
|
|
91
4
|
export interface CommentUsernameProps extends CommentAccountProps {
|
|
92
5
|
username?: string | null;
|
|
93
6
|
setUsername?: React.Dispatch<SetStateAction<string>>;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CommentContextType, CommentProviderProps } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const CommentProvider: ({ children, editor, ydoc, initialComments, setInitialComments, username, setUsername, activeCommentId, setActiveCommentId, activeTabId, focusCommentWithActiveId, onNewComment, onCommentReply, ensResolutionUrl, onResolveComment, onUnresolveComment, onDeleteComment, isConnected, connectViaWallet, isLoading, connectViaUsername, isDDocOwner, onInlineComment, onComment, setCommentDrawerOpen, }: CommentProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const useComments: () => CommentContextType;
|