Skip to content

Commit b6d8a84

Browse files
Update jupyter-collaboration v3.0.0-beta.8 (#472)
* 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]>
1 parent 8ad1651 commit b6d8a84

File tree

13 files changed

+109
-357
lines changed

13 files changed

+109
-357
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"build:app": "lerna run --ignore @jupytercad/jupytercad-lab build"
5353
},
5454
"resolutions": {
55+
"@jupyter/collaboration": "^3.0.0-beta.8",
5556
"@jupyterlab/apputils": "^4.0.0",
5657
"@lumino/coreutils": "^2.0.0",
5758
"@jupyterlab/notebook": "^4.0.0",

packages/base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
},
3737
"dependencies": {
3838
"@deathbeds/jupyterlab-rjsf": "^1.1.0",
39-
"@jupyter/docprovider": "^2.0.0",
40-
"@jupyter/ydoc": "^1.0.0",
39+
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
40+
"@jupyter/ydoc": "^3.0.0-a9",
4141
"@jupytercad/occ-worker": "^3.0.0-alpha.3",
4242
"@jupytercad/schema": "^3.0.0-alpha.3",
4343
"@jupyterlab/application": "^4.0.0",

packages/schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"dependencies": {
4040
"@apidevtools/json-schema-ref-parser": "^9.0.9",
41-
"@jupyter/ydoc": "^1.0.0",
41+
"@jupyter/ydoc": "^3.0.0-a9",
4242
"@jupyterlab/apputils": "^4.0.0",
4343
"@jupyterlab/coreutils": "^6.0.0",
4444
"@jupyterlab/docregistry": "^4.0.0",

packages/schema/src/doc.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MapChange, YDocument } from '@jupyter/ydoc';
2-
import { JSONExt, JSONObject } from '@lumino/coreutils';
2+
import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils';
33
import { ISignal, Signal } from '@lumino/signaling';
44
import * as Y from 'yjs';
55

@@ -65,6 +65,42 @@ export class JupyterCadDoc
6565
return this._optionsChanged;
6666
}
6767

68+
getSource(): JSONValue | string {
69+
const objects = this._objects.toJSON();
70+
const options = this._options.toJSON();
71+
const metadata = this._metadata.toJSON();
72+
const outputs = this._outputs.toJSON();
73+
74+
return { objects, options, metadata, outputs };
75+
}
76+
77+
setSource(value: JSONValue): void {
78+
if (!value) {
79+
return;
80+
}
81+
this.transact(() => {
82+
const objects = value['objects'] ?? [];
83+
objects.forEach(obj => {
84+
this._objects.push([new Y.Map(Object.entries(obj))]);
85+
});
86+
87+
const options = value['options'] ?? {};
88+
Object.entries(options).forEach(([key, val]) =>
89+
this._options.set(key, val)
90+
);
91+
92+
const metadata = value['metadata'] ?? {};
93+
Object.entries(metadata).forEach(([key, val]) =>
94+
this._metadata.set(key, val as string)
95+
);
96+
97+
const outputs = value['outputs'] ?? {};
98+
Object.entries(outputs).forEach(([key, val]) =>
99+
this._outputs.set(key, val as IPostResult)
100+
);
101+
});
102+
}
103+
68104
get metadataChanged(): ISignal<IJupyterCadDoc, MapChange> {
69105
return this._metadataChanged;
70106
}

python/jupytercad_app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"dependencies": {
5252
"@codemirror/state": "^6.2.0",
5353
"@codemirror/view": "^6.9.3",
54-
"@jupyter/collaboration": "^3.0.0-beta.6",
55-
"@jupyter/docprovider": "^2.0.0",
56-
"@jupyter/ydoc": "^0.3.4 || ^1.0.2",
54+
"@jupyter/collaboration": "^3.0.0-beta.8",
55+
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
56+
"@jupyter/ydoc": "^3.0.0-a9",
5757
"@jupytercad/base": "^3.0.0-alpha.3",
5858
"@jupytercad/schema": "^3.0.0-alpha.3",
5959
"@jupyterlab/application": "^4.0.0",

python/jupytercad_core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production"
5454
},
5555
"dependencies": {
56-
"@jupyter/docprovider": "^2.0.0",
56+
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
5757
"@jupytercad/base": "^3.0.0-alpha.3",
5858
"@jupytercad/occ-worker": "^3.0.0-alpha.3",
5959
"@jupytercad/schema": "^3.0.0-alpha.3",
@@ -115,7 +115,7 @@
115115
"singleton": true,
116116
"bundled": true
117117
},
118-
"@jupyter/docprovider": {
118+
"@jupyter/collaborative-drive": {
119119
"singleton": true,
120120
"bundled": false
121121
}

python/jupytercad_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
dependencies = [
2222
"jupyter_server>=2.0.6,<3",
2323
"jupyter_ydoc>=2,<3",
24-
"jupyter-collaboration>=3.0.0b6,<4",
24+
"jupyter-collaboration>=3.0.0b8,<4",
2525
]
2626
dynamic = ["version", "description", "authors", "urls", "keywords"]
2727
license = {file = "LICENSE"}

python/jupytercad_core/src/jcadplugin/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
ICollaborativeDrive,
33
SharedDocumentFactory
4-
} from '@jupyter/docprovider';
4+
} from '@jupyter/collaborative-drive';
55
import { logoIcon } from '@jupytercad/base';
66
import {
77
IAnnotationModel,

python/jupytercad_core/src/stepplugin/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
ICollaborativeDrive,
33
SharedDocumentFactory
4-
} from '@jupyter/docprovider';
4+
} from '@jupyter/collaborative-drive';
55
import {
66
IJCadWorkerRegistry,
77
IJCadWorkerRegistryToken,

python/jupytercad_core/src/stlplugin/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
ICollaborativeDrive,
33
SharedDocumentFactory
4-
} from '@jupyter/docprovider';
4+
} from '@jupyter/collaborative-drive';
55
import {
66
IJCadWorkerRegistry,
77
IJCadWorkerRegistryToken,

0 commit comments

Comments
 (0)