Skip to content

Commit 4478962

Browse files
committed
Add CKEditor comments docs
1 parent f47c203 commit 4478962

4 files changed

Lines changed: 451 additions & 1 deletion

File tree

api-reference/sdk/api/api-methods.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,38 @@ Resolves Velt comment annotations back to TinyMCE DOM ranges and renders stable
595595
- [Full Documentation →](/async-collaboration/comments/setup/tinymce#rendercomments)
596596

597597

598+
### CKEditor
599+
600+
<a id="ckeditor-veltcommentsplugin" />
601+
602+
#### VeltCommentsPlugin
603+
The CKEditor 5 plugin class that powers Velt comments. Add it to the editor's `plugins` list and configure it with `config.veltComments`.
604+
- Config: [VeltCommentsPluginConfig](/api-reference/sdk/models/data-models#ckeditor-veltcommentspluginconfig)
605+
- Returns: CKEditor plugin class
606+
- React Hook: `n/a`
607+
- [Full Documentation →](/async-collaboration/comments/setup/ckeditor#veltcommentsplugin)
608+
609+
<a id="ckeditor-addcomment" />
610+
611+
#### addComment()
612+
Creates a comment annotation for the currently selected text in CKEditor.
613+
- Signature: `async (request:` [AddCommentRequest](/api-reference/sdk/models/data-models#ckeditor-addcommentrequest)`) => Promise<void>`
614+
- Params: `request:` [AddCommentRequest](/api-reference/sdk/models/data-models#ckeditor-addcommentrequest)
615+
- Returns: `Promise<void>`
616+
- React Hook: `n/a`
617+
- [Full Documentation →](/async-collaboration/comments/setup/ckeditor#addcomment)
618+
619+
<a id="ckeditor-rendercomments" />
620+
621+
#### renderComments()
622+
Resolves and highlights Velt comment annotations in CKEditor.
623+
- Signature: `(request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#ckeditor-rendercommentsrequest)`) => void`
624+
- Params: `request:` [RenderCommentsRequest](/api-reference/sdk/models/data-models#ckeditor-rendercommentsrequest)
625+
- Returns: `void`
626+
- React Hook: `n/a`
627+
- [Full Documentation →](/async-collaboration/comments/setup/ckeditor#rendercomments)
628+
629+
598630
### Monaco
599631

600632
#### registerVeltComments()

api-reference/sdk/models/data-models.mdx

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ Configuration for text formatting toolbar options in comment composers.
653653
| -------------------- | --------------------- | -------- | -------------------------------------------- |
654654
| `editor` | `Editor` | Yes | Slate editor instance. |
655655
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
656-
| `commentAnnotations` | `CommentAnnotation[]` | No | Annotations to render/highlight. |
656+
| `commentAnnotations` | [`CommentAnnotation`](#commentannotation)`[]` | No | Annotations to render/highlight. |
657657

658658
For the CommentAnnotation model referenced above, see [CommentAnnotation](#commentannotation).
659659

@@ -1176,6 +1176,78 @@ Nested in `CommentAnnotationContext`.
11761176
| `occurrence` | `number` | Yes | The 1-based occurrence index of the selected text in the document. |
11771177
| `editorId` | `string` | No | The editor ID associated with this comment. |
11781178

1179+
### CKEditor
1180+
1181+
<a id="ckeditor-addcommentrequest" />
1182+
1183+
#### AddCommentRequest
1184+
1185+
---
1186+
1187+
Request interface for the CKEditor `addComment()` function.
1188+
1189+
| Property | Type | Required | Description |
1190+
| ---------- | -------------------------- | -------- | ---------------------------------------------------- |
1191+
| `editor` | `Editor` | Yes | CKEditor 5 editor instance. |
1192+
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
1193+
| `context` | [`CommentAnnotationContext`](#ckeditor-commentannotationcontext) | No | Optional custom context to attach to the annotation. |
1194+
1195+
<a id="ckeditor-rendercommentsrequest" />
1196+
1197+
#### RenderCommentsRequest
1198+
1199+
---
1200+
1201+
Request interface for the CKEditor `renderComments()` function.
1202+
1203+
| Property | Type | Required | Description |
1204+
| -------------------- | --------------------- | -------- | -------------------------------------------- |
1205+
| `editor` | `Editor` | Yes | CKEditor 5 editor instance. |
1206+
| `editorId` | `string` | No | Optional editor ID used to scope operations. |
1207+
| `commentAnnotations` | `CommentAnnotation[]` | No | Annotations to render/highlight. |
1208+
1209+
For the CommentAnnotation model referenced above, see [CommentAnnotation](#commentannotation).
1210+
1211+
<a id="ckeditor-veltcommentspluginconfig" />
1212+
1213+
#### VeltCommentsPluginConfig
1214+
1215+
---
1216+
1217+
Configuration options for `config.veltComments` in the CKEditor editor config.
1218+
1219+
| Property | Type | Required | Description |
1220+
| ------------------ | --------- | -------- | ------------------------------------------------------------------------ |
1221+
| `editorId` | `string` | No | Unique identifier for this editor instance. |
1222+
| `persistVeltMarks` | `boolean` | No | Reserved for API parity; highlights are always rendered as an overlay. |
1223+
1224+
<a id="ckeditor-commentannotationcontext" />
1225+
1226+
#### CommentAnnotationContext
1227+
1228+
---
1229+
1230+
Context object merged into the Velt comment annotation by `addComment()`.
1231+
1232+
| Property | Type | Required | Description |
1233+
| ------------------ | ------------------------------------------------ | -------- | ---------------------------------------------------------- |
1234+
| `textEditorConfig` | [`TextEditorConfig`](#ckeditor-texteditorconfig) | No | Text editor configuration auto-generated by the library. |
1235+
| `[key: string]` | `unknown` | No | Additional custom properties to attach to the annotation. |
1236+
1237+
<a id="ckeditor-texteditorconfig" />
1238+
1239+
#### TextEditorConfig
1240+
1241+
---
1242+
1243+
Logical text anchor stored in `annotation.context.textEditorConfig`.
1244+
1245+
| Property | Type | Required | Description |
1246+
| ------------ | -------- | -------- | ------------------------------------------------- |
1247+
| `text` | `string` | Yes | The selected text content. |
1248+
| `occurrence` | `number` | Yes | The occurrence index of the text in the document. |
1249+
| `editorId` | `string` | No | The editor ID associated with this comment. |
1250+
11791251
### Monaco
11801252

11811253
#### AddCommentRequest

0 commit comments

Comments
 (0)