@fileverse-dev/ddoc 2.0.7 → 2.0.8-patch-1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  import { BubbleMenuProps } from '@tiptap/react';
2
+ import { default as React } from 'react';
2
3
 
3
4
  export interface BubbleMenuItem {
4
5
  name: string;
@@ -8,6 +9,9 @@ export interface BubbleMenuItem {
8
9
  }
9
10
  type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
10
11
  onError?: (errorString: string) => void;
12
+ setIsCommentSectionOpen?: (isOpen: boolean) => void;
13
+ inlineCommentData?: InlineCommentData;
14
+ setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
11
15
  };
12
16
  export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
13
17
  export {};
@@ -69,10 +69,24 @@ export declare const LinkPopup: ({ elementRef, editor, setToolVisibility, bubble
69
69
  setIsLinkPopupOpen?: Dispatch<SetStateAction<boolean>>;
70
70
  onError?: (errorString: string) => void;
71
71
  }) => import("react/jsx-runtime").JSX.Element;
72
- export declare const ScriptsPopup: ({ elementRef, editor, setToolVisibility, }: {
72
+ export declare const InlineCommentPopup: ({ elementRef, editor, setIsCommentSectionOpen, inlineCommentData, setInlineCommentData, }: {
73
+ elementRef: React.RefObject<HTMLDivElement>;
74
+ editor: Editor;
75
+ setIsCommentSectionOpen: Dispatch<SetStateAction<boolean>>;
76
+ inlineCommentData: {
77
+ highlightedTextContent: string;
78
+ inlineCommentText: string;
79
+ handleClick: boolean;
80
+ };
81
+ setInlineCommentData: (data: {
82
+ highlightedTextContent?: string;
83
+ inlineCommentText?: string;
84
+ handleClick?: boolean;
85
+ }) => void;
86
+ }) => import("react/jsx-runtime").JSX.Element;
87
+ export declare const ScriptsPopup: ({ elementRef, editor, }: {
73
88
  elementRef: React.RefObject<HTMLDivElement>;
74
89
  editor: Editor;
75
- setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
76
90
  }) => import("react/jsx-runtime").JSX.Element;
77
91
  export declare const TextColor: ({ editor, setVisibility, elementRef, }: {
78
92
  editor: Editor;
@@ -10,10 +10,19 @@ export interface IDocCollabUsers {
10
10
  isEns: string;
11
11
  color: string;
12
12
  }
13
+ type InlineCommentData = {
14
+ inlineCommentText: string;
15
+ highlightedTextContent: string;
16
+ handleClick: boolean;
17
+ };
13
18
  export interface DdocProps {
14
19
  selectedTags?: TagType[];
15
20
  setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
16
- enableCollaboration?: boolean;
21
+ enableCollaboration?: boolean | undefined;
22
+ setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
23
+ inlineCommentData?: InlineCommentData;
24
+ setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
25
+ isCommentSectionOpen?: boolean;
17
26
  collaborationId?: string;
18
27
  isPreviewMode: boolean;
19
28
  ensResolutionUrl?: string;
@@ -40,6 +49,7 @@ export interface DdocProps {
40
49
  }>;
41
50
  className?: string;
42
51
  scrollPosition?: number;
52
+ unFocused?: boolean;
43
53
  }
44
54
  export interface IEditorSelectionData {
45
55
  from: number;
@@ -55,3 +65,4 @@ export interface IUser {
55
65
  color: string;
56
66
  isEns: boolean;
57
67
  }
68
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
3
  import * as Y from 'yjs';
4
- export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, onTextSelection, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, }: Partial<DdocProps>) => {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, onTextSelection, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, unFocused, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;