Dependency process: When linking @jupyter/ydoc to jupyterlab in dev mode, JupyterLab complains about ydoc missing this dependency. I added it in devDependencies so we only install it in dev mode.
I changed the argument of the static method YNotebook.create to be able to initialize the notebook in a generic way. For example, JupyterLab needs to initialize the model with nbformat, nbformat_minor, and metadata but other frontends might need other attributes.
Fixed the imports
Fixed the callbacks for metadata changed in YCell and YNotebook. Both oldValue and newValue might be undefined.
Regarding the tests, I moved them to different files. The only changes are that I added YNotebook/factory as you requested. In addition, I added a few tests for the YFile.
Necessary to fix tests in JupyterLab.
Code changes:
@jupyter/ydoc
to jupyterlab in dev mode, JupyterLab complains about ydoc missing this dependency. I added it in devDependencies so we only install it in dev mode.YNotebook.create
to be able to initialize the notebook in a generic way. For example, JupyterLab needs to initialize the model withnbformat
,nbformat_minor
, andmetadata
but other frontends might need other attributes.oldValue
andnewValue
might beundefined
.