@fileverse-dev/ddoc 1.7.1 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/index.es.js +7268 -7254
- package/dist/index.umd.js +105 -105
- package/dist/packages/ddoc/components/bottom-toolbar.d.ts +2 -2
- package/dist/packages/ddoc/components/editor-toolbar.d.ts +2 -2
- package/dist/packages/ddoc/components/editor-utils.d.ts +7 -3
- package/dist/packages/ddoc/components/slash-comand.d.ts +1 -1
- package/dist/packages/ddoc/types.d.ts +1 -1
- package/dist/packages/ddoc/use-ddoc-editor.d.ts +1 -1
- package/dist/packages/ddoc/utils/upload-images.d.ts +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
2
2
|
|
3
|
-
declare const BottomToolbar: ({ editor,
|
3
|
+
declare const BottomToolbar: ({ editor, onError, }: {
|
4
4
|
editor: Editor;
|
5
|
-
|
5
|
+
onError?: (errorString: string) => void;
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
7
7
|
export default BottomToolbar;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
2
2
|
|
3
|
-
declare const TiptapToolBar: ({ editor,
|
3
|
+
declare const TiptapToolBar: ({ editor, onError, }: {
|
4
4
|
editor: Editor;
|
5
|
-
|
5
|
+
onError?: (errorString: string) => void;
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
7
7
|
export default TiptapToolBar;
|
@@ -17,9 +17,13 @@ export declare const colors: {
|
|
17
17
|
color: string;
|
18
18
|
code: string;
|
19
19
|
}[];
|
20
|
-
export declare const
|
20
|
+
export declare const MAX_IMAGE_SIZE: number;
|
21
|
+
export declare const ERR_MSG_MAP: {
|
22
|
+
IMAGE_SIZE: string;
|
23
|
+
};
|
24
|
+
export declare const useEditorToolbar: ({ editor, onError, }: {
|
21
25
|
editor: Editor;
|
22
|
-
|
26
|
+
onError?: (errorString: string) => void;
|
23
27
|
}) => {
|
24
28
|
toolbar: (IEditorToolElement | null)[];
|
25
29
|
bottomToolbar: (IEditorToolElement | null)[];
|
@@ -68,7 +72,7 @@ export declare const TextFormatingPopup: ({ editor, setToolVisibility, }: {
|
|
68
72
|
editor: Editor;
|
69
73
|
setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
|
70
74
|
}) => import("react/jsx-runtime").JSX.Element;
|
71
|
-
export declare const TextColorPicker: ({ editor
|
75
|
+
export declare const TextColorPicker: ({ editor }: {
|
72
76
|
editor: Editor;
|
73
77
|
}) => import("react/jsx-runtime").JSX.Element;
|
74
78
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
2
2
|
|
3
3
|
export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
|
4
|
-
declare const SlashCommand: (
|
4
|
+
declare const SlashCommand: (onError?: (errorString: string) => void) => Extension<any, any>;
|
5
5
|
export default SlashCommand;
|
@@ -23,13 +23,13 @@ export interface DdocProps {
|
|
23
23
|
editor: JSONContent;
|
24
24
|
}) => JSX.Element;
|
25
25
|
onChange?: (changes: Data['editorJSONData']) => void;
|
26
|
-
handleImageUploadToIpfs: (file: File) => Promise<string>;
|
27
26
|
onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
|
28
27
|
onTextSelection?: (data: IEditorSelectionData) => void;
|
29
28
|
onCommentInteraction?: (data: IEditorSelectionData) => void;
|
30
29
|
handleCommentButtonClick?: (e: Editor) => void;
|
31
30
|
showCommentButton?: boolean;
|
32
31
|
disableBottomToolbar?: boolean;
|
32
|
+
onError?: (error: string) => void;
|
33
33
|
}
|
34
34
|
export interface IEditorSelectionData {
|
35
35
|
from: number;
|
@@ -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,
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, onTextSelection, ensResolutionUrl, onError, }: Partial<DdocProps>) => {
|
5
5
|
editor: import('@tiptap/react').Editor | null;
|
6
6
|
ref: import('react').RefObject<HTMLDivElement>;
|
7
7
|
connect: (username: string | null | undefined, isEns?: boolean) => () => void;
|
@@ -3,5 +3,5 @@ import { DecorationSet, EditorView } from '@tiptap/pm/view';
|
|
3
3
|
|
4
4
|
declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
|
5
5
|
export default UploadImagesPlugin;
|
6
|
-
export declare function startImageUpload(file: File, view: EditorView, pos: number
|
6
|
+
export declare function startImageUpload(file: File, view: EditorView, pos: number): void;
|
7
7
|
export declare const uploadFn: (image: File) => Promise<string>;
|