@fileverse-dev/ddoc 3.2.6-sg-1 → 3.2.6-slides-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.
Files changed (31) hide show
  1. package/dist/index.es.js +27908 -29664
  2. package/dist/package/components/editor-toolbar.d.ts +3 -1
  3. package/dist/package/components/editor-utils.d.ts +3 -1
  4. package/dist/package/components/inline-comment/comment-card.d.ts +1 -19
  5. package/dist/package/components/inline-comment/context/types.d.ts +1 -7
  6. package/dist/package/components/inline-comment/floating-comment/types.d.ts +1 -6
  7. package/dist/package/components/inline-comment/floating-comment-layout-utils.d.ts +1 -4
  8. package/dist/package/components/inline-comment/types.d.ts +0 -1
  9. package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +0 -25
  10. package/dist/package/extensions/comment/comment.d.ts +0 -5
  11. package/dist/package/hooks/use-editing-context.d.ts +0 -2
  12. package/dist/package/hooks/use-tab-editor.d.ts +1 -4
  13. package/dist/package/stores/comment-store-provider.d.ts +1 -9
  14. package/dist/package/stores/comment-store.d.ts +0 -75
  15. package/dist/package/types.d.ts +0 -9
  16. package/dist/package/use-ddoc-editor.d.ts +1 -3
  17. package/dist/style.css +1 -1
  18. package/package.json +1 -1
  19. package/dist/package/components/inline-comment/comment-drawer-constants.d.ts +0 -1
  20. package/dist/package/components/inline-comment/comment-drawer-desktop.d.ts +0 -35
  21. package/dist/package/components/inline-comment/comment-drawer-mobile.d.ts +0 -43
  22. package/dist/package/components/inline-comment/floating-comment/suggestion-draft-floating-card.d.ts +0 -17
  23. package/dist/package/components/inline-comment/floating-comment/suggestion-thread-floating-card.d.ts +0 -15
  24. package/dist/package/components/inline-comment/mobile-inline-comment-sheet.d.ts +0 -15
  25. package/dist/package/components/inline-comment/mobile-suggestion-draft-sheet.d.ts +0 -15
  26. package/dist/package/components/inline-comment/use-comment-drawer-drafts.d.ts +0 -22
  27. package/dist/package/components/inline-comment/use-comment-drawer-filters.d.ts +0 -40
  28. package/dist/package/components/inline-comment/use-comment-drawer-focus.d.ts +0 -17
  29. package/dist/package/components/inline-comment/use-comment-drawer-lifecycle.d.ts +0 -13
  30. package/dist/package/components/inline-comment/use-mobile-comment-navigation.d.ts +0 -20
  31. package/dist/package/extensions/suggestion/suggestion-tracking-extension.d.ts +0 -43
@@ -4,9 +4,11 @@ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
4
  import { Tab } from './tabs/utils/tab-utils';
5
5
 
6
6
  import * as Y from 'yjs';
7
- declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, }: {
7
+ declare const TiptapToolBar: ({ editor, onError, isPresentationMode, setIsPresentationMode, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, }: {
8
8
  editor: Editor | null;
9
9
  onError?: (errorString: string) => void;
10
+ isPresentationMode?: boolean;
11
+ setIsPresentationMode: () => void;
10
12
  zoomLevel: string;
11
13
  setZoomLevel: (zoom: string) => void;
12
14
  isNavbarVisible: boolean;
@@ -56,8 +56,10 @@ export declare const IMG_UPLOAD_SETTINGS: {
56
56
  errorMsg: string;
57
57
  };
58
58
  };
59
- export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
59
+ export declare const useEditorToolbar: ({ editor, onError, isPresentationMode, setIsPresentationMode, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
60
60
  editor: Editor | null;
61
+ isPresentationMode?: boolean;
62
+ setIsPresentationMode?: () => void;
61
63
  onError?: (errorString: string) => void;
62
64
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
63
65
  onMarkdownExport?: () => void;
@@ -1,22 +1,4 @@
1
- import { MouseEvent } from 'react';
2
- import { CommentCardProps, CommentReplyProps, EnsStatus } from './types';
1
+ import { CommentCardProps } from './types';
3
2
 
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;
20
3
  export declare const CommentCard: (props: CommentCardProps) => import("react/jsx-runtime").JSX.Element;
21
4
  export declare const UserDisplaySkeleton: () => import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -26,13 +26,7 @@ export interface CommentFloatingThreadCard extends CommentFloatingBaseCard {
26
26
  type: 'thread';
27
27
  commentId: string;
28
28
  }
29
- export interface SuggestionFloatingDraftCard extends CommentFloatingBaseCard {
30
- type: 'suggestion-draft';
31
- suggestionId: string;
32
- /** Accumulated inserted text from the live suggestion context. */
33
- insertedText: string;
34
- }
35
- export type CommentFloatingCard = CommentFloatingDraftCard | CommentFloatingThreadCard | SuggestionFloatingDraftCard;
29
+ export type CommentFloatingCard = CommentFloatingDraftCard | CommentFloatingThreadCard;
36
30
  export interface InlineCommentData {
37
31
  highlightedTextContent?: string;
38
32
  inlineCommentText: string;
@@ -1,7 +1,7 @@
1
1
  import { Editor } from '@tiptap/react';
2
2
  import { ReactNode, RefObject } from 'react';
3
3
  import { IComment } from '../../../extensions/comment';
4
- import { CommentFloatingDraftCard, CommentFloatingThreadCard, SuggestionFloatingDraftCard } from '../context/types';
4
+ import { CommentFloatingDraftCard, CommentFloatingThreadCard } from '../context/types';
5
5
 
6
6
  export type RegisterCardNode = (floatingCardId: string, node: HTMLDivElement | null) => void;
7
7
  export interface CommentFloatingContainerProps {
@@ -32,8 +32,3 @@ export interface ThreadFloatingCardProps {
32
32
  registerCardNode: RegisterCardNode;
33
33
  isCollaborationEnabled?: boolean;
34
34
  }
35
- export interface SuggestionDraftFloatingCardProps {
36
- card: SuggestionFloatingDraftCard;
37
- isHidden: boolean;
38
- registerCardNode: RegisterCardNode;
39
- }
@@ -2,7 +2,7 @@ import { Editor } from '@tiptap/react';
2
2
  import { FloatingLayoutInvalidationFlag, FloatingCardLayoutInput } from './comment-floating-layout';
3
3
  import { CommentFloatingCard } from './context/types';
4
4
 
5
- export type AnchorType = 'draft' | 'thread' | 'suggestion-draft';
5
+ export type AnchorType = 'draft' | 'thread';
6
6
  export interface CachedAnchorRect {
7
7
  top: number;
8
8
  height: number;
@@ -40,9 +40,6 @@ export declare const FLOATING_VIEWPORT_BUFFER_MULTIPLIER = 1;
40
40
  export declare const getAnchorIdentity: (floatingCard: CommentFloatingCard) => {
41
41
  anchorId: string;
42
42
  anchorType: "draft";
43
- } | {
44
- anchorId: string;
45
- anchorType: "suggestion-draft";
46
43
  } | {
47
44
  anchorId: string;
48
45
  anchorType: "thread";
@@ -50,7 +50,6 @@ export interface CommentCardProps extends IComment {
50
50
  activeCommentId?: string;
51
51
  isDisabled?: boolean;
52
52
  isCommentOwner?: boolean;
53
- canResolveComment?: boolean;
54
53
  version?: string;
55
54
  emptyComment?: boolean;
56
55
  isFocused?: boolean;
@@ -2,7 +2,6 @@ import { Extension, Editor } from '@tiptap/core';
2
2
  import { EditorState, PluginKey } from '@tiptap/pm/state';
3
3
  import { Transform } from '@tiptap/pm/transform';
4
4
  import { DecorationSet } from '@tiptap/pm/view';
5
- import { SuggestionType } from '../../types';
6
5
 
7
6
  import * as Y from 'yjs';
8
7
  export interface CommentAnchor {
@@ -11,10 +10,6 @@ export interface CommentAnchor {
11
10
  anchorTo: Y.RelativePosition;
12
11
  resolved: boolean;
13
12
  deleted: boolean;
14
- isSuggestion?: boolean;
15
- suggestionType?: SuggestionType;
16
- originalContent?: string;
17
- suggestedContent?: string;
18
13
  }
19
14
  interface CommentDecorationPluginState {
20
15
  decorations: DecorationSet;
@@ -39,13 +34,6 @@ export type CommentAnchorTransactionChange = {
39
34
  } & CommentAnchorRange & CommentAnchorRelativeRange);
40
35
  export declare const commentDecorationPluginKey: PluginKey<CommentDecorationPluginState>;
41
36
  export declare function resolveCommentAnchorRangeInState(anchor: Pick<CommentAnchor, 'anchorFrom' | 'anchorTo'>, state: EditorState): CommentAnchorRange | null;
42
- /**
43
- * Resolve anchorFrom to a single absolute position.
44
- * Used for 'add' suggestion anchors where anchorFrom === anchorTo (cursor,
45
- * no initial selection) — resolveCommentAnchorRangeInState rejects from >= to,
46
- * so we need a separate path that allows a point position.
47
- */
48
- export declare function resolveCommentAnchorPointInState(anchor: Pick<CommentAnchor, 'anchorFrom'>, state: EditorState): number | null;
49
37
  export declare function resolveCommentAnchorRangeForAnalysis(anchor: Pick<CommentAnchor, 'id' | 'anchorFrom' | 'anchorTo'>, state: EditorState): CommentAnchorRange | null;
50
38
  /**
51
39
  * Analyze transaction changes to classify each active anchor's mutation status.
@@ -75,21 +63,8 @@ export declare const CommentDecorationExtension: Extension<CommentDecorationOpti
75
63
  * These are consumed by the draft-creation flow and transaction-analysis layer.
76
64
  */
77
65
  export declare function createCommentAnchorFromEditor(editor: Editor, from: number, to: number): CommentAnchorRelativeRange | null;
78
- /**
79
- * Create a point anchor (anchorFrom === anchorTo) at a single doc position.
80
- * Used by the suggestion-mode draft flow when the viewer places a cursor
81
- * without selecting text — createCommentAnchorFromEditor rejects from >= to
82
- * since an empty range is invalid for regular comments.
83
- */
84
- export declare function createCommentAnchorPointFromEditor(editor: Editor, pos: number): CommentAnchorRelativeRange | null;
85
66
  export declare function createCommentAnchorFromSelection(editor: Editor): CommentAnchorRelativeRange | null;
86
67
  export declare function triggerDecorationRebuild(editor: Editor): void;
87
68
  export declare function getCommentAtPosition(editor: Editor, pos: number, getAnchors: () => CommentAnchor[]): CommentAnchor | null;
88
69
  export declare function getCommentAnchorRange(editor: Editor, commentId: string, getAnchors: () => CommentAnchor[]): CommentAnchorRange | null;
89
- /**
90
- * Apply the accepted suggestion's change to the document.
91
- * Called by the store's acceptSuggestion action before resolving on-chain.
92
- * Returns false if the anchor can't be resolved or the suggestion type is unknown.
93
- */
94
- export declare function applyAcceptedSuggestion(editor: Editor, anchor: CommentAnchor): boolean;
95
70
  export {};
@@ -2,7 +2,6 @@ import { Mark, Range } from '@tiptap/core';
2
2
  import { Mark as PMMark } from '@tiptap/pm/model';
3
3
  import { PluginKey, EditorState } from '@tiptap/pm/state';
4
4
  import { DecorationSet } from '@tiptap/pm/view';
5
- import { SuggestionType } from '../../types';
6
5
 
7
6
  declare module '@tiptap/core' {
8
7
  interface Commands<ReturnType> {
@@ -94,10 +93,6 @@ export interface IComment {
94
93
  deleted?: boolean;
95
94
  commentIndex?: number;
96
95
  version?: string;
97
- isSuggestion?: boolean;
98
- suggestionType?: SuggestionType;
99
- originalContent?: string;
100
- suggestedContent?: string;
101
96
  }
102
97
  export declare const CommentExtension: Mark<CommentOptions, CommentStorage>;
103
98
  export {};
@@ -4,7 +4,6 @@ type EditingContextType = {
4
4
  isPreviewMode: boolean;
5
5
  isPresentationMode?: boolean;
6
6
  isCollaboratorsDoc?: boolean;
7
- isSuggestionMode?: boolean;
8
7
  };
9
8
  export declare const useEditingContext: () => EditingContextType;
10
9
  type EditingProviderProps = {
@@ -13,7 +12,6 @@ type EditingProviderProps = {
13
12
  isPresentationMode?: boolean;
14
13
  isCollaboratorsDoc?: boolean;
15
14
  isPreviewEditor?: boolean;
16
- isSuggestionMode?: boolean;
17
15
  };
18
16
  export declare const EditingProvider: React.FC<EditingProviderProps>;
19
17
  export {};
@@ -12,7 +12,6 @@ interface UseTabEditorArgs {
12
12
  hasTabState?: boolean;
13
13
  versionId?: string;
14
14
  isPreviewMode?: boolean;
15
- viewerMode?: DdocProps['viewerMode'];
16
15
  initialContent: DdocProps['initialContent'];
17
16
  collaboration?: CollaborationProps;
18
17
  isReady?: boolean;
@@ -52,7 +51,7 @@ interface UseTabEditorArgs {
52
51
  editorRef?: MutableRefObject<Editor | null>;
53
52
  initialCommentAnchors?: SerializedCommentAnchor[];
54
53
  }
55
- export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, viewerMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, initialCommentAnchors, }: UseTabEditorArgs) => {
54
+ export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, initialCommentAnchors, }: UseTabEditorArgs) => {
56
55
  editor: Editor | null;
57
56
  ref: import('react').RefObject<HTMLDivElement>;
58
57
  slides: string[];
@@ -64,7 +63,5 @@ export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionI
64
63
  focusCommentWithActiveId: (id: string) => void;
65
64
  isContentLoading: boolean | undefined;
66
65
  commentAnchorsRef: MutableRefObject<CommentAnchor[]>;
67
- draftAnchorsRef: MutableRefObject<CommentAnchor[]>;
68
- storeApiRef: MutableRefObject<import('zustand').StoreApi<import('../stores/comment-store').CommentStoreState> | null>;
69
66
  };
70
67
  export {};
@@ -3,7 +3,6 @@ import { Editor } from '@tiptap/core';
3
3
  import { IComment } from '../extensions/comment';
4
4
  import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin';
5
5
  import { CommentMutationMeta, SerializedCommentAnchor } from '../types';
6
- import { createCommentStore } from './comment-store';
7
6
 
8
7
  import * as Y from 'yjs';
9
8
  export interface CommentStoreProviderProps {
@@ -29,13 +28,6 @@ export interface CommentStoreProviderProps {
29
28
  connectViaUsername?: (username: string) => Promise<void>;
30
29
  ensResolutionUrl: string;
31
30
  commentAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
32
- draftAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
33
- /**
34
- * Ref populated by the provider with the Zustand store instance.
35
- * SuggestionTrackingExtension reads this inside event handlers to route
36
- * keystrokes into draft actions without rebuilding the editor.
37
- */
38
- storeApiRef?: React.MutableRefObject<ReturnType<typeof createCommentStore> | null>;
39
31
  initialCommentAnchors?: SerializedCommentAnchor[];
40
32
  initialComments: IComment[];
41
33
  username: string | null;
@@ -46,7 +38,7 @@ export interface CommentStoreProviderProps {
46
38
  isDDocOwner?: boolean;
47
39
  setUsername?: React.Dispatch<React.SetStateAction<string>>;
48
40
  }
49
- export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onDeleteReply, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, draftAnchorsRef, storeApiRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onDeleteReply, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
50
42
  interface CommentRefsContextType {
51
43
  commentsSectionRef: React.RefObject<HTMLDivElement>;
52
44
  replySectionRef: React.RefObject<HTMLDivElement>;
@@ -30,35 +30,7 @@ export interface CommentExternalDeps {
30
30
  ensResolutionUrl: string;
31
31
  commentAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
32
32
  refreshCommentAnchorState?: () => void;
33
- /**
34
- * Derived anchor list for in-progress suggestion drafts. Maintained by the
35
- * store (not the consumer) — draft actions upsert into this ref whenever
36
- * state.drafts changes. The decoration extension reads this ref alongside
37
- * commentAnchorsRef to render both layers identically.
38
- */
39
- draftAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
40
- }
41
- /**
42
- * A suggestion draft is the viewer's in-progress proposed edit — kept local
43
- * until Submit. Drafts live in memory only (lost on refresh). Derived into
44
- * a CommentAnchor for decoration rendering via deriveDraftAnchor(). The
45
- * suggestion type ('add' | 'delete' | 'replace') is not stored; it is derived
46
- * at use time from hadDeletion + insertedText.
47
- */
48
- export interface DraftSuggestion {
49
- id: string;
50
- anchorFrom: Y.RelativePosition;
51
- anchorTo: Y.RelativePosition;
52
- /** The text that was selected at draft creation (for Delete/Replace strikethrough). */
53
- originalContent: string;
54
- /** Accumulated text the viewer has typed. Empty for a pure Delete draft. */
55
- insertedText: string;
56
- /** Per-keystroke history for undo — each entry is one typed character. */
57
- keystrokes: string[];
58
- /** True when the draft was created via select+delete or select+type. */
59
- hadDeletion: boolean;
60
33
  }
61
- type SuggestionDeleteDirection = 'backward' | 'forward';
62
34
  type FloatingCardsUpdater = React.SetStateAction<CommentFloatingCard[]>;
63
35
  type InlineCommentDataUpdater = Partial<InlineCommentData> | ((prev: InlineCommentData) => Partial<InlineCommentData> | InlineCommentData);
64
36
  type InlineDraftRecordMap = Record<string, InlineCommentDraft>;
@@ -121,8 +93,6 @@ export interface CommentStoreState {
121
93
  inlineCommentData: InlineCommentData;
122
94
  floatingCards: CommentFloatingCard[];
123
95
  pendingPrehydrationFloatingThreadIds: string[];
124
- /** In-progress suggestion drafts — keyed by suggestionId. Viewer-local, lost on refresh. */
125
- drafts: Record<string, DraftSuggestion>;
126
96
  inlineDrafts: InlineDraftRecordMap;
127
97
  activeDraftId: string | null;
128
98
  isDesktopFloatingEnabled: boolean;
@@ -208,50 +178,6 @@ export interface CommentStoreState {
208
178
  deleteComment: (commentId: string, options?: {
209
179
  skipExternalCallback?: boolean;
210
180
  }) => void;
211
- acceptSuggestion: (commentId: string) => void;
212
- /**
213
- * Append typed characters to the draft at the current cursor position.
214
- * Creates a new Add draft if no draft exists at the cursor.
215
- */
216
- appendToDraftAtCursor: (text: string) => void;
217
- /**
218
- * Create a Delete (or pending Replace) draft from a selection range.
219
- * Captures originalContent, leaves insertedText empty; type becomes 'replace'
220
- * as soon as the viewer types.
221
- */
222
- startDeleteDraft: (from: number, to: number, collapseTo?: number) => void;
223
- /**
224
- * Convert a collapsed-caret Backspace/Delete into a delete draft when the
225
- * caret is adjacent to text, or shrink the active draft if the caret is
226
- * already inside one.
227
- */
228
- deleteAtCursorOrUndoActiveDraft: (direction: SuggestionDeleteDirection) => void;
229
- /**
230
- * Handle browser deletion paths that resolved to a concrete range even
231
- * though the user had no explicit selection.
232
- */
233
- deleteRangeOrUndoActiveDraft: (from: number, to: number) => void;
234
- /**
235
- * Undo the last keystroke in the draft at the current cursor position.
236
- * When the draft has no keystrokes left, it is discarded.
237
- * For a pure Delete draft (no keystrokes ever), calling this discards.
238
- */
239
- undoLastKeystrokeInActiveDraft: () => void;
240
- /** Drop a draft entirely — removes the inline overlay and draft card. */
241
- discardDraft: (suggestionId: string) => void;
242
- /**
243
- * Refresh the `originalContent` (and the suggestion-draft card's selectedText)
244
- * for a Delete/Replace draft whose anchored range still resolves but now
245
- * covers different text — happens when the owner edits within the anchored
246
- * range while the viewer's draft is open.
247
- */
248
- refreshDraftOriginalContent: (suggestionId: string, currentText: string) => void;
249
- /**
250
- * Promote a draft to a submitted suggestion. Pushes the anchor into
251
- * commentAnchorsRef, calls onNewComment, removes the draft, and swaps the
252
- * suggestion-draft floating card for a thread card (same floatingCardId).
253
- */
254
- submitDraft: (suggestionId: string) => void;
255
181
  deleteReply: (commentId: string, replyId: string) => void;
256
182
  requestEditComment: (commentId: string) => void;
257
183
  requestEditReply: (commentId: string, replyId: string) => void;
@@ -259,7 +185,6 @@ export interface CommentStoreState {
259
185
  editReplyContent: (commentId: string, replyId: string, content: string) => void;
260
186
  handleAddReply: (activeCommentId: string, replyContent: string, replyCallback?: (activeCommentId: string, reply: IComment) => void) => void;
261
187
  focusCommentInEditor: (commentId: string, options?: FocusCommentInEditorOptions) => void;
262
- focusSuggestionDraftInEditor: (suggestionId: string) => void;
263
188
  onPrevComment: () => void;
264
189
  onNextComment: () => void;
265
190
  getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
@@ -20,7 +20,6 @@ export type InlineCommentData = {
20
20
  handleClick: boolean;
21
21
  };
22
22
  export type CommentMutationType = 'create' | 'edit' | 'resolve' | 'unresolve' | 'delete';
23
- export type SuggestionType = 'add' | 'replace' | 'delete';
24
23
  export interface CommentMutationMeta {
25
24
  type: CommentMutationType;
26
25
  updateChunk?: string;
@@ -28,9 +27,6 @@ export interface CommentMutationMeta {
28
27
  anchorTo?: string;
29
28
  selectedContent?: string;
30
29
  content?: string;
31
- suggestionType?: SuggestionType;
32
- originalContent?: string;
33
- suggestedContent?: string;
34
30
  }
35
31
  export interface SerializedCommentAnchor {
36
32
  id: string;
@@ -38,10 +34,6 @@ export interface SerializedCommentAnchor {
38
34
  anchorTo: string;
39
35
  resolved: boolean;
40
36
  deleted: boolean;
41
- isSuggestion?: boolean;
42
- suggestionType?: SuggestionType;
43
- originalContent?: string;
44
- suggestedContent?: string;
45
37
  }
46
38
  export interface CommentAccountProps {
47
39
  isConnected?: boolean;
@@ -153,7 +145,6 @@ export interface DdocProps extends CommentAccountProps {
153
145
  editorCanvasClassNames?: string;
154
146
  isCommentSectionOpen?: boolean;
155
147
  isPreviewMode: boolean;
156
- viewerMode?: 'suggest' | 'view-only';
157
148
  ensResolutionUrl?: string;
158
149
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
159
150
  enableIndexeddbSync?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { DdocProps } from './types';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
- export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, ...rest }: Partial<DdocProps> & {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, ...rest }: Partial<DdocProps> & {
5
5
  isFocusMode?: boolean;
6
6
  }) => {
7
7
  ydoc: import('yjs').Doc;
@@ -41,6 +41,4 @@ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent
41
41
  setActiveCommentId: import('react').Dispatch<import('react').SetStateAction<string | null>>;
42
42
  focusCommentWithActiveId: (id: string) => void;
43
43
  commentAnchorsRef: import('react').MutableRefObject<import('./extensions/comment/comment-decoration-plugin').CommentAnchor[]>;
44
- draftAnchorsRef: import('react').MutableRefObject<import('./extensions/comment/comment-decoration-plugin').CommentAnchor[]>;
45
- storeApiRef: import('react').MutableRefObject<import('zustand').StoreApi<import('./stores/comment-store').CommentStoreState> | null>;
46
44
  };