@fileverse-dev/ddoc 1.5.1 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +19 -13
- package/dist/index.es.js +6372 -6240
- package/dist/index.umd.js +95 -90
- package/dist/packages/ddoc/types.d.ts +11 -0
- package/dist/packages/ddoc/use-ddoc-editor.d.ts +1 -1
- package/package.json +1 -2
- package/dist/packages/ddoc/utils/buildUCANToken.d.ts +0 -2
package/README.md
CHANGED
@@ -28,19 +28,25 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
|
|
28
28
|
|
29
29
|
## Properties
|
30
30
|
|
31
|
-
| Property
|
32
|
-
|
|
33
|
-
| `isPreviewMode`
|
34
|
-
| `handleImageUploadToIpfs`
|
35
|
-
| `data` (optional)
|
36
|
-
| `
|
37
|
-
| `
|
38
|
-
|
39
|
-
| `
|
40
|
-
| `
|
41
|
-
| `
|
42
|
-
| `
|
43
|
-
|
31
|
+
| Property | Type | Description |
|
32
|
+
| -------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
33
|
+
| `isPreviewMode` | `boolean` | Indicates whether the page is in preview mode or not. |
|
34
|
+
| `handleImageUploadToIpfs` | `(file: File) => Promise<string>` | Required function to upload ddoc editor's image on IPFS |
|
35
|
+
| `data` (optional) | `Data` | Optional property holding data related to the page. |
|
36
|
+
| `handleCommentButtonClick` (optional) | `(editor: Editor) => void` | Optional function that get triggered with the editor once the comment button is clicked |
|
37
|
+
| `handleCommentButtonOutsideClick` (optional) | `(editor: Editor | null) => void` | Optional function that get triggered with the editor once outside the comment button is clicked |
|
38
|
+
|
39
|
+
| `enableCollaboration` (optional) | `boolean` | Optional property to enable collaboration |
|
40
|
+
| `onCommentInteraction` (optional) | `(commentInfo: IEditSelectionData) => void` | Optional function that get's called whenever there is a mouse-over and click interaction on a comment |
|
41
|
+
| `collaborationId` (optional) | `string` | When using enableCollaboration, you need to provide collaborationId, it can be uuid of doc |
|
42
|
+
| `onAutoSave` (optional) | `(flag:boolean) => void` | Function which expose the current editor state every 10 seconds |
|
43
|
+
`showCommentButton` (optional) | `boolean` | Optional property to show the comment button
|
44
|
+
| `onTextSelection` (optional) | `(data: IEditorSelectionData) => void` | Function called when a text is selected on the editor |
|
45
|
+
| `renderToolRightSection` (optional) | `({editor}) => JSX.Element` | Function that render the right section of the toolbar. it calls the function with the editor instance |
|
46
|
+
| `renderToolLeftSection` (optional) | `({editor}) => JSX.Element` | Accept a react component |
|
47
|
+
| `username` (required when using collaboration) | `boolean` | Takes a username which can be used by collaboration cursor |
|
48
|
+
| `walletAddress` (optional) | `string ` | Takes a wallet address |
|
49
|
+
| `ref` (optional) | `any` | Gets editor instance |
|
44
50
|
|
45
51
|
## Data Interface
|
46
52
|
|