@fileverse-dev/ddoc 3.1.6-patch-001 → 3.1.6-patch-002
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 +35447 -35952
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/editor-utils.d.ts +2 -1
- package/dist/package/components/inline-comment/comment-card.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-dropdown.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-username.d.ts +1 -1
- package/dist/package/components/inline-comment/context/comment-context.d.ts +4 -0
- package/dist/package/components/inline-comment/context/types.d.ts +89 -46
- package/dist/package/components/inline-comment/empty-comments.d.ts +1 -4
- package/dist/package/components/inline-comment/types.d.ts +0 -22
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
- package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
- package/dist/package/components/preview-export-trigger.d.ts +2 -1
- package/dist/package/components/tabs/document-tabs-sidebar.d.ts +1 -2
- package/dist/package/context/editor-context.d.ts +3 -3
- package/dist/package/extensions/comment/comment.d.ts +0 -27
- package/dist/package/extensions/custom-link/index.d.ts +19 -0
- package/dist/package/extensions/default-extension.d.ts +1 -1
- package/dist/package/extensions/odt-export/index.d.ts +30 -0
- package/dist/package/hooks/use-ddoc-export.d.ts +1 -1
- package/dist/package/hooks/use-export-headless-editor-content.d.ts +1 -1
- package/dist/package/hooks/use-tab-editor.d.ts +3 -5
- package/dist/package/hooks/use-tab-manager.d.ts +2 -1
- package/dist/package/sync-local/SyncManager.d.ts +12 -0
- package/dist/package/sync-local/types/index.d.ts +4 -0
- package/dist/package/types.d.ts +7 -17
- package/dist/package/use-ddoc-editor.d.ts +0 -1
- package/dist/package/utils/colors.d.ts +3 -1
- package/dist/package/utils/document-styling.d.ts +3 -3
- package/dist/package/utils/heading-link.d.ts +23 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/package/components/inline-comment/comment-floating-container.d.ts +0 -1
- package/dist/package/components/inline-comment/comment-floating-layout.d.ts +0 -31
- package/dist/package/components/inline-comment/comment-input-field.d.ts +0 -3
- package/dist/package/components/inline-comment/comment-reply-input.d.ts +0 -7
- package/dist/package/components/inline-comment/constants.d.ts +0 -1
- package/dist/package/components/inline-comment/delete-confirm-overlay.d.ts +0 -10
- package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/draft-floating-card.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/floating-auth-prompt.d.ts +0 -1
- package/dist/package/components/inline-comment/floating-comment/floating-card-shell.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/index.d.ts +0 -1
- package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/types.d.ts +0 -32
- package/dist/package/components/inline-comment/floating-comment-layout-utils.d.ts +0 -78
- package/dist/package/components/inline-comment/resize-inline-comment-textarea.d.ts +0 -1
- package/dist/package/components/inline-comment/use-anchor-registry.d.ts +0 -34
- package/dist/package/components/inline-comment/use-comment-card.d.ts +0 -29
- package/dist/package/components/inline-comment/use-comment-list-container.d.ts +0 -17
- package/dist/package/components/inline-comment/use-ens-status.d.ts +0 -3
- package/dist/package/components/inline-comment/use-floating-card-state.d.ts +0 -36
- package/dist/package/components/inline-comment/use-floating-comment-card-layout.d.ts +0 -23
- package/dist/package/components/inline-comment/use-floating-comment-card-state.d.ts +0 -13
- package/dist/package/components/inline-comment/use-floating-layout-engine.d.ts +0 -26
- package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +0 -67
- package/dist/package/stores/comment-store-provider.d.ts +0 -50
- package/dist/package/stores/comment-store.d.ts +0 -185
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin';
|
|
4
|
-
import { CommentFloatingCard, EnsCache, InlineCommentData, InlineCommentDraft, InlineDraftLocation } from '../components/inline-comment/context/types';
|
|
5
|
-
import { EnsStatus } from '../components/inline-comment/types';
|
|
6
|
-
import { IComment } from '../extensions/comment';
|
|
7
|
-
import { CommentMutationMeta, CommentMutationType } from '../types';
|
|
8
|
-
|
|
9
|
-
import * as Y from 'yjs';
|
|
10
|
-
export interface CommentExternalDeps {
|
|
11
|
-
editor: Editor | null;
|
|
12
|
-
ydoc: Y.Doc;
|
|
13
|
-
setActiveCommentId: (id: string | null) => void;
|
|
14
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
15
|
-
setInitialComments?: React.Dispatch<React.SetStateAction<IComment[]>>;
|
|
16
|
-
setUsername?: React.Dispatch<React.SetStateAction<string>>;
|
|
17
|
-
onNewComment?: (comment: IComment, meta?: CommentMutationMeta) => void;
|
|
18
|
-
onEditComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
19
|
-
onEditReply?: (commentId: string, replyId: string, meta?: CommentMutationMeta) => void;
|
|
20
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
21
|
-
onResolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
22
|
-
onUnresolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
23
|
-
onDeleteComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
24
|
-
onInlineComment?: () => void;
|
|
25
|
-
onComment?: () => void;
|
|
26
|
-
setCommentDrawerOpen?: (open: boolean) => void;
|
|
27
|
-
connectViaWallet?: () => Promise<void>;
|
|
28
|
-
connectViaUsername?: (username: string) => Promise<void>;
|
|
29
|
-
ensResolutionUrl: string;
|
|
30
|
-
commentAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
|
|
31
|
-
}
|
|
32
|
-
type FloatingCardsUpdater = React.SetStateAction<CommentFloatingCard[]>;
|
|
33
|
-
type InlineCommentDataUpdater = Partial<InlineCommentData> | ((prev: InlineCommentData) => Partial<InlineCommentData> | InlineCommentData);
|
|
34
|
-
type InlineDraftRecordMap = Record<string, InlineCommentDraft>;
|
|
35
|
-
type CreateInlineDraftOptions = {
|
|
36
|
-
location?: InlineDraftLocation;
|
|
37
|
-
tabId?: string;
|
|
38
|
-
allowEmptySelection?: boolean;
|
|
39
|
-
};
|
|
40
|
-
type CommentEditRequest = {
|
|
41
|
-
requestId: string;
|
|
42
|
-
kind: 'comment' | 'reply';
|
|
43
|
-
commentId: string;
|
|
44
|
-
replyId?: string;
|
|
45
|
-
text: string;
|
|
46
|
-
};
|
|
47
|
-
type ReplyEditTarget = {
|
|
48
|
-
kind: 'comment' | 'reply';
|
|
49
|
-
commentId: string;
|
|
50
|
-
replyId?: string;
|
|
51
|
-
originalText: string;
|
|
52
|
-
};
|
|
53
|
-
type CommentEditCompletion = {
|
|
54
|
-
nonce: number;
|
|
55
|
-
kind: 'comment' | 'reply';
|
|
56
|
-
commentId: string;
|
|
57
|
-
replyId?: string;
|
|
58
|
-
};
|
|
59
|
-
export interface CommentStoreState {
|
|
60
|
-
initialComments: IComment[];
|
|
61
|
-
tabComments: IComment[];
|
|
62
|
-
activeComments: IComment[];
|
|
63
|
-
activeComment: IComment | undefined;
|
|
64
|
-
activeCommentIndex: number;
|
|
65
|
-
username: string | null;
|
|
66
|
-
activeCommentId: string | null;
|
|
67
|
-
activeTabId: string;
|
|
68
|
-
isConnected: boolean;
|
|
69
|
-
isLoading: boolean;
|
|
70
|
-
isDDocOwner: boolean;
|
|
71
|
-
onComment: (() => void) | null;
|
|
72
|
-
setCommentDrawerOpen: ((open: boolean) => void) | null;
|
|
73
|
-
connectViaWallet: (() => Promise<void>) | null;
|
|
74
|
-
connectViaUsername: ((username: string) => Promise<void>) | null;
|
|
75
|
-
isCommentActive: boolean;
|
|
76
|
-
isCommentResolved: boolean;
|
|
77
|
-
showResolved: boolean;
|
|
78
|
-
reply: string;
|
|
79
|
-
comment: string;
|
|
80
|
-
openReplyId: string | null;
|
|
81
|
-
selectedText: string;
|
|
82
|
-
isCommentOpen: boolean;
|
|
83
|
-
isBubbleMenuSuppressed: boolean;
|
|
84
|
-
inlineCommentData: InlineCommentData;
|
|
85
|
-
floatingCards: CommentFloatingCard[];
|
|
86
|
-
inlineDrafts: InlineDraftRecordMap;
|
|
87
|
-
activeDraftId: string | null;
|
|
88
|
-
isDesktopFloatingEnabled: boolean;
|
|
89
|
-
ensCache: EnsCache;
|
|
90
|
-
inProgressFetch: string[];
|
|
91
|
-
editRequest: CommentEditRequest | null;
|
|
92
|
-
replyEditTarget: ReplyEditTarget | null;
|
|
93
|
-
editCompletion: CommentEditCompletion | null;
|
|
94
|
-
_externalDepsRef: React.RefObject<CommentExternalDeps | null> | null;
|
|
95
|
-
setExternalDepsRef: (ref: React.RefObject<CommentExternalDeps | null>) => void;
|
|
96
|
-
_recomputeDerived: () => void;
|
|
97
|
-
setInitialComments: (comments: IComment[]) => void;
|
|
98
|
-
setUsername: (username: string | null) => void;
|
|
99
|
-
setActiveCommentId: (id: string | null) => void;
|
|
100
|
-
setActiveTabId: (tabId: string) => void;
|
|
101
|
-
setIsConnected: (connected: boolean) => void;
|
|
102
|
-
setIsLoading: (loading: boolean) => void;
|
|
103
|
-
setIsDDocOwner: (isOwner: boolean) => void;
|
|
104
|
-
setOnComment: (fn: (() => void) | null) => void;
|
|
105
|
-
setCommentDrawerOpenFn: (fn: ((open: boolean) => void) | null) => void;
|
|
106
|
-
setConnectViaWallet: (fn: (() => Promise<void>) | null) => void;
|
|
107
|
-
setConnectViaUsername: (fn: ((username: string) => Promise<void>) | null) => void;
|
|
108
|
-
setIsCommentActive: (active: boolean) => void;
|
|
109
|
-
setIsCommentResolved: (resolved: boolean) => void;
|
|
110
|
-
getTabComments: () => IComment[];
|
|
111
|
-
getActiveComment: () => IComment | undefined;
|
|
112
|
-
getActiveComments: () => IComment[];
|
|
113
|
-
getActiveCommentIndex: () => number;
|
|
114
|
-
getIsCommentActive: () => boolean;
|
|
115
|
-
getIsCommentResolved: () => boolean;
|
|
116
|
-
setShowResolved: (show: boolean) => void;
|
|
117
|
-
setReply: (reply: string) => void;
|
|
118
|
-
setComment: (comment: string) => void;
|
|
119
|
-
setOpenReplyId: (id: string | null) => void;
|
|
120
|
-
setSelectedText: (text: string) => void;
|
|
121
|
-
setIsCommentOpen: (open: boolean) => void;
|
|
122
|
-
setIsBubbleMenuSuppressed: (suppressed: boolean) => void;
|
|
123
|
-
setInlineCommentData: (data: InlineCommentDataUpdater) => void;
|
|
124
|
-
setFloatingCards: (floatingCards: FloatingCardsUpdater) => void;
|
|
125
|
-
clearFloatingCards: () => void;
|
|
126
|
-
setActiveDraftId: (draftId: string | null) => void;
|
|
127
|
-
setIsDesktopFloatingEnabled: (enabled: boolean) => void;
|
|
128
|
-
toggleResolved: () => void;
|
|
129
|
-
clearEditRequest: (requestId: string) => void;
|
|
130
|
-
setReplyEditTarget: (target: ReplyEditTarget | null) => void;
|
|
131
|
-
cancelReplyEdit: () => void;
|
|
132
|
-
handleInput: (e: React.FormEvent<HTMLTextAreaElement>, content: string) => void;
|
|
133
|
-
handleReplyChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
134
|
-
handleCommentChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
135
|
-
handleCommentKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>, tabId?: string) => void;
|
|
136
|
-
handleReplyKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
137
|
-
handleReplySubmit: () => void;
|
|
138
|
-
handleCommentSubmit: (tabId?: string) => void;
|
|
139
|
-
handleInlineComment: () => void;
|
|
140
|
-
addComment: (content?: string, usernameProp?: string) => string | undefined;
|
|
141
|
-
createFloatingDraft: (options?: CreateInlineDraftOptions) => string | null;
|
|
142
|
-
updateInlineDraftText: (draftId: string, value: string) => void;
|
|
143
|
-
cancelInlineDraft: (draftId: string) => void;
|
|
144
|
-
submitInlineDraft: (draftId: string) => void;
|
|
145
|
-
updateFloatingDraftText: (draftId: string, value: string) => void;
|
|
146
|
-
cancelFloatingDraft: (draftId: string) => void;
|
|
147
|
-
submitFloatingDraft: (draftId: string) => void;
|
|
148
|
-
openFloatingThread: (commentId: string) => void;
|
|
149
|
-
closeFloatingCard: (floatingCardId: string) => void;
|
|
150
|
-
blurFloatingCard: (floatingCardId: string) => void;
|
|
151
|
-
focusFloatingCard: (floatingCardId: string) => void;
|
|
152
|
-
removeInvalidFloatingCards: () => void;
|
|
153
|
-
syncFloatingThreadCardWithActiveComment: () => void;
|
|
154
|
-
submitPendingFloatingDrafts: () => void;
|
|
155
|
-
/**
|
|
156
|
-
* Apply anchor edits to local comment state.
|
|
157
|
-
* Called after transaction analysis identifies edited anchors.
|
|
158
|
-
* Updates selectedContent for each affected comment
|
|
159
|
-
* so thread display stays in sync immediately, before consumer rehydration.
|
|
160
|
-
*/
|
|
161
|
-
applyCommentAnchorEdits: (edits: Array<{
|
|
162
|
-
commentId: string;
|
|
163
|
-
selectedContent: string;
|
|
164
|
-
}>) => void;
|
|
165
|
-
resolveComment: (commentId: string) => void;
|
|
166
|
-
unresolveComment: (commentId: string) => void;
|
|
167
|
-
deleteComment: (commentId: string, options?: {
|
|
168
|
-
skipExternalCallback?: boolean;
|
|
169
|
-
}) => void;
|
|
170
|
-
deleteReply: (commentId: string, replyId: string) => void;
|
|
171
|
-
requestEditComment: (commentId: string) => void;
|
|
172
|
-
requestEditReply: (commentId: string, replyId: string) => void;
|
|
173
|
-
editCommentContent: (commentId: string, content: string) => void;
|
|
174
|
-
editReplyContent: (commentId: string, replyId: string, content: string) => void;
|
|
175
|
-
handleAddReply: (activeCommentId: string, replyContent: string, replyCallback?: (activeCommentId: string, reply: IComment) => void) => void;
|
|
176
|
-
focusCommentInEditor: (commentId: string) => void;
|
|
177
|
-
onPrevComment: () => void;
|
|
178
|
-
onNextComment: () => void;
|
|
179
|
-
getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
|
|
180
|
-
createMutationMeta: (type: CommentMutationType, mutate: () => boolean) => CommentMutationMeta | undefined;
|
|
181
|
-
}
|
|
182
|
-
export declare const createCommentStore: () => import('zustand').StoreApi<CommentStoreState>;
|
|
183
|
-
export declare const CommentStoreContext: React.Context<import('zustand').StoreApi<CommentStoreState> | null>;
|
|
184
|
-
export declare function useCommentStore<T>(selector: (state: CommentStoreState) => T): T;
|
|
185
|
-
export {};
|