I have specific requirement in my Notes application, where user creates a note, they should get some default data already in the editor.
Lets say,
const initialData = "Welcome to notes application...."
const docWithInitialData = new Y.Doc(default=initialData)
(and if I use docWithInitialData, it will have initial data
without any client making any transactions. Later on they
can wipe the initial data, its up to them)
above is example code of what I am expecting. I might be not entirely sure how Y.js docs work but this is what I need.
Is there any way, by which I can generate similar outcome ?
Also I want to intercept the cursors of connected users and give suggestions using AI (something similar to what Github Copilot does in vs code)
How can I intercept docs and do Y Doc manipulation when required after client starts typing??