Skip to content

Commit 06cf304

Browse files
committed
docs: enhance documentation for document modes and user roles; clarify functionality in method descriptions
1 parent 902968c commit 06cf304

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs/src/components/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const superdoc = new SuperDoc({
4949
| `selector` | `string\|Element` | CSS selector or DOM element where SuperDoc will be rendered || - |
5050
| `documents` | `array` | Array of document objects to load || - |
5151
| `superdocId` | `string` | Unique identifier for this SuperDoc instance | | Random UUID |
52-
| `documentMode` | `string` | Initial mode: 'viewing' or 'editing' | | 'viewing' |
52+
| `documentMode` | `string` | Document mode: 'viewing', 'suggesting', or 'editing' | | 'editing' |
53+
| `role` | `string` | User role: 'editor', 'suggester', or 'viewer' | | 'editor' |
5354
| `user` | `object` | Current user information | | {} |
5455
| `toolbar` | `string\|Element` | DOM element to render toolbar | | Internal toolbar |
5556
| `modules` | `object` | Additional modules configuration | | {} |
@@ -91,7 +92,7 @@ modules: {
9192
| Method | Parameters | Return | Description |
9293
| :------------------------------------ | :-------------------------------- | :-------------- | :---------------------------------------------------------- |
9394
| `export()` | - | `Promise<Void>` | Exports the SuperDocs and triggers download |
94-
| `setDocumentMode(mode)` | mode: 'viewing' or 'editing' | - | Switches between view and edit modes |
95+
| `setDocumentMode(mode)` | mode: 'viewing', 'suggesting', or 'editing' | - | Switches between view, suggest, and edit modes |
9596
| `on(event, callback)` | event: string, callback: function | - | Registers an event listener |
9697
| `off(event, callback)` | event: string, callback: function | - | Removes an event listener |
9798
| `getHTML()` | - | - | Get a list of HTML strings (one per DOCX document) |

docs/src/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const config = {
8787
// Required: A DOM element ID to render superdoc into
8888
selector: '#superdoc',
8989

90-
// Optional: Initial document mode: viewing, editing. Defaults to viewing
90+
// Optional: Initial document mode: viewing, suggesting,editing. Defaults to editing
9191
documentMode: 'editing',
9292

9393
// Optional: User role: editor, suggester, viewer. Defaults to editor
@@ -220,8 +220,9 @@ superdoc.off('ready', myReadyHandler);
220220
// Export the document as DOCX
221221
await superdoc.export();
222222

223-
// Switch between viewing and editing modes
223+
// Switch between viewing, suggesting, and editing modes
224224
superdoc.setDocumentMode('viewing');
225+
superdoc.setDocumentMode('suggesting');
225226
superdoc.setDocumentMode('editing');
226227

227228
// Get a list of HTML strings (one per DOCX editor)

0 commit comments

Comments
 (0)