@fileverse-dev/ddoc 3.0.96-zustand-7 → 3.0.97-patch.1
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 +23105 -23050
- package/dist/package/components/inline-comment/context/comment-context.d.ts +4 -0
- package/dist/package/components/inline-comment/context/types.d.ts +88 -1
- package/dist/package/hooks/use-tab-editor.d.ts +1 -1
- package/dist/package/sync-local/SyncManager.d.ts +12 -0
- package/dist/style.css +1 -1
- package/package.json +3 -4
- package/dist/package/components/inline-comment/comment-compose-input.d.ts +0 -1
- package/dist/package/components/inline-comment/comment-reply-input.d.ts +0 -8
- package/dist/package/stores/comment-store-provider.d.ts +0 -43
- package/dist/package/stores/comment-store.d.ts +0 -114
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.97-patch.1",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"mammoth": "^1.10.0",
|
|
94
94
|
"markdown-it-footnote": "^4.0.0",
|
|
95
95
|
"ollama": "^0.5.14",
|
|
96
|
+
"socket.io-client": "^4.7.5",
|
|
96
97
|
"platform": "^1.3.6",
|
|
97
98
|
"prosemirror-model": "^1.21.0",
|
|
98
99
|
"prosemirror-state": "^1.4.3",
|
|
@@ -100,7 +101,6 @@
|
|
|
100
101
|
"react-dom": "^18.2.0",
|
|
101
102
|
"react-tweet": "^3.2.2",
|
|
102
103
|
"react-uuid": "^2.0.0",
|
|
103
|
-
"socket.io-client": "^4.7.5",
|
|
104
104
|
"tailwindcss-animate": "^1.0.7",
|
|
105
105
|
"tiptap-markdown": "^0.9.0",
|
|
106
106
|
"turndown": "^7.2.0",
|
|
@@ -113,8 +113,7 @@
|
|
|
113
113
|
"y-prosemirror": "^1.2.5",
|
|
114
114
|
"y-protocols": "^1.0.6",
|
|
115
115
|
"y-webrtc": "^10.3.0",
|
|
116
|
-
"yjs": "^13.6.15"
|
|
117
|
-
"zustand": "^5.0.12"
|
|
116
|
+
"yjs": "^13.6.15"
|
|
118
117
|
},
|
|
119
118
|
"peerDependencies": {
|
|
120
119
|
"@dnd-kit/core": ">=6.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CommentComposeInput: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface CommentReplyInputProps {
|
|
2
|
-
commentId: string;
|
|
3
|
-
commentUsername?: string;
|
|
4
|
-
replyCount: number;
|
|
5
|
-
activeCommentId: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const CommentReplyInput: ({ commentId, commentUsername, replyCount, activeCommentId, }: CommentReplyInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { IComment } from '../extensions/comment';
|
|
3
|
-
import { CommentMutationMeta } from '../types';
|
|
4
|
-
import { Editor } from '@tiptap/react';
|
|
5
|
-
|
|
6
|
-
import * as Y from 'yjs';
|
|
7
|
-
export interface CommentStoreProviderProps {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
editor: Editor | null;
|
|
10
|
-
ydoc: Y.Doc;
|
|
11
|
-
setActiveCommentId: (id: string | null) => void;
|
|
12
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
13
|
-
setInitialComments?: (comments: IComment[]) => void;
|
|
14
|
-
onNewComment?: (comment: IComment, meta?: CommentMutationMeta) => void;
|
|
15
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
16
|
-
onResolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
17
|
-
onUnresolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
18
|
-
onDeleteComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
19
|
-
onInlineComment?: () => void;
|
|
20
|
-
onComment?: () => void;
|
|
21
|
-
setCommentDrawerOpen?: (open: boolean) => void;
|
|
22
|
-
connectViaWallet?: () => Promise<void>;
|
|
23
|
-
connectViaUsername?: (username: string) => Promise<void>;
|
|
24
|
-
ensResolutionUrl: string;
|
|
25
|
-
initialComments: IComment[];
|
|
26
|
-
username: string | null;
|
|
27
|
-
activeCommentId: string | null;
|
|
28
|
-
activeTabId: string;
|
|
29
|
-
isConnected?: boolean;
|
|
30
|
-
isLoading?: boolean;
|
|
31
|
-
isDDocOwner?: boolean;
|
|
32
|
-
setUsername?: (name: string) => void;
|
|
33
|
-
}
|
|
34
|
-
export declare const CommentStoreProvider: ({ children, editor, ydoc, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
interface CommentRefsContextType {
|
|
36
|
-
commentsSectionRef: React.RefObject<HTMLDivElement>;
|
|
37
|
-
replySectionRef: React.RefObject<HTMLDivElement>;
|
|
38
|
-
portalRef: React.RefObject<HTMLDivElement>;
|
|
39
|
-
buttonRef: React.RefObject<HTMLDivElement>;
|
|
40
|
-
dropdownRef: React.RefObject<HTMLDivElement>;
|
|
41
|
-
}
|
|
42
|
-
export declare const useCommentRefs: () => CommentRefsContextType;
|
|
43
|
-
export {};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { IComment } from '../extensions/comment';
|
|
3
|
-
import { CommentMutationMeta, CommentMutationType } from '../types';
|
|
4
|
-
import { EnsCache } from '../components/inline-comment/context/types';
|
|
5
|
-
import { EnsStatus } from '../components/inline-comment/types';
|
|
6
|
-
import { default as React } from 'react';
|
|
7
|
-
|
|
8
|
-
import * as Y from 'yjs';
|
|
9
|
-
export interface CommentExternalDeps {
|
|
10
|
-
editor: Editor | null;
|
|
11
|
-
ydoc: Y.Doc;
|
|
12
|
-
setActiveCommentId: (id: string | null) => void;
|
|
13
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
14
|
-
setInitialComments?: (comments: IComment[]) => void;
|
|
15
|
-
setUsername?: (name: string) => void;
|
|
16
|
-
onNewComment?: (comment: IComment, meta?: CommentMutationMeta) => void;
|
|
17
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
18
|
-
onResolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
19
|
-
onUnresolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
20
|
-
onDeleteComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
21
|
-
onInlineComment?: () => void;
|
|
22
|
-
onComment?: () => void;
|
|
23
|
-
setCommentDrawerOpen?: (open: boolean) => void;
|
|
24
|
-
connectViaWallet?: () => Promise<void>;
|
|
25
|
-
connectViaUsername?: (username: string) => Promise<void>;
|
|
26
|
-
ensResolutionUrl: string;
|
|
27
|
-
}
|
|
28
|
-
export interface CommentStoreState {
|
|
29
|
-
initialComments: IComment[];
|
|
30
|
-
tabComments: IComment[];
|
|
31
|
-
activeComments: IComment[];
|
|
32
|
-
activeComment: IComment | undefined;
|
|
33
|
-
activeCommentIndex: number;
|
|
34
|
-
username: string | null;
|
|
35
|
-
activeCommentId: string | null;
|
|
36
|
-
activeTabId: string;
|
|
37
|
-
isConnected: boolean;
|
|
38
|
-
isLoading: boolean;
|
|
39
|
-
isDDocOwner: boolean;
|
|
40
|
-
onComment: (() => void) | null;
|
|
41
|
-
setCommentDrawerOpen: ((open: boolean) => void) | null;
|
|
42
|
-
connectViaWallet: (() => Promise<void>) | null;
|
|
43
|
-
connectViaUsername: ((username: string) => Promise<void>) | null;
|
|
44
|
-
isCommentActive: boolean;
|
|
45
|
-
isCommentResolved: boolean;
|
|
46
|
-
showResolved: boolean;
|
|
47
|
-
reply: string;
|
|
48
|
-
comment: string;
|
|
49
|
-
openReplyId: string | null;
|
|
50
|
-
selectedText: string;
|
|
51
|
-
isCommentOpen: boolean;
|
|
52
|
-
isBubbleMenuSuppressed: boolean;
|
|
53
|
-
inlineCommentData: {
|
|
54
|
-
inlineCommentText: string;
|
|
55
|
-
handleClick: boolean;
|
|
56
|
-
};
|
|
57
|
-
ensCache: EnsCache;
|
|
58
|
-
inProgressFetch: string[];
|
|
59
|
-
_externalDepsRef: React.RefObject<CommentExternalDeps | null> | null;
|
|
60
|
-
setExternalDepsRef: (ref: React.RefObject<CommentExternalDeps | null>) => void;
|
|
61
|
-
_recomputeDerived: () => void;
|
|
62
|
-
setInitialComments: (comments: IComment[]) => void;
|
|
63
|
-
setUsername: (username: string | null) => void;
|
|
64
|
-
setActiveCommentId: (id: string | null) => void;
|
|
65
|
-
setActiveTabId: (tabId: string) => void;
|
|
66
|
-
setIsConnected: (connected: boolean) => void;
|
|
67
|
-
setIsLoading: (loading: boolean) => void;
|
|
68
|
-
setIsDDocOwner: (isOwner: boolean) => void;
|
|
69
|
-
setOnComment: (fn: (() => void) | null) => void;
|
|
70
|
-
setCommentDrawerOpenFn: (fn: ((open: boolean) => void) | null) => void;
|
|
71
|
-
setConnectViaWallet: (fn: (() => Promise<void>) | null) => void;
|
|
72
|
-
setConnectViaUsername: (fn: ((username: string) => Promise<void>) | null) => void;
|
|
73
|
-
setIsCommentActive: (active: boolean) => void;
|
|
74
|
-
setIsCommentResolved: (resolved: boolean) => void;
|
|
75
|
-
getTabComments: () => IComment[];
|
|
76
|
-
getActiveComment: () => IComment | undefined;
|
|
77
|
-
getActiveComments: () => IComment[];
|
|
78
|
-
getActiveCommentIndex: () => number;
|
|
79
|
-
getIsCommentActive: () => boolean;
|
|
80
|
-
getIsCommentResolved: () => boolean;
|
|
81
|
-
setShowResolved: (show: boolean) => void;
|
|
82
|
-
setReply: (reply: string) => void;
|
|
83
|
-
setComment: (comment: string) => void;
|
|
84
|
-
setOpenReplyId: (id: string | null) => void;
|
|
85
|
-
setSelectedText: (text: string) => void;
|
|
86
|
-
setIsCommentOpen: (open: boolean) => void;
|
|
87
|
-
setIsBubbleMenuSuppressed: (suppressed: boolean) => void;
|
|
88
|
-
setInlineCommentData: (data: {
|
|
89
|
-
inlineCommentText: string;
|
|
90
|
-
handleClick: boolean;
|
|
91
|
-
}) => void;
|
|
92
|
-
toggleResolved: () => void;
|
|
93
|
-
handleInput: (e: React.FormEvent<HTMLTextAreaElement>, content: string) => void;
|
|
94
|
-
handleReplyChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
95
|
-
handleCommentChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
96
|
-
handleCommentKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
97
|
-
handleReplyKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
98
|
-
handleReplySubmit: () => void;
|
|
99
|
-
handleCommentSubmit: () => void;
|
|
100
|
-
handleInlineComment: () => void;
|
|
101
|
-
addComment: (content?: string, usernameProp?: string) => string | undefined;
|
|
102
|
-
resolveComment: (commentId: string) => void;
|
|
103
|
-
unresolveComment: (commentId: string) => void;
|
|
104
|
-
deleteComment: (commentId: string) => void;
|
|
105
|
-
handleAddReply: (activeCommentId: string, replyContent: string, replyCallback?: (activeCommentId: string, reply: IComment) => void) => void;
|
|
106
|
-
focusCommentInEditor: (commentId: string) => void;
|
|
107
|
-
onPrevComment: () => void;
|
|
108
|
-
onNextComment: () => void;
|
|
109
|
-
getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
|
|
110
|
-
createMutationMeta: (type: CommentMutationType, mutate: () => boolean) => CommentMutationMeta | undefined;
|
|
111
|
-
}
|
|
112
|
-
export declare const createCommentStore: () => import('zustand').StoreApi<CommentStoreState>;
|
|
113
|
-
export declare const CommentStoreContext: React.Context<import('zustand').StoreApi<CommentStoreState> | null>;
|
|
114
|
-
export declare function useCommentStore<T>(selector: (state: CommentStoreState) => T): T;
|