@fileverse-dev/ddoc 1.3.8 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, ensProviderUrl, username, onAutoSave, onChange }: DdocProps) => {
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
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "1.3.8",
5
+ "version": "1.3.9",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {