Problem
The constructor of YDocument is empty since the internal YJS doc is created by the class. It would be useful if users can provide an existing ydoc to the YDocument constructor.
Proposed Solution
Update the YDocument constructor signature to allow overriding the ydoc property.
Additional context
- This would help
ypywidgets project to create frontend widgets.