mirror of
https://github.com/cudr/slate-collaborative.git
synced 2026-03-02 03:40:18 +00:00
fix: garbage cursors on client
This commit is contained in:
@@ -7,15 +7,18 @@ export const createTextJSON = (text: string = ''): TextJSON => ({
|
||||
text
|
||||
})
|
||||
|
||||
export const createParagraphJSON = (text: string = ''): NodeJSON => ({
|
||||
export const createBlockJSON = (
|
||||
type: string = 'paragraph',
|
||||
text: string = ''
|
||||
): NodeJSON => ({
|
||||
object: 'block',
|
||||
type: 'paragraph',
|
||||
type,
|
||||
nodes: [createTextJSON(text)]
|
||||
})
|
||||
|
||||
export const createValueJSON = (): ValueJSON => ({
|
||||
document: {
|
||||
nodes: [createParagraphJSON()]
|
||||
nodes: [createBlockJSON()]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user