Skip to content

Commit

Permalink
Update jupyter-collaboration v3.0.0-beta.8 (#472)
Browse files Browse the repository at this point in the history
* Update jupyter-collaboration v3.0.0-beta.8

* Add @jupyter/collaboration:^3.0.0-beta.8 resolution

* Fix build

---------

Co-authored-by: Duc Trung Le <[email protected]>
  • Loading branch information
davidbrochart and trungleduc authored Oct 15, 2024
1 parent 8ad1651 commit b6d8a84
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 357 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"build:app": "lerna run --ignore @jupytercad/jupytercad-lab build"
},
"resolutions": {
"@jupyter/collaboration": "^3.0.0-beta.8",
"@jupyterlab/apputils": "^4.0.0",
"@lumino/coreutils": "^2.0.0",
"@jupyterlab/notebook": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
},
"dependencies": {
"@deathbeds/jupyterlab-rjsf": "^1.1.0",
"@jupyter/docprovider": "^2.0.0",
"@jupyter/ydoc": "^1.0.0",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupyter/ydoc": "^3.0.0-a9",
"@jupytercad/occ-worker": "^3.0.0-alpha.3",
"@jupytercad/schema": "^3.0.0-alpha.3",
"@jupyterlab/application": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@jupyter/ydoc": "^1.0.0",
"@jupyter/ydoc": "^3.0.0-a9",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/docregistry": "^4.0.0",
Expand Down
38 changes: 37 additions & 1 deletion packages/schema/src/doc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MapChange, YDocument } from '@jupyter/ydoc';
import { JSONExt, JSONObject } from '@lumino/coreutils';
import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils';
import { ISignal, Signal } from '@lumino/signaling';
import * as Y from 'yjs';

Expand Down Expand Up @@ -65,6 +65,42 @@ export class JupyterCadDoc
return this._optionsChanged;
}

getSource(): JSONValue | string {
const objects = this._objects.toJSON();
const options = this._options.toJSON();
const metadata = this._metadata.toJSON();
const outputs = this._outputs.toJSON();

return { objects, options, metadata, outputs };
}

setSource(value: JSONValue): void {
if (!value) {
return;
}
this.transact(() => {
const objects = value['objects'] ?? [];
objects.forEach(obj => {
this._objects.push([new Y.Map(Object.entries(obj))]);
});

const options = value['options'] ?? {};
Object.entries(options).forEach(([key, val]) =>
this._options.set(key, val)
);

const metadata = value['metadata'] ?? {};
Object.entries(metadata).forEach(([key, val]) =>
this._metadata.set(key, val as string)
);

const outputs = value['outputs'] ?? {};
Object.entries(outputs).forEach(([key, val]) =>
this._outputs.set(key, val as IPostResult)
);
});
}

get metadataChanged(): ISignal<IJupyterCadDoc, MapChange> {
return this._metadataChanged;
}
Expand Down
6 changes: 3 additions & 3 deletions python/jupytercad_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"dependencies": {
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.9.3",
"@jupyter/collaboration": "^3.0.0-beta.6",
"@jupyter/docprovider": "^2.0.0",
"@jupyter/ydoc": "^0.3.4 || ^1.0.2",
"@jupyter/collaboration": "^3.0.0-beta.8",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupyter/ydoc": "^3.0.0-a9",
"@jupytercad/base": "^3.0.0-alpha.3",
"@jupytercad/schema": "^3.0.0-alpha.3",
"@jupyterlab/application": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions python/jupytercad_core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production"
},
"dependencies": {
"@jupyter/docprovider": "^2.0.0",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupytercad/base": "^3.0.0-alpha.3",
"@jupytercad/occ-worker": "^3.0.0-alpha.3",
"@jupytercad/schema": "^3.0.0-alpha.3",
Expand Down Expand Up @@ -115,7 +115,7 @@
"singleton": true,
"bundled": true
},
"@jupyter/docprovider": {
"@jupyter/collaborative-drive": {
"singleton": true,
"bundled": false
}
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
dependencies = [
"jupyter_server>=2.0.6,<3",
"jupyter_ydoc>=2,<3",
"jupyter-collaboration>=3.0.0b6,<4",
"jupyter-collaboration>=3.0.0b8,<4",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_core/src/jcadplugin/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ICollaborativeDrive,
SharedDocumentFactory
} from '@jupyter/docprovider';
} from '@jupyter/collaborative-drive';
import { logoIcon } from '@jupytercad/base';
import {
IAnnotationModel,
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_core/src/stepplugin/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ICollaborativeDrive,
SharedDocumentFactory
} from '@jupyter/docprovider';
} from '@jupyter/collaborative-drive';
import {
IJCadWorkerRegistry,
IJCadWorkerRegistryToken,
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_core/src/stlplugin/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ICollaborativeDrive,
SharedDocumentFactory
} from '@jupyter/docprovider';
} from '@jupyter/collaborative-drive';
import {
IJCadWorkerRegistry,
IJCadWorkerRegistryToken,
Expand Down
4 changes: 2 additions & 2 deletions python/jupytercad_lab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter/docprovider": "^2.0.0",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupytercad/base": "^3.0.0-alpha.3",
"@jupytercad/jupytercad-core": "^3.0.0-alpha.3",
"@jupytercad/schema": "^3.0.0-alpha.3",
Expand Down Expand Up @@ -113,7 +113,7 @@
"singleton": true,
"bundled": false
},
"@jupyter/docprovider": {
"@jupyter/collaborative-drive": {
"singleton": true,
"bundled": false
},
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_lab/src/notebookrenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ICollaborativeDrive } from '@jupyter/docprovider';
import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
import { JupyterCadPanel } from '@jupytercad/base';
import {
IJCadWorkerRegistry,
Expand Down
Loading

0 comments on commit b6d8a84

Please sign in to comment.