@fileverse-dev/ddoc 1.3.1 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
- declare const DdocEditor: ({ isPreviewMode, data, enableCollaboration, collaborationId, username, onAutoSave, renderToolRightSection, renderToolLeftSection, ensProviderUrl, }: DdocProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const DdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, username, onAutoSave, renderToolRightSection, renderToolLeftSection, ensProviderUrl, onChange }: DdocProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default DdocEditor;
@@ -1,6 +1,5 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
2
  import { EditorProps } from '@tiptap/pm/view';
3
- import { Editor } from '@tiptap/react';
4
3
 
5
4
  export declare const DdocEditorProps: EditorProps;
6
5
  export interface DdocProps {
@@ -8,16 +7,17 @@ export interface DdocProps {
8
7
  collaborationId?: string;
9
8
  isPreviewMode: boolean;
10
9
  toggleCollaboration?: (flag: boolean) => void;
11
- data?: Data | null;
10
+ initialContent?: JSONContent | null;
12
11
  onAutoSave?: (data: Data) => void;
13
12
  ensProviderUrl?: string;
14
13
  username?: string | null;
15
14
  renderToolLeftSection?: ({ editor }: {
16
- editor: Editor;
15
+ editor: JSONContent;
17
16
  }) => JSX.Element;
18
17
  renderToolRightSection?: ({ editor }: {
19
- editor: Editor;
18
+ editor: JSONContent;
20
19
  }) => JSX.Element;
20
+ onChange?: (changes: Data['editorJSONData']) => void;
21
21
  }
22
22
  export interface Data {
23
23
  editorJSONData: JSONContent;
@@ -1,6 +1,6 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
- export declare const useDdocEditor: ({ isPreviewMode, data, enableCollaboration, collaborationId, ensProviderUrl, username, onAutoSave, }: DdocProps) => {
3
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, ensProviderUrl, username, onAutoSave, onChange }: DdocProps) => {
4
4
  editor: import('@tiptap/react').Editor | null;
5
5
  focusEditor: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
6
6
  ref: import('react').RefObject<HTMLDivElement>;
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.1",
5
+ "version": "1.3.3",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {