TSK-1146: Support initial content text for collaborator doc (#2960)

Signed-off-by: Anton Brechka <anton.brechka@ezthera.com>
This commit is contained in:
Anton Brechka 2023-04-12 23:47:13 +07:00 committed by GitHub
parent ad9ffff2e5
commit 12404949d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,7 @@
export let field: string | undefined = undefined
export let autoOverflow = false
export let initialContent: string | undefined = undefined
const ydoc = (getContext(CollaborationIds.Doc) as Y.Doc | undefined) ?? new Y.Doc()
const contextProvider = getContext(CollaborationIds.Provider) as WebsocketProvider | undefined
@ -265,6 +266,10 @@
updateFormattingState()
}
})
if (initialContent) {
insertText(initialContent)
}
})
})