@fileverse-dev/ddoc 1.2.2 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +21 -22
- package/package.json +1 -1
package/README.md
CHANGED
@@ -28,16 +28,16 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
|
|
28
28
|
|
29
29
|
## Properties
|
30
30
|
|
31
|
-
| Property
|
32
|
-
|
33
|
-
| `isPreviewMode`
|
34
|
-
| `
|
35
|
-
| `
|
36
|
-
| `
|
37
|
-
| `
|
38
|
-
| `
|
39
|
-
| `
|
40
|
-
| `
|
31
|
+
| Property | Type | Description |
|
32
|
+
| ---------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
33
|
+
| `isPreviewMode` | `boolean` | Indicates whether the page is in preview mode or not. |
|
34
|
+
| `data` (optional) | `Data` | Optional property holding data related to the page. |
|
35
|
+
| `enableCollaboration` (optional) | `boolean` | Optional property to enable collaboration |
|
36
|
+
| `collaborationId` (optional) | `string` | When using enableCollaboration, you need to provide collaborationId, it can be uuid of doc |
|
37
|
+
| `toggleCollaboration` (optional) | `(flag: boolean) => void` | Function to toggle collaboration mode with a boolean flag |
|
38
|
+
| `onAutoSave` (optional) | `(flag:boolean) => void` | Function which expose the current editor state every 10 seconds |
|
39
|
+
| `renderToolRightSection` (optional) | `({editor, pluginMetaData}) => JSX.Element` | Function that render the right section of the toolbar. it calls the function with the editor instance and the pluginMedata |
|
40
|
+
| `username` (required when using collaboration) | `boolean` | Takes a username which can be used by collaboration cursor |
|
41
41
|
|
42
42
|
## Data Interface
|
43
43
|
|
@@ -45,10 +45,10 @@ The `Data` interface defines the structure of the data object that can be passed
|
|
45
45
|
|
46
46
|
### Properties
|
47
47
|
|
48
|
-
| Property
|
49
|
-
|
50
|
-
| `metaData`
|
51
|
-
| `editorJSONData`
|
48
|
+
| Property | Type | Description |
|
49
|
+
| ---------------- | ---------------- | ------------------------------------------ |
|
50
|
+
| `metaData` | `PluginMetaData` | Contains metadata related to the plugin. |
|
51
|
+
| `editorJSONData` | `JSONContent` | Contains JSON data for the editor content. |
|
52
52
|
|
53
53
|
## PluginMetaData Interface
|
54
54
|
|
@@ -56,9 +56,9 @@ The `PluginMetaData` interface defines the structure of the metadata related to
|
|
56
56
|
|
57
57
|
### Properties
|
58
58
|
|
59
|
-
| Property
|
60
|
-
|
61
|
-
| `plugin`
|
59
|
+
| Property | Type | Description |
|
60
|
+
| -------- | -------- | -------------------------------------------- |
|
61
|
+
| `plugin` | `Plugin` | Contains information about the plugin title. |
|
62
62
|
|
63
63
|
## Plugin Interface
|
64
64
|
|
@@ -66,14 +66,13 @@ The `Plugin` interface defines the structure of the plugin information.
|
|
66
66
|
|
67
67
|
### Properties
|
68
68
|
|
69
|
-
| Property
|
70
|
-
|
71
|
-
| `title`
|
72
|
-
|
69
|
+
| Property | Type | Description |
|
70
|
+
| -------- | ---------------- | ------------------------------------ |
|
71
|
+
| `title` | `string \| null` | Title of the plugin (can be `null`). |
|
73
72
|
|
74
73
|
### Steps to run this example locally
|
75
74
|
|
76
75
|
- `npm i`
|
77
76
|
- `npm run dev`
|
78
77
|
|
79
|
-
It will open up a vite server, that will have the Ddoc Editor
|
78
|
+
It will open up a vite server, that will have the Ddoc Editor
|