Skip to content

Commit baabc0f

Browse files
committed
Updated dependencies
1 parent 3724b9e commit baabc0f

File tree

4 files changed

+2458
-829
lines changed

4 files changed

+2458
-829
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@
4646
"watch:src": "tsc -w"
4747
},
4848
"dependencies": {
49-
"@jupyterlab/application": "^3.1.0-alpha.13",
50-
"@jupyterlab/apputils": "^3.1.0-alpha.13",
51-
"@jupyterlab/coreutils": "^5.1.0-alpha.13",
52-
"@jupyterlab/docregistry": "^3.1.0-alpha.13",
53-
"@jupyterlab/filebrowser": "^3.1.0-alpha.13",
54-
"@jupyterlab/launcher": "^3.1.0-alpha.13",
55-
"@jupyterlab/mainmenu": "^3.1.0-alpha.13",
56-
"@jupyterlab/observables": "^4.1.0-alpha.13",
57-
"@jupyterlab/services": "^6.1.0-alpha.13",
58-
"@jupyterlab/shared-models": "^3.1.0-alpha.13",
59-
"@jupyterlab/ui-components": "^3.1.0-alpha.13",
49+
"@jupyterlab/application": "^3.1.6",
50+
"@jupyterlab/apputils": "^3.1.6",
51+
"@jupyterlab/coreutils": "^5.1.6",
52+
"@jupyterlab/docregistry": "^3.1.6",
53+
"@jupyterlab/filebrowser": "^3.1.6",
54+
"@jupyterlab/launcher": "^3.1.6",
55+
"@jupyterlab/mainmenu": "^3.1.6",
56+
"@jupyterlab/observables": "^4.1.6",
57+
"@jupyterlab/services": "^6.1.6",
58+
"@jupyterlab/shared-models": "^3.1.6",
59+
"@jupyterlab/ui-components": "^3.1.6",
6060
"@lumino/commands": "^1.12.0",
6161
"@lumino/coreutils": "^1.5.3",
6262
"@lumino/signaling": "^1.4.3",

src/model.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,19 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel {
174174
sender: YDrawIO,
175175
changes: IDrawIOChange
176176
): void => {
177-
if (changes.stateChange && changes.stateChange.has('dirty')) {
178-
const dirty = changes.stateChange.get('dirty');
179-
this._stateChanged.emit({
180-
name: 'dirty',
181-
oldValue: dirty.oldValue,
182-
newValue: dirty.newValue
177+
console.debug("State changed:");
178+
if (changes.stateChange) {
179+
changes.stateChange.forEach( state => {
180+
console.debug("State changed:", state);
181+
if (state.name === 'dirty') {
182+
this._stateChanged.emit({
183+
name: 'dirty',
184+
oldValue: state.oldValue,
185+
newValue: state.newValue
186+
});
187+
}
183188
});
189+
184190
} else {
185191
this.dirty = true;
186192
this._sharedModelChanged.emit(changes);
@@ -196,13 +202,11 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel {
196202

197203
export type IDrawIOChange = {
198204
contextChange?: MapChange;
199-
stateChange?: Map<
200-
string,
201-
{
202-
oldValue: any;
203-
newValue: any;
204-
}
205-
>;
205+
stateChange?: Array<{
206+
name: string;
207+
oldValue: any;
208+
newValue: any;
209+
}>;
206210
attrChange?: MapChange;
207211
cellChange?: boolean;
208212
};
@@ -366,17 +370,12 @@ export class YDrawIO extends YDocument<IDrawIOChange> {
366370
* Handle a change to the _mxGraphModel.
367371
*/
368372
private _stateObserver = (event: Y.YMapEvent<any>): void => {
369-
const stateChange = new Map<
370-
string,
371-
{
372-
oldValue: any;
373-
newValue: any;
374-
}
375-
>();
373+
const stateChange = new Array();
376374

377375
if (event.keysChanged.has('dirty')) {
378376
const change = event.changes.keys.get('dirty');
379-
stateChange.set('dirty', {
377+
stateChange.push({
378+
name: 'dirty',
380379
oldValue: change?.oldValue === true ? true : false,
381380
newValue: this._state.get('dirty')
382381
});

src/widget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ export class DrawIODocumentWidget extends DocumentWidget<
8585
this._addToolbarItems();
8686
this.context.model.dirty = false;
8787

88-
this.context.pathChanged.connect(this._onTitleChanged, this);
88+
this.context.pathChanged.connect(this._titleChanged, this);
8989
});
9090
}
9191

9292
/**
9393
* Dispose of the resources held by the widget.
9494
*/
9595
dispose(): void {
96-
this.context.pathChanged.disconnect(this._onTitleChanged, this);
96+
this.context.pathChanged.disconnect(this._titleChanged, this);
9797
this.content.dispose();
9898
super.dispose();
9999
}
@@ -156,7 +156,7 @@ export class DrawIODocumentWidget extends DocumentWidget<
156156
/**
157157
* Handle a change to the title.
158158
*/
159-
private _onTitleChanged(): void {
159+
private _titleChanged(): void {
160160
this.title.label = PathExt.basename(this.context.localPath);
161161
}
162162

0 commit comments

Comments
 (0)