mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00
2.6 KiB
2.6 KiB
CollaborationAnnotation
⚠️ Experiment
:::warning Don’t use this in production This extension still has major issues (for example https://github.com/yjs/y-prosemirror/issues/44). We’re looking for funding to finish the extension. If you think you can help with that, reach out to humans@tiptap.dev! :::
Annotations can be used to add additional information to the content, for example comments. They live on a different level than the actual editor content.
Installation
# with npm
npm install @tiptap/extension-collaboration-annotation
# with Yarn
yarn add @tiptap/extension-collaboration-annotation
This extension requires the Collaboration
extension.
Settings
Option | Type | Default | Description |
---|---|---|---|
document | Object |
null |
An initialized Y.js document. |
field | String |
'default' |
Name of a Y.js map, can be changed to sync multiple fields with one Y.js document. |
map | Object |
null |
A raw Y.js map, can be used instead of document and field . |
Commands
Command | Parameters | Description |
---|---|---|
addAnnotation | data | Adds an annotation to the current selection, takes a string or an object. |
updateAnnotation | id, data | Update the data that’s associated with an annotation. |
deleteAnnotation | id | Remove an annotation. |