@fileverse-dev/ddoc 2.0.3-sync-patch-11 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,8 @@ export interface BubbleMenuItem {
6
6
  command: () => void;
7
7
  icon: any;
8
8
  }
9
- type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'>;
9
+ type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
10
+ onError?: (errorString: string) => void;
11
+ };
10
12
  export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -0,0 +1,12 @@
1
+ export interface TagProps {
2
+ name: string;
3
+ color: string;
4
+ }
5
+ export interface TagInputProps {
6
+ tags: TagProps[];
7
+ selectedTags: TagProps[];
8
+ onAddTag: (tag: TagProps) => void;
9
+ isPreviewMode: boolean;
10
+ }
11
+ declare const TagInput: ({ tags, selectedTags, onAddTag, isPreviewMode }: TagInputProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export { TagInput };
@@ -9,4 +9,4 @@ export type UploadFnType = (image: File) => Promise<string>;
9
9
  * If no upload function is provided, it reads the media file as DataURL and uses this in the new node.
10
10
  * The function returns a new instance of the Plugin.
11
11
  */
12
- export declare const getMediaPasteDropPlugin: (upload: UploadFnType) => Plugin<any>;
12
+ export declare const getMediaPasteDropPlugin: (upload: UploadFnType, onError: (error: string) => void) => Plugin<any>;
@@ -20,7 +20,7 @@ export interface DdocProps {
20
20
  renderNavbar?: ({ editor }: {
21
21
  editor: JSONContent;
22
22
  }) => JSX.Element;
23
- onChange?: (changes: string) => void;
23
+ onChange?: (changes: Data['editorJSONData']) => void;
24
24
  onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
25
25
  onTextSelection?: (data: IEditorSelectionData) => void;
26
26
  onCommentInteraction?: (data: IEditorSelectionData) => void;
@@ -30,11 +30,10 @@ export interface DdocProps {
30
30
  onError?: (error: string) => void;
31
31
  setCharacterCount?: React.Dispatch<SetStateAction<number>>;
32
32
  setWordCount?: React.Dispatch<SetStateAction<number>>;
33
- collaborationKey?: string;
34
- yjsUpdate?: string;
35
- onDisconnectionDueToSyncError?: (syncError: {
36
- message: string;
37
- }) => void;
33
+ tags?: Array<{
34
+ name: string;
35
+ color: string;
36
+ }>;
38
37
  }
39
38
  export interface IEditorSelectionData {
40
39
  from: number;
@@ -50,19 +49,3 @@ export interface IUser {
50
49
  color: string;
51
50
  isEns: boolean;
52
51
  }
53
- export type CollaborationCursorStorage = {
54
- users: {
55
- clientId: number;
56
- [key: string]: any;
57
- }[];
58
- };
59
- export interface CollaborationCursorOptions {
60
- provider: any;
61
- user: Record<string, any>;
62
- render(user: Record<string, any>): HTMLElement;
63
- selectionRender(user: Record<string, any>): any;
64
- onUpdate: (users: {
65
- clientId: number;
66
- [key: string]: any;
67
- }[]) => null;
68
- }
@@ -1,14 +1,10 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
- export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, ensResolutionUrl, onError, setCharacterCount, setWordCount, collaborationKey, yjsUpdate, onDisconnectionDueToSyncError, }: Partial<DdocProps>) => {
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, }: Partial<DdocProps>) => {
4
5
  editor: import('@tiptap/core').Editor | null;
5
6
  isContentLoading: boolean;
6
7
  ref: import('react').RefObject<HTMLDivElement>;
7
- connect: (username: string | null | undefined, isEns?: boolean) => void;
8
- ydoc: import('yjs').Doc;
9
- isCollaborationReady: boolean;
10
- syncError: {
11
- message: string;
12
- } | null;
13
- isSyncFetchingFromIpfs: boolean;
8
+ connect: (username: string | null | undefined, isEns?: boolean) => () => void;
9
+ ydoc: Y.Doc;
14
10
  };