@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.
- package/dist/index.es.js +30927 -36017
- package/dist/package/components/editor-bubble-menu.d.ts +3 -1
- package/dist/package/components/tag-input.d.ts +12 -0
- package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +1 -1
- package/dist/package/types.d.ts +5 -22
- package/dist/package/use-ddoc-editor.d.ts +4 -8
- package/dist/style.css +1 -1
- package/package.json +6 -4
- package/dist/package/extensions/sync-cursor.d.ts +0 -12
@@ -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 };
|
package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts
CHANGED
@@ -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>;
|
package/dist/package/types.d.ts
CHANGED
@@ -20,7 +20,7 @@ export interface DdocProps {
|
|
20
20
|
renderNavbar?: ({ editor }: {
|
21
21
|
editor: JSONContent;
|
22
22
|
}) => JSX.Element;
|
23
|
-
onChange?: (changes:
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
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:
|
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
|
};
|