Skip to content

Commit 7ab85d8

Browse files
committed
test shared model
1 parent b9b516f commit 7ab85d8

File tree

7 files changed

+481
-391
lines changed

7 files changed

+481
-391
lines changed

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
"build:lib": "rimraf lib/drawio && mkdir -p lib/drawio && cp -R src/drawio lib && tsc",
3434
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
3535
"clean": "jlpm run clean:lib",
36-
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
36+
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension && jlpm run clean:node",
3737
"clean:labextension": "rimraf jupyterlab-drawio/labextension",
38+
"clean:node": "rimraf node_modules yarn.lock",
3839
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
3940
"eslint": "eslint . --ext .ts,.tsx --fix",
4041
"eslint:check": "eslint . --ext .ts,.tsx",
@@ -45,27 +46,28 @@
4546
"watch:src": "tsc -w"
4647
},
4748
"dependencies": {
48-
"@jupyterlab/application": "^3.1.0-alpha.7",
49-
"@jupyterlab/apputils": "^3.1.0-alpha.7",
50-
"@jupyterlab/coreutils": "^5.1.0-alpha.7",
51-
"@jupyterlab/docregistry": "^3.1.0-alpha.7",
52-
"@jupyterlab/filebrowser": "^3.1.0-alpha.7",
53-
"@jupyterlab/launcher": "^3.1.0-alpha.7",
54-
"@jupyterlab/mainmenu": "^3.1.0-alpha.7",
55-
"@jupyterlab/observables": "^4.1.0-alpha.7",
56-
"@jupyterlab/services": "~6.1.0-alpha.7",
57-
"@jupyterlab/shared-models": "^3.1.0-alpha.7",
58-
"@jupyterlab/ui-components": "^3.1.0-alpha.7",
49+
"@jupyterlab/application": "^3.1.0-alpha.8",
50+
"@jupyterlab/apputils": "^3.1.0-alpha.8",
51+
"@jupyterlab/coreutils": "^5.1.0-alpha.8",
52+
"@jupyterlab/docregistry": "^3.1.0-alpha.8",
53+
"@jupyterlab/filebrowser": "^3.1.0-alpha.8",
54+
"@jupyterlab/launcher": "^3.1.0-alpha.8",
55+
"@jupyterlab/mainmenu": "^3.1.0-alpha.8",
56+
"@jupyterlab/observables": "^4.1.0-alpha.8",
57+
"@jupyterlab/services": "~6.1.0-alpha.8",
58+
"@jupyterlab/shared-models": "^3.1.0-alpha.8",
59+
"@jupyterlab/ui-components": "^3.1.0-alpha.8",
5960
"@lumino/commands": "^1.12.0",
6061
"@lumino/coreutils": "^1.5.3",
6162
"@lumino/signaling": "^1.4.3",
6263
"@lumino/widgets": "^1.19.0",
64+
"fast-xml-parser": "^3.19.0",
6365
"react": "^17.0.1",
6466
"react-dom": "^17.0.1",
6567
"yjs": "^13.5.3"
6668
},
6769
"devDependencies": {
68-
"@jupyterlab/builder": "^3.1.0-alpha.7",
70+
"@jupyterlab/builder": "^3.1.0-alpha.8",
6971
"@typescript-eslint/eslint-plugin": "^2.27.0",
7072
"@typescript-eslint/parser": "^2.27.0",
7173
"eslint": "^7.5.0",

src/factory.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class DrawIOWidgetFactory extends ABCWidgetFactory<
3333
return new DrawIODocumentWidget({
3434
context,
3535
commands: this._commands,
36-
content: new DrawIOWidget(context.model)
36+
content: new DrawIOWidget(context)
3737
});
3838
}
3939

@@ -48,14 +48,11 @@ export namespace DrawIOWidgetFactory {
4848
}
4949

5050
export class DrawIODocumentModelFactory
51-
implements DocumentRegistry.IModelFactory<DrawIODocumentModel> {
52-
53-
constructor() {}
54-
55-
/**
51+
implements DocumentRegistry.IModelFactory<DrawIODocumentModel> {
52+
/**
5653
* The name of the model.
5754
*/
58-
get name(): string {
55+
get name(): string {
5956
return 'dio';
6057
}
6158

@@ -73,24 +70,27 @@ export class DrawIODocumentModelFactory
7370
return 'text';
7471
}
7572

76-
/**
73+
/**
7774
* Get whether the model factory has been disposed.
7875
*/
79-
get isDisposed(): boolean {
76+
get isDisposed(): boolean {
8077
return this._disposed;
8178
}
8279

83-
dispose(): void {
84-
this._disposed = true;
85-
}
80+
dispose(): void {
81+
this._disposed = true;
82+
}
8683

87-
preferredLanguage(path: string): string {
88-
return '';
89-
}
84+
preferredLanguage(path: string): string {
85+
return '';
86+
}
9087

91-
createNew(languagePreference?: string, modelDB?: IModelDB): DrawIODocumentModel {
92-
return new DrawIODocumentModel(languagePreference, modelDB);
93-
}
88+
createNew(
89+
languagePreference?: string,
90+
modelDB?: IModelDB
91+
): DrawIODocumentModel {
92+
return new DrawIODocumentModel(languagePreference, modelDB);
93+
}
9494

95-
private _disposed = false;
96-
}
95+
private _disposed = false;
96+
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function activate(
111111
tracker.add(widget);
112112
});
113113
app.docRegistry.addWidgetFactory(widgetFactory);
114-
114+
115115
const modelFactory = new DrawIODocumentModelFactory();
116116
app.docRegistry.addModelFactory(modelFactory);
117117

0 commit comments

Comments
 (0)