Base cell constructor
Don't use the constructor directly - prefer using YNotebook.insertCell
The ysource
is needed because ymodel.get('source')
will
not return the real source if the model is not yet attached to
a document. Requesting it explicitly allows to introspect a non-empty
source before the cell is attached to the document.
Cell map
Cell source
{ notebook?: The notebook the cell is attached to }
Optional
ymetadata: YMap<any>Cell metadata
Protected
_metadataProtected
_notebookThe notebook that this cell belongs to.
Readonly
ymodelCell attachments
Cell attachments
String identifying the type of cell.
The changed signal.
Cell id
Whether the model has been disposed or not.
Whether the cell is standalone or not.
If the cell is standalone. It cannot be inserted into a YNotebook because the Yjs model is already attached to an anonymous Y.Doc instance.
Signal triggered when the cell metadata changes.
Cell input content.
Text
The cell undo manager.
Gets the cell attachments.
The cell attachments.
Protected
getExtract changes from YJS events
Cell changes
YJS events
Returns all or a single metadata associated with the cell.
cell's metadata.
Returns a metadata associated with the cell.
Cell's metadata.
Metadata key to get
Sets the cell attachments
Sets all or a single cell metadata.
If only one argument is provided, it will override all cell metadata. Otherwise a single key will be set to a new value.
Cell's metadata key or cell's metadata.
Sets a cell metadata.
Cell's metadata key.
Metadata value
Serialize the model to JSON.
Perform a transaction. While the function f is called, all changes to the shared document are bundled into a single event.
Transaction to execute
Whether to track the change in the action history or not (default true
)
Static
createCreate a new YMarkdownCell that works standalone. It cannot be inserted into a YNotebook because the Yjs model is already attached to an anonymous Y.Doc instance.
Optional
id: stringGenerated using TypeDoc
Shareable markdown cell.