@fileverse-dev/ddoc 1.3.7 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +3634 -3571
- package/dist/index.umd.js +53 -53
- package/dist/packages/ddoc/types.d.ts +6 -0
- package/dist/packages/ddoc/use-ddoc-editor.d.ts +3 -1
- package/package.json +1 -1
@@ -2,6 +2,11 @@ import { JSONContent } from '@tiptap/core';
|
|
2
2
|
import { EditorProps } from '@tiptap/pm/view';
|
3
3
|
|
4
4
|
export declare const DdocEditorProps: EditorProps;
|
5
|
+
export interface IDocCollabUsers {
|
6
|
+
name: string;
|
7
|
+
isEns: string;
|
8
|
+
color: string;
|
9
|
+
}
|
5
10
|
export interface DdocProps {
|
6
11
|
enableCollaboration?: boolean;
|
7
12
|
collaborationId?: string;
|
@@ -17,6 +22,7 @@ export interface DdocProps {
|
|
17
22
|
editor: JSONContent;
|
18
23
|
}) => JSX.Element;
|
19
24
|
onChange?: (changes: Data['editorJSONData']) => void;
|
25
|
+
onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
|
20
26
|
}
|
21
27
|
export interface Data {
|
22
28
|
editorJSONData: JSONContent;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { DdocProps } from './types';
|
2
2
|
|
3
|
-
|
3
|
+
import * as Y from 'yjs';
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, ensProviderUrl, username, onAutoSave, onChange, onCollaboratorChange }: DdocProps) => {
|
4
5
|
editor: import('@tiptap/react').Editor | null;
|
5
6
|
focusEditor: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
6
7
|
ref: import('react').RefObject<HTMLDivElement>;
|
7
8
|
loading: boolean;
|
8
9
|
connect: (username: string, isEns?: boolean) => () => void;
|
10
|
+
ydoc: Y.Doc;
|
9
11
|
};
|