@fileverse-dev/ddoc 2.1.3-patch-26 → 2.1.3-patch-27
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 +73 -43
- package/dist/index.es.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -28,49 +28,47 @@ The `DdocProps` interface is a TypeScript interface that defines the properties
|
|
28
28
|
|
29
29
|
## Properties
|
30
30
|
|
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
|
-
| `onCommentInteraction` (optional) | `(commentInfo: IEditSelectionData) => void` | Optional function that get's called whenever there is a mouse-over and click interaction on a comment
|
37
|
-
| `collaborationId` (optional) | `string` | When using enableCollaboration, you need to provide collaborationId, it can be uuid of doc
|
38
|
-
| `onTextSelection` (optional) | `(data: IEditorSelectionData) => void` | Function called when a text is selected on the editor
|
39
|
-
| `renderToolRightSection` (optional) | `({editor}) => JSX.Element` | Function that render the right section of the toolbar. it calls the function with the editor instance
|
40
|
-
| `renderToolLeftSection` (optional) | `({editor}) => JSX.Element` | Accept a react component
|
41
|
-
| `username` (required when using collaboration) | `boolean` | Takes a username which can be used by collaboration cursor
|
42
|
-
| `walletAddress` (optional) | `string ` | Takes a wallet address
|
43
|
-
| `ref` (optional) | `any` | Gets editor instance
|
44
|
-
| `ensResolutionUrl` (optional) | `string` | Api Url for resolving ens names
|
45
|
-
| `secureImageUploadUrl` (optional) | `string` | Api Url for secure image upload
|
46
|
-
| `initialContent` (optional) | `JSONContent` | Initial content of the editor
|
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)
|
55
|
-
| `editorCanvasClassNames`(optional) | `string` | Optional. Extra className for editor-canvas
|
56
|
-
| `selectedTags` (optional) | `TagType[]` | Array of currently selected tags
|
57
|
-
| `setSelectedTags` (optional) | `React.Dispatch<SetStateAction<TagType[]>>` | Function to update selected tags
|
58
|
-
| `zoomLevel` (required) | `string` | Current zoom level of the editor
|
59
|
-
| `setZoomLevel` (required) | `React.Dispatch<SetStateAction<string>>` | Function to update zoom level
|
60
|
-
| `isNavbarVisible` (required) | `boolean` | Controls visibility of the navbar
|
61
|
-
| `setIsNavbarVisible` (required) | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle navbar visibility
|
62
|
-
| `renderNavbar` (optional) | `({ editor: JSONContent }) => JSX.Element` | Function to render custom navbar content
|
63
|
-
| `disableBottomToolbar` (optional) | `boolean` | When true, disables the bottom toolbar
|
64
|
-
| `isPresentationMode` (optional) | `boolean` | Controls if editor is in presentation mode
|
65
|
-
| `setIsPresentationMode` (optional) | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle presentation mode
|
66
|
-
| `onInlineComment` (optional) | `() => void` | Callback function when inline comment is added
|
67
|
-
| `onMarkdownExport` (optional) | `() => void` | Callback function for markdown export
|
68
|
-
| `onMarkdownImport` (optional) | `() => void` | Callback function for markdown import
|
69
|
-
| `sharedSlidesLink` (optional) | `string` | Link for shared slides in presentation mode
|
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
|
-
| |
|
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
|
+
| `onCommentInteraction` (optional) | `(commentInfo: IEditSelectionData) => void` | Optional function that get's called whenever there is a mouse-over and click interaction on a comment |
|
37
|
+
| `collaborationId` (optional) | `string` | When using enableCollaboration, you need to provide collaborationId, it can be uuid of doc |
|
38
|
+
| `onTextSelection` (optional) | `(data: IEditorSelectionData) => void` | Function called when a text is selected on the editor |
|
39
|
+
| `renderToolRightSection` (optional) | `({editor}) => JSX.Element` | Function that render the right section of the toolbar. it calls the function with the editor instance |
|
40
|
+
| `renderToolLeftSection` (optional) | `({editor}) => JSX.Element` | Accept a react component |
|
41
|
+
| `username` (required when using collaboration) | `boolean` | Takes a username which can be used by collaboration cursor |
|
42
|
+
| `walletAddress` (optional) | `string ` | Takes a wallet address |
|
43
|
+
| `ref` (optional) | `any` | Gets editor instance |
|
44
|
+
| `ensResolutionUrl` (optional) | `string` | Api Url for resolving ens names |
|
45
|
+
| `secureImageUploadUrl` (optional) | `string` | Api Url for secure image upload |
|
46
|
+
| `initialContent` (optional) | `JSONContent` | Initial content of the editor |
|
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) |
|
55
|
+
| `editorCanvasClassNames`(optional) | `string` | Optional. Extra className for editor-canvas |
|
56
|
+
| `selectedTags` (optional) | `TagType[]` | Array of currently selected tags |
|
57
|
+
| `setSelectedTags` (optional) | `React.Dispatch<SetStateAction<TagType[]>>` | Function to update selected tags |
|
58
|
+
| `zoomLevel` (required) | `string` | Current zoom level of the editor |
|
59
|
+
| `setZoomLevel` (required) | `React.Dispatch<SetStateAction<string>>` | Function to update zoom level |
|
60
|
+
| `isNavbarVisible` (required) | `boolean` | Controls visibility of the navbar |
|
61
|
+
| `setIsNavbarVisible` (required) | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle navbar visibility |
|
62
|
+
| `renderNavbar` (optional) | `({ editor: JSONContent }) => JSX.Element` | Function to render custom navbar content |
|
63
|
+
| `disableBottomToolbar` (optional) | `boolean` | When true, disables the bottom toolbar |
|
64
|
+
| `isPresentationMode` (optional) | `boolean` | Controls if editor is in presentation mode |
|
65
|
+
| `setIsPresentationMode` (optional) | `React.Dispatch<SetStateAction<boolean>>` | Function to toggle presentation mode |
|
66
|
+
| `onInlineComment` (optional) | `() => void` | Callback function when inline comment is added |
|
67
|
+
| `onMarkdownExport` (optional) | `() => void` | Callback function for markdown export |
|
68
|
+
| `onMarkdownImport` (optional) | `() => void` | Callback function for markdown import |
|
69
|
+
| `sharedSlidesLink` (optional) | `string` | Link for shared slides in presentation mode |
|
70
|
+
| `documentName` (optional) | `string` | Name of the document |
|
71
|
+
| `onSlidesShare` (optional) | `() => void` | Callback |
|
74
72
|
|
75
73
|
## Data Interface
|
76
74
|
|
@@ -104,3 +102,35 @@ proExtensions={{
|
|
104
102
|
TableOfContents
|
105
103
|
}}
|
106
104
|
```
|
105
|
+
|
106
|
+
### Comment-related Props
|
107
|
+
|
108
|
+
| Prop | Type | Description |
|
109
|
+
| ---------------------- | --------------------------------------- | -------------------------------------------------------- |
|
110
|
+
| `initialComments` | `IComment[]` | Array of initial comments to populate the editor |
|
111
|
+
| `onCommentReply` | `(id: string, reply: IComment) => void` | Callback function when a reply is added to a comment |
|
112
|
+
| `onNewComment` | `(comment: IComment) => void` | Callback function when a new comment is created |
|
113
|
+
| `setInitialComments` | `(comments: IComment[]) => void` | Function to update the initial comments array |
|
114
|
+
| `onResolveComment` | `(commentId: string) => void` | Callback function when a comment is marked as resolved |
|
115
|
+
| `onUnresolveComment` | `(commentId: string) => void` | Callback function when a comment is marked as unresolved |
|
116
|
+
| `onDeleteComment` | `(commentId: string) => void` | Callback function when a comment is deleted |
|
117
|
+
| `commentDrawerOpen` | `boolean` | Controls the visibility of the comment drawer |
|
118
|
+
| `setCommentDrawerOpen` | `(isOpen: boolean) => void` | Function to toggle the comment drawer |
|
119
|
+
|
120
|
+
### Table of Contents Props
|
121
|
+
|
122
|
+
| Prop | Type | Description |
|
123
|
+
| --------------- | ------------------------------------------------------- | --------------------------------------------------- |
|
124
|
+
| `showTOC` | `boolean` | Controls the visibility of the table of contents |
|
125
|
+
| `setShowTOC` | `(show: boolean) => void` | Function to toggle the table of contents visibility |
|
126
|
+
| `proExtensions` | `{ TableOfContents: any, getHierarchicalIndexes: any }` | Extensions for table of contents functionality |
|
127
|
+
|
128
|
+
### Authentication Props
|
129
|
+
|
130
|
+
| Prop | Type | Description |
|
131
|
+
| -------------------- | ------------------------------------- | --------------------------------------------------- |
|
132
|
+
| `isConnected` | `boolean` | Indicates if the user is connected |
|
133
|
+
| `connectViaWallet` | `() => Promise<void>` | Function to handle wallet-based authentication |
|
134
|
+
| `isLoading` | `boolean` | Indicates if authentication is in progress |
|
135
|
+
| `connectViaUsername` | `(username: string) => Promise<void>` | Function to handle username-based authentication |
|
136
|
+
| `isDDocOwner` | `boolean` | Indicates if the current user is the document owner |
|
package/dist/index.es.js
CHANGED
@@ -147170,9 +147170,9 @@ const n_ = ({
|
|
147170
147170
|
{
|
147171
147171
|
id: "editor-canvas",
|
147172
147172
|
className: jt(
|
147173
|
-
"h-[100vh] bg-[#f8f9fa] w-full
|
147173
|
+
"h-[100vh] bg-[#f8f9fa] w-full custom-scrollbar",
|
147174
147174
|
{
|
147175
|
-
"overflow-x-hidden
|
147175
|
+
"overflow-x-hidden": V !== "2",
|
147176
147176
|
"overflow-x-auto scroll-container": V === "2"
|
147177
147177
|
},
|
147178
147178
|
q ? "bg-[#ffffff]" : "bg-[#f8f9fa]",
|