Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jupyter-collaboration v3.0.0-beta.8 #472

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix build
trungleduc committed Oct 15, 2024

Verified

This commit was signed with the committer’s verified signature.
radoering Randy Döring
commit 2771518086d8a570aeff26286033956c7a7e02ba
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
"dependencies": {
"@deathbeds/jupyterlab-rjsf": "^1.1.0",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupyter/ydoc": "^1.0.0",
"@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",
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
@@ -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",
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';

@@ -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;
}
2 changes: 1 addition & 1 deletion python/jupytercad_app/package.json
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@
"@codemirror/view": "^6.9.3",
"@jupyter/collaboration": "^3.0.0-beta.8",
"@jupyter/collaborative-drive": "^3.0.0-beta.8",
"@jupyter/ydoc": "^0.3.4 || ^1.0.2",
"@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",
Loading
Loading