@fileverse-dev/ddoc 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;
@@ -7,7 +7,7 @@ export interface DdocProps {
7
7
  collaborationId?: string;
8
8
  isPreviewMode: boolean;
9
9
  toggleCollaboration?: (flag: boolean) => void;
10
- data?: Data | null;
10
+ initialContent?: JSONContent | null;
11
11
  onAutoSave?: (data: Data) => void;
12
12
  ensProviderUrl?: string;
13
13
  username?: string | null;
@@ -17,6 +17,7 @@ export interface DdocProps {
17
17
  renderToolRightSection?: ({ editor }: {
18
18
  editor: JSONContent;
19
19
  }) => JSX.Element;
20
+ onChange?: (changes: Data['editorJSONData']) => void;
20
21
  }
21
22
  export interface Data {
22
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.2",
5
+ "version": "1.3.4",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {