@fileverse-dev/ddoc 2.1.1 → 2.1.2-patch-2

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.
package/README.md CHANGED
@@ -45,13 +45,13 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
45
45
  | `secureImageUploadUrl` (optional) | `string` | Api Url for secure image upload |
46
46
  | `initialContent` (optional) | `JSONContent` | Initial content of the editor |
47
47
  | `onChange` (optional) | `(changes: JSONContent) => void` | Optional function that gets triggered with the latest content of the editor on every change in the editor |
48
- | `onCollaboratorChange` (optional) | `(collaborators?: IDocCollabUsers[] ) => void` | Optional function that gets triggered when a user join or leave the doc during collaboration |
49
- | `onError` (optional) | `(errorString: string) => void` | Function to call on error |
50
- | `setCharacterCount` (optional) | `React.Dispatch<SetStateAction<number>>` | Optional. React Set State function to update Character Count |
51
- | `setWordCount` (optional) | `React.Dispatch<SetStateAction<number>>` | Optional. React Set State function to update Word Count |
52
- | `scrollPosition`(optional) | `number` | User cursor position to scroll to on intitalising the content of the editor
53
- | `enableIndexeddbSync` (optional) | `boolean` | Indicates when to use yjs-indexeddb provider
54
- | `ddocId` (optional) | `string` | custom ID for the document (this has to be provided to enable yjs-indexeddb provider) |
48
+ | `onCollaboratorChange` (optional) | `(collaborators?: IDocCollabUsers[] ) => void` | Optional function that gets triggered when a user join or leave the doc during collaboration |
49
+ | `onError` (optional) | `(errorString: string) => void` | Function to call on error |
50
+ | `setCharacterCount` (optional) | `React.Dispatch<SetStateAction<number>>` | Optional. React Set State function to update Character Count |
51
+ | `setWordCount` (optional) | `React.Dispatch<SetStateAction<number>>` | Optional. React Set State function to update Word Count |
52
+ | `scrollPosition`(optional) | `number` | User cursor position to scroll to on intitalising the content of the editor |
53
+ | `enableIndexeddbSync` (optional) | `boolean` | Indicates when to use yjs-indexeddb provider |
54
+ | `ddocId` (optional) | `string` | custom ID for the document (this has to be provided to enable yjs-indexeddb provider) |
55
55
  | `editorCanvasClassNames`(optional) | `string` | Optional. Extra className for editor-canvas |
56
56
  | `selectedTags` (optional) | `TagType[]` | Array of currently selected tags |
57
57
  | `setSelectedTags` (optional) | `React.Dispatch<SetStateAction<TagType[]>>` | Function to update selected tags |
@@ -68,6 +68,9 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
68
68
  | `onMarkdownImport` (optional) | `() => void` | Callback function for markdown import |
69
69
  | `sharedSlidesLink` (optional) | `string` | Link for shared slides in presentation mode |
70
70
  | `documentName` (optional) | `string` | Name of the document |
71
+ | `onSlidesShare` (optional) | `() => void` | Callback |
72
+ | `proExtensions` (optional) | `Record<string, Extension \| any>` | Object mapping extension names to their configurations. **Note:** Requires proper `.npmrc` setup and installing the corresponding extension packages. Example: `{ ai: AiExtension, slides: SlidesExtension }` |
73
+ | |
71
74
 
72
75
  ## Data Interface
73
76
 
@@ -87,3 +90,17 @@ The `Data` interface defines the structure of the data object
87
90
  It will open up a vite server, that will have the Ddoc Editor
88
91
 
89
92
  ⚠️ This repository is currently undergoing rapid development, with frequent updates and changes. We recommend not to use in production yet
93
+
94
+ ## Pro Extensions Setup
95
+
96
+ 1. Configure your `.npmrc` with the appropriate registry and authentication token:
97
+
98
+ 2. Install the corresponding extension packages:
99
+
100
+ 3. Use the extension in your DdocEditor component:
101
+
102
+ ```tsx
103
+ proExtensions={{
104
+ TableOfContents
105
+ }}
106
+ ```