From 7380454ac49efcdf802b7d3096135bd9f13435aa Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Tue, 11 May 2021 13:08:17 +0200 Subject: [PATCH 01/11] Added a new DocumentModel --- package.json | 25 +- src/editor.ts | 285 -------- src/factory.ts | 68 +- src/index.ts | 14 +- src/model.ts | 105 +++ src/panel.ts | 471 +++++++++++++ src/widget.ts | 630 ++++++----------- yarn.lock | 1756 +++++++++++++++++++++++++++++------------------- 8 files changed, 1952 insertions(+), 1402 deletions(-) delete mode 100644 src/editor.ts create mode 100644 src/model.ts create mode 100644 src/panel.ts diff --git a/package.json b/package.json index 20cea799..dfd2f8eb 100644 --- a/package.json +++ b/package.json @@ -45,19 +45,26 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.6", - "@jupyterlab/apputils": "^3.0.5", - "@jupyterlab/coreutils": "^5.0.3", - "@jupyterlab/docregistry": "^3.0.6", - "@jupyterlab/filebrowser": "^3.0.6", - "@jupyterlab/launcher": "^3.0.5", - "@jupyterlab/mainmenu": "^3.0.5", + "@jupyterlab/application": "^3.1.0-alpha.7", + "@jupyterlab/apputils": "^3.1.0-alpha.7", + "@jupyterlab/coreutils": "^5.1.0-alpha.7", + "@jupyterlab/docregistry": "^3.1.0-alpha.7", + "@jupyterlab/filebrowser": "^3.1.0-alpha.7", + "@jupyterlab/launcher": "^3.1.0-alpha.7", + "@jupyterlab/mainmenu": "^3.1.0-alpha.7", + "@jupyterlab/observables": "^4.1.0-alpha.7", + "@jupyterlab/services": "~6.1.0-alpha.7", + "@jupyterlab/shared-models": "^3.1.0-alpha.7", + "@jupyterlab/ui-components": "^3.1.0-alpha.7", + "@lumino/commands": "^1.12.0", "@lumino/coreutils": "^1.5.3", - "@lumino/widgets": "^1.18.0" + "@lumino/signaling": "^1.4.3", + "@lumino/widgets": "^1.19.0", + "react": "^17.0.1", + "react-dom": "^17.0.1" }, "devDependencies": { "@jupyterlab/builder": "^3.0.5", - "@lumino/messaging": "^1.4.3", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/src/editor.ts b/src/editor.ts deleted file mode 100644 index 08e33944..00000000 --- a/src/editor.ts +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2018 Wolf Vollprecht -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { DocumentRegistry, DocumentWidget } from '@jupyterlab/docregistry'; - -import { MainMenu, JupyterLabMenu } from '@jupyterlab/mainmenu'; - -import { IChangedArgs, PathExt } from '@jupyterlab/coreutils'; - -import { undoIcon, redoIcon } from '@jupyterlab/ui-components'; - -import { CommandRegistry } from '@lumino/commands'; - -import { Signal } from '@lumino/signaling'; - -import { DrawIOWidget } from './widget'; - -import { DrawIOToolbarButton } from './toolbar'; - -import { - formatPanelIcon, - plusIcon, - zoominIcon, - zoomoutIcon, - deleteIcon, - toFrontIcon, - toBackIcon, - fillColorIcon, - strokeColorIcon, - shadowIcon -} from './icons'; - -const DIRTY_CLASS = 'jp-mod-dirty'; - -export class DrawIODocumentWidget extends DocumentWidget { - constructor(options: DrawIODocumentWidget.IOptions) { - super(options); - // Adding the buttons to the widget toolbar - // Modify containers style: line ~92700 - // modulated.js, line: 84246 - // actions: modulated.js line: ~93000 - // actions: modulated.js line: ~111000 - - this._commands = options.commands; - this._menubar = new MainMenu(this._commands); - - this._menubar.clearMenus(); - this.toolbar.addClass('dio-toolbar'); - - //TODO: - // Add toolbar actions to change the default style of arrows and conections. - this._menuView = new JupyterLabMenu({ commands: this._commands }); - this._menuView.menu.title.caption = 'View (Space+Drag to Scroll)'; - this._menuView.menu.title.icon = formatPanelIcon; - this._menubar.addMenu(this._menuView.menu, { rank: 1 }); - - this._menuZoom = new JupyterLabMenu({ commands: this._commands }); - //TODO: Change label to a view percentage - this._menuZoom.menu.title.label = 'Zoom'; - this._menuZoom.menu.title.caption = 'Zoom (Alt+Mousewheel)'; - this._menubar.addMenu(this._menuZoom.menu, { rank: 2 }); - - this._menuInsert = new JupyterLabMenu({ commands: this._commands }); - this._menuInsert.menu.title.caption = 'Insert'; - this._menuInsert.menu.title.icon = plusIcon; - this._menubar.addMenu(this._menuInsert.menu, { rank: 2 }); - - this.context.ready.then(async value => { - await this.content.ready.promise; - - this._onTitleChanged(); - this._addToolbarItems(); - this.content.setContent(this.context.model.toString()); - this._handleDirtyStateNew(); - - this.context.pathChanged.connect(this._onTitleChanged, this); - //this.context.model.contentChanged.connect(this._onContentChanged, this); - this.context.model.stateChanged.connect( - this._onModelStateChangedNew, - this - ); - this.content.graphChanged.connect(this._saveToContext, this); - }); - } - - /** - * Dispose of the resources held by the widget. - */ - dispose(): void { - Signal.clearData(this); - super.dispose(); - } - - /** - * A promise that resolves when the csv viewer is ready. - */ - get ready(): Promise { - return this.content.ready.promise; - } - - public getSVG(): string { - return ''; //this.mx.mxUtils.getXml(this._editor.editor.graph.getSvg()); - } - - public getAction(action: string): any { - return this.content.getAction(action); - } - - public execute(action: string): void { - this.content.getAction(action).funct(); - } - - public toggleCellStyles(flip: string): void { - this.content.toggleCellStyles(flip); - } - - public alignCells(align: string): void { - this.content.alignCells(align); - } - - public distributeCells(horizontal: boolean): void { - this.content.distributeCells(horizontal); - } - - public layoutFlow(direction: string): void { - this.content.layoutFlow(direction); - } - - public horizontalTree(): void { - this.content.horizontalTree(); - } - - public verticalTree(): void { - this.content.verticalTree(); - } - - public radialTree(): void { - this.content.radialTree(); - } - - public organic(): void { - this.content.organic(); - } - - public circle(): void { - this.content.circle(); - } - - /** - * Handle a change to the title. - */ - private _onTitleChanged(): void { - this.title.label = PathExt.basename(this.context.localPath); - } - - /* private _onContentChanged(): void { - this.content.setContent(this.context.model.toString()); - } */ - - private _saveToContext(emiter: DrawIOWidget, content: string): void { - this.context.model.fromString(content); - } - - private _onModelStateChangedNew( - sender: DocumentRegistry.IModel, - args: IChangedArgs - ): void { - if (args.name === 'dirty') { - this._handleDirtyStateNew(); - } - } - - private _handleDirtyStateNew(): void { - if (this.context.model.dirty) { - this.title.className += ` ${DIRTY_CLASS}`; - } else { - this.title.className = this.title.className.replace(DIRTY_CLASS, ''); - } - } - - private _addToolbarItems(): void { - const actions = this.content.getActions(); - - // Menu view - this._menuView.addGroup([ - { command: 'drawio:command/formatPanel' }, - { command: 'drawio:command/outline' }, - { command: 'drawio:command/layers' } - ]); - - // Menu Zoom - this._menuZoom.addGroup([ - { command: 'drawio:command/resetView' }, - { command: 'drawio:command/fitWindow' }, - { command: 'drawio:command/fitPageWidth' }, - { command: 'drawio:command/fitPage' }, - { command: 'drawio:command/fitTwoPages' }, - { command: 'drawio:command/customZoom' } - ]); - - // Menu insert - this._menuInsert.addGroup([ - { command: 'drawio:command/insertLink' }, - { command: 'drawio:command/insertImage' } - ]); - - this.toolbar.addItem('ViewDropdown', this._menubar); - - actions['zoomIn'].icon = zoominIcon; - actions['zoomIn'].tooltip = 'Zoom In (Ctrl+(Numpad)/Alt+Mousewheel)'; - this.toolbar.addItem('zoomIn', new DrawIOToolbarButton(actions['zoomIn'])); - - actions['zoomOut'].icon = zoomoutIcon; - actions['zoomOut'].tooltip = 'Zoom Out (Ctrl-(Numpad)/Alt+Mousewheel)'; - this.toolbar.addItem( - 'zoomOut', - new DrawIOToolbarButton(actions['zoomOut']) - ); - - actions['undo'].icon = undoIcon; - actions['fillColor'].tooltip = 'Undo (Ctrl+Z)'; - this.toolbar.addItem('undo', new DrawIOToolbarButton(actions['undo'])); - - actions['redo'].icon = redoIcon; - actions['redo'].tooltip = 'Redo (Ctrl+Shift+Z)'; - this.toolbar.addItem('redo', new DrawIOToolbarButton(actions['redo'])); - - actions['delete'].icon = deleteIcon; - actions['delete'].tooltip = 'Delete'; - this.toolbar.addItem('delete', new DrawIOToolbarButton(actions['delete'])); - - actions['toFront'].icon = toFrontIcon; - actions['toFront'].tooltip = 'To Front (Ctrl+Shift+F)'; - this.toolbar.addItem( - 'toFront', - new DrawIOToolbarButton(actions['toFront']) - ); - - actions['toBack'].icon = toBackIcon; - actions['toBack'].tooltip = 'To Back (Ctrl+Shift+B)'; - this.toolbar.addItem('toBack', new DrawIOToolbarButton(actions['toBack'])); - - actions['fillColor'].icon = fillColorIcon; - actions['fillColor'].tooltip = 'Fill Color'; - this.toolbar.addItem( - 'fillColor', - new DrawIOToolbarButton(actions['fillColor']) - ); - - actions['strokeColor'].icon = strokeColorIcon; - actions['strokeColor'].tooltip = 'Fill Stroke Color'; - this.toolbar.addItem( - 'strokeColor', - new DrawIOToolbarButton(actions['strokeColor']) - ); - - actions['shadow'].icon = shadowIcon; - actions['shadow'].tooltip = 'Shadow'; - this.toolbar.addItem('shadow', new DrawIOToolbarButton(actions['shadow'])); - } - - private _commands: CommandRegistry; - private _menubar: MainMenu; - private _menuView: JupyterLabMenu; - private _menuZoom: JupyterLabMenu; - private _menuInsert: JupyterLabMenu; -} - -export namespace DrawIODocumentWidget { - export interface IOptions - extends DocumentWidget.IOptions { - commands: CommandRegistry; - } -} diff --git a/src/factory.ts b/src/factory.ts index 8894d527..60f0c87c 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -1,28 +1,34 @@ import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry'; +import { IModelDB } from '@jupyterlab/observables'; + +import { Contents } from '@jupyterlab/services'; + import { CommandRegistry } from '@lumino/commands'; -import { DrawIODocumentWidget } from './editor'; +import { DrawIODocumentWidget } from './widget'; + +import { DrawIODocumentModel } from './model'; -import { DrawIOWidget } from './widget'; +import { DrawIOWidget } from './panel'; /** * A widget factory for drawio. */ -export class DrawIOFactory extends ABCWidgetFactory< +export class DrawIOWidgetFactory extends ABCWidgetFactory< DrawIODocumentWidget, - DocumentRegistry.IModel + DrawIODocumentModel > { /** * Create a new widget given a context. */ - constructor(options: DrawIOFactory.IDrawIOFactoryOptions) { + constructor(options: DrawIOWidgetFactory.IDrawIOFactoryOptions) { super(options); this._commands = options.commands; } protected createNewWidget( - context: DocumentRegistry.Context + context: DocumentRegistry.IContext ): DrawIODocumentWidget { return new DrawIODocumentWidget({ context, @@ -34,9 +40,57 @@ export class DrawIOFactory extends ABCWidgetFactory< private _commands: CommandRegistry; } -export namespace DrawIOFactory { +export namespace DrawIOWidgetFactory { export interface IDrawIOFactoryOptions extends DocumentRegistry.IWidgetFactoryOptions { commands: CommandRegistry; } } + +export class DrawIODocumentModelFactory + implements DocumentRegistry.IModelFactory { + + constructor() {} + + /** + * The name of the model. + */ + get name(): string { + return 'dio'; + } + + /** + * The content type of the file. + */ + get contentType(): Contents.ContentType { + return 'file'; + } + + /** + * The format of the file. + */ + get fileFormat(): Contents.FileFormat { + return 'text'; + } + + /** + * Get whether the model factory has been disposed. + */ + get isDisposed(): boolean { + return this._disposed; + } + + dispose(): void { + this._disposed = true; + } + + preferredLanguage(path: string): string { + return ''; + } + + createNew(languagePreference?: string, modelDB?: IModelDB): DrawIODocumentModel { + return new DrawIODocumentModel(languagePreference, modelDB); + } + + private _disposed = false; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 115f9bdd..90d7ab40 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,9 +46,9 @@ import { shadowIcon } from './icons'; -import { DrawIODocumentWidget } from './editor'; +import { DrawIODocumentWidget } from './widget'; -import { DrawIOFactory } from './factory'; +import { DrawIOWidgetFactory, DrawIODocumentModelFactory } from './factory'; /** * The name of the factory that creates editor widgets. @@ -93,14 +93,15 @@ function activate( name: widget => widget.context.path }); - const factory = new DrawIOFactory({ + const widgetFactory = new DrawIOWidgetFactory({ name: FACTORY, + modelName: 'dio', fileTypes: ['dio', 'drawio'], defaultFor: ['dio', 'drawio'], commands: app.commands }); - factory.widgetCreated.connect((sender, widget) => { + widgetFactory.widgetCreated.connect((sender, widget) => { widget.title.icon = 'jp-MaterialIcon jp-ImageIcon'; // TODO change // Notify the instance tracker if restore data needs to update. @@ -109,7 +110,10 @@ function activate( }); tracker.add(widget); }); - app.docRegistry.addWidgetFactory(factory); + app.docRegistry.addWidgetFactory(widgetFactory); + + const modelFactory = new DrawIODocumentModelFactory(); + app.docRegistry.addModelFactory(modelFactory); // register the filetype app.docRegistry.addFileType({ diff --git a/src/model.ts b/src/model.ts new file mode 100644 index 00000000..9a0ca34c --- /dev/null +++ b/src/model.ts @@ -0,0 +1,105 @@ +// Copyright 2018 Wolf Vollprecht +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { DocumentRegistry } from '@jupyterlab/docregistry'; + +import { ISharedDocument, YFile } from '@jupyterlab/shared-models'; + +import { IChangedArgs } from '@jupyterlab/coreutils'; + +import { IModelDB, ModelDB } from '@jupyterlab/observables'; + +import { PartialJSONValue, ReadonlyPartialJSONValue } from '@lumino/coreutils'; + +import { ISignal, Signal } from '@lumino/signaling'; + + +export class DrawIODocumentModel implements DocumentRegistry.IModel { + + /** + * Construct a new DrawIODocumentModel. + */ + constructor(languagePreference?: string, modelDB?: IModelDB) { + this.modelDB = modelDB || new ModelDB(); + console.debug(this.modelDB); + } + + get dirty(): boolean { + return this._dirty; + } + set dirty(value: boolean) { + this._dirty = value; + } + + get readOnly(): boolean { + return this._readOnly; + } + set readOnly(value: boolean) { + this._readOnly = value; + } + + get isDisposed(): boolean { + return this._isDisposed; + } + + get contentChanged(): ISignal { + return this._contentChanged; + } + + get stateChanged(): ISignal> { + return this._stateChanged; + } + + readonly defaultKernelName: string; + + readonly defaultKernelLanguage: string; + + readonly modelDB: IModelDB; + + readonly sharedModel: ISharedDocument = YFile.create(); + + dispose(): void { + this._isDisposed = true; + } + + toString(): string { + // TODO: Return content from shared model + console.warn("toString(): Not implemented"); + return ''; + } + + fromString(value: string): void { + // TODO: Add content to shared model + console.warn("fromString(): Not implemented"); + } + + toJSON(): PartialJSONValue { + // TODO: Return content from shared model + console.warn("toJSON(): Not implemented"); + return {}; + } + + fromJSON(value: ReadonlyPartialJSONValue): void { + // TODO: Add content to shared model + console.warn("fromJSON(): Not implemented"); + } + + initialize(): void {} + + private _dirty = false; + private _readOnly = false; + private _isDisposed = false; + private _contentChanged = new Signal(this); + private _stateChanged = new Signal>(this); +} diff --git a/src/panel.ts b/src/panel.ts new file mode 100644 index 00000000..203c14bf --- /dev/null +++ b/src/panel.ts @@ -0,0 +1,471 @@ +import { Widget } from '@lumino/widgets'; + +import { Signal, ISignal } from '@lumino/signaling'; + +import { PromiseDelegate } from '@lumino/coreutils'; + +/* + This is a typing-only import. If you use it directly, the mxgraph content + will be included in the main JupyterLab js bundle. +*/ +// @ts-ignore +import * as MX from './drawio/modulated.js'; + +import './drawio/css/common.css'; + +import './drawio/styles/grapheditor.css'; + +import { grapheditorTxt, defaultXml } from './pack'; + +const w = window as any; +const webPath = + 'https://raw.githubusercontent.com/jgraph/mxgraph/master/javascript/examples/grapheditor/www/'; + +w.RESOURCES_BASE = webPath + 'resources/'; +w.STENCIL_PATH = webPath + 'stencils/'; +w.IMAGE_PATH = webPath + 'images/'; +w.STYLE_PATH = webPath + 'styles/'; +w.CSS_PATH = webPath + 'styles/'; +w.OPEN_FORM = webPath + 'open.html'; + +// w.mxBasePath = "http://localhost:8000/src/mxgraph/javascript/src/"; +//w.imageBasePath = 'http://localhost:8000/src/mxgraph/javascript/'; +w.mxLoadStylesheets = false; // disable loading stylesheets +w.mxLoadResources = false; + +/** + * A DrawIO layout. + */ +export class DrawIOWidget extends Widget { + /** + * Construct a `GridStackLayout`. + * + * @param info - The `DashboardView` metadata. + */ + constructor() { + super(); + void Private.ensureMx().then(mx => this._loadDrawIO(mx)); + //this._loadDrawIO(MX); + } + + /** + * Dispose of the resources held by the widget. + */ + dispose(): void { + Signal.clearData(this); + this._editor.destroy(); + super.dispose(); + } + + /** + * A promise that resolves when the csv viewer is ready. + */ + get ready(): PromiseDelegate { + return this._ready; + } + + get graphChanged(): ISignal { + return this._graphChanged; + } + + get mx(): any { + return this._mx; + } + + get editor(): any { + return this._editor; + } + + get graph(): any { + return this._editor.editor.graph; + } + + getAction(action: string): any { + return this._editor.actions.actions[action]; + } + + getActions(): any { + return this._editor.actions.actions; + } + + setContent(newValue: string): void { + if (this._editor === undefined) { + return; + } + + const oldValue = this._mx.mxUtils.getXml(this._editor.editor.getGraphXml()); + + if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { + if (newValue.length) { + const xml = this._mx.mxUtils.parseXml(newValue); + this._editor.editor.setGraphXml(xml.documentElement); + } + } + } + + //Direction + public toggleCellStyles(flip: string): void { + let styleFlip = this._editor.mx.mxConstants.STYLE_FLIPH; + switch (flip) { + case 'flipH': + styleFlip = this._editor.mx.mxConstants.STYLE_FLIPH; + break; + case 'flipV': + styleFlip = this._editor.mx.mxConstants.STYLE_FLIPV; + break; + } + this._editor.graph.toggleCellStyles(styleFlip, false); + } + + //Align + public alignCells(align: string): void { + if (this._editor.graph.isEnabled()) { + let pos = this._editor.mx.mxConstants.ALIGN_CENTER; + switch (align) { + case 'alignCellsLeft': + pos = this._editor.mx.mxConstants.ALIGN_LEFT; + break; + case 'alignCellsCenter': + pos = this._editor.mx.mxConstants.ALIGN_CENTER; + break; + case 'alignCellsRight': + pos = this._editor.mx.mxConstants.ALIGN_RIGHT; + break; + case 'alignCellsTop': + pos = this._editor.mx.mxConstants.ALIGN_TOP; + break; + case 'alignCellsMiddle': + pos = this._editor.mx.mxConstants.ALIGN_MIDDLE; + break; + case 'alignCellsBottom': + pos = this._editor.mx.mxConstants.ALIGN_BOTTOM; + break; + } + this._editor.graph.alignCells(pos); + } + } + + //Distribute + //drawio:command/horizontal + //drawio:command/vertical + public distributeCells(horizontal: boolean): void { + this._editor.graph.distributeCells(horizontal); + } + + //Layout + //drawio:command/horizontalFlow + //drawio:command/verticalFlow + public layoutFlow(direction: string): void { + let directionFlow = this._editor.mx.mxConstants.DIRECTION_WEST; + switch (direction) { + case 'horizontalFlow': + directionFlow = this._editor.mx.mxConstants.DIRECTION_WEST; + break; + case 'verticalFlow': + directionFlow = this._editor.mx.mxConstants.DIRECTION_NORTH; + break; + } + + const mxHierarchicalLayout = this._editor.mx.mxHierarchicalLayout; + const layout = new mxHierarchicalLayout(this._editor.graph, directionFlow); + + this._editor.editor.executeLayout(() => { + const selectionCells = this._editor.graph.getSelectionCells(); + layout.execute( + this._editor.graph.getDefaultParent(), + selectionCells.length === 0 ? null : selectionCells + ); + }, true); + } + + public horizontalTree(): void { + let tmp = this._editor.graph.getSelectionCell(); + let roots = null; + + if ( + tmp === null || + this._editor.graph.getModel().getChildCount(tmp) === 0 + ) { + if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { + roots = this._editor.graph.findTreeRoots( + this._editor.graph.getDefaultParent() + ); + } + } else { + roots = this._editor.graph.findTreeRoots(tmp); + } + + if (roots !== null && roots.length > 0) { + tmp = roots[0]; + } + + if (tmp !== null) { + const mxCompactTreeLayout = this._editor.mx.mxCompactTreeLayout; + const layout = new mxCompactTreeLayout(this._editor.graph, true); + layout.edgeRouting = false; + layout.levelDistance = 30; + + this._promptSpacing( + layout.levelDistance, + this._editor.mx.mxUtils.bind(this, (newValue: any) => { + layout.levelDistance = newValue; + + this._editor.editor.executeLayout(() => { + layout.execute(this._editor.graph.getDefaultParent(), tmp); + }, true); + }) + ); + } + } + + public verticalTree(): void { + let tmp = this._editor.graph.getSelectionCell(); + let roots = null; + + if ( + tmp === null || + this._editor.graph.getModel().getChildCount(tmp) === 0 + ) { + if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { + roots = this._editor.graph.findTreeRoots( + this._editor.graph.getDefaultParent() + ); + } + } else { + roots = this._editor.graph.findTreeRoots(tmp); + } + + if (roots !== null && roots.length > 0) { + tmp = roots[0]; + } + + if (tmp !== null) { + const mxCompactTreeLayout = this._editor.mx.mxCompactTreeLayout; + const layout = new mxCompactTreeLayout(this._editor.graph, false); + layout.edgeRouting = false; + layout.levelDistance = 30; + + this._promptSpacing( + layout.levelDistance, + this._editor.mx.mxUtils.bind(this, (newValue: any) => { + layout.levelDistance = newValue; + + this._editor.editor.executeLayout(() => { + layout.execute(this._editor.graph.getDefaultParent(), tmp); + }, true); + }) + ); + } + } + + public radialTree(): void { + let tmp = this._editor.graph.getSelectionCell(); + let roots = null; + + if ( + tmp === null || + this._editor.graph.getModel().getChildCount(tmp) === 0 + ) { + if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { + roots = this._editor.graph.findTreeRoots( + this._editor.graph.getDefaultParent() + ); + } + } else { + roots = this._editor.graph.findTreeRoots(tmp); + } + + if (roots !== null && roots.length > 0) { + tmp = roots[0]; + } + + if (tmp !== null) { + const mxRadialTreeLayout = this._editor.mx.mxRadialTreeLayout; + const layout = new mxRadialTreeLayout(this._editor.graph, false); + layout.levelDistance = 80; + layout.autoRadius = true; + + this._promptSpacing( + layout.levelDistance, + this._editor.mx.mxUtils.bind(this, (newValue: any) => { + layout.levelDistance = newValue; + + this._editor.editor.executeLayout(() => { + layout.execute(this._editor.graph.getDefaultParent(), tmp); + + if (!this._editor.graph.isSelectionEmpty()) { + tmp = this._editor.graph.getModel().getParent(tmp); + + if (this._editor.graph.getModel().isVertex(tmp)) { + this._editor.graph.updateGroupBounds( + [tmp], + this._editor.graph.gridSize * 2, + true + ); + } + } + }, true); + }) + ); + } + } + + public organic(): void { + const mxFastOrganicLayout = this._editor.mx.mxFastOrganicLayout; + const layout = new mxFastOrganicLayout(this._editor.graph); + + this._promptSpacing( + layout.forceConstant, + this._editor.mx.mxUtils.bind(this, (newValue: any) => { + layout.forceConstant = newValue; + + this._editor.editor.executeLayout(() => { + let tmp = this._editor.graph.getSelectionCell(); + + if ( + tmp === null || + this._editor.graph.getModel().getChildCount(tmp) === 0 + ) { + tmp = this._editor.graph.getDefaultParent(); + } + + layout.execute(tmp); + + if (this._editor.graph.getModel().isVertex(tmp)) { + this._editor.graph.updateGroupBounds( + [tmp], + this._editor.graph.gridSize * 2, + true + ); + } + }, true); + }) + ); + } + + public circle(): void { + const mxCircleLayout = this._editor.mx.mxCircleLayout; + const layout = new mxCircleLayout(this._editor.graph); + + this._editor.editor.executeLayout(() => { + let tmp = this._editor.graph.getSelectionCell(); + + if ( + tmp === null || + this._editor.graph.getModel().getChildCount(tmp) === 0 + ) { + tmp = this._editor.graph.getDefaultParent(); + } + + layout.execute(tmp); + + if (this._editor.graph.getModel().isVertex(tmp)) { + this._editor.graph.updateGroupBounds( + [tmp], + this._editor.graph.gridSize * 2, + true + ); + } + }, true); + } + + private _loadDrawIO(mx: Private.MX): void { + this._mx = mx; + + // Adds required resources (disables loading of fallback properties, this can only + // be used if we know that all keys are defined in the language specific file) + this._mx.mxResources.loadDefaultBundle = false; + + // Fixes possible asynchronous requests + this._mx.mxResources.parse(grapheditorTxt); + const oParser = new DOMParser(); + const oDOM = oParser.parseFromString(defaultXml, 'text/xml'); + const themes: any = new Object(null); + themes[(this._mx.Graph as any).prototype.defaultThemeName] = + oDOM.documentElement; + + // Workaround for TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature + const Editor: any = this._mx.Editor; + this._editor = new this._mx.EditorUi(new Editor(false, themes), this.node); + this._editor.refresh(); + + this._editor.editor.graph.model.addListener( + this._mx.mxEvent.NOTIFY, + (sender: any, evt: any) => { + const changes: any[] = evt.properties.changes; + for (let i = 0; i < changes.length; i++) { + if (changes[i].root) { + return; + } + } + + if (this._editor.editor.graph.isEditing()) { + this._editor.editor.graph.stopEditing(); + } + + const graph = this._editor.editor.getGraphXml(); + const xml = this._mx.mxUtils.getXml(graph); + this._graphChanged.emit(xml); + } + ); + + this._promptSpacing = this._mx.mxUtils.bind( + this, + (defaultValue: any, fn: any) => { + const FilenameDialog = this._mx.FilenameDialog; + const dlg = new FilenameDialog( + this._editor.editor, + defaultValue, + this._mx.mxResources.get('apply'), + (newValue: any) => { + fn(parseFloat(newValue)); + }, + this._mx.mxResources.get('spacing') + ); + this._editor.editor.showDialog(dlg.container, 300, 80, true, true); + dlg.init(); + } + ); + + this._ready.resolve(void 0); + } + + private _editor: any; + private _mx: Private.MX; + private _promptSpacing: any; + private _ready = new PromiseDelegate(); + private _graphChanged = new Signal(this); +} + +/** + * A namespace for module-level concerns like loading mxgraph + */ + +namespace Private { + export type MX = typeof MX; + + let _mx: typeof MX; + let _mxLoading: PromiseDelegate; + + /** + * Asynchronously load the mx bundle, or return it if already available + */ + export async function ensureMx(): Promise { + if (_mx) { + return _mx; + } + + if (_mxLoading) { + return await _mxLoading.promise; + } + + _mxLoading = new PromiseDelegate(); + /*eslint-disable */ + // @ts-ignore + _mx = await import('./drawio/modulated.js'); + /*eslint-enable */ + + _mxLoading.resolve(_mx); + return _mx; + } +} diff --git a/src/widget.ts b/src/widget.ts index 203c14bf..82a80465 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -1,51 +1,99 @@ -import { Widget } from '@lumino/widgets'; - -import { Signal, ISignal } from '@lumino/signaling'; - -import { PromiseDelegate } from '@lumino/coreutils'; - -/* - This is a typing-only import. If you use it directly, the mxgraph content - will be included in the main JupyterLab js bundle. -*/ -// @ts-ignore -import * as MX from './drawio/modulated.js'; - -import './drawio/css/common.css'; - -import './drawio/styles/grapheditor.css'; - -import { grapheditorTxt, defaultXml } from './pack'; - -const w = window as any; -const webPath = - 'https://raw.githubusercontent.com/jgraph/mxgraph/master/javascript/examples/grapheditor/www/'; - -w.RESOURCES_BASE = webPath + 'resources/'; -w.STENCIL_PATH = webPath + 'stencils/'; -w.IMAGE_PATH = webPath + 'images/'; -w.STYLE_PATH = webPath + 'styles/'; -w.CSS_PATH = webPath + 'styles/'; -w.OPEN_FORM = webPath + 'open.html'; - -// w.mxBasePath = "http://localhost:8000/src/mxgraph/javascript/src/"; -//w.imageBasePath = 'http://localhost:8000/src/mxgraph/javascript/'; -w.mxLoadStylesheets = false; // disable loading stylesheets -w.mxLoadResources = false; - -/** - * A DrawIO layout. - */ -export class DrawIOWidget extends Widget { - /** - * Construct a `GridStackLayout`. - * - * @param info - The `DashboardView` metadata. - */ - constructor() { - super(); - void Private.ensureMx().then(mx => this._loadDrawIO(mx)); - //this._loadDrawIO(MX); +// Copyright 2018 Wolf Vollprecht +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { DocumentRegistry, DocumentWidget } from '@jupyterlab/docregistry'; + +import { MainMenu, JupyterLabMenu } from '@jupyterlab/mainmenu'; + +import { IChangedArgs, PathExt } from '@jupyterlab/coreutils'; + +import { undoIcon, redoIcon } from '@jupyterlab/ui-components'; + +import { CommandRegistry } from '@lumino/commands'; + +import { Signal } from '@lumino/signaling'; + +import { DrawIODocumentModel } from './model'; + +import { DrawIOWidget } from './panel'; + +import { DrawIOToolbarButton } from './toolbar'; + +import { + formatPanelIcon, + plusIcon, + zoominIcon, + zoomoutIcon, + deleteIcon, + toFrontIcon, + toBackIcon, + fillColorIcon, + strokeColorIcon, + shadowIcon +} from './icons'; + +const DIRTY_CLASS = 'jp-mod-dirty'; + +export class DrawIODocumentWidget extends DocumentWidget { + constructor(options: DrawIODocumentWidget.IOptions) { + super(options); + // Adding the buttons to the widget toolbar + // Modify containers style: line ~92700 + // modulated.js, line: 84246 + // actions: modulated.js line: ~93000 + // actions: modulated.js line: ~111000 + + this._commands = options.commands; + this._menubar = new MainMenu(this._commands); + + this._menubar.clearMenus(); + this.toolbar.addClass('dio-toolbar'); + + //TODO: + // Add toolbar actions to change the default style of arrows and conections. + this._menuView = new JupyterLabMenu({ commands: this._commands }); + this._menuView.menu.title.caption = 'View (Space+Drag to Scroll)'; + this._menuView.menu.title.icon = formatPanelIcon; + this._menubar.addMenu(this._menuView.menu, { rank: 1 }); + + this._menuZoom = new JupyterLabMenu({ commands: this._commands }); + //TODO: Change label to a view percentage + this._menuZoom.menu.title.label = 'Zoom'; + this._menuZoom.menu.title.caption = 'Zoom (Alt+Mousewheel)'; + this._menubar.addMenu(this._menuZoom.menu, { rank: 2 }); + + this._menuInsert = new JupyterLabMenu({ commands: this._commands }); + this._menuInsert.menu.title.caption = 'Insert'; + this._menuInsert.menu.title.icon = plusIcon; + this._menubar.addMenu(this._menuInsert.menu, { rank: 2 }); + + this.context.ready.then(async value => { + await this.content.ready.promise; + + this._onTitleChanged(); + this._addToolbarItems(); + this.content.setContent(this.context.model.toString()); + this._handleDirtyStateNew(); + + this.context.pathChanged.connect(this._onTitleChanged, this); + this.context.model.contentChanged.connect(this._onContentChanged, this); + this.context.model.stateChanged.connect( + this._onModelStateChangedNew, + this + ); + this.content.graphChanged.connect(this._saveToContext, this); + }); } /** @@ -53,419 +101,187 @@ export class DrawIOWidget extends Widget { */ dispose(): void { Signal.clearData(this); - this._editor.destroy(); super.dispose(); } /** * A promise that resolves when the csv viewer is ready. */ - get ready(): PromiseDelegate { - return this._ready; + get ready(): Promise { + return this.content.ready.promise; } - get graphChanged(): ISignal { - return this._graphChanged; + public getSVG(): string { + return ''; //this.mx.mxUtils.getXml(this._editor.editor.graph.getSvg()); } - get mx(): any { - return this._mx; + public getAction(action: string): any { + return this.content.getAction(action); } - get editor(): any { - return this._editor; + public execute(action: string): void { + this.content.getAction(action).funct(); } - get graph(): any { - return this._editor.editor.graph; + public toggleCellStyles(flip: string): void { + this.content.toggleCellStyles(flip); } - getAction(action: string): any { - return this._editor.actions.actions[action]; + public alignCells(align: string): void { + this.content.alignCells(align); } - getActions(): any { - return this._editor.actions.actions; + public distributeCells(horizontal: boolean): void { + this.content.distributeCells(horizontal); } - setContent(newValue: string): void { - if (this._editor === undefined) { - return; - } - - const oldValue = this._mx.mxUtils.getXml(this._editor.editor.getGraphXml()); - - if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { - if (newValue.length) { - const xml = this._mx.mxUtils.parseXml(newValue); - this._editor.editor.setGraphXml(xml.documentElement); - } - } + public layoutFlow(direction: string): void { + this.content.layoutFlow(direction); } - //Direction - public toggleCellStyles(flip: string): void { - let styleFlip = this._editor.mx.mxConstants.STYLE_FLIPH; - switch (flip) { - case 'flipH': - styleFlip = this._editor.mx.mxConstants.STYLE_FLIPH; - break; - case 'flipV': - styleFlip = this._editor.mx.mxConstants.STYLE_FLIPV; - break; - } - this._editor.graph.toggleCellStyles(styleFlip, false); + public horizontalTree(): void { + this.content.horizontalTree(); } - //Align - public alignCells(align: string): void { - if (this._editor.graph.isEnabled()) { - let pos = this._editor.mx.mxConstants.ALIGN_CENTER; - switch (align) { - case 'alignCellsLeft': - pos = this._editor.mx.mxConstants.ALIGN_LEFT; - break; - case 'alignCellsCenter': - pos = this._editor.mx.mxConstants.ALIGN_CENTER; - break; - case 'alignCellsRight': - pos = this._editor.mx.mxConstants.ALIGN_RIGHT; - break; - case 'alignCellsTop': - pos = this._editor.mx.mxConstants.ALIGN_TOP; - break; - case 'alignCellsMiddle': - pos = this._editor.mx.mxConstants.ALIGN_MIDDLE; - break; - case 'alignCellsBottom': - pos = this._editor.mx.mxConstants.ALIGN_BOTTOM; - break; - } - this._editor.graph.alignCells(pos); - } + public verticalTree(): void { + this.content.verticalTree(); } - //Distribute - //drawio:command/horizontal - //drawio:command/vertical - public distributeCells(horizontal: boolean): void { - this._editor.graph.distributeCells(horizontal); + public radialTree(): void { + this.content.radialTree(); } - //Layout - //drawio:command/horizontalFlow - //drawio:command/verticalFlow - public layoutFlow(direction: string): void { - let directionFlow = this._editor.mx.mxConstants.DIRECTION_WEST; - switch (direction) { - case 'horizontalFlow': - directionFlow = this._editor.mx.mxConstants.DIRECTION_WEST; - break; - case 'verticalFlow': - directionFlow = this._editor.mx.mxConstants.DIRECTION_NORTH; - break; - } + public organic(): void { + this.content.organic(); + } - const mxHierarchicalLayout = this._editor.mx.mxHierarchicalLayout; - const layout = new mxHierarchicalLayout(this._editor.graph, directionFlow); + public circle(): void { + this.content.circle(); + } - this._editor.editor.executeLayout(() => { - const selectionCells = this._editor.graph.getSelectionCells(); - layout.execute( - this._editor.graph.getDefaultParent(), - selectionCells.length === 0 ? null : selectionCells - ); - }, true); + /** + * Handle a change to the title. + */ + private _onTitleChanged(): void { + this.title.label = PathExt.basename(this.context.localPath); } - public horizontalTree(): void { - let tmp = this._editor.graph.getSelectionCell(); - let roots = null; - - if ( - tmp === null || - this._editor.graph.getModel().getChildCount(tmp) === 0 - ) { - if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { - roots = this._editor.graph.findTreeRoots( - this._editor.graph.getDefaultParent() - ); - } - } else { - roots = this._editor.graph.findTreeRoots(tmp); - } + private _onContentChanged(): void { + this.content.setContent(this.context.model.toString()); + } - if (roots !== null && roots.length > 0) { - tmp = roots[0]; - } + private _saveToContext(emiter: DrawIOWidget, content: string): void { + this.context.model.fromString(content); + } - if (tmp !== null) { - const mxCompactTreeLayout = this._editor.mx.mxCompactTreeLayout; - const layout = new mxCompactTreeLayout(this._editor.graph, true); - layout.edgeRouting = false; - layout.levelDistance = 30; - - this._promptSpacing( - layout.levelDistance, - this._editor.mx.mxUtils.bind(this, (newValue: any) => { - layout.levelDistance = newValue; - - this._editor.editor.executeLayout(() => { - layout.execute(this._editor.graph.getDefaultParent(), tmp); - }, true); - }) - ); + private _onModelStateChangedNew( + sender: DocumentRegistry.IModel, + args: IChangedArgs + ): void { + if (args.name === 'dirty') { + this._handleDirtyStateNew(); } } - public verticalTree(): void { - let tmp = this._editor.graph.getSelectionCell(); - let roots = null; - - if ( - tmp === null || - this._editor.graph.getModel().getChildCount(tmp) === 0 - ) { - if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { - roots = this._editor.graph.findTreeRoots( - this._editor.graph.getDefaultParent() - ); - } + private _handleDirtyStateNew(): void { + if (this.context.model.dirty) { + this.title.className += ` ${DIRTY_CLASS}`; } else { - roots = this._editor.graph.findTreeRoots(tmp); - } - - if (roots !== null && roots.length > 0) { - tmp = roots[0]; - } - - if (tmp !== null) { - const mxCompactTreeLayout = this._editor.mx.mxCompactTreeLayout; - const layout = new mxCompactTreeLayout(this._editor.graph, false); - layout.edgeRouting = false; - layout.levelDistance = 30; - - this._promptSpacing( - layout.levelDistance, - this._editor.mx.mxUtils.bind(this, (newValue: any) => { - layout.levelDistance = newValue; - - this._editor.editor.executeLayout(() => { - layout.execute(this._editor.graph.getDefaultParent(), tmp); - }, true); - }) - ); + this.title.className = this.title.className.replace(DIRTY_CLASS, ''); } } - public radialTree(): void { - let tmp = this._editor.graph.getSelectionCell(); - let roots = null; - - if ( - tmp === null || - this._editor.graph.getModel().getChildCount(tmp) === 0 - ) { - if (this._editor.graph.getModel().getEdgeCount(tmp) === 0) { - roots = this._editor.graph.findTreeRoots( - this._editor.graph.getDefaultParent() - ); - } - } else { - roots = this._editor.graph.findTreeRoots(tmp); - } + private _addToolbarItems(): void { + const actions = this.content.getActions(); + + // Menu view + this._menuView.addGroup([ + { command: 'drawio:command/formatPanel' }, + { command: 'drawio:command/outline' }, + { command: 'drawio:command/layers' } + ]); + + // Menu Zoom + this._menuZoom.addGroup([ + { command: 'drawio:command/resetView' }, + { command: 'drawio:command/fitWindow' }, + { command: 'drawio:command/fitPageWidth' }, + { command: 'drawio:command/fitPage' }, + { command: 'drawio:command/fitTwoPages' }, + { command: 'drawio:command/customZoom' } + ]); + + // Menu insert + this._menuInsert.addGroup([ + { command: 'drawio:command/insertLink' }, + { command: 'drawio:command/insertImage' } + ]); + + this.toolbar.addItem('ViewDropdown', this._menubar); + + actions['zoomIn'].icon = zoominIcon; + actions['zoomIn'].tooltip = 'Zoom In (Ctrl+(Numpad)/Alt+Mousewheel)'; + this.toolbar.addItem('zoomIn', new DrawIOToolbarButton(actions['zoomIn'])); + + actions['zoomOut'].icon = zoomoutIcon; + actions['zoomOut'].tooltip = 'Zoom Out (Ctrl-(Numpad)/Alt+Mousewheel)'; + this.toolbar.addItem( + 'zoomOut', + new DrawIOToolbarButton(actions['zoomOut']) + ); - if (roots !== null && roots.length > 0) { - tmp = roots[0]; - } + actions['undo'].icon = undoIcon; + actions['fillColor'].tooltip = 'Undo (Ctrl+Z)'; + this.toolbar.addItem('undo', new DrawIOToolbarButton(actions['undo'])); - if (tmp !== null) { - const mxRadialTreeLayout = this._editor.mx.mxRadialTreeLayout; - const layout = new mxRadialTreeLayout(this._editor.graph, false); - layout.levelDistance = 80; - layout.autoRadius = true; - - this._promptSpacing( - layout.levelDistance, - this._editor.mx.mxUtils.bind(this, (newValue: any) => { - layout.levelDistance = newValue; - - this._editor.editor.executeLayout(() => { - layout.execute(this._editor.graph.getDefaultParent(), tmp); - - if (!this._editor.graph.isSelectionEmpty()) { - tmp = this._editor.graph.getModel().getParent(tmp); - - if (this._editor.graph.getModel().isVertex(tmp)) { - this._editor.graph.updateGroupBounds( - [tmp], - this._editor.graph.gridSize * 2, - true - ); - } - } - }, true); - }) - ); - } - } + actions['redo'].icon = redoIcon; + actions['redo'].tooltip = 'Redo (Ctrl+Shift+Z)'; + this.toolbar.addItem('redo', new DrawIOToolbarButton(actions['redo'])); - public organic(): void { - const mxFastOrganicLayout = this._editor.mx.mxFastOrganicLayout; - const layout = new mxFastOrganicLayout(this._editor.graph); - - this._promptSpacing( - layout.forceConstant, - this._editor.mx.mxUtils.bind(this, (newValue: any) => { - layout.forceConstant = newValue; - - this._editor.editor.executeLayout(() => { - let tmp = this._editor.graph.getSelectionCell(); - - if ( - tmp === null || - this._editor.graph.getModel().getChildCount(tmp) === 0 - ) { - tmp = this._editor.graph.getDefaultParent(); - } - - layout.execute(tmp); - - if (this._editor.graph.getModel().isVertex(tmp)) { - this._editor.graph.updateGroupBounds( - [tmp], - this._editor.graph.gridSize * 2, - true - ); - } - }, true); - }) + actions['delete'].icon = deleteIcon; + actions['delete'].tooltip = 'Delete'; + this.toolbar.addItem('delete', new DrawIOToolbarButton(actions['delete'])); + + actions['toFront'].icon = toFrontIcon; + actions['toFront'].tooltip = 'To Front (Ctrl+Shift+F)'; + this.toolbar.addItem( + 'toFront', + new DrawIOToolbarButton(actions['toFront']) ); - } - public circle(): void { - const mxCircleLayout = this._editor.mx.mxCircleLayout; - const layout = new mxCircleLayout(this._editor.graph); - - this._editor.editor.executeLayout(() => { - let tmp = this._editor.graph.getSelectionCell(); - - if ( - tmp === null || - this._editor.graph.getModel().getChildCount(tmp) === 0 - ) { - tmp = this._editor.graph.getDefaultParent(); - } - - layout.execute(tmp); - - if (this._editor.graph.getModel().isVertex(tmp)) { - this._editor.graph.updateGroupBounds( - [tmp], - this._editor.graph.gridSize * 2, - true - ); - } - }, true); - } + actions['toBack'].icon = toBackIcon; + actions['toBack'].tooltip = 'To Back (Ctrl+Shift+B)'; + this.toolbar.addItem('toBack', new DrawIOToolbarButton(actions['toBack'])); - private _loadDrawIO(mx: Private.MX): void { - this._mx = mx; - - // Adds required resources (disables loading of fallback properties, this can only - // be used if we know that all keys are defined in the language specific file) - this._mx.mxResources.loadDefaultBundle = false; - - // Fixes possible asynchronous requests - this._mx.mxResources.parse(grapheditorTxt); - const oParser = new DOMParser(); - const oDOM = oParser.parseFromString(defaultXml, 'text/xml'); - const themes: any = new Object(null); - themes[(this._mx.Graph as any).prototype.defaultThemeName] = - oDOM.documentElement; - - // Workaround for TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature - const Editor: any = this._mx.Editor; - this._editor = new this._mx.EditorUi(new Editor(false, themes), this.node); - this._editor.refresh(); - - this._editor.editor.graph.model.addListener( - this._mx.mxEvent.NOTIFY, - (sender: any, evt: any) => { - const changes: any[] = evt.properties.changes; - for (let i = 0; i < changes.length; i++) { - if (changes[i].root) { - return; - } - } - - if (this._editor.editor.graph.isEditing()) { - this._editor.editor.graph.stopEditing(); - } - - const graph = this._editor.editor.getGraphXml(); - const xml = this._mx.mxUtils.getXml(graph); - this._graphChanged.emit(xml); - } + actions['fillColor'].icon = fillColorIcon; + actions['fillColor'].tooltip = 'Fill Color'; + this.toolbar.addItem( + 'fillColor', + new DrawIOToolbarButton(actions['fillColor']) ); - this._promptSpacing = this._mx.mxUtils.bind( - this, - (defaultValue: any, fn: any) => { - const FilenameDialog = this._mx.FilenameDialog; - const dlg = new FilenameDialog( - this._editor.editor, - defaultValue, - this._mx.mxResources.get('apply'), - (newValue: any) => { - fn(parseFloat(newValue)); - }, - this._mx.mxResources.get('spacing') - ); - this._editor.editor.showDialog(dlg.container, 300, 80, true, true); - dlg.init(); - } + actions['strokeColor'].icon = strokeColorIcon; + actions['strokeColor'].tooltip = 'Fill Stroke Color'; + this.toolbar.addItem( + 'strokeColor', + new DrawIOToolbarButton(actions['strokeColor']) ); - this._ready.resolve(void 0); + actions['shadow'].icon = shadowIcon; + actions['shadow'].tooltip = 'Shadow'; + this.toolbar.addItem('shadow', new DrawIOToolbarButton(actions['shadow'])); } - private _editor: any; - private _mx: Private.MX; - private _promptSpacing: any; - private _ready = new PromiseDelegate(); - private _graphChanged = new Signal(this); + private _commands: CommandRegistry; + private _menubar: MainMenu; + private _menuView: JupyterLabMenu; + private _menuZoom: JupyterLabMenu; + private _menuInsert: JupyterLabMenu; } -/** - * A namespace for module-level concerns like loading mxgraph - */ - -namespace Private { - export type MX = typeof MX; - - let _mx: typeof MX; - let _mxLoading: PromiseDelegate; - - /** - * Asynchronously load the mx bundle, or return it if already available - */ - export async function ensureMx(): Promise { - if (_mx) { - return _mx; - } - - if (_mxLoading) { - return await _mxLoading.promise; - } - - _mxLoading = new PromiseDelegate(); - /*eslint-disable */ - // @ts-ignore - _mx = await import('./drawio/modulated.js'); - /*eslint-enable */ - - _mxLoading.resolve(_mx); - return _mx; +export namespace DrawIODocumentWidget { + export interface IOptions + extends DocumentWidget.IOptions { + commands: CommandRegistry; } } diff --git a/yarn.lock b/yarn.lock index 907ba63c..e06af5ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,33 +9,33 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== +"@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== "@babel/highlight@^7.10.4": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" - integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" + "@babel/helper-validator-identifier" "^7.14.0" chalk "^2.0.0" js-tokens "^4.0.0" "@babel/runtime@^7.1.2": - version "7.13.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.7.tgz#d494e39d198ee9ca04f4dcb76d25d9d7a1dc961a" - integrity sha512-h+ilqoX998mRVM5FtB5ijRuHUDVt5l3yfoOi2uh18Z/O3hvyaHQ39NpxVkCIG5yFs+mLq/ewFp8Bss6zmWv6ZA== + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" + integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== dependencies: regenerator-runtime "^0.13.4" -"@blueprintjs/core@^3.36.0", "@blueprintjs/core@^3.39.0": - version "3.39.0" - resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-3.39.0.tgz#77c13aea4e5285568b9ad76f69004567ea7d75e5" - integrity sha512-Pl92Qvfo0iowvJ81hOxfOXgBUuqHdMgtYao7hCvhF5hvz8wYRfOr1GHChVsiD5NvpNmG2rtUTYqkfft06Tyj5A== +"@blueprintjs/core@^3.36.0", "@blueprintjs/core@^3.44.2": + version "3.44.2" + resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-3.44.2.tgz#6b6502a7d26128ccf795b79a0c10aa6b9fd863f7" + integrity sha512-rxw0KU0Trdnf5HoILyWrEYpfubC1+VyfpbqcD4pG3iA79oGfo1q5x4S16YTeZpVXRm8VK3TBob4RDRXDd+/4PQ== dependencies: - "@blueprintjs/icons" "^3.24.0" + "@blueprintjs/icons" "^3.26.0" "@types/dom4" "^2.0.1" classnames "^2.2" dom4 "^2.1.5" @@ -47,20 +47,20 @@ resize-observer-polyfill "^1.5.1" tslib "~1.13.0" -"@blueprintjs/icons@^3.24.0": - version "3.24.0" - resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-3.24.0.tgz#aa7e6042e40806d22f85da8d62990ff0296adcf2" - integrity sha512-OvDDI5EUueS1Y3t594iS8LAGoHhLhYjC2GuN/01a85n+ASLSp0jf0/+uix2JeCOj41iTdRRCINbWuRwVQNNGPw== +"@blueprintjs/icons@^3.26.0": + version "3.26.0" + resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-3.26.0.tgz#d3f0aa0d35a9ebe8648db9651af364dfcc529d9f" + integrity sha512-1+yhYH1Fjj5qGx8drZUL2L1R42MiN0WVHTTKYqGEV9TAzhvFHCSZgALD7WNQa+FEibw/8B4U+79IRgUPJNEjow== dependencies: classnames "^2.2" tslib "~1.13.0" "@blueprintjs/select@^3.15.0": - version "3.15.5" - resolved "https://registry.yarnpkg.com/@blueprintjs/select/-/select-3.15.5.tgz#f3448a21ff596a793c8949d8ac5068b1fcd70bbd" - integrity sha512-ZZaW60v7sKY2NIPvqG9PO+BAvbfeFvL/LQ6wNHias+T63Nk34NZrUx0a3MSELkTsJwdpZLZJLzH7c8zQANBOkg== + version "3.16.2" + resolved "https://registry.yarnpkg.com/@blueprintjs/select/-/select-3.16.2.tgz#ac09710ebef14381c1c25e393a7d5bce76119558" + integrity sha512-/wcQTVwQNqesmi7ag/BFjBMla64HkwyvPRfYK0INwaIW08itjoATflAvw5QYRqqk6FeZ/OwGUOwoKS8oe5goDg== dependencies: - "@blueprintjs/core" "^3.39.0" + "@blueprintjs/core" "^3.44.2" classnames "^2.2" tslib "~1.13.0" @@ -69,10 +69,10 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== -"@eslint/eslintrc@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" - integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== +"@eslint/eslintrc@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.1.tgz#442763b88cecbe3ee0ec7ca6d6dd6168550cbf14" + integrity sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -81,14 +81,13 @@ ignore "^4.0.6" import-fresh "^3.2.1" js-yaml "^3.13.1" - lodash "^4.17.20" minimatch "^3.0.4" strip-json-comments "^3.1.1" "@fortawesome/fontawesome-free@^5.12.0": - version "5.15.2" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.2.tgz#218cd7276ab4f9ab57cc3d2efa2697e6a579f25d" - integrity sha512-7l/AX41m609L/EXI9EKH3Vs3v0iA8tKlIOGtw+kgcoanI7p+e4I4GYLqW3UXWiTnjSFymKSmTTPKYrivzbxxqA== + version "5.15.3" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.3.tgz#c36ffa64a2a239bf948541a97b6ae8d729e09a9a" + integrity sha512-rFnSUN/QOtnOAgqFRooTA3H57JLDm0QEG/jPdk+tLQNL/eWd+Aok8g3qCI+Q1xuDPWpGW/i9JySpJVsq8Q0s9w== "@hypnosphi/create-react-context@^0.3.1": version "0.3.1" @@ -98,23 +97,24 @@ gud "^1.0.0" warning "^4.0.3" -"@jupyterlab/application@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/application/-/application-3.0.6.tgz#9729bd42b24f0191859a34711d7e2f8353d371d1" - integrity sha512-BjFmJGciO984RkxV2ZUtr7z3VEquV+OI+mwzrlM80tUDvxMBjiTn8qUFeOGLnEf1t2MbEnxGXu1cnkpK6nUVNg== +"@jupyterlab/application@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/application/-/application-3.1.0-alpha.7.tgz#803f79328617b6ee311c94d004c11b7cecbba2ca" + integrity sha512-jdsjm9rds1csr8mogwo2h9wYG5WzJj962I6/Am1+heSR+5ec8ao67xIUeLPLYvJjL7/YlTpCO0FbKmednmFyLA== dependencies: "@fortawesome/fontawesome-free" "^5.12.0" - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/docregistry" "^3.0.6" - "@jupyterlab/rendermime" "^3.0.6" - "@jupyterlab/rendermime-interfaces" "^3.0.5" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/statedb" "^3.0.3" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/docmanager" "^3.1.0-alpha.7" + "@jupyterlab/docregistry" "^3.1.0-alpha.7" + "@jupyterlab/rendermime" "^3.1.0-alpha.7" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" - "@lumino/application" "^1.13.1" + "@lumino/application" "^1.16.0" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -122,19 +122,19 @@ "@lumino/polling" "^1.3.3" "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" - -"@jupyterlab/apputils@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/apputils/-/apputils-3.0.5.tgz#1eb682e20f5da98ea7c1d2b3909ea8c17565f607" - integrity sha512-m09ClizpX/rysqFvlVRVe683xmbG/Lk8d4TDXZDVmApNyWOLhsBHqfk+Im5WSQt2Oe2DiolwiiJXgZdWN57vag== - dependencies: - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/settingregistry" "^3.0.3" - "@jupyterlab/statedb" "^3.0.3" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" + "@lumino/widgets" "^1.19.0" + +"@jupyterlab/apputils@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/apputils/-/apputils-3.1.0-alpha.7.tgz#7245ebee743ccc137687e062cbba69107f817ba1" + integrity sha512-zRXw6LDlIFoH6N/Yc0FlmD0tHlKZAZlhQmvPl/5gRMOHu0QXPYJ+UQgDgTyXwCyyqIGNNs7yYMlFjwcQJVpW/w== + dependencies: + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/settingregistry" "^3.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -144,20 +144,19 @@ "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" "@lumino/virtualdom" "^1.8.0" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" "@types/react" "^17.0.0" - buffer "^5.6.0" react "^17.0.1" react-dom "^17.0.1" - sanitize-html "~1.27.4" + sanitize-html "~2.3.3" url "^0.11.0" "@jupyterlab/builder@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/builder/-/builder-3.0.5.tgz#284a97aa8fc236761df694b9c051d82fe4a92a27" - integrity sha512-UmKPA+KS2ut+l7uMclJDmuHNuL41K3vfIRVFI1YvDJXsQszmotQqtvEyPpw3wKamy/1aXZSAlA/56hpY3qrg+Q== + version "3.0.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/builder/-/builder-3.0.8.tgz#132182cf61959f5b17110f5da035d0625acf318c" + integrity sha512-f5HPbH+oxxZGRt+/hxeuW/217cGyD2jCE2ksy8758WgQGspfQHSNWhshGgGufs/6PfUoKx8vIYY8dmPMn5WdeQ== dependencies: - "@jupyterlab/buildutils" "^3.0.3" + "@jupyterlab/buildutils" "^3.0.6" "@lumino/algorithm" "^1.3.3" "@lumino/application" "^1.13.1" "@lumino/commands" "^1.12.0" @@ -179,6 +178,7 @@ glob "~7.1.6" mini-css-extract-plugin "~1.3.2" path-browserify "^1.0.0" + process "^0.11.10" raw-loader "~4.0.0" style-loader "~2.0.0" supports-color "^7.2.0" @@ -191,10 +191,10 @@ webpack-merge "^5.1.2" worker-loader "^3.0.2" -"@jupyterlab/buildutils@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/buildutils/-/buildutils-3.0.3.tgz#b56a920cec69560e859eba5112e8b75c58e08d6d" - integrity sha512-sAk4BTcbP6ZP7N8WTEuZM4XfN7+KAwaqvvRX2rLwgeKhJeZkeFgidkGacXcGt3TuKQIgySins6UWejs68P8/Aw== +"@jupyterlab/buildutils@^3.0.6": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@jupyterlab/buildutils/-/buildutils-3.0.6.tgz#b9a0500c07581471266adc7dea03295d32d911fa" + integrity sha512-S6Hnop5A5KjCCHQt1ob3ABy1VQ94ssbRPsYa04R7mUjVQu5NsIS8Kd0O/+yqtuSaWIJOqCKhRZEev3rgG+dHqw== dependencies: "@lumino/coreutils" "^1.5.3" "@yarnpkg/lockfile" "^1.1.0" @@ -211,49 +211,52 @@ sort-package-json "~1.44.0" typescript "~4.1.3" -"@jupyterlab/codeeditor@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/codeeditor/-/codeeditor-3.0.5.tgz#20022ef1d76361b5ac0319b9ca23939e8f8c2521" - integrity sha512-O1eWSyP4k/MZgaQ94t5BIgE3YNGQL122BfNZpDEGaceNPZei94tLBaAnG4X0HWqn0/h+U9E2E1RlcX0gDluD1Q== - dependencies: - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/nbformat" "^3.0.3" - "@jupyterlab/observables" "^4.0.3" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" +"@jupyterlab/codeeditor@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/codeeditor/-/codeeditor-3.1.0-alpha.7.tgz#4462e67dd76eb031e763bd7a7dc723b94ba15c55" + integrity sha512-R0tYdZjTpK56+j7scLUVMEsUK0yHjSbXLLTxiSj66qiHAyZVMufw+F/yTOB8ZmhpoN6a6QOr9TWj8CAHzHi3jw== + dependencies: + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@jupyterlab/observables" "^4.1.0-alpha.7" + "@jupyterlab/shared-models" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/dragdrop" "^1.7.1" "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" - -"@jupyterlab/codemirror@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/codemirror/-/codemirror-3.0.5.tgz#40b23bbee462613828c7eac312a3083d08e0aaa0" - integrity sha512-rSdI6Y5Se2sEtrTZwRzyaD8Ls9OhZrf91KfhaF6uMeBHQXLb3KkN6diO0rB/Uj1oqoz+rTybFIfbbhAzzzj6UA== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/codeeditor" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/nbformat" "^3.0.3" - "@jupyterlab/observables" "^4.0.3" - "@jupyterlab/statusbar" "^3.0.5" - "@jupyterlab/translation" "^3.0.5" + "@lumino/widgets" "^1.19.0" + +"@jupyterlab/codemirror@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/codemirror/-/codemirror-3.1.0-alpha.7.tgz#fadf55b457292724a4c7a83e1b00826b1aa3ba67" + integrity sha512-ndkibm3lw1JlrO1Tzam015FJimSToNHwF3a2xJo7uRn6aWPtV8R2KJxGxOUjc26gLohSLHgH985wm7cGOhNC7g== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/codeeditor" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@jupyterlab/observables" "^4.1.0-alpha.7" + "@jupyterlab/shared-models" "^3.1.0-alpha.7" + "@jupyterlab/statusbar" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/polling" "^1.3.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" - codemirror "~5.57.0" + "@lumino/widgets" "^1.19.0" + codemirror "~5.61.0" react "^17.0.1" + y-codemirror "^2.1.0" -"@jupyterlab/coreutils@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/coreutils/-/coreutils-5.0.3.tgz#fddf9d9c80c5c7bbb2dfa3e55569d6974a15fe34" - integrity sha512-PfdtV95/nSEwYjkaZltCTgumT22BekpSaPXF9oWtrCxC2Gc6zP8BxPhMdbPbx67y6FeO8vltr6dxOat93wZ4KA== +"@jupyterlab/coreutils@^5.1.0-alpha.7": + version "5.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/coreutils/-/coreutils-5.1.0-alpha.7.tgz#07d09cb61dcbcc3a7b9e0441452de8cbae09b8aa" + integrity sha512-bURndusUf04K6kOhdfP3+RDN3d2Uvl6D2ErIRGawUW5uwB2UD8jNwLCG80+6zovqHwHu+wsCGxezw8SHm5xQgw== dependencies: "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -261,64 +264,77 @@ minimist "~1.2.0" moment "^2.24.0" path-browserify "^1.0.0" - url-parse "~1.4.7" - -"@jupyterlab/docmanager@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/docmanager/-/docmanager-3.0.6.tgz#3858805d28eade30716603f1960c020d1e542b9c" - integrity sha512-98/4neCQ5pMLwFkiVOdKnaogmNFiHNl4ibLH3+1af235z/PabywbqKa8sf9RIIN9H8V2H8I+V9L0jU4KG14ZTw== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/docregistry" "^3.0.6" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/statusbar" "^3.0.5" - "@jupyterlab/translation" "^3.0.5" + url-parse "~1.5.1" + +"@jupyterlab/docmanager@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/docmanager/-/docmanager-3.1.0-alpha.7.tgz#da694d5d567e41a4287116ed688a0fec720be0fb" + integrity sha512-eKSWeElpur8Vg5tCUizsyiZQQvXgClJX/ia+0m+/YM+KJIRXWCGquxhDaFMcU4KrdKoKGynaPEGqkkSK/J4jZw== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/docregistry" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/statusbar" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/messaging" "^1.4.3" "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/docregistry@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/docregistry/-/docregistry-3.0.6.tgz#07f5480435c1a8510b2397d4bdf9168aea2371fb" - integrity sha512-e4LEXudcgVWJsuzRnz4zg+lAd0gjsvShAQQQomT8ZYWv6wPTC2ci/6LPKQY9MyeVSw+9JEHIj8650BjmRc7oLA== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/codeeditor" "^3.0.5" - "@jupyterlab/codemirror" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/observables" "^4.0.3" - "@jupyterlab/rendermime" "^3.0.6" - "@jupyterlab/rendermime-interfaces" "^3.0.5" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" +"@jupyterlab/docprovider@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/docprovider/-/docprovider-3.1.0-alpha.7.tgz#416c81dacd109da8d0bee6f6b89ddc9c3b5a94c5" + integrity sha512-Z8BCY7XAQEbsn5upDBc8eqJwRPCJCxunloc3vpQP8xHHthdPkLZKDNK/cVGSTTXHjWcjuF7l4hcP586eDoHitA== + dependencies: + "@jupyterlab/shared-models" "^3.1.0-alpha.7" + lib0 "^0.2.41" + y-websocket "^1.3.11" + yjs "^13.5.3" + +"@jupyterlab/docregistry@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/docregistry/-/docregistry-3.1.0-alpha.7.tgz#bb3e52476767d2165e13c40af0c4f5dc4fda30d8" + integrity sha512-olBzMafAd0/cYUZUN4R7JP2fmENTakbeqhPOuuF2nGG+z4DvQaWGy+PoqXEiWH5+/X+Et1AIlTtfRDk56Ojb5w== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/codeeditor" "^3.1.0-alpha.7" + "@jupyterlab/codemirror" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/docprovider" "^3.1.0-alpha.7" + "@jupyterlab/observables" "^4.1.0-alpha.7" + "@jupyterlab/rendermime" "^3.1.0-alpha.7" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/shared-models" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" - -"@jupyterlab/filebrowser@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/filebrowser/-/filebrowser-3.0.6.tgz#66cebfbe97292c9a05842b2efb534c3d4c7e5856" - integrity sha512-26H3XKtnmH8g2tRgAyoIWaL6FISIXkzzjk6rbPxCeKsdgwwv0fS8Eec9V2SjZoFGPjdYj/jnBhAdO57ZeVKWng== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/docmanager" "^3.0.6" - "@jupyterlab/docregistry" "^3.0.6" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/statedb" "^3.0.3" - "@jupyterlab/statusbar" "^3.0.5" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" + "@lumino/widgets" "^1.19.0" + yjs "^13.5.3" + +"@jupyterlab/filebrowser@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/filebrowser/-/filebrowser-3.1.0-alpha.7.tgz#ae3ee45b829e363ff49a9185be9d99976f5da57e" + integrity sha512-LthV8cc4ffYYGW8YJfP6AjSuM5d/cvG3zXWTin5vejtVXtpsIqKhU3kI5fdAL3gqq+o9NboUryjtYugo7mklpQ== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/docmanager" "^3.1.0-alpha.7" + "@jupyterlab/docregistry" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/statusbar" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -328,50 +344,50 @@ "@lumino/polling" "^1.3.3" "@lumino/signaling" "^1.4.3" "@lumino/virtualdom" "^1.8.0" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/launcher@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/launcher/-/launcher-3.0.5.tgz#3204a9b12c3a0b034c0c9c54fa2cb778e759b76a" - integrity sha512-vFIt0v83K+xA8JFlnopuleeK0VSa+rFeEHQU7AHEX+JKipGM3RyhtRKMVmRJewsuPbMKYiDEN1SkROWY+dy7jA== +"@jupyterlab/launcher@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/launcher/-/launcher-3.1.0-alpha.7.tgz#2f37b2fc6828caebab7a4fcfb059dc622852f6c8" + integrity sha512-cxu2mKQLZYNMGYP8jiIU4HZmfV44j9GSwiJtcVwHLPXLRgC7Cm9bfKzrIM3pcC38/PP8Nj1GKirteC1hNvHk/g== dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/properties" "^1.2.3" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/mainmenu@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/mainmenu/-/mainmenu-3.0.5.tgz#0376f3202bb61ef83077581ab1155dd2025578cd" - integrity sha512-2rziVmmr3/Sl84PzzGYfcGfvjB1tx9aLQVJF+iMvKLEWtPZAsObCVK0SZLPb1S/f942l6/tC87nNOMinIFujBw== +"@jupyterlab/mainmenu@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/mainmenu/-/mainmenu-3.1.0-alpha.7.tgz#85d13266d787f7a6f2b0b0d49011f12b4265dd1c" + integrity sha512-X6UXDR2eODZlBT/BGWvyNXgc09udFmU2wcp5+w18xI8qRL3vNiBoq7A8c/eMnbRhAiXO2CF6hvVkx9cmhqBvDw== dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/ui-components" "^3.0.4" + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" -"@jupyterlab/nbformat@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.0.3.tgz#da8a6fa3f05059d71bc07cb737ada56da01c7100" - integrity sha512-o7UMbRXQCGjHOoXhclov6JP/xSwFkx2Bv2qZldU5Yey+3RIcSFlnI8OcPHVZWmz+9xzdtXEmEhVnbErESO1fsg== +"@jupyterlab/nbformat@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.1.0-alpha.7.tgz#ce16d9e98fe16738d63f82fb76746cc835619fa4" + integrity sha512-4NoIU7weVjLKvRg+odTaqLMO81aiN8p0wN+jf+Ni7qCWMN+EQHDA8rD0HI3/QKm3NdASCDhrC14/vVS6qeBh3A== dependencies: "@lumino/coreutils" "^1.5.3" -"@jupyterlab/observables@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/observables/-/observables-4.0.3.tgz#0fc5672468b32e8f4a98987454d57e0644104877" - integrity sha512-OrAO201PkaFRJ+hWQB5Ozasnp/TkafMC/hOYcThWEQ9SFZEyanmTJIJh0hiHBmWmCorH2ocgTrp0csCzqVXc5w== +"@jupyterlab/observables@^4.1.0-alpha.7": + version "4.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/observables/-/observables-4.1.0-alpha.7.tgz#2d8e904aee84358bbebbd3e70439e9814a172623" + integrity sha512-Joc4Rb79/1Gef2EvOBJHV+vM6BW1ikpj+mXaB8RcKoApPFSgJOp59tB/51Lm8u4CXGBKmK5WzAbYUv5LpMFLfQ== dependencies: "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" @@ -379,46 +395,46 @@ "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" -"@jupyterlab/rendermime-interfaces@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime-interfaces/-/rendermime-interfaces-3.0.5.tgz#86e7abd726c0baf485f555e02dc42af151ca9888" - integrity sha512-LrG7B//izECP5LoouuSLa3WIpUhCBVjBDrqFXd+vMsW3hUF8IGc8Ngooj9dmyBn905/uIt6/JVJGB25qh3ed1w== +"@jupyterlab/rendermime-interfaces@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime-interfaces/-/rendermime-interfaces-3.1.0-alpha.7.tgz#e862a348e76f73ba36b44adf2ba085e1da7e347e" + integrity sha512-ph8uZUmjesfpamaOLNMgUz/FBfdd2PH8V9KCrswdBRXmfAfdkDTNjgrRqyE5ZvryBpcK6bedyecQCLZo+YZh+Q== dependencies: - "@jupyterlab/translation" "^3.0.5" + "@jupyterlab/translation" "^3.1.0-alpha.7" "@lumino/coreutils" "^1.5.3" - "@lumino/widgets" "^1.16.1" - -"@jupyterlab/rendermime@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime/-/rendermime-3.0.6.tgz#1c8759f21c9dcd0f45ff6b7cfb46350c85885ec2" - integrity sha512-lpiRPQrEVbze+2brvsgCzBQdTeI0piF0dCOAokwDFLb3WAgXxXh8g+voJ+3I41P5LeMoranwV4y/z261nMMk9Q== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/codemirror" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/nbformat" "^3.0.3" - "@jupyterlab/observables" "^4.0.3" - "@jupyterlab/rendermime-interfaces" "^3.0.5" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/translation" "^3.0.5" + "@lumino/widgets" "^1.19.0" + +"@jupyterlab/rendermime@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime/-/rendermime-3.1.0-alpha.7.tgz#2e37d9e7148a051c7a472e6e2dfbe68067b1a00a" + integrity sha512-wTDcL2zwuqqFcIWEQL8ET6T1BG1TRsknwS+ScwHtiQBP7mYvveQyzyEUJTFd5io6v7HCyOyi2Qi3otfI5oyGmg== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/codemirror" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@jupyterlab/observables" "^4.1.0-alpha.7" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" lodash.escape "^4.0.1" marked "^2.0.0" -"@jupyterlab/services@^6.0.5": - version "6.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-6.0.5.tgz#06b952d148c098d6befed591bfa5d63518ab96d4" - integrity sha512-hOD9qOqDthpKmlkUoUV+1bj7Uxbe7Pe6nQbftgwfX1rXLgIJjNHkiCce2fkIiSqQh/dd3SFcu3MouTpJ6plglw== - dependencies: - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/nbformat" "^3.0.3" - "@jupyterlab/observables" "^4.0.3" - "@jupyterlab/settingregistry" "^3.0.3" - "@jupyterlab/statedb" "^3.0.3" +"@jupyterlab/services@^6.1.0-alpha.7", "@jupyterlab/services@~6.1.0-alpha.7": + version "6.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-6.1.0-alpha.7.tgz#e0c9d68363b494ff59ba0c0c2252c9d78bfbd79f" + integrity sha512-AanzgTG7Oia5Nk7Z8d7mmLC391jqYpUDQoOFI9Gxo/VUybHo7SCzD+ixhn/XepmJ7HH6AuNr4x4b/RcnsU7OzQ== + dependencies: + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@jupyterlab/observables" "^4.1.0-alpha.7" + "@jupyterlab/settingregistry" "^3.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -427,12 +443,12 @@ node-fetch "^2.6.0" ws "^7.2.0" -"@jupyterlab/settingregistry@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-3.0.3.tgz#ec7943013c1f433ead920c7d9e67aed713461ef0" - integrity sha512-mxvP4AMi62u6ekarhgCefJeyTV6Z8fnnKb0psvvnWikdSgQT6x7OngV5emuo2N02IXkUqXxM1aHRwYQsLUAbOQ== +"@jupyterlab/settingregistry@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-3.1.0-alpha.7.tgz#237334801b1f9213ad137f5f7d33de51b7580843" + integrity sha512-LjvfjoWrMT/Bt41qzaSdGT4LAtvkKoHKLHjsyLryyjdfJJT1BD2oJXrLffq6VKjvM/psLUU2t0WS507UsLH1kg== dependencies: - "@jupyterlab/statedb" "^3.0.3" + "@jupyterlab/statedb" "^3.1.0-alpha.7" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -440,10 +456,22 @@ ajv "^6.12.3" json5 "^2.1.1" -"@jupyterlab/statedb@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-3.0.3.tgz#3bc36f3a439f514fd28b9c0543e0acac1205c704" - integrity sha512-j+WtWyLszzmlsLEkcEhbc+TAMdc+6X+CCeBSFgOK9GN9RSp+pe9tGU/Y4PS0xPSvUwLSqv7RG0Oj0+/1bmNwlw== +"@jupyterlab/shared-models@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/shared-models/-/shared-models-3.1.0-alpha.7.tgz#43fb5bc046065d26e5c39071678ceacf2617d262" + integrity sha512-OnAIVd+qRs6AcwEdZpF06lHKiCCKLPA57H/BsEsbeYxRhKoV5NrvqTarZsRjEtCyb4tQL6ne9HOm9/EWluB59Q== + dependencies: + "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@lumino/coreutils" "^1.5.3" + "@lumino/disposable" "^1.4.3" + "@lumino/signaling" "^1.4.3" + y-protocols "^1.0.4" + yjs "^13.5.3" + +"@jupyterlab/statedb@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-3.1.0-alpha.7.tgz#007b166f3481ebba153a0d2134ddbbfc4190177b" + integrity sha512-lpGnCGssuNrUrHHao6JXo1FutQ+wEcg0BpWAq9uiCo2mAgoyZI2+qBgCqUtCbrJy7f1DYtvmCvszFhy12Y6Ivw== dependencies: "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -451,170 +479,170 @@ "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" -"@jupyterlab/statusbar@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/statusbar/-/statusbar-3.0.5.tgz#d4806d64b5f84debc777052acdfcec780c9777f8" - integrity sha512-a6ZZ3xihjpEaoyF9Aoz+eT/mVwedCdBwuMv44+v+r/zuhPyTys4FdihYw71yB6F5SPrhlT+6TlajndDC+DJiUw== - dependencies: - "@jupyterlab/apputils" "^3.0.5" - "@jupyterlab/codeeditor" "^3.0.5" - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/translation" "^3.0.5" - "@jupyterlab/ui-components" "^3.0.4" +"@jupyterlab/statusbar@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/statusbar/-/statusbar-3.1.0-alpha.7.tgz#f4ad46b918015e37b71c73244933e94965b08af6" + integrity sha512-ocXxErAq3+Zd1Nfn17k9NBrjDeIhtyEaha2TpvTovXipYdiV7+y+5NjlBwr9GsGRUlOwZBmZtvmVluSfZQtfeQ== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.7" + "@jupyterlab/codeeditor" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/ui-components" "^3.1.0-alpha.7" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" csstype "~3.0.3" react "^17.0.1" typestyle "^2.0.4" -"@jupyterlab/translation@^3.0.5": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jupyterlab/translation/-/translation-3.0.5.tgz#8706f48e6989d4aaa8613fa88e348a84ae87eade" - integrity sha512-/ehpYkuUk4RXdKM8WsTW7BTsD4G3FBCviva4nUQ9gCmteySrQpBNhgfCRhG3aFCUKFo28B1BP1s5rza4A7lf6g== +"@jupyterlab/translation@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/translation/-/translation-3.1.0-alpha.7.tgz#47ec794622a9ea2910c70ad5d7c18086a6fcf696" + integrity sha512-Q2WOC6LEkNQpX52/j9ZPOiuaE9Tmc6AkNnpjoF2cu8m2K2HVot3FQVhddXa/d8O/VgQDPv11H4W9hhjwZQhzzw== dependencies: - "@jupyterlab/coreutils" "^5.0.3" - "@jupyterlab/services" "^6.0.5" - "@jupyterlab/statedb" "^3.0.3" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/services" "^6.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.7" "@lumino/coreutils" "^1.5.3" -"@jupyterlab/ui-components@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@jupyterlab/ui-components/-/ui-components-3.0.4.tgz#354b222ef141746e18b1bfda83a5219a9213e8d3" - integrity sha512-6+a5tYQn8HhDNELvQsA190CrgYIJpnKKzRzi5cs8IO2yila+mTHO+xaX2ZOs7jnEbv9dOqdxopjWHRMiKvgGKA== +"@jupyterlab/ui-components@^3.1.0-alpha.7": + version "3.1.0-alpha.7" + resolved "https://registry.yarnpkg.com/@jupyterlab/ui-components/-/ui-components-3.1.0-alpha.7.tgz#c4a63861d7c58da54bb11974c5387cbaa77f00d6" + integrity sha512-PQBknIk7gcajDXXT41a7kIZowTqtffjbIbwlwvCuW+KoS/kyGyh8eSeqaRCOrpHoc1JOonPCpHqo1m4wtBT43w== dependencies: "@blueprintjs/core" "^3.36.0" "@blueprintjs/select" "^3.15.0" - "@jupyterlab/coreutils" "^5.0.3" + "@jupyterlab/coreutils" "^5.1.0-alpha.7" "@lumino/coreutils" "^1.5.3" "@lumino/signaling" "^1.4.3" "@lumino/virtualdom" "^1.8.0" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" react "^17.0.1" react-dom "^17.0.1" typestyle "^2.0.4" -"@lumino/algorithm@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@lumino/algorithm/-/algorithm-1.3.3.tgz#fdf4daa407a1ce6f233e173add6a2dda0c99eef4" - integrity sha512-I2BkssbOSLq3rDjgAC3fzf/zAIwkRUnAh60MO0lYcaFdSGyI15w4K3gwZHGIO0p9cKEiNHLXKEODGmOjMLOQ3g== - -"@lumino/application@^1.13.1": - version "1.15.0" - resolved "https://registry.yarnpkg.com/@lumino/application/-/application-1.15.0.tgz#8b7e5142bc6d38d1300164507e0a214a55ea6d05" - integrity sha512-W/12+UFk1oBdJ793L3NegQvt0T355k64fPmDVzPhM48TW8vM/0tDc+zBx1KShn52eRMTrVBDc2cG5t6C5/XF1w== - dependencies: - "@lumino/commands" "^1.12.0" - "@lumino/coreutils" "^1.5.3" - "@lumino/widgets" "^1.18.0" +"@lumino/algorithm@^1.3.3", "@lumino/algorithm@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@lumino/algorithm/-/algorithm-1.6.0.tgz#771e7896cd94e660f9b58a52f80e1bb255de1d41" + integrity sha512-NMOcm5Yr9nXz5gokS/K4jHBbUMQYBkvDXl1n51XWdcz0LY+oGuIKPhjazhUgmbNRehzdZBj5hMMd1+htYWeVKQ== -"@lumino/collections@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@lumino/collections/-/collections-1.3.3.tgz#fa95c826b93ee6e24b3c4b07c8f595312525f8cc" - integrity sha512-vN3GSV5INkgM6tMLd+WqTgaPnQNTY7L/aFUtTOC8TJQm+vg1eSmR4fNXsoGHM3uA85ctSJThvdZr5triu1Iajg== +"@lumino/application@^1.13.1", "@lumino/application@^1.16.0": + version "1.20.0" + resolved "https://registry.yarnpkg.com/@lumino/application/-/application-1.20.0.tgz#b50ca4180bc400589fdfcfcaab08c4af937fccd0" + integrity sha512-FAoQcq4L3ZswTK0lWfLKnG1ecG26cwqjzg2fyoBeuWGBi1TG9BYjFBdV7ErTFMxW8jE1CLOLuxsZaKFLNErcKA== dependencies: - "@lumino/algorithm" "^1.3.3" + "@lumino/commands" "^1.15.0" + "@lumino/coreutils" "^1.8.0" + "@lumino/widgets" "^1.23.0" -"@lumino/commands@^1.12.0": - version "1.12.0" - resolved "https://registry.yarnpkg.com/@lumino/commands/-/commands-1.12.0.tgz#63a744d034d8bc524455e47f06c0ac5f2eb6ec38" - integrity sha512-5TFlhDzZk1X8rCBjhh0HH3j6CcJ03mx2Pd/1rGa7MB5R+3+yYYk+gTlfHRqsxdehNRmiISaHRSrMnW8bynW7ZQ== +"@lumino/collections@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@lumino/collections/-/collections-1.6.0.tgz#7d3e94cee26409b0cd719c1934bdda471e6a5662" + integrity sha512-ZETm0/xF0oUHV03sOXNOfFI1EEpS317HvN5n+fZBJvCNZIrJkWmKD8QuxcfwHb7AChKUhXlVHhDbWlb1LKnd7g== dependencies: - "@lumino/algorithm" "^1.3.3" - "@lumino/coreutils" "^1.5.3" - "@lumino/disposable" "^1.4.3" - "@lumino/domutils" "^1.2.3" - "@lumino/keyboard" "^1.2.3" - "@lumino/signaling" "^1.4.3" - "@lumino/virtualdom" "^1.8.0" + "@lumino/algorithm" "^1.6.0" -"@lumino/coreutils@^1.5.3": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@lumino/coreutils/-/coreutils-1.5.3.tgz#89dd7b7f381642a1bf568910c5b62c7bde705d71" - integrity sha512-G72jJ6sgOwAUuilz+cri7LpHIJxllK+qz+YZUC3fyyWHK7oRlZemcc43jZAVE+tagTdMxKYSQWNIVzM5lI8sWw== +"@lumino/commands@^1.12.0", "@lumino/commands@^1.15.0": + version "1.15.0" + resolved "https://registry.yarnpkg.com/@lumino/commands/-/commands-1.15.0.tgz#06eb94fb4b34cad59f35b1fcaf473e8d2047f779" + integrity sha512-JOE68KfbR9xw5YTfcwo+9E0PSWidifEMAcOC/aXd7iSzfsCRknMTcMQIUGL277IU7J7CJvoe10DUE5QKwTmX+g== + dependencies: + "@lumino/algorithm" "^1.6.0" + "@lumino/coreutils" "^1.8.0" + "@lumino/disposable" "^1.7.0" + "@lumino/domutils" "^1.5.0" + "@lumino/keyboard" "^1.5.0" + "@lumino/signaling" "^1.7.0" + "@lumino/virtualdom" "^1.11.0" + +"@lumino/coreutils@^1.5.3", "@lumino/coreutils@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@lumino/coreutils/-/coreutils-1.8.0.tgz#4feb3ccbfbc3efc8e395a90f22b5a938fbad959a" + integrity sha512-OvCsaASUqOE7R6Dxngyk4/b5QMOjyRUNxuZuuL+fx+JvGKZFZ/B2c9LYtAJ9mDmQ1BQiGNV/qSpL4o7x8PCfjw== -"@lumino/disposable@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@lumino/disposable/-/disposable-1.4.3.tgz#0a69b15cc5a1e506f93bb390ac44aae338da3c36" - integrity sha512-zKQ9N2AEGcYpG6PJkeMWQXvoXU9w1ocji78z+fboM/SmSgtOIVGeQt3fZeldymf0XrlOPpNXs1ZFg54yWUMnXA== +"@lumino/disposable@^1.4.3", "@lumino/disposable@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@lumino/disposable/-/disposable-1.7.0.tgz#539463490cb42e8d2dc46b5ff7cc291f4f1a8d07" + integrity sha512-3mWi11ko3XVY63BPwvys7MXrbFddA2i+gp72d0wAKM2NDDUopVPikMHhJpjGJcw+otjahzXYiTewxPDEau9dYg== dependencies: - "@lumino/algorithm" "^1.3.3" - "@lumino/signaling" "^1.4.3" + "@lumino/algorithm" "^1.6.0" + "@lumino/signaling" "^1.7.0" -"@lumino/domutils@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@lumino/domutils/-/domutils-1.2.3.tgz#7e8e549a97624bfdbd4dd95ae4d1e30b87799822" - integrity sha512-SEi8WZSy+DWMkL5CfAY78MHbi3x83AVmRFxjs9+A6qsFPde+Hr1I4DNtLsSDmfAWsobHHgBnjyNp2ZkQEq0IEA== +"@lumino/domutils@^1.2.3", "@lumino/domutils@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@lumino/domutils/-/domutils-1.5.0.tgz#fdba0cfe404b4817e63aa064f63b3c965655e76e" + integrity sha512-dZ0Aa+/qhvfPc1aa5kX4LLGE3B6BW1XmJa0R1XVCEpAFY3cZiujuQWmhYHJtZPrOiqn0UtioT2OpqnWdtCWc0A== -"@lumino/dragdrop@^1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@lumino/dragdrop/-/dragdrop-1.7.1.tgz#1466206d43a64dadca383e0b9a87cc8a14c8c59b" - integrity sha512-IeSSOTmpqBSWz+EVsbGVeHe/KIaHaUsQXZ4BJCEbCKgNGHbqMfUOtlneiKq7rEhZGF4wYs7gWWjNhMVZbUGO9Q== +"@lumino/dragdrop@^1.10.0", "@lumino/dragdrop@^1.7.1": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@lumino/dragdrop/-/dragdrop-1.10.0.tgz#2fddacfee055e660dd33dd9a3cfbd8fbba811673" + integrity sha512-A3cNLcp09zygOprWmLTkLZCQYNq3dJfN+mhni4IZizqCTkKbTCEzo2/IwoCWvy+ABKft8d/A9Y40wFW6yJ9OyA== dependencies: - "@lumino/coreutils" "^1.5.3" - "@lumino/disposable" "^1.4.3" + "@lumino/coreutils" "^1.8.0" + "@lumino/disposable" "^1.7.0" -"@lumino/keyboard@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@lumino/keyboard/-/keyboard-1.2.3.tgz#594c73233636d85ed035b1a37a095acf956cfe8c" - integrity sha512-ibS0sz0VABeuJXx2JVSz36sUBMUOcQNCNPybVhwzN/GkJFs0dnDKluMu+3Px0tkB2y33bGPZU/RLZY1Xj/faEA== +"@lumino/keyboard@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@lumino/keyboard/-/keyboard-1.5.0.tgz#c12213822dd2645c412e8689aecd4a2726113ac6" + integrity sha512-/uF9xqHYVbIkser2Q6UIv7VWrzThr1fxAmSOShjSoKGocL0XHeaBaCOMezSaVxnJ1wm1ciNdhMsjscVM8Inp7g== -"@lumino/messaging@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@lumino/messaging/-/messaging-1.4.3.tgz#75a1901f53086c7c0e978a63cb784eae5cc59f3f" - integrity sha512-wa2Pj2KOuLNLS2n0wVBzUVFGbvjL1FLbuCOAUEYfN6xXVleqqtGGzd08uTF7ebu01KCO3VQ38+dkvoaM/C2qPw== +"@lumino/messaging@^1.4.3", "@lumino/messaging@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@lumino/messaging/-/messaging-1.7.0.tgz#32542f9e9a266fd5b3f71842f70cfe141e016d93" + integrity sha512-QYWf9QGIGD0Oes104zw7mVln4S8yRije2mZhNNRBjkYcDuQlPW+eRSuC5LwAMsFnGymBlUPwPbKOUEO2RbhAtg== dependencies: - "@lumino/algorithm" "^1.3.3" - "@lumino/collections" "^1.3.3" + "@lumino/algorithm" "^1.6.0" + "@lumino/collections" "^1.6.0" "@lumino/polling@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@lumino/polling/-/polling-1.3.3.tgz#6336638cb9ba2f4f4c3ef2529c7f260abbd25148" - integrity sha512-uMRi6sPRnKW8m38WUY3qox1jxwzpvceafUbDJATCwyrZ48+YoY5Fxfmd9dqwioHS1aq9np5c6L35a9ZGuS0Maw== + version "1.6.0" + resolved "https://registry.yarnpkg.com/@lumino/polling/-/polling-1.6.0.tgz#64f40bba4602fe9eceb9f3fae8f3647831e5b7e9" + integrity sha512-jG1nqw6UO5XEN7QamOr6iDW8WvYeZQcBVRjM38fszz62dwJ/VGPvO2hlNl6QWWIfCynbJudms0LQm+z0BT1EdA== dependencies: - "@lumino/coreutils" "^1.5.3" - "@lumino/disposable" "^1.4.3" - "@lumino/signaling" "^1.4.3" - -"@lumino/properties@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@lumino/properties/-/properties-1.2.3.tgz#10675e554e4a9dcc4022de01875fd51f33e2c785" - integrity sha512-dbS9V/L+RpQoRjxHMAGh1JYoXaLA6F7xkVbg/vmYXqdXZ7DguO5C3Qteu9tNp7Z7Q31TqFWUCrniTI9UJiJCoQ== + "@lumino/coreutils" "^1.8.0" + "@lumino/disposable" "^1.7.0" + "@lumino/signaling" "^1.7.0" -"@lumino/signaling@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@lumino/signaling/-/signaling-1.4.3.tgz#d29f7f542fdcd70b91ca275d3ca793ae21cebf6a" - integrity sha512-6clc8SMcH0tyKXIX31xw6sxjxJl5hj4YRd1DTHTS62cegQ0FkO8JjJeuv+Nc1pgTg6nEAf65aSOHpUdsFHDAvQ== - dependencies: - "@lumino/algorithm" "^1.3.3" +"@lumino/properties@^1.2.3", "@lumino/properties@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@lumino/properties/-/properties-1.5.0.tgz#7e8638e84c51bb110c5a69f91ca8b0e40b2c3fca" + integrity sha512-YqpJE6/1Wkjrie0E+ypu+yzd55B5RlvKYMnQs3Ox+SrJsnNBhA6Oj44EhVf8SUTuHgn1t/mm+LvbswKN5RM4+g== -"@lumino/virtualdom@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@lumino/virtualdom/-/virtualdom-1.8.0.tgz#42ea5778e3870e4961ea36697b28aab997c75fa6" - integrity sha512-X/1b8b7TxB9tb4+xQiS8oArcA/AK7NBZrsg2dzu/gHa3JC45R8nzQ+0tObD8Nd0gF/e9w9Ps9M62rLfefcbbKw== +"@lumino/signaling@^1.4.3", "@lumino/signaling@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@lumino/signaling/-/signaling-1.7.0.tgz#76da4738bf8f19e7da6de1d457a54220e2140670" + integrity sha512-a5kd11Sf04jTfpzxCr7TOBD2o5YvItA4IGwiOoG+QR6sPR0Rwmcf47fPItqXo5st58iNIblC3F+c264N+Me+gg== dependencies: - "@lumino/algorithm" "^1.3.3" + "@lumino/algorithm" "^1.6.0" -"@lumino/widgets@^1.16.1", "@lumino/widgets@^1.18.0": - version "1.18.0" - resolved "https://registry.yarnpkg.com/@lumino/widgets/-/widgets-1.18.0.tgz#fa8ce727126a1e91b9f3ba78e08425115046e3ac" - integrity sha512-8i10njkGjctuXrbaoV2dRI2rVUaL7eA5djtHj36pX9cALwciEPHNecF6hoZXmQ4ODv6LTwhr87Uz8LT4Aan77A== - dependencies: - "@lumino/algorithm" "^1.3.3" - "@lumino/commands" "^1.12.0" - "@lumino/coreutils" "^1.5.3" - "@lumino/disposable" "^1.4.3" - "@lumino/domutils" "^1.2.3" - "@lumino/dragdrop" "^1.7.1" - "@lumino/keyboard" "^1.2.3" - "@lumino/messaging" "^1.4.3" - "@lumino/properties" "^1.2.3" - "@lumino/signaling" "^1.4.3" - "@lumino/virtualdom" "^1.8.0" +"@lumino/virtualdom@^1.11.0", "@lumino/virtualdom@^1.8.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@lumino/virtualdom/-/virtualdom-1.11.0.tgz#468b4d28a07e2b8988dc583b4aab40e37dc6955e" + integrity sha512-G0sIx4pLYbgJ4w+SIgsCYQgKP/GBrWgjh8wcumD6XpaYZNivJv4c01xITYYlh7FU61jZmMWMrxtZztArNRDSqg== + dependencies: + "@lumino/algorithm" "^1.6.0" + +"@lumino/widgets@^1.16.1", "@lumino/widgets@^1.19.0", "@lumino/widgets@^1.23.0": + version "1.23.0" + resolved "https://registry.yarnpkg.com/@lumino/widgets/-/widgets-1.23.0.tgz#096c7574de75fa67b32bcb914c5dae290fbee6f3" + integrity sha512-0Akt9ESgc06SJ3EJG3VK1Liw+AAjRWkKMfm8VUTwT/1QJYYGZ8kfHNO97mkBLv+0EkLEkZIeaQb8fIoU6vh7bw== + dependencies: + "@lumino/algorithm" "^1.6.0" + "@lumino/commands" "^1.15.0" + "@lumino/coreutils" "^1.8.0" + "@lumino/disposable" "^1.7.0" + "@lumino/domutils" "^1.5.0" + "@lumino/dragdrop" "^1.10.0" + "@lumino/keyboard" "^1.5.0" + "@lumino/messaging" "^1.7.0" + "@lumino/properties" "^1.5.0" + "@lumino/signaling" "^1.7.0" + "@lumino/virtualdom" "^1.11.0" "@nodelib/fs.scandir@2.1.4": version "2.1.4" @@ -676,17 +704,17 @@ integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== "@types/eslint@*": - version "7.2.6" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.6.tgz#5e9aff555a975596c03a98b59ecd103decc70c3c" - integrity sha512-I+1sYH+NPQ3/tVqCeUSBwTE/0heyvtXqpIopUUArlBm0Kpocb8FbMa3AZ/ASKIFpN3rnEx932TTXDbt9OXsNDw== + version "7.2.10" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.10.tgz#4b7a9368d46c0f8cd5408c23288a59aa2394d917" + integrity sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.46": - version "0.0.46" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" - integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== +"@types/estree@*", "@types/estree@^0.0.47": + version "0.0.47" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" + integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== "@types/glob@^7.1.1": version "7.1.3" @@ -702,14 +730,14 @@ integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/minimatch@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" + integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== "@types/node@*": - version "14.14.31" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055" - integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g== + version "15.0.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" + integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA== "@types/prop-types@*": version "15.7.3" @@ -717,13 +745,19 @@ integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== "@types/react@^17.0.0": - version "17.0.2" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.2.tgz#3de24c4efef902dd9795a49c75f760cbe4f7a5a8" - integrity sha512-Xt40xQsrkdvjn1EyWe1Bc0dJLcil/9x2vAuW7ya+PuQip4UYUaXyhzWmAbwRsdMgwOFHpfp7/FFZebDU6Y8VHA== + version "17.0.5" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.5.tgz#3d887570c4489011f75a3fc8f965bf87d09a1bea" + integrity sha512-bj4biDB9ZJmGAYTWSKJly6bMr4BLUiBrx9ujiJEoP9XIDY9CTaPGxE5QWN/1WjpPLzYF7/jRNnV2nNxNe970sw== dependencies: "@types/prop-types" "*" + "@types/scheduler" "*" csstype "^3.0.2" +"@types/scheduler@*": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" + integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + "@typescript-eslint/eslint-plugin@^2.27.0": version "2.34.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" @@ -888,22 +922,22 @@ "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.1.tgz#241aecfbdc715eee96bed447ed402e12ec171935" - integrity sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ== +"@webpack-cli/configtest@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.3.tgz#204bcff87cda3ea4810881f7ea96e5f5321b87b9" + integrity sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw== -"@webpack-cli/info@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.2.tgz#ef3c0cd947a1fa083e174a59cb74e0b6195c236c" - integrity sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ== +"@webpack-cli/info@^1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.4.tgz#7381fd41c9577b2d8f6c2594fad397ef49ad5573" + integrity sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.0.tgz#2730c770f5f1f132767c63dcaaa4ec28f8c56a6c" - integrity sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw== +"@webpack-cli/serve@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.4.0.tgz#f84fd07bcacefe56ce762925798871092f0f228e" + integrity sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -920,6 +954,28 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +abstract-leveldown@^6.2.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" + integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +abstract-leveldown@~6.2.1, abstract-leveldown@~6.2.3: + version "6.2.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" + integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + acorn-jsx@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" @@ -930,10 +986,10 @@ acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4: - version "8.0.5" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.5.tgz#a3bfb872a74a6a7f661bc81b9849d9cac12601b7" - integrity sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== +acorn@^8.2.1: + version "8.2.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0" + integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg== aggregate-error@^3.0.0: version "3.1.0" @@ -958,10 +1014,10 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^7.0.2: - version "7.1.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.1.tgz#1e6b37a454021fa9941713f38b952fc1c8d32a84" - integrity sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ== +ajv@^8.0.1: + version "8.3.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.3.0.tgz#25ee7348e32cdc4a1dbb38256bf6bdc451dd577c" + integrity sha512-RYE7B5An83d7eWnDR8kbdaIFqmKCNsP16ay1hDbJEU+sa0e3H9SebskCt0Uufem6cfAVu7Col6ubcn/W+Sm8/Q== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -974,11 +1030,11 @@ ansi-colors@^4.1.1: integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-escapes@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: - type-fest "^0.11.0" + type-fest "^0.21.3" ansi-regex@^5.0.0: version "5.0.0" @@ -1016,15 +1072,20 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + at-least-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base64-js@^1.3.1: version "1.5.1" @@ -1052,22 +1113,22 @@ braces@^3.0.1: fill-range "^7.0.1" browserslist@^4.14.5: - version "4.16.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" - integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== + version "4.16.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== dependencies: - caniuse-lite "^1.0.30001181" - colorette "^1.2.1" - electron-to-chromium "^1.3.649" + caniuse-lite "^1.0.30001219" + colorette "^1.2.2" + electron-to-chromium "^1.3.723" escalade "^3.1.1" - node-releases "^1.1.70" + node-releases "^1.1.71" buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer@^5.6.0: +buffer@^5.5.0, buffer@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -1076,9 +1137,9 @@ buffer@^5.6.0: ieee754 "^1.1.13" cacache@^15.0.5: - version "15.0.5" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.5.tgz#69162833da29170d6732334643c60e005f5f17d0" - integrity sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A== + version "15.0.6" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.6.tgz#65a8c580fda15b59150fb76bf3f3a8e45d583099" + integrity sha512-g1WYDMct/jzW+JdWEyjaX2zoBkZ6ZT9VpOyp2I/VMtDsNLffNat3kqPFfi1eDRSK9/SuKGyORDHcQMcPF8sQ/w== dependencies: "@npmcli/move-file" "^1.0.1" chownr "^2.0.0" @@ -1094,7 +1155,7 @@ cacache@^15.0.5: p-map "^4.0.0" promise-inflight "^1.0.1" rimraf "^3.0.2" - ssri "^8.0.0" + ssri "^8.0.1" tar "^6.0.2" unique-filename "^1.1.1" @@ -1129,12 +1190,12 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001181: - version "1.0.30001191" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001191.tgz#bacb432b6701f690c8c5f7c680166b9a9f0843d9" - integrity sha512-xJJqzyd+7GCJXkcoBiQ1GuxEiOBCLQ0aVW9HMekifZsAVGdj5eJ4mFB9fEhSHipq9IOk/QXFJUiIr9lZT+EsGw== +caniuse-lite@^1.0.30001219: + version "1.0.30001228" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa" + integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== -chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.1: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1144,9 +1205,9 @@ chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: supports-color "^5.3.0" chalk@^4.0.0, chalk@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1167,16 +1228,14 @@ chownr@^2.0.0: integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== chrome-trace-event@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" - integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== - dependencies: - tslib "^1.9.0" + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== classnames@^2.2: - version "2.2.6" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== + version "2.3.1" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" + integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== clean-stack@^2.0.0: version "2.2.0" @@ -1211,10 +1270,10 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -codemirror@~5.57.0: - version "5.57.0" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.57.0.tgz#d26365b72f909f5d2dbb6b1209349ca1daeb2d50" - integrity sha512-WGc6UL7Hqt+8a6ZAsj/f1ApQl3NPvHY/UQSzG6fB6l4BjExgVdhFaxd7mRTw1UCiYe/6q86zHP+kfvBQcZGvUg== +codemirror@~5.61.0: + version "5.61.0" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.61.0.tgz#318e5b034a707207948b92ffc2862195e8fdb08e" + integrity sha512-D3wYH90tYY1BsKlUe0oNj2JAhQ9TepkD51auk3N7q+4uz7A/cgJ5JsWHreT0PqieW1QhOuqxQ2reCXV1YXzecg== color-convert@^1.9.0: version "1.9.3" @@ -1240,10 +1299,10 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b" - integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== +colorette@^1.2.1, colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== commander@^2.20.0: version "2.20.3" @@ -1251,9 +1310,9 @@ commander@^2.20.0: integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" - integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== commander@~6.0.0: version "6.0.0" @@ -1296,37 +1355,36 @@ crypto@~1.0.1: integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig== css-loader@^5.0.1: - version "5.0.2" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.0.2.tgz#24f758dae349bad0a440c50d7e2067742e0899cb" - integrity sha512-gbkBigdcHbmNvZ1Cg6aV6qh6k9N6XOr8YWzISLQGrwk2mgOH8LLrizhkxbDhQtaLtktyKHD4970S0xwz5btfTA== + version "5.2.4" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.4.tgz#e985dcbce339812cb6104ef3670f08f9893a1536" + integrity sha512-OFYGyINCKkdQsTrSYxzGSFnGS4gNjcXkKkQgWxK138jgnPt+lepxdjSZNc8sHAl5vP3DhsJUxufWIjOwI8PMMw== dependencies: camelcase "^6.2.0" - cssesc "^3.0.0" icss-utils "^5.1.0" loader-utils "^2.0.0" - postcss "^8.2.4" + postcss "^8.2.10" postcss-modules-extract-imports "^3.0.0" postcss-modules-local-by-default "^4.0.0" postcss-modules-scope "^3.0.0" postcss-modules-values "^4.0.0" postcss-value-parser "^4.1.0" schema-utils "^3.0.0" - semver "^7.3.4" + semver "^7.3.5" cssesc@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -csstype@^2.4.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.4.2.tgz#158e36c69566bf968da63d0ba14eda1c20e8643a" - integrity sha512-1TnkyZwDy0oUl//6685j2bTMNe61SzntWntijNdmmEzvpYbGmVMZkj204gv4glcQp6z/ypg+YRziT91XVFmOyg== +csstype@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.9.tgz#05141d0cd557a56b8891394c1911c40c8a98d098" + integrity sha512-xz39Sb4+OaTsULgUERcCk+TJj8ylkL4aSVDQiX/ksxbELSqwkgt4d4RD7fovIdgJGSuNYqwZEiVjYY5l0ask+Q== csstype@^3.0.2, csstype@~3.0.3: - version "3.0.7" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.7.tgz#2a5fb75e1015e84dd15692f71e89a1450290950b" - integrity sha512-KxnUB0ZMlnUWCsx2Z8MUsr6qV6ja1w9ArPErJaJaF8a5SOWoHLIszeCTKGRGRgtLgYrs1E8CHkNSP1VZTTPc9g== + version "3.0.8" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" + integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== debug@^4.0.1, debug@^4.1.1: version "4.3.1" @@ -1342,6 +1400,18 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +deep-equal@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== + dependencies: + is-arguments "^1.0.4" + is-date-object "^1.0.1" + is-regex "^1.0.4" + object-is "^1.0.1" + object-keys "^1.1.1" + regexp.prototype.flags "^1.2.0" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -1352,11 +1422,24 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +deferred-leveldown@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" + integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== + dependencies: + abstract-leveldown "~6.2.1" + inherits "^2.0.3" + define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -1401,9 +1484,9 @@ dom-helpers@^3.4.0: "@babel/runtime" "^7.1.2" dom-serializer@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.2.0.tgz#3433d9136aeb3c627981daa385fc7f32d27c48f1" - integrity sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA== + version "1.3.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.1.tgz#d845a1565d7c041a95e5dab62184ab41e3a519be" + integrity sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q== dependencies: domelementtype "^2.0.1" domhandler "^4.0.0" @@ -1414,33 +1497,26 @@ dom4@^2.1.5: resolved "https://registry.yarnpkg.com/dom4/-/dom4-2.1.6.tgz#c90df07134aa0dbd81ed4d6ba1237b36fc164770" integrity sha512-JkCVGnN4ofKGbjf5Uvc8mmxaATIErKQKSgACdBXpsQ3fY6DlIpAyWfiBSrGkttATssbDCp3psiAKWXk5gmjycA== -domelementtype@^2.0.1, domelementtype@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.1.0.tgz#a851c080a6d1c3d94344aed151d99f669edf585e" - integrity sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w== - -domhandler@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.3.0.tgz#6db7ea46e4617eb15cf875df68b2b8524ce0037a" - integrity sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA== - dependencies: - domelementtype "^2.0.1" +domelementtype@^2.0.1, domelementtype@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" + integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== -domhandler@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.0.0.tgz#01ea7821de996d85f69029e81fa873c21833098e" - integrity sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA== +domhandler@^4.0.0, domhandler@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.0.tgz#f9768a5f034be60a89a27c2e4d0f74eba0d8b059" + integrity sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA== dependencies: - domelementtype "^2.1.0" + domelementtype "^2.2.0" -domutils@^2.0.0: - version "2.4.4" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.4.4.tgz#282739c4b150d022d34699797369aad8d19bbbd3" - integrity sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA== +domutils@^2.5.2: + version "2.6.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.6.0.tgz#2e15c04185d43fb16ae7057cb76433c6edb938b7" + integrity sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA== dependencies: dom-serializer "^1.0.1" - domelementtype "^2.0.1" - domhandler "^4.0.0" + domelementtype "^2.2.0" + domhandler "^4.2.0" duplexer3@^0.1.4: version "0.1.4" @@ -1457,10 +1533,10 @@ duplicate-package-checker-webpack-plugin@^3.0.0: lodash "^4.17.4" semver "^5.4.1" -electron-to-chromium@^1.3.649: - version "1.3.673" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.673.tgz#b4f81c930b388f962b7eba20d0483299aaa40913" - integrity sha512-ms+QR2ckfrrpEAjXweLx6kNCbpAl66DcW//3BZD4BV5KhUgr0RZRce1ON/9J3QyA3JO28nzgb5Xv8DnPr05ILg== +electron-to-chromium@^1.3.723: + version "1.3.727" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf" + integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg== emoji-regex@^8.0.0: version "8.0.0" @@ -1472,6 +1548,16 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== +encoding-down@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" + integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== + dependencies: + abstract-leveldown "^6.2.1" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -1479,15 +1565,15 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c" - integrity sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw== +enhanced-resolve@^5.8.0: + version "5.8.2" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" + integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.5, enquirer@^2.3.6: +enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -1500,9 +1586,16 @@ entities@^2.0.0: integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== envinfo@^7.7.3: - version "7.7.4" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.7.4.tgz#c6311cdd38a0e86808c1c9343f667e4267c4a320" - integrity sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ== + version "7.8.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + +errno@~0.1.1: + version "0.1.8" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" + integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== + dependencies: + prr "~1.0.1" error-ex@^1.3.1: version "1.3.2" @@ -1512,29 +1605,31 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.18.0-next.2: - version "1.18.0-next.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.2.tgz#088101a55f0541f595e7e057199e27ddc8f3a5c2" - integrity sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw== + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" - get-intrinsic "^1.0.2" + get-intrinsic "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.2" + has-symbols "^1.0.2" + is-callable "^1.2.3" is-negative-zero "^2.0.1" - is-regex "^1.1.1" + is-regex "^1.1.2" + is-string "^1.0.5" object-inspect "^1.9.0" object-keys "^1.1.1" object.assign "^4.1.2" - string.prototype.trimend "^1.0.3" - string.prototype.trimstart "^1.0.3" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" es-module-lexer@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.0.tgz#21f4181cc8b7eee06855f1c59e6087c7bc4f77b0" - integrity sha512-iuEGihqqhKWFgh72Q/Jtch7V2t/ft8w8IPP2aEN8ArYKO+IWyo6hsi96hCdgyeEDQIV3InhYQ9BlwUFPGXrbEQ== + version "0.4.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.1.tgz#dda8c6a14d8f340a24e34331e0fab0cb50438e0e" + integrity sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA== es-to-primitive@^1.2.1: version "1.2.1" @@ -1555,6 +1650,11 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + eslint-config-prettier@^6.10.1: version "6.15.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" @@ -1563,9 +1663,9 @@ eslint-config-prettier@^6.10.1: get-stdin "^6.0.0" eslint-plugin-prettier@^3.1.2: - version "3.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7" - integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ== + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" + integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== dependencies: prettier-linter-helpers "^1.0.0" @@ -1590,17 +1690,17 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint@^7.5.0: - version "7.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" - integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== + version "7.26.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.26.0.tgz#d416fdcdcb3236cd8f282065312813f8c13982f6" + integrity sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg== dependencies: "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.3.0" + "@eslint/eslintrc" "^0.4.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -1613,10 +1713,10 @@ eslint@^7.5.0: espree "^7.3.1" esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^6.0.0" + file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" - globals "^12.1.0" + globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -1624,7 +1724,7 @@ eslint@^7.5.0: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.20" + lodash "^4.17.21" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" @@ -1681,9 +1781,9 @@ esutils@^2.0.2: integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== events@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== execa@^5.0.0: version "5.0.0" @@ -1760,7 +1860,7 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^6.0.0: +file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== @@ -1817,10 +1917,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== -free-style@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/free-style/-/free-style-2.6.1.tgz#6af512568291195854842cbbaacd95578a6a9a8b" - integrity sha512-uaVA8e57tvhrFKAl6x32SGIrGFBoeTAFtfHDzWxjPhiXQiUxOI6EEdEReRkjNO2H9XcdMJXXEnMHw8Q7iMYLbw== +free-style@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/free-style/-/free-style-3.1.0.tgz#4e2996029534e6b1731611d843437b9e2f473f08" + integrity sha512-vJujYSIyT30iDoaoeigNAxX4yB1RUrh+N2ZMhIElMr3BvCuGXOw7XNJMEEJkDUeamK2Rnb/IKFGKRKlTWIGRWA== fs-extra@^8.1.0: version "8.1.0" @@ -1863,7 +1963,7 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -get-intrinsic@^1.0.2: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -1892,9 +1992,9 @@ get-stream@^5.1.0: pump "^3.0.0" get-stream@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" - integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== git-hooks-list@1.0.3: version "1.0.3" @@ -1902,9 +2002,9 @@ git-hooks-list@1.0.3: integrity sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ== glob-parent@^5.0.0, glob-parent@^5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" @@ -1914,9 +2014,9 @@ glob-to-regexp@^0.4.1: integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1932,6 +2032,13 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globals@^13.6.0: + version "13.8.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.8.0.tgz#3e20f504810ce87a8d72e55aecf8435b50f4c1b3" + integrity sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q== + dependencies: + type-fest "^0.20.2" + globby@10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.0.tgz#abfcd0630037ae174a88590132c2f6804e291072" @@ -1973,6 +2080,11 @@ gud@^1.0.0: resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1983,10 +2095,10 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== has@^1.0.3: version "1.0.3" @@ -1996,18 +2108,18 @@ has@^1.0.3: function-bind "^1.1.1" hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -htmlparser2@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" - integrity sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q== +htmlparser2@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" + integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== dependencies: domelementtype "^2.0.1" - domhandler "^3.0.0" - domutils "^2.0.0" + domhandler "^4.0.0" + domutils "^2.5.2" entities "^2.0.0" http-cache-semantics@^4.0.0: @@ -2047,6 +2159,11 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +immediate@^3.2.3: + version "3.3.0" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" + integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -2073,11 +2190,6 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indexes-of@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= - infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -2091,7 +2203,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2125,27 +2237,46 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +is-arguments@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== + dependencies: + call-bind "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-callable@^1.1.4, is-callable@^1.2.2: +is-bigint@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" + integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + +is-boolean-object@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" + integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + dependencies: + call-bind "^1.0.2" + +is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== is-core-module@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + version "2.4.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" + integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== dependencies: has "^1.0.3" is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" + integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== is-extglob@^2.1.1: version "2.1.1" @@ -2169,6 +2300,11 @@ is-negative-zero@^2.0.1: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== +is-number-object@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" + integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -2186,25 +2322,35 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-regex@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" - integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +is-regex@^1.0.4, is-regex@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" + integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== dependencies: call-bind "^1.0.2" - has-symbols "^1.0.1" + has-symbols "^1.0.2" is-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== +is-string@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" + integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== dependencies: - has-symbols "^1.0.1" + has-symbols "^1.0.2" isexe@^2.0.0: version "2.0.0" @@ -2216,6 +2362,11 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isomorphic.js@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/isomorphic.js/-/isomorphic.js-0.2.4.tgz#24ca374163ae54a7ce3b86ce63b701b91aa84969" + integrity sha512-Y4NjZceAwaPXctwsHgNsmfuPxR8lJ3f8X7QTAkhltrX4oGIv+eTlgHLXn4tWysC9zGTi929gapnPp+8F8cg7nA== + jest-worker@^26.5.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" @@ -2305,6 +2456,93 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klona@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" + integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== + +level-codec@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" + integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== + dependencies: + buffer "^5.6.0" + +level-concat-iterator@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" + integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== + +level-errors@^2.0.0, level-errors@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" + integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== + dependencies: + errno "~0.1.1" + +level-iterator-stream@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" + integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== + dependencies: + inherits "^2.0.4" + readable-stream "^3.4.0" + xtend "^4.0.2" + +level-js@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/level-js/-/level-js-5.0.2.tgz#5e280b8f93abd9ef3a305b13faf0b5397c969b55" + integrity sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg== + dependencies: + abstract-leveldown "~6.2.3" + buffer "^5.5.0" + inherits "^2.0.3" + ltgt "^2.1.2" + +level-packager@^5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" + integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== + dependencies: + encoding-down "^6.3.0" + levelup "^4.3.2" + +level-supports@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" + integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== + dependencies: + xtend "^4.0.2" + +level@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/level/-/level-6.0.1.tgz#dc34c5edb81846a6de5079eac15706334b0d7cd6" + integrity sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw== + dependencies: + level-js "^5.0.0" + level-packager "^5.1.0" + leveldown "^5.4.0" + +leveldown@^5.4.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-5.6.0.tgz#16ba937bb2991c6094e13ac5a6898ee66d3eee98" + integrity sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ== + dependencies: + abstract-leveldown "~6.2.1" + napi-macros "~2.0.0" + node-gyp-build "~4.1.0" + +levelup@^4.3.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" + integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== + dependencies: + deferred-leveldown "~5.3.0" + level-errors "~2.0.0" + level-iterator-stream "~4.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -2313,6 +2551,13 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lib0@^0.2.31, lib0@^0.2.35, lib0@^0.2.38, lib0@^0.2.41: + version "0.2.41" + resolved "https://registry.yarnpkg.com/lib0/-/lib0-0.2.41.tgz#57e6e9ffa2eb7c621c891946d150af50fac035bc" + integrity sha512-lZ0I6N81tIDgoPIlUTRhb6mNjPsG5BXIbaK/UbtjakcYnfR+O64bKtIrLXDDnfd7nAo4vpGeZ0mPzbTsNTREcg== + dependencies: + isomorphic.js "^0.2.4" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -2353,12 +2598,27 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + lodash.escape@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= + +lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2387,6 +2647,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +ltgt@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= + make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -2395,9 +2660,9 @@ make-dir@^3.0.2: semver "^6.0.0" marked@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.0.tgz#9662bbcb77ebbded0662a7be66ff929a8611cee5" - integrity sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q== + version "2.0.3" + resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.3.tgz#3551c4958c4da36897bda2a16812ef1399c8d6b0" + integrity sha512-5otztIIcJfPc2qGTN8cVtOJEjNJZ0jwa46INMagrYfk0EvqtRuEHLsEe0LrFS0/q+ZRKT0+kXK7P2T1AN5lWRA== memorystream@^0.3.1: version "0.3.1" @@ -2415,24 +2680,24 @@ merge2@^1.2.3, merge2@^1.3.0: integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== dependencies: braces "^3.0.1" - picomatch "^2.0.5" + picomatch "^2.2.3" -mime-db@1.46.0: - version "1.46.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee" - integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== +mime-db@1.47.0: + version "1.47.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" + integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== mime-types@^2.1.27: - version "2.1.29" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.29.tgz#1d4ab77da64b91f5f72489df29236563754bb1b2" - integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== + version "2.1.30" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" + integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== dependencies: - mime-db "1.46.0" + mime-db "1.47.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2445,9 +2710,9 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== mini-css-extract-plugin@~1.3.2: - version "1.3.8" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.8.tgz#639047b78c2ee728704285aa468d2a5a8d91d566" - integrity sha512-u+2kVov/Gcs74iz+x3phEBWMAGw2djjnKfYez+Pl/b5dyXL7aM4Lp5QQtIq16CDwRHT/woUJki49gBNMhfm1eA== + version "1.3.9" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.9.tgz#47a32132b0fd97a119acd530e8421e8f6ab16d5e" + integrity sha512-Ac4s+xhVbqlyhXS5J/Vh/QXUz3ycXlCqoCPpg0vdfhsIBH9eg/It/9L1r1XhSCH737M1lqcWnMuWL13zcygn5A== dependencies: loader-utils "^2.0.0" schema-utils "^3.0.0" @@ -2521,10 +2786,15 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanoid@^3.1.20: - version "3.1.20" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" - integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== +nanoid@^3.1.23: + version "3.1.23" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81" + integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw== + +napi-macros@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" + integrity sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg== natural-compare@^1.4.0: version "1.4.0" @@ -2546,7 +2816,12 @@ node-fetch@^2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== -node-releases@^1.1.70: +node-gyp-build@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.1.tgz#d7270b5d86717068d114cc57fff352f96d745feb" + integrity sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ== + +node-releases@^1.1.71: version "1.1.71" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== @@ -2599,9 +2874,17 @@ object-assign@^4.1.1: integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-inspect@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" - integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== + version "1.10.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" + integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== + +object-is@^1.0.1: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -2759,10 +3042,10 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -picomatch@^2.0.5, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.2.1, picomatch@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" + integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== pidtree@^0.3.0: version "0.3.1" @@ -2815,13 +3098,11 @@ postcss-modules-values@^4.0.0: icss-utils "^5.0.0" postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz#56075a1380a04604c38b063ea7767a129af5c2b3" - integrity sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw== + version "6.0.5" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz#042d74e137db83e6f294712096cb413f5aa612c4" + integrity sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg== dependencies: cssesc "^3.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" util-deprecate "^1.0.2" postcss-value-parser@^4.1.0: @@ -2829,22 +3110,13 @@ postcss-value-parser@^4.1.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -postcss@^7.0.27: - version "7.0.35" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" - integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== +postcss@^8.0.2, postcss@^8.2.10: + version "8.2.15" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.15.tgz#9e66ccf07292817d226fc315cbbf9bc148fbca65" + integrity sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q== dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" - -postcss@^8.2.4: - version "8.2.6" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.6.tgz#5d69a974543b45f87e464bc4c3e392a97d6be9fe" - integrity sha512-xpB8qYxgPuly166AGlpRjUdEYtmOWx2iCwGmrv4vqZL9YPVviDVPZPRXxnXr6xPZOdxQ9lp3ZBFCRgWJ7LE3Sg== - dependencies: - colorette "^1.2.1" - nanoid "^3.1.20" + colorette "^1.2.2" + nanoid "^3.1.23" source-map "^0.6.1" prelude-ls@^1.2.1: @@ -2870,9 +3142,14 @@ prettier@^1.19.0: integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== prettier@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" + integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= progress@^2.0.0: version "2.0.3" @@ -2893,6 +3170,11 @@ prop-types@^15.6.1, prop-types@^15.6.2: object-assign "^4.1.1" react-is "^16.8.1" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -2922,9 +3204,9 @@ querystringify@^2.1.1: integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== queue-microtask@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.2.tgz#abf64491e6ecf0f38a6502403d4cda04f372dfd3" - integrity sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg== + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== randombytes@^2.1.0: version "2.1.0" @@ -2952,13 +3234,13 @@ rc@^1.2.8: strip-json-comments "~2.0.1" react-dom@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6" - integrity sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug== + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - scheduler "^0.20.1" + scheduler "^0.20.2" react-is@^16.8.1: version "16.13.1" @@ -2971,12 +3253,13 @@ react-lifecycles-compat@^3.0.4: integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== react-popper@^1.3.7: - version "1.3.10" - resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.10.tgz#96fd88cc1bf45957e551c5053afea7adc0b1d4d8" - integrity sha512-sZfwHtHCMst0L0G/c83/Y/K1f9fNWMEKsk/cGAor68rQBHB75WuDQ7k95tkce8QNaUHhg9uFXIJbZO0eWRvJbw== + version "1.3.11" + resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.11.tgz#a2cc3f0a67b75b66cfa62d2c409f9dd1fcc71ffd" + integrity sha512-VSA/bS+pSndSF2fiasHK/PTEEAyOpX60+H5EPAjoArr8JGm+oihu4UbrqcEBpQibJxBVCpYyjAX7abJ+7DoYVg== dependencies: "@babel/runtime" "^7.1.2" "@hypnosphi/create-react-context" "^0.3.1" + deep-equal "^1.1.1" popper.js "^1.14.4" prop-types "^15.6.1" typed-styles "^0.0.7" @@ -2993,9 +3276,9 @@ react-transition-group@^2.9.0: react-lifecycles-compat "^3.0.4" react@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127" - integrity sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w== + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -3009,6 +3292,15 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" +readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + rechoir@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" @@ -3021,6 +3313,14 @@ regenerator-runtime@^0.13.4: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== +regexp.prototype.flags@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" + integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" @@ -3120,13 +3420,13 @@ run-parallel@^1.1.9: queue-microtask "^1.2.2" rxjs@^6.6.0: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -safe-buffer@^5.1.0: +safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3136,20 +3436,23 @@ safe-buffer@^5.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sanitize-html@~1.27.4: - version "1.27.5" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.27.5.tgz#6c8149462adb23e360e1bb71cc0bae7f08c823c7" - integrity sha512-M4M5iXDAUEcZKLXkmk90zSYWEtk5NH3JmojQxKxV371fnMh+x9t1rqdmXaGoyEHw3z/X/8vnFhKjGL5xFGOJ3A== +sanitize-html@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.3.3.tgz#3db382c9a621cce4c46d90f10c64f1e9da9e8353" + integrity sha512-DCFXPt7Di0c6JUnlT90eIgrjs6TsJl/8HYU3KLdmrVclFN4O0heTcVbJiMa23OKVr6aR051XYtsgd8EWwEBwUA== dependencies: - htmlparser2 "^4.1.0" - lodash "^4.17.15" + deepmerge "^4.2.2" + escape-string-regexp "^4.0.0" + htmlparser2 "^6.0.0" + is-plain-object "^5.0.0" + klona "^2.0.3" parse-srcset "^1.0.2" - postcss "^7.0.27" + postcss "^8.0.2" -scheduler@^0.20.1: - version "0.20.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" - integrity sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw== +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -3182,10 +3485,10 @@ semver@^6.0.0, semver@^6.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== +semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" @@ -3322,7 +3625,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -ssri@^8.0.0: +ssri@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== @@ -3330,9 +3633,9 @@ ssri@^8.0.0: minipass "^3.1.1" string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" @@ -3347,7 +3650,7 @@ string.prototype.padend@^3.0.0: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" -string.prototype.trimend@^1.0.3: +string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== @@ -3355,7 +3658,7 @@ string.prototype.trimend@^1.0.3: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimstart@^1.0.3: +string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== @@ -3363,6 +3666,13 @@ string.prototype.trimstart@^1.0.3: call-bind "^1.0.2" define-properties "^1.1.3" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -3405,13 +3715,6 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -3428,14 +3731,16 @@ svg-url-loader@~6.0.0: loader-utils "~2.0.0" table@^6.0.4: - version "6.0.7" - resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" - integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== + version "6.7.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.0.tgz#26274751f0ee099c547f6cb91d3eff0d61d155b2" + integrity sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw== dependencies: - ajv "^7.0.2" - lodash "^4.17.20" + ajv "^8.0.1" + lodash.clonedeep "^4.5.0" + lodash.truncate "^4.4.2" slice-ansi "^4.0.0" string-width "^4.2.0" + strip-ansi "^6.0.0" tapable@^2.1.1, tapable@^2.2.0: version "2.2.0" @@ -3482,9 +3787,9 @@ terser-webpack-plugin@^5.1.1: terser "^5.5.1" terser@^5.3.4, terser@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.0.tgz#138cdf21c5e3100b1b3ddfddf720962f88badcd2" - integrity sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA== + version "5.7.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.0.tgz#a761eeec206bc87b605ab13029876ead938ae693" + integrity sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g== dependencies: commander "^2.20.0" source-map "~0.7.2" @@ -3537,9 +3842,9 @@ tslib@~1.13.0: integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== tsutils@^3.17.1: - version "3.20.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.20.0.tgz#ea03ea45462e146b53d70ce0893de453ff24f698" - integrity sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg== + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== dependencies: tslib "^1.8.1" @@ -3550,10 +3855,15 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-fest@^0.8.1: version "0.8.1" @@ -3576,17 +3886,22 @@ typescript@~4.1.3: integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== typestyle@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/typestyle/-/typestyle-2.0.4.tgz#b8da5feaf8a4f9d1f69066f3cc4659098bd08457" - integrity sha512-+57eGqcEjiAc51hB/zXnZFoVuzwuxb9WbPpb1VT2zPJPIo88wGXod7dHa0IJ1Ue+sncHj2WZMZEPJRAqwVraoA== + version "2.1.0" + resolved "https://registry.yarnpkg.com/typestyle/-/typestyle-2.1.0.tgz#7c5cc567de72cd8bfb686813150b92791aaa7636" + integrity sha512-6uCYPdG4xWLeEcl9O0GtNFnNGhami+irKiLsXSuvWHC/aTS7wdj49WeikWAKN+xHN3b1hm+9v0svwwgSBhCsNA== dependencies: - csstype "^2.4.0" - free-style "2.6.1" + csstype "2.6.9" + free-style "3.1.0" -uniq@^1.0.1: +unbox-primitive@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" unique-filename@^1.1.1: version "1.1.1" @@ -3635,10 +3950,10 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url-parse@~1.4.7: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== +url-parse@~1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" + integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" @@ -3651,15 +3966,15 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -util-deprecate@^1.0.2: +util-deprecate@^1.0.1, util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== validate-npm-package-license@^3.0.1: version "3.0.4" @@ -3685,17 +4000,16 @@ watchpack@^2.0.0: graceful-fs "^4.1.2" webpack-cli@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.5.0.tgz#b5213b84adf6e1f5de6391334c9fa53a48850466" - integrity sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q== + version "4.7.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.7.0.tgz#3195a777f1f802ecda732f6c95d24c0004bc5a35" + integrity sha512-7bKr9182/sGfjFm+xdZSwgQuFjgEcy0iCTIBxRUeteJ2Kr8/Wz0qNJX+jw60LU36jApt4nmMkep6+W5AKhok6g== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.0.1" - "@webpack-cli/info" "^1.2.2" - "@webpack-cli/serve" "^1.3.0" + "@webpack-cli/configtest" "^1.0.3" + "@webpack-cli/info" "^1.2.4" + "@webpack-cli/serve" "^1.4.0" colorette "^1.2.1" commander "^7.0.0" - enquirer "^2.3.6" execa "^5.0.0" fastest-levenshtein "^1.0.12" import-local "^3.0.2" @@ -3729,19 +4043,19 @@ webpack-sources@^2.1.1: source-map "^0.6.1" webpack@^5.3.1: - version "5.24.2" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.2.tgz#33790dad631e8b639f4246d762e257720875fe54" - integrity sha512-uxxKYEY4kMNjP+D2Y+8aw5Vd7ar4pMuKCNemxV26ysr1nk0YDiQTylg9U3VZIdkmI0YHa0uC8ABxL+uGxGWWJg== + version "5.37.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.37.0.tgz#2ab00f613faf494504eb2beef278dab7493cc39d" + integrity sha512-yvdhgcI6QkQkDe1hINBAJ1UNevqNGTVaCkD2SSJcB8rcrNNl922RI8i2DXUAuNfANoxwsiXXEA4ZPZI9q2oGLA== dependencies: "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.46" + "@types/estree" "^0.0.47" "@webassemblyjs/ast" "1.11.0" "@webassemblyjs/wasm-edit" "1.11.0" "@webassemblyjs/wasm-parser" "1.11.0" - acorn "^8.0.4" + acorn "^8.2.1" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.7.0" + enhanced-resolve "^5.8.0" es-module-lexer "^0.4.0" eslint-scope "^5.1.1" events "^3.2.0" @@ -3757,6 +4071,17 @@ webpack@^5.3.1: watchpack "^2.0.0" webpack-sources "^2.1.1" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -3794,16 +4119,69 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +ws@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" + integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + dependencies: + async-limiter "~1.0.0" + ws@^7.2.0: - version "7.4.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.3.tgz#1f9643de34a543b8edb124bdcbc457ae55a6e5cd" - integrity sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA== + version "7.4.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" + integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== + +xtend@^4.0.2, xtend@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y-codemirror@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/y-codemirror/-/y-codemirror-2.1.0.tgz#905c85fececd6ffa784f9c4bcb69c22ff1ae696e" + integrity sha512-lwuXbZoUW1EmhSTFYR7Qkbi01ixn5/L2LpnZ/7/vSRcJL3PKnWLFJOxXdXTx6bNDGUjY8N0VjJe97fYL6ev00Q== + dependencies: + lib0 "^0.2.35" + +y-leveldb@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/y-leveldb/-/y-leveldb-0.1.0.tgz#8b60c1af020252445875ebc70d52666017bcb038" + integrity sha512-sMuitVrsAUNh+0b66I42nAuW3lCmez171uP4k0ePcTAJ+c+Iw9w4Yq3wwiyrDMFXBEyQSjSF86Inc23wEvWnxw== + dependencies: + level "^6.0.1" + lib0 "^0.2.31" + +y-protocols@^1.0.3, y-protocols@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/y-protocols/-/y-protocols-1.0.4.tgz#810978c6172474be87457c3bcd669e529c5ba3a1" + integrity sha512-5/Hd6DJ5Y2SlbqLIKq86BictdOS0iAcWJZCVop8MKqx0XWwA+BbMn4538n4Z0CGjFMUGnG1kGzagk3BKGz5SvQ== + dependencies: + lib0 "^0.2.35" + +y-websocket@^1.3.11: + version "1.3.11" + resolved "https://registry.yarnpkg.com/y-websocket/-/y-websocket-1.3.11.tgz#b6e1357a2f63fe8d74ab8999991f85af88ed4221" + integrity sha512-Cvf85SE1mwFxrMRCokr4Rj16febCtfJziQWGn/F74h2W37SGPPpPNQjYZR9PFG7ryMAskoMF3ge7ZR1IEnL5CQ== + dependencies: + lib0 "^0.2.35" + lodash.debounce "^4.0.8" + y-protocols "^1.0.3" + optionalDependencies: + ws "^6.2.1" + y-leveldb "^0.1.0" yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yjs@^13.5.3: + version "13.5.5" + resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.5.5.tgz#8a52a7354006e04a54dc62c9ffbbd7c606e20ded" + integrity sha512-sbE4G+bSP0jw71aJ9Hqi5UxOTy8JGkObIaCSpY6krRoNqssPCWq05rqV9PQcuMqcrHD3twzko92fVaF1S3id/Q== + dependencies: + lib0 "^0.2.38" + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From b9b516f49955855489b18cb28598955b506d5cb4 Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Fri, 14 May 2021 13:17:55 +0200 Subject: [PATCH 02/11] Enable a basic collaborative model --- package.json | 5 +-- src/factory.ts | 2 +- src/model.ts | 92 ++++++++++++++++++++++++++++++++++++++++++++++---- src/panel.ts | 80 ++++++++++++++++++++++++++++--------------- src/widget.ts | 14 ++------ yarn.lock | 54 +++++++++++++++++++++-------- 6 files changed, 183 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index dfd2f8eb..2d74bd3b 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,11 @@ "@lumino/signaling": "^1.4.3", "@lumino/widgets": "^1.19.0", "react": "^17.0.1", - "react-dom": "^17.0.1" + "react-dom": "^17.0.1", + "yjs": "^13.5.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.5", + "@jupyterlab/builder": "^3.1.0-alpha.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/src/factory.ts b/src/factory.ts index 60f0c87c..64e763b1 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -33,7 +33,7 @@ export class DrawIOWidgetFactory extends ABCWidgetFactory< return new DrawIODocumentWidget({ context, commands: this._commands, - content: new DrawIOWidget() + content: new DrawIOWidget(context.model) }); } diff --git a/src/model.ts b/src/model.ts index 9a0ca34c..935ff25f 100644 --- a/src/model.ts +++ b/src/model.ts @@ -14,7 +14,7 @@ import { DocumentRegistry } from '@jupyterlab/docregistry'; -import { ISharedDocument, YFile } from '@jupyterlab/shared-models'; +import { ISharedFile, YDocument, YFile, Delta } from '@jupyterlab/shared-models'; import { IChangedArgs } from '@jupyterlab/coreutils'; @@ -24,6 +24,14 @@ import { PartialJSONValue, ReadonlyPartialJSONValue } from '@lumino/coreutils'; import { ISignal, Signal } from '@lumino/signaling'; +import { + XmlFragment, + XmlElement, + XmlText, + YEvent, + YXmlEvent +} from 'yjs'; + export class DrawIODocumentModel implements DocumentRegistry.IModel { @@ -32,7 +40,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { */ constructor(languagePreference?: string, modelDB?: IModelDB) { this.modelDB = modelDB || new ModelDB(); - console.debug(this.modelDB); } get dirty(): boolean { @@ -67,7 +74,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { readonly modelDB: IModelDB; - readonly sharedModel: ISharedDocument = YFile.create(); + readonly sharedModel: ISharedFile = YFile.create(); dispose(): void { this._isDisposed = true; @@ -75,13 +82,14 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { toString(): string { // TODO: Return content from shared model - console.warn("toString(): Not implemented"); - return ''; + //console.info("DrawIODocumentModel.toString():", this.sharedModel.getSource()); + return this.sharedModel.getSource(); } fromString(value: string): void { // TODO: Add content to shared model - console.warn("fromString(): Not implemented"); + //console.info("DrawIODocumentModel.fromString():", value); + this.sharedModel.setSource(value); } toJSON(): PartialJSONValue { @@ -103,3 +111,75 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { private _contentChanged = new Signal(this); private _stateChanged = new Signal>(this); } + +export type XMLChange = { + graphChanged?: Delta; + rootChanged?: Delta; +}; + +export class XMLModel extends YDocument { + constructor() { + super(); + this._mxGraphModel = this.ydoc.getXmlFragment('mxGraphModel'); + this._root = new XmlElement(); + this._mxGraphModel.observeDeep(this._modelObserver); + this.transact(() => { + this._mxGraphModel.insert(0, [this._root]); + }); + } + + /** + * Handle a change to the _mxGraphModel. + */ + private _modelObserver = (events: YEvent[]) => { + const changes: XMLChange = {}; + //changes.graphChanged = events.find();.delta as any; + this._changed.emit(changes); + }; + + public static create(): XMLModel { + return new XMLModel(); + } + + /** + * Gets cell's source. + * + * @returns Cell's source. + */ + public getGraphModel(): string { + return this._mxGraphModel.toString(); + } + + /** + * Sets cell's source. + * + * @param value: New source. + */ + public setSource(value: string): void { + this.transact(() => { + const text = this._root; + text.delete(0, text.length); + text.insert(0, [new XmlText(value)]); + }); + } + + /** + * Replace content from `start' to `end` with `value`. + * + * @param start: The start index of the range to replace (inclusive). + * + * @param end: The end index of the range to replace (exclusive). + * + * @param value: New source (optional). + */ + public updateSource(start: number, end: number, value = ''): void { + this.transact(() => { + const source = this._root; + source.delete(start, end - start); + source.insert(start, [new XmlText(value)]); + }); + } + + private _mxGraphModel: XmlFragment; + private _root: XmlElement; +} \ No newline at end of file diff --git a/src/panel.ts b/src/panel.ts index 203c14bf..5d2ddff2 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -1,7 +1,5 @@ import { Widget } from '@lumino/widgets'; -import { Signal, ISignal } from '@lumino/signaling'; - import { PromiseDelegate } from '@lumino/coreutils'; /* @@ -15,6 +13,8 @@ import './drawio/css/common.css'; import './drawio/styles/grapheditor.css'; +import { DrawIODocumentModel } from './model'; + import { grapheditorTxt, defaultXml } from './pack'; const w = window as any; @@ -42,17 +42,19 @@ export class DrawIOWidget extends Widget { * * @param info - The `DashboardView` metadata. */ - constructor() { + constructor(model: DrawIODocumentModel) { super(); - void Private.ensureMx().then(mx => this._loadDrawIO(mx)); - //this._loadDrawIO(MX); + this._model = model; + Private.ensureMx().then(mx => { + this._loadDrawIO(mx); + this._model.sharedModel.changed.connect(this._onContentChanged, this); + }); } /** * Dispose of the resources held by the widget. */ dispose(): void { - Signal.clearData(this); this._editor.destroy(); super.dispose(); } @@ -64,10 +66,6 @@ export class DrawIOWidget extends Widget { return this._ready; } - get graphChanged(): ISignal { - return this._graphChanged; - } - get mx(): any { return this._mx; } @@ -88,21 +86,6 @@ export class DrawIOWidget extends Widget { return this._editor.actions.actions; } - setContent(newValue: string): void { - if (this._editor === undefined) { - return; - } - - const oldValue = this._mx.mxUtils.getXml(this._editor.editor.getGraphXml()); - - if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { - if (newValue.length) { - const xml = this._mx.mxUtils.parseXml(newValue); - this._editor.editor.setGraphXml(xml.documentElement); - } - } - } - //Direction public toggleCellStyles(flip: string): void { let styleFlip = this._editor.mx.mxConstants.STYLE_FLIPH; @@ -369,6 +352,22 @@ export class DrawIOWidget extends Widget { }, true); } + private _onContentChanged(): void { + const newValue = this._model.sharedModel.getSource(); + if (this._editor === undefined) { + return; + } + + const oldValue = this._mx.mxUtils.getXml(this._editor.editor.getGraphXml()); + + if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { + if (newValue.length) { + const xml = this._mx.mxUtils.parseXml(newValue); + this._editor.editor.setGraphXml(xml.documentElement); + } + } + } + private _loadDrawIO(mx: Private.MX): void { this._mx = mx; @@ -389,9 +388,12 @@ export class DrawIOWidget extends Widget { this._editor = new this._mx.EditorUi(new Editor(false, themes), this.node); this._editor.refresh(); + //console.debug(this._mx.Editor); + //console.debug(this._editor.editor.graph.model); this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { + //console.debug("Event:", evt); const changes: any[] = evt.properties.changes; for (let i = 0; i < changes.length; i++) { if (changes[i].root) { @@ -405,10 +407,29 @@ export class DrawIOWidget extends Widget { const graph = this._editor.editor.getGraphXml(); const xml = this._mx.mxUtils.getXml(graph); - this._graphChanged.emit(xml); + this._model.sharedModel.setSource(xml); } ); + /* this._editor.editor.graph.model.addListener( + this._mx.mxEvent.NOTIFY, + (sender: any, evt: any) => { + var changes = evt.getProperty('edit').changes; + + for (var i = 0; i < changes.length; i++) + { + var change = changes[i]; + + if ( + change instanceof this._mx.mxChildChange && + change.change.previous == null + ) { + this._editor.editor.graph.startEditingAtCell(change.child); + break; + } + } + }); */ + this._promptSpacing = this._mx.mxUtils.bind( this, (defaultValue: any, fn: any) => { @@ -426,15 +447,18 @@ export class DrawIOWidget extends Widget { dlg.init(); } ); - + + const data = this._model.sharedModel.getSource(); + const xml = this._mx.mxUtils.parseXml(data); + this._editor.editor.setGraphXml(xml.documentElement); this._ready.resolve(void 0); } private _editor: any; private _mx: Private.MX; private _promptSpacing: any; + private _model: DrawIODocumentModel; private _ready = new PromiseDelegate(); - private _graphChanged = new Signal(this); } /** diff --git a/src/widget.ts b/src/widget.ts index 82a80465..b024c0cd 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -83,16 +83,14 @@ export class DrawIODocumentWidget extends DocumentWidget diff --git a/yarn.lock b/yarn.lock index e06af5ec..93de5a76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -151,14 +151,14 @@ sanitize-html "~2.3.3" url "^0.11.0" -"@jupyterlab/builder@^3.0.5": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@jupyterlab/builder/-/builder-3.0.8.tgz#132182cf61959f5b17110f5da035d0625acf318c" - integrity sha512-f5HPbH+oxxZGRt+/hxeuW/217cGyD2jCE2ksy8758WgQGspfQHSNWhshGgGufs/6PfUoKx8vIYY8dmPMn5WdeQ== +"@jupyterlab/builder@^3.1.0-alpha.7": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/builder/-/builder-3.1.0-alpha.8.tgz#705f458a5c61f2b11a75bf9bf57c54ea80a83a76" + integrity sha512-C+K3tXaYZVCmYh7k2HuP7egwYRHjZH4cVGC+LBFMTcQDaHCJqY15w9o9x/IlZ/ttdmmBrn2WAn+OYcMx4LCvRw== dependencies: - "@jupyterlab/buildutils" "^3.0.6" + "@jupyterlab/buildutils" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" - "@lumino/application" "^1.13.1" + "@lumino/application" "^1.16.0" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -168,7 +168,7 @@ "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" "@lumino/virtualdom" "^1.8.0" - "@lumino/widgets" "^1.16.1" + "@lumino/widgets" "^1.19.0" ajv "^6.12.3" commander "~6.0.0" css-loader "^5.0.1" @@ -176,6 +176,7 @@ file-loader "~6.0.0" fs-extra "^9.0.1" glob "~7.1.6" + license-webpack-plugin "^2.3.11" mini-css-extract-plugin "~1.3.2" path-browserify "^1.0.0" process "^0.11.10" @@ -191,10 +192,10 @@ webpack-merge "^5.1.2" worker-loader "^3.0.2" -"@jupyterlab/buildutils@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@jupyterlab/buildutils/-/buildutils-3.0.6.tgz#b9a0500c07581471266adc7dea03295d32d911fa" - integrity sha512-S6Hnop5A5KjCCHQt1ob3ABy1VQ94ssbRPsYa04R7mUjVQu5NsIS8Kd0O/+yqtuSaWIJOqCKhRZEev3rgG+dHqw== +"@jupyterlab/buildutils@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/buildutils/-/buildutils-3.1.0-alpha.8.tgz#7924f92b0a59d96d7fcdeae0aa9ab1afe877731e" + integrity sha512-0iggMuQPubF/FboOFxGZO8/T242WUkBQjMMCcAJToywt2sFf2pxbWAzkjgu74mugLvnkikUJQrnMEOwBmfoJ5A== dependencies: "@lumino/coreutils" "^1.5.3" "@yarnpkg/lockfile" "^1.1.0" @@ -205,6 +206,7 @@ fs-extra "^9.0.1" glob "~7.1.6" inquirer "^7.0.0" + minimatch "~3.0.4" package-json "^6.5.0" prettier "^2.1.1" semver "^7.3.2" @@ -531,7 +533,7 @@ resolved "https://registry.yarnpkg.com/@lumino/algorithm/-/algorithm-1.6.0.tgz#771e7896cd94e660f9b58a52f80e1bb255de1d41" integrity sha512-NMOcm5Yr9nXz5gokS/K4jHBbUMQYBkvDXl1n51XWdcz0LY+oGuIKPhjazhUgmbNRehzdZBj5hMMd1+htYWeVKQ== -"@lumino/application@^1.13.1", "@lumino/application@^1.16.0": +"@lumino/application@^1.16.0": version "1.20.0" resolved "https://registry.yarnpkg.com/@lumino/application/-/application-1.20.0.tgz#b50ca4180bc400589fdfcfcaab08c4af937fccd0" integrity sha512-FAoQcq4L3ZswTK0lWfLKnG1ecG26cwqjzg2fyoBeuWGBi1TG9BYjFBdV7ErTFMxW8jE1CLOLuxsZaKFLNErcKA== @@ -627,7 +629,7 @@ dependencies: "@lumino/algorithm" "^1.6.0" -"@lumino/widgets@^1.16.1", "@lumino/widgets@^1.19.0", "@lumino/widgets@^1.23.0": +"@lumino/widgets@^1.19.0", "@lumino/widgets@^1.23.0": version "1.23.0" resolved "https://registry.yarnpkg.com/@lumino/widgets/-/widgets-1.23.0.tgz#096c7574de75fa67b32bcb914c5dae290fbee6f3" integrity sha512-0Akt9ESgc06SJ3EJG3VK1Liw+AAjRWkKMfm8VUTwT/1QJYYGZ8kfHNO97mkBLv+0EkLEkZIeaQb8fIoU6vh7bw== @@ -758,6 +760,20 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== +"@types/source-list-map@*": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" + integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== + +"@types/webpack-sources@^0.1.5": + version "0.1.8" + resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.8.tgz#078d75410435993ec8a0a2855e88706f3f751f81" + integrity sha512-JHB2/xZlXOjzjBB6fMOpH1eQAfsrpqVVIbneE0Rok16WXwFaznaI5vfg75U5WgGJm7V9W1c4xeRQDjX/zwvghA== + dependencies: + "@types/node" "*" + "@types/source-list-map" "*" + source-map "^0.6.1" + "@typescript-eslint/eslint-plugin@^2.27.0": version "2.34.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9" @@ -2558,6 +2574,14 @@ lib0@^0.2.31, lib0@^0.2.35, lib0@^0.2.38, lib0@^0.2.41: dependencies: isomorphic.js "^0.2.4" +license-webpack-plugin@^2.3.11: + version "2.3.18" + resolved "https://registry.yarnpkg.com/license-webpack-plugin/-/license-webpack-plugin-2.3.18.tgz#03bfe916634ecb845c0899a37443e6869b08b83c" + integrity sha512-a6tSN07AgKkX9nVntBd9MP7OAzt7gKAcnXOy6xegH5y0012vVPNiglLdR0qrEIagg7TMAGhZi1WONiNOg8pe8w== + dependencies: + "@types/webpack-sources" "^0.1.5" + webpack-sources "^1.2.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -2718,7 +2742,7 @@ mini-css-extract-plugin@~1.3.2: schema-utils "^3.0.0" webpack-sources "^1.1.0" -minimatch@^3.0.4: +minimatch@^3.0.4, minimatch@~3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -4026,7 +4050,7 @@ webpack-merge@^5.1.2, webpack-merge@^5.7.3: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-sources@^1.1.0, webpack-sources@^1.4.3: +webpack-sources@^1.1.0, webpack-sources@^1.2.0, webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== From 7ab85d8e0b21b4379fe748cd0f379cbdd6f4f772 Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Tue, 18 May 2021 11:53:06 +0200 Subject: [PATCH 03/11] test shared model --- package.json | 28 +-- src/factory.ts | 40 ++--- src/index.ts | 2 +- src/model.ts | 280 ++++++++++++++++++----------- src/panel.ts | 33 ++-- src/widget.ts | 10 +- yarn.lock | 479 +++++++++++++++++++++++++------------------------ 7 files changed, 481 insertions(+), 391 deletions(-) diff --git a/package.json b/package.json index 2d74bd3b..c4498459 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,9 @@ "build:lib": "rimraf lib/drawio && mkdir -p lib/drawio && cp -R src/drawio lib && tsc", "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", - "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension && jlpm run clean:node", "clean:labextension": "rimraf jupyterlab-drawio/labextension", + "clean:node": "rimraf node_modules yarn.lock", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", @@ -45,27 +46,28 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.1.0-alpha.7", - "@jupyterlab/apputils": "^3.1.0-alpha.7", - "@jupyterlab/coreutils": "^5.1.0-alpha.7", - "@jupyterlab/docregistry": "^3.1.0-alpha.7", - "@jupyterlab/filebrowser": "^3.1.0-alpha.7", - "@jupyterlab/launcher": "^3.1.0-alpha.7", - "@jupyterlab/mainmenu": "^3.1.0-alpha.7", - "@jupyterlab/observables": "^4.1.0-alpha.7", - "@jupyterlab/services": "~6.1.0-alpha.7", - "@jupyterlab/shared-models": "^3.1.0-alpha.7", - "@jupyterlab/ui-components": "^3.1.0-alpha.7", + "@jupyterlab/application": "^3.1.0-alpha.8", + "@jupyterlab/apputils": "^3.1.0-alpha.8", + "@jupyterlab/coreutils": "^5.1.0-alpha.8", + "@jupyterlab/docregistry": "^3.1.0-alpha.8", + "@jupyterlab/filebrowser": "^3.1.0-alpha.8", + "@jupyterlab/launcher": "^3.1.0-alpha.8", + "@jupyterlab/mainmenu": "^3.1.0-alpha.8", + "@jupyterlab/observables": "^4.1.0-alpha.8", + "@jupyterlab/services": "~6.1.0-alpha.8", + "@jupyterlab/shared-models": "^3.1.0-alpha.8", + "@jupyterlab/ui-components": "^3.1.0-alpha.8", "@lumino/commands": "^1.12.0", "@lumino/coreutils": "^1.5.3", "@lumino/signaling": "^1.4.3", "@lumino/widgets": "^1.19.0", + "fast-xml-parser": "^3.19.0", "react": "^17.0.1", "react-dom": "^17.0.1", "yjs": "^13.5.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.1.0-alpha.7", + "@jupyterlab/builder": "^3.1.0-alpha.8", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/src/factory.ts b/src/factory.ts index 64e763b1..78e42589 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -33,7 +33,7 @@ export class DrawIOWidgetFactory extends ABCWidgetFactory< return new DrawIODocumentWidget({ context, commands: this._commands, - content: new DrawIOWidget(context.model) + content: new DrawIOWidget(context) }); } @@ -48,14 +48,11 @@ export namespace DrawIOWidgetFactory { } export class DrawIODocumentModelFactory - implements DocumentRegistry.IModelFactory { - - constructor() {} - - /** + implements DocumentRegistry.IModelFactory { + /** * The name of the model. */ - get name(): string { + get name(): string { return 'dio'; } @@ -73,24 +70,27 @@ export class DrawIODocumentModelFactory return 'text'; } - /** + /** * Get whether the model factory has been disposed. */ - get isDisposed(): boolean { + get isDisposed(): boolean { return this._disposed; } - dispose(): void { - this._disposed = true; - } + dispose(): void { + this._disposed = true; + } - preferredLanguage(path: string): string { - return ''; - } + preferredLanguage(path: string): string { + return ''; + } - createNew(languagePreference?: string, modelDB?: IModelDB): DrawIODocumentModel { - return new DrawIODocumentModel(languagePreference, modelDB); - } + createNew( + languagePreference?: string, + modelDB?: IModelDB + ): DrawIODocumentModel { + return new DrawIODocumentModel(languagePreference, modelDB); + } - private _disposed = false; -} \ No newline at end of file + private _disposed = false; +} diff --git a/src/index.ts b/src/index.ts index 90d7ab40..56110d9e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -111,7 +111,7 @@ function activate( tracker.add(widget); }); app.docRegistry.addWidgetFactory(widgetFactory); - + const modelFactory = new DrawIODocumentModelFactory(); app.docRegistry.addModelFactory(modelFactory); diff --git a/src/model.ts b/src/model.ts index 935ff25f..9607d138 100644 --- a/src/model.ts +++ b/src/model.ts @@ -14,7 +14,12 @@ import { DocumentRegistry } from '@jupyterlab/docregistry'; -import { ISharedFile, YDocument, YFile, Delta } from '@jupyterlab/shared-models'; +import { + ISharedDocument, + YDocument, + Delta, + MapChange +} from '@jupyterlab/shared-models'; import { IChangedArgs } from '@jupyterlab/coreutils'; @@ -24,121 +29,167 @@ import { PartialJSONValue, ReadonlyPartialJSONValue } from '@lumino/coreutils'; import { ISignal, Signal } from '@lumino/signaling'; -import { - XmlFragment, - XmlElement, - XmlText, - YEvent, - YXmlEvent -} from 'yjs'; +import * as Y from 'yjs'; +import { parse } from 'fast-xml-parser'; export class DrawIODocumentModel implements DocumentRegistry.IModel { - - /** + /** * Construct a new DrawIODocumentModel. */ - constructor(languagePreference?: string, modelDB?: IModelDB) { - this.modelDB = modelDB || new ModelDB(); - } - - get dirty(): boolean { - return this._dirty; - } - set dirty(value: boolean) { - this._dirty = value; - } - - get readOnly(): boolean { - return this._readOnly; - } - set readOnly(value: boolean) { - this._readOnly = value; - } - - get isDisposed(): boolean { - return this._isDisposed; - } - - get contentChanged(): ISignal { - return this._contentChanged; - } - - get stateChanged(): ISignal> { - return this._stateChanged; - } - - readonly defaultKernelName: string; - - readonly defaultKernelLanguage: string; - - readonly modelDB: IModelDB; - - readonly sharedModel: ISharedFile = YFile.create(); - - dispose(): void { - this._isDisposed = true; - } - - toString(): string { - // TODO: Return content from shared model - //console.info("DrawIODocumentModel.toString():", this.sharedModel.getSource()); - return this.sharedModel.getSource(); - } - - fromString(value: string): void { - // TODO: Add content to shared model - //console.info("DrawIODocumentModel.fromString():", value); - this.sharedModel.setSource(value); - } - - toJSON(): PartialJSONValue { - // TODO: Return content from shared model - console.warn("toJSON(): Not implemented"); - return {}; - } - - fromJSON(value: ReadonlyPartialJSONValue): void { - // TODO: Add content to shared model - console.warn("fromJSON(): Not implemented"); - } - - initialize(): void {} - - private _dirty = false; - private _readOnly = false; - private _isDisposed = false; - private _contentChanged = new Signal(this); - private _stateChanged = new Signal>(this); + constructor(languagePreference?: string, modelDB?: IModelDB) { + this.modelDB = modelDB || new ModelDB(); + } + + get dirty(): boolean { + return this._dirty; + } + set dirty(value: boolean) { + this._dirty = value; + } + + get readOnly(): boolean { + return this._readOnly; + } + set readOnly(value: boolean) { + this._readOnly = value; + } + + get isDisposed(): boolean { + return this._isDisposed; + } + + get contentChanged(): ISignal { + return this._contentChanged; + } + + get stateChanged(): ISignal> { + return this._stateChanged; + } + + readonly defaultKernelName: string; + + readonly defaultKernelLanguage: string; + + readonly modelDB: IModelDB; + + readonly sharedModel: ISharedXMLFile = XMLFile.create(); + + dispose(): void { + this._isDisposed = true; + } + + toString(): string { + // TODO: Return content from shared model + console.info( + 'DrawIODocumentModel.toString():', + this.sharedModel.getSource() + ); + throw new Error('not implemented'); + return this.sharedModel.getSource(); + } + + fromString(value: string): void { + // TODO: Add content to shared model + //console.info("DrawIODocumentModel.fromString():", value); + this.sharedModel.setSource(value); + } + + toJSON(): PartialJSONValue { + // TODO: Return content from shared model + console.warn('toJSON(): Not implemented'); + return {}; + } + + fromJSON(value: ReadonlyPartialJSONValue): void { + // TODO: Add content to shared model + console.warn('fromJSON(): Not implemented'); + } + + initialize(): void { + console.warn('fromJSON(): Not implemented'); + } + + private _dirty = false; + private _readOnly = false; + private _isDisposed = false; + private _contentChanged = new Signal(this); + private _stateChanged = new Signal>(this); } export type XMLChange = { - graphChanged?: Delta; - rootChanged?: Delta; + graphChanged?: Delta; + rootChanged?: Delta; + contextChange?: MapChange; }; -export class XMLModel extends YDocument { - constructor() { +/** + * Text/Markdown/Code files are represented as ISharedFile + */ +export interface ISharedXMLFile extends ISharedDocument { + /** + * The changed signal. + */ + readonly changed: ISignal; + /** + * Gets cell's source. + * + * @returns Cell's source. + */ + getSource(): string; + + /** + * Sets cell's source. + * + * @param value: New source. + */ + setSource(value: string): void; + + /** + * Replace content from `start' to `end` with `value`. + * + * @param start: The start index of the range to replace (inclusive). + * + * @param end: The end index of the range to replace (exclusive). + * + * @param value: New source (optional). + */ + updateSource(start: number, end: number, value?: string): void; +} + +export class XMLFile extends YDocument implements ISharedDocument { + constructor() { super(); - this._mxGraphModel = this.ydoc.getXmlFragment('mxGraphModel'); - this._root = new XmlElement(); - this._mxGraphModel.observeDeep(this._modelObserver); - this.transact(() => { - this._mxGraphModel.insert(0, [this._root]); - }); + console.debug('XMLFile:', this.ydoc); + this._mxGraphAttributes = this.ydoc.getMap('attributes'); + this._root = this.ydoc.getXmlFragment('root'); + console.debug(this._root instanceof Y.XmlFragment); + this._root.insert(0, [new Y.XmlElement('cell')]); + + this._mxGraphAttributes.observeDeep(this._modelObserver); + this._root.observeDeep(this._cellsObserver); } /** * Handle a change to the _mxGraphModel. */ - private _modelObserver = (events: YEvent[]) => { + private _modelObserver = (events: Y.YEvent[]): void => { + const changes: XMLChange = {}; + //changes.graphChanged = events.find();.delta as any; + this._changed.emit(changes); + }; + + /** + * Handle a change to the _mxGraphModel. + */ + private _cellsObserver = (events: Y.YEvent[]): void => { const changes: XMLChange = {}; //changes.graphChanged = events.find();.delta as any; this._changed.emit(changes); }; - public static create(): XMLModel { - return new XMLModel(); + public static create(): XMLFile { + return new XMLFile(); } /** @@ -146,8 +197,21 @@ export class XMLModel extends YDocument { * * @returns Cell's source. */ - public getGraphModel(): string { - return this._mxGraphModel.toString(); + public getSource(): string { + const serializer = new XMLSerializer(); + + const doc = new Y.XmlElement('mxGraphModel'); + + this._mxGraphAttributes.forEach((key, value) => { + console.debug('key:', key, 'value:', value); + doc.setAttribute(key, value); + }); + + const root = this._root.get(0).clone() as Y.XmlElement; + root.nodeName = 'root'; + doc.insert(0, [root]); + + return serializer.serializeToString(doc.toDOM()); } /** @@ -156,10 +220,15 @@ export class XMLModel extends YDocument { * @param value: New source. */ public setSource(value: string): void { + const doc = parse(value); + console.debug('setSource:', doc); this.transact(() => { - const text = this._root; - text.delete(0, text.length); - text.insert(0, [new XmlText(value)]); + console.debug(doc['mxGraphModel']); + doc['mxGraphModel'].attributes.map((key: string, value: any) => { + console.debug(key, value); + }); + //this._source.delete(0, this._source.length); + //this._source.insert(0, [new XmlElement(value)]); }); } @@ -174,12 +243,11 @@ export class XMLModel extends YDocument { */ public updateSource(start: number, end: number, value = ''): void { this.transact(() => { - const source = this._root; - source.delete(start, end - start); - source.insert(start, [new XmlText(value)]); + //this._source.delete(start, end - start); + //this._source.insert(0, [new XmlElement(value)]); }); } - private _mxGraphModel: XmlFragment; - private _root: XmlElement; -} \ No newline at end of file + private _mxGraphAttributes: Y.Map; + private _root: Y.XmlFragment; +} diff --git a/src/panel.ts b/src/panel.ts index 5d2ddff2..873803ca 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -1,7 +1,9 @@ -import { Widget } from '@lumino/widgets'; +import { DocumentRegistry } from '@jupyterlab/docregistry'; import { PromiseDelegate } from '@lumino/coreutils'; +import { Widget } from '@lumino/widgets'; + /* This is a typing-only import. If you use it directly, the mxgraph content will be included in the main JupyterLab js bundle. @@ -42,12 +44,18 @@ export class DrawIOWidget extends Widget { * * @param info - The `DashboardView` metadata. */ - constructor(model: DrawIODocumentModel) { + constructor(context: DocumentRegistry.IContext) { super(); - this._model = model; - Private.ensureMx().then(mx => { - this._loadDrawIO(mx); - this._model.sharedModel.changed.connect(this._onContentChanged, this); + this._context = context; + this._context.ready.then(value => { + console.debug('DrawIOWidget context ready'); + Private.ensureMx().then(mx => { + this._loadDrawIO(mx); + this._context.model.sharedModel.changed.connect( + this._onContentChanged, + this + ); + }); }); } @@ -353,7 +361,8 @@ export class DrawIOWidget extends Widget { } private _onContentChanged(): void { - const newValue = this._model.sharedModel.getSource(); + console.debug('_onContentChanged'); + const newValue = this._context.model.sharedModel.getSource(); if (this._editor === undefined) { return; } @@ -393,7 +402,7 @@ export class DrawIOWidget extends Widget { this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { - //console.debug("Event:", evt); + console.debug('Event:', evt); const changes: any[] = evt.properties.changes; for (let i = 0; i < changes.length; i++) { if (changes[i].root) { @@ -407,7 +416,7 @@ export class DrawIOWidget extends Widget { const graph = this._editor.editor.getGraphXml(); const xml = this._mx.mxUtils.getXml(graph); - this._model.sharedModel.setSource(xml); + this._context.model.sharedModel.setSource(xml); } ); @@ -447,8 +456,8 @@ export class DrawIOWidget extends Widget { dlg.init(); } ); - - const data = this._model.sharedModel.getSource(); + + const data = this._context.model.sharedModel.getSource(); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); this._ready.resolve(void 0); @@ -457,7 +466,7 @@ export class DrawIOWidget extends Widget { private _editor: any; private _mx: Private.MX; private _promptSpacing: any; - private _model: DrawIODocumentModel; + private _context: DocumentRegistry.IContext; private _ready = new PromiseDelegate(); } diff --git a/src/widget.ts b/src/widget.ts index b024c0cd..ed2bb046 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -45,8 +45,13 @@ import { const DIRTY_CLASS = 'jp-mod-dirty'; -export class DrawIODocumentWidget extends DocumentWidget { - constructor(options: DrawIODocumentWidget.IOptions) { +export class DrawIODocumentWidget extends DocumentWidget< + DrawIOWidget, + DrawIODocumentModel +> { + constructor( + options: DrawIODocumentWidget.IOptions + ) { super(options); // Adding the buttons to the widget toolbar // Modify containers style: line ~92700 @@ -79,6 +84,7 @@ export class DrawIODocumentWidget extends DocumentWidget { + console.debug('Context ready'); await this.content.ready.promise; this._onTitleChanged(); diff --git a/yarn.lock b/yarn.lock index 93de5a76..ea3d0eb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -65,9 +65,9 @@ tslib "~1.13.0" "@discoveryjs/json-ext@^0.5.0": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" - integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== + version "0.5.3" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d" + integrity sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g== "@eslint/eslintrc@^0.4.1": version "0.4.1" @@ -97,22 +97,22 @@ gud "^1.0.0" warning "^4.0.3" -"@jupyterlab/application@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/application/-/application-3.1.0-alpha.7.tgz#803f79328617b6ee311c94d004c11b7cecbba2ca" - integrity sha512-jdsjm9rds1csr8mogwo2h9wYG5WzJj962I6/Am1+heSR+5ec8ao67xIUeLPLYvJjL7/YlTpCO0FbKmednmFyLA== +"@jupyterlab/application@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/application/-/application-3.1.0-alpha.8.tgz#25c427e79f09fbf9b36816a47bedd2c4bf394d80" + integrity sha512-qVAa0I/oNhFfj7FR7wTe0lCeK+euujrQn9OzL1dO258TR6Cy/xfjOdVVTIC/PPcJsWXxQmoL8a2ld0MkpN2Lxg== dependencies: "@fortawesome/fontawesome-free" "^5.12.0" - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/docmanager" "^3.1.0-alpha.7" - "@jupyterlab/docregistry" "^3.1.0-alpha.7" - "@jupyterlab/rendermime" "^3.1.0-alpha.7" - "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/statedb" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/docmanager" "^3.1.0-alpha.8" + "@jupyterlab/docregistry" "^3.1.0-alpha.8" + "@jupyterlab/rendermime" "^3.1.0-alpha.8" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/statedb" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/application" "^1.16.0" "@lumino/commands" "^1.12.0" @@ -124,17 +124,17 @@ "@lumino/signaling" "^1.4.3" "@lumino/widgets" "^1.19.0" -"@jupyterlab/apputils@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/apputils/-/apputils-3.1.0-alpha.7.tgz#7245ebee743ccc137687e062cbba69107f817ba1" - integrity sha512-zRXw6LDlIFoH6N/Yc0FlmD0tHlKZAZlhQmvPl/5gRMOHu0QXPYJ+UQgDgTyXwCyyqIGNNs7yYMlFjwcQJVpW/w== - dependencies: - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/settingregistry" "^3.1.0-alpha.7" - "@jupyterlab/statedb" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" +"@jupyterlab/apputils@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/apputils/-/apputils-3.1.0-alpha.8.tgz#6dd186bde882dc62b18b0cc37d6cb6b684e838b1" + integrity sha512-CLNAfhTL6hrnVQJ2q5r+0s4MpdCJhF35XkiyyRTx8RgW+ui08jgDTj0Od9J+aX4X7KG0AqXA3EkGJY857YCmew== + dependencies: + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/settingregistry" "^3.1.0-alpha.8" + "@jupyterlab/statedb" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -151,7 +151,7 @@ sanitize-html "~2.3.3" url "^0.11.0" -"@jupyterlab/builder@^3.1.0-alpha.7": +"@jupyterlab/builder@^3.1.0-alpha.8": version "3.1.0-alpha.8" resolved "https://registry.yarnpkg.com/@jupyterlab/builder/-/builder-3.1.0-alpha.8.tgz#705f458a5c61f2b11a75bf9bf57c54ea80a83a76" integrity sha512-C+K3tXaYZVCmYh7k2HuP7egwYRHjZH4cVGC+LBFMTcQDaHCJqY15w9o9x/IlZ/ttdmmBrn2WAn+OYcMx4LCvRw== @@ -213,17 +213,17 @@ sort-package-json "~1.44.0" typescript "~4.1.3" -"@jupyterlab/codeeditor@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/codeeditor/-/codeeditor-3.1.0-alpha.7.tgz#4462e67dd76eb031e763bd7a7dc723b94ba15c55" - integrity sha512-R0tYdZjTpK56+j7scLUVMEsUK0yHjSbXLLTxiSj66qiHAyZVMufw+F/yTOB8ZmhpoN6a6QOr9TWj8CAHzHi3jw== - dependencies: - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/nbformat" "^3.1.0-alpha.7" - "@jupyterlab/observables" "^4.1.0-alpha.7" - "@jupyterlab/shared-models" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" +"@jupyterlab/codeeditor@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/codeeditor/-/codeeditor-3.1.0-alpha.8.tgz#df81ab1b41c93ae2c156bd12110231b88f21d4d5" + integrity sha512-8T6cOio5Feq5vsUuVRmc5afNwzU/NfjOigk6+k4Un+X15l4WXD+z3DHYiUTSbKKwZTWSK3Dx8vbR2NbLmrXQWg== + dependencies: + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/nbformat" "^3.1.0-alpha.8" + "@jupyterlab/observables" "^4.1.0-alpha.8" + "@jupyterlab/shared-models" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/dragdrop" "^1.7.1" @@ -231,19 +231,19 @@ "@lumino/signaling" "^1.4.3" "@lumino/widgets" "^1.19.0" -"@jupyterlab/codemirror@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/codemirror/-/codemirror-3.1.0-alpha.7.tgz#fadf55b457292724a4c7a83e1b00826b1aa3ba67" - integrity sha512-ndkibm3lw1JlrO1Tzam015FJimSToNHwF3a2xJo7uRn6aWPtV8R2KJxGxOUjc26gLohSLHgH985wm7cGOhNC7g== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/codeeditor" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/nbformat" "^3.1.0-alpha.7" - "@jupyterlab/observables" "^4.1.0-alpha.7" - "@jupyterlab/shared-models" "^3.1.0-alpha.7" - "@jupyterlab/statusbar" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" +"@jupyterlab/codemirror@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/codemirror/-/codemirror-3.1.0-alpha.8.tgz#793515e964305571b73e8d2236f84adb2429b881" + integrity sha512-tsGWZzXA7XjQB5q1NcGRuJz6qf4FhZHBzaK8j5Q3nNwLfopf4L+tABJ4AUWFftNlonzwy7aO8lX7wbu4X5H9PQ== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/codeeditor" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/nbformat" "^3.1.0-alpha.8" + "@jupyterlab/observables" "^4.1.0-alpha.8" + "@jupyterlab/shared-models" "^3.1.0-alpha.8" + "@jupyterlab/statusbar" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -255,10 +255,10 @@ react "^17.0.1" y-codemirror "^2.1.0" -"@jupyterlab/coreutils@^5.1.0-alpha.7": - version "5.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/coreutils/-/coreutils-5.1.0-alpha.7.tgz#07d09cb61dcbcc3a7b9e0441452de8cbae09b8aa" - integrity sha512-bURndusUf04K6kOhdfP3+RDN3d2Uvl6D2ErIRGawUW5uwB2UD8jNwLCG80+6zovqHwHu+wsCGxezw8SHm5xQgw== +"@jupyterlab/coreutils@^5.1.0-alpha.8": + version "5.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/coreutils/-/coreutils-5.1.0-alpha.8.tgz#389e7b08b90daa2a04f096b924aeca2fa4094dba" + integrity sha512-zS+7DoCTynAyNcgy7Z8uvXVuY/Dke9McuCelE2msCbOf1JtBWV9fabGIY6VOh+Bg8fRUdSLw9TkYqFjCikMBPg== dependencies: "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -268,17 +268,17 @@ path-browserify "^1.0.0" url-parse "~1.5.1" -"@jupyterlab/docmanager@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/docmanager/-/docmanager-3.1.0-alpha.7.tgz#da694d5d567e41a4287116ed688a0fec720be0fb" - integrity sha512-eKSWeElpur8Vg5tCUizsyiZQQvXgClJX/ia+0m+/YM+KJIRXWCGquxhDaFMcU4KrdKoKGynaPEGqkkSK/J4jZw== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/docregistry" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/statusbar" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" +"@jupyterlab/docmanager@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/docmanager/-/docmanager-3.1.0-alpha.8.tgz#feb783e3c6802d598f7e8929aa99461c4478b55c" + integrity sha512-blF73sbuflI9o7M+OuOqxiJOMXRQbgpVBblS2xMMvWsJPZqLP+v4H05fYmuJQtTCFI7m8LPOmpX1KoGwA7h0jw== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/docregistry" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/statusbar" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -288,33 +288,33 @@ "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/docprovider@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/docprovider/-/docprovider-3.1.0-alpha.7.tgz#416c81dacd109da8d0bee6f6b89ddc9c3b5a94c5" - integrity sha512-Z8BCY7XAQEbsn5upDBc8eqJwRPCJCxunloc3vpQP8xHHthdPkLZKDNK/cVGSTTXHjWcjuF7l4hcP586eDoHitA== +"@jupyterlab/docprovider@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/docprovider/-/docprovider-3.1.0-alpha.8.tgz#3c68f2798afcee16b56be9198cd98eb494dd7582" + integrity sha512-TBAC+/T0A/PnBBKCmwQEYGfePxXdKiwLmPrx0O6M9tGOIPAf44nNT38jez+ouLh6ou5CSEdWK3oyPMoMpjawDg== dependencies: - "@jupyterlab/shared-models" "^3.1.0-alpha.7" + "@jupyterlab/shared-models" "^3.1.0-alpha.8" lib0 "^0.2.41" y-websocket "^1.3.11" yjs "^13.5.3" -"@jupyterlab/docregistry@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/docregistry/-/docregistry-3.1.0-alpha.7.tgz#bb3e52476767d2165e13c40af0c4f5dc4fda30d8" - integrity sha512-olBzMafAd0/cYUZUN4R7JP2fmENTakbeqhPOuuF2nGG+z4DvQaWGy+PoqXEiWH5+/X+Et1AIlTtfRDk56Ojb5w== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/codeeditor" "^3.1.0-alpha.7" - "@jupyterlab/codemirror" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/docprovider" "^3.1.0-alpha.7" - "@jupyterlab/observables" "^4.1.0-alpha.7" - "@jupyterlab/rendermime" "^3.1.0-alpha.7" - "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/shared-models" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" +"@jupyterlab/docregistry@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/docregistry/-/docregistry-3.1.0-alpha.8.tgz#a08aa43d19559c775e43e1459a6ada84d424e307" + integrity sha512-gngeCk7ux15EJuxWIWIaEjWfH6uTmB0WHOXmt+kY/6yR5BTlFJtjeeeuNHjNtOkpVk1Hq9ZrLT4CkgNskBv71w== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/codeeditor" "^3.1.0-alpha.8" + "@jupyterlab/codemirror" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/docprovider" "^3.1.0-alpha.8" + "@jupyterlab/observables" "^4.1.0-alpha.8" + "@jupyterlab/rendermime" "^3.1.0-alpha.8" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/shared-models" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -323,20 +323,20 @@ "@lumino/widgets" "^1.19.0" yjs "^13.5.3" -"@jupyterlab/filebrowser@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/filebrowser/-/filebrowser-3.1.0-alpha.7.tgz#ae3ee45b829e363ff49a9185be9d99976f5da57e" - integrity sha512-LthV8cc4ffYYGW8YJfP6AjSuM5d/cvG3zXWTin5vejtVXtpsIqKhU3kI5fdAL3gqq+o9NboUryjtYugo7mklpQ== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/docmanager" "^3.1.0-alpha.7" - "@jupyterlab/docregistry" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/statedb" "^3.1.0-alpha.7" - "@jupyterlab/statusbar" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" +"@jupyterlab/filebrowser@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/filebrowser/-/filebrowser-3.1.0-alpha.8.tgz#9af7eda151b353eb9eb5ba1ba3b2b5108cc7ae1a" + integrity sha512-VU+YkIx/C5QuNCeKBLmkuHJm227bEUFThemZ15WPAO6F7FMb3hU6N+XRNP3dqDkF1sX4wX9uU3fg8pmlIlgKNg== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/docmanager" "^3.1.0-alpha.8" + "@jupyterlab/docregistry" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/statedb" "^3.1.0-alpha.8" + "@jupyterlab/statusbar" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -349,14 +349,14 @@ "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/launcher@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/launcher/-/launcher-3.1.0-alpha.7.tgz#2f37b2fc6828caebab7a4fcfb059dc622852f6c8" - integrity sha512-cxu2mKQLZYNMGYP8jiIU4HZmfV44j9GSwiJtcVwHLPXLRgC7Cm9bfKzrIM3pcC38/PP8Nj1GKirteC1hNvHk/g== +"@jupyterlab/launcher@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/launcher/-/launcher-3.1.0-alpha.8.tgz#68ca0908d82472762eb885868c605fe4c5b5dc48" + integrity sha512-itKLt9/vqUZXag/YRXIh4YakTRs3NYho9/yJodqNynWQzQy7BrcDB2A9jXXGdJiw8o/ibDte/jJ+fOGu06BjbA== dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -365,31 +365,31 @@ "@lumino/widgets" "^1.19.0" react "^17.0.1" -"@jupyterlab/mainmenu@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/mainmenu/-/mainmenu-3.1.0-alpha.7.tgz#85d13266d787f7a6f2b0b0d49011f12b4265dd1c" - integrity sha512-X6UXDR2eODZlBT/BGWvyNXgc09udFmU2wcp5+w18xI8qRL3vNiBoq7A8c/eMnbRhAiXO2CF6hvVkx9cmhqBvDw== +"@jupyterlab/mainmenu@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/mainmenu/-/mainmenu-3.1.0-alpha.8.tgz#59ea14483f60039d807d80745d7ab445dcd79ac2" + integrity sha512-F9Xlek4IPDYoJ4Mg+fj+3LwJePMWWmeVm4iyIIoiz2ymsz0KlfQ0SHuLdwdmuJS94rRwkDt5u6OSYoHNC3MODw== dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/widgets" "^1.19.0" -"@jupyterlab/nbformat@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.1.0-alpha.7.tgz#ce16d9e98fe16738d63f82fb76746cc835619fa4" - integrity sha512-4NoIU7weVjLKvRg+odTaqLMO81aiN8p0wN+jf+Ni7qCWMN+EQHDA8rD0HI3/QKm3NdASCDhrC14/vVS6qeBh3A== +"@jupyterlab/nbformat@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-3.1.0-alpha.8.tgz#3155a4c81ddd02bd6cb6b63a92f722d4d8c8a5db" + integrity sha512-ITDJhqtHK9XU3jkfFgBsfo+i98A78PsU7TkG4BXh2/XoGv+AkdhCoDolkWyIvMWhoTC28qaAVH1E31BUSxa6MA== dependencies: "@lumino/coreutils" "^1.5.3" -"@jupyterlab/observables@^4.1.0-alpha.7": - version "4.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/observables/-/observables-4.1.0-alpha.7.tgz#2d8e904aee84358bbebbd3e70439e9814a172623" - integrity sha512-Joc4Rb79/1Gef2EvOBJHV+vM6BW1ikpj+mXaB8RcKoApPFSgJOp59tB/51Lm8u4CXGBKmK5WzAbYUv5LpMFLfQ== +"@jupyterlab/observables@^4.1.0-alpha.8": + version "4.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/observables/-/observables-4.1.0-alpha.8.tgz#f12b2c5b7bf3cf796d1efd6fbd62450c12bcd078" + integrity sha512-lGXxXhFsW6jNwB9nclXRT4t5ugVcWDKKVnJch0wmIjV4IV9C3k/BnIwqWnAPmyv66Slzee3DgpE8ZvlR0RfQMA== dependencies: "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" @@ -397,28 +397,28 @@ "@lumino/messaging" "^1.4.3" "@lumino/signaling" "^1.4.3" -"@jupyterlab/rendermime-interfaces@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime-interfaces/-/rendermime-interfaces-3.1.0-alpha.7.tgz#e862a348e76f73ba36b44adf2ba085e1da7e347e" - integrity sha512-ph8uZUmjesfpamaOLNMgUz/FBfdd2PH8V9KCrswdBRXmfAfdkDTNjgrRqyE5ZvryBpcK6bedyecQCLZo+YZh+Q== +"@jupyterlab/rendermime-interfaces@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime-interfaces/-/rendermime-interfaces-3.1.0-alpha.8.tgz#35bbdddabc892e47a5a4a5102e4f6365f42bdf09" + integrity sha512-RmyKjfSPQ24TrG1Z2NHhCK8tBbpPoZZy7Shmxo/0DO74neFzwpGcXNZQp5K2svaaSO+OOwn82eci1Io6MJFTWA== dependencies: - "@jupyterlab/translation" "^3.1.0-alpha.7" + "@jupyterlab/translation" "^3.1.0-alpha.8" "@lumino/coreutils" "^1.5.3" "@lumino/widgets" "^1.19.0" -"@jupyterlab/rendermime@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime/-/rendermime-3.1.0-alpha.7.tgz#2e37d9e7148a051c7a472e6e2dfbe68067b1a00a" - integrity sha512-wTDcL2zwuqqFcIWEQL8ET6T1BG1TRsknwS+ScwHtiQBP7mYvveQyzyEUJTFd5io6v7HCyOyi2Qi3otfI5oyGmg== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/codemirror" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/nbformat" "^3.1.0-alpha.7" - "@jupyterlab/observables" "^4.1.0-alpha.7" - "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" +"@jupyterlab/rendermime@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/rendermime/-/rendermime-3.1.0-alpha.8.tgz#ae1768f706572fd5acbc207891e3c569e0a3ce43" + integrity sha512-gymm9xNqLHqFmm1rxQZbceKec8vwijyJMgSUMcamlhUJ1lGpj7RvYwSzcsUNTG+6S+c0+NmbtyQHLW7pUfwwEg== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/codemirror" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/nbformat" "^3.1.0-alpha.8" + "@jupyterlab/observables" "^4.1.0-alpha.8" + "@jupyterlab/rendermime-interfaces" "^3.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/messaging" "^1.4.3" @@ -427,16 +427,16 @@ lodash.escape "^4.0.1" marked "^2.0.0" -"@jupyterlab/services@^6.1.0-alpha.7", "@jupyterlab/services@~6.1.0-alpha.7": - version "6.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-6.1.0-alpha.7.tgz#e0c9d68363b494ff59ba0c0c2252c9d78bfbd79f" - integrity sha512-AanzgTG7Oia5Nk7Z8d7mmLC391jqYpUDQoOFI9Gxo/VUybHo7SCzD+ixhn/XepmJ7HH6AuNr4x4b/RcnsU7OzQ== +"@jupyterlab/services@^6.1.0-alpha.8", "@jupyterlab/services@~6.1.0-alpha.8": + version "6.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-6.1.0-alpha.8.tgz#7d70cb26474aaba9979e9dc632539b21371266eb" + integrity sha512-1OPIkdF7zC5rUklD0zfR7Ozyg1RHW5IyY1CKE2ksbxQsBPAB1aPDj9V4CLOyla3l6QBLkPTpm6MTlXgQh/MD8Q== dependencies: - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/nbformat" "^3.1.0-alpha.7" - "@jupyterlab/observables" "^4.1.0-alpha.7" - "@jupyterlab/settingregistry" "^3.1.0-alpha.7" - "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/nbformat" "^3.1.0-alpha.8" + "@jupyterlab/observables" "^4.1.0-alpha.8" + "@jupyterlab/settingregistry" "^3.1.0-alpha.8" + "@jupyterlab/statedb" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -445,12 +445,12 @@ node-fetch "^2.6.0" ws "^7.2.0" -"@jupyterlab/settingregistry@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-3.1.0-alpha.7.tgz#237334801b1f9213ad137f5f7d33de51b7580843" - integrity sha512-LjvfjoWrMT/Bt41qzaSdGT4LAtvkKoHKLHjsyLryyjdfJJT1BD2oJXrLffq6VKjvM/psLUU2t0WS507UsLH1kg== +"@jupyterlab/settingregistry@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-3.1.0-alpha.8.tgz#1a6f0b087985eb25d2109688bbfc7dea7a959ccd" + integrity sha512-diNdrlu8XGL76qOBpV1LakAAtFgnjIqVvzBDZekpYfkxAjM8GmletsY5n8k0/zblMM+zPX56oGZ3hcGL1LEH9w== dependencies: - "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/statedb" "^3.1.0-alpha.8" "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -458,22 +458,22 @@ ajv "^6.12.3" json5 "^2.1.1" -"@jupyterlab/shared-models@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/shared-models/-/shared-models-3.1.0-alpha.7.tgz#43fb5bc046065d26e5c39071678ceacf2617d262" - integrity sha512-OnAIVd+qRs6AcwEdZpF06lHKiCCKLPA57H/BsEsbeYxRhKoV5NrvqTarZsRjEtCyb4tQL6ne9HOm9/EWluB59Q== +"@jupyterlab/shared-models@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/shared-models/-/shared-models-3.1.0-alpha.8.tgz#9fa40ab8aa670ffbeacc8d80a2537fa898879f9c" + integrity sha512-y8XZGfxbQDkykX8WK3nU1rdZIOqmdiaAUyleyUUNckqtkHRFe1NojDCnD6CTm2FMhfe2V1CRLJ0Z7vSRCCjo2A== dependencies: - "@jupyterlab/nbformat" "^3.1.0-alpha.7" + "@jupyterlab/nbformat" "^3.1.0-alpha.8" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" "@lumino/signaling" "^1.4.3" y-protocols "^1.0.4" yjs "^13.5.3" -"@jupyterlab/statedb@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-3.1.0-alpha.7.tgz#007b166f3481ebba153a0d2134ddbbfc4190177b" - integrity sha512-lpGnCGssuNrUrHHao6JXo1FutQ+wEcg0BpWAq9uiCo2mAgoyZI2+qBgCqUtCbrJy7f1DYtvmCvszFhy12Y6Ivw== +"@jupyterlab/statedb@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-3.1.0-alpha.8.tgz#6db4adb8b37f1b9e72022ea6909a4d4b6b6f4641" + integrity sha512-5u+L1rN5TyNnGhMTS/rMa3aqxCkc8odUwfZCfmDK2XUX34O6QwTiwbTNeU5IdQU87HS7wqQvrcOI3fD1yxdzpw== dependencies: "@lumino/commands" "^1.12.0" "@lumino/coreutils" "^1.5.3" @@ -481,17 +481,17 @@ "@lumino/properties" "^1.2.3" "@lumino/signaling" "^1.4.3" -"@jupyterlab/statusbar@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/statusbar/-/statusbar-3.1.0-alpha.7.tgz#f4ad46b918015e37b71c73244933e94965b08af6" - integrity sha512-ocXxErAq3+Zd1Nfn17k9NBrjDeIhtyEaha2TpvTovXipYdiV7+y+5NjlBwr9GsGRUlOwZBmZtvmVluSfZQtfeQ== - dependencies: - "@jupyterlab/apputils" "^3.1.0-alpha.7" - "@jupyterlab/codeeditor" "^3.1.0-alpha.7" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/translation" "^3.1.0-alpha.7" - "@jupyterlab/ui-components" "^3.1.0-alpha.7" +"@jupyterlab/statusbar@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/statusbar/-/statusbar-3.1.0-alpha.8.tgz#417e58e1bb7b7535a40ddcee4358e3cd0abc53a8" + integrity sha512-LXru9f4IuVG4ab1YE3mI/mx0qcNz5+0MzsE8b+NAppJcjg8aJpBE/SNTsmR5aUc8K4g4xD9lEAjHuXHF4eywPw== + dependencies: + "@jupyterlab/apputils" "^3.1.0-alpha.8" + "@jupyterlab/codeeditor" "^3.1.0-alpha.8" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/translation" "^3.1.0-alpha.8" + "@jupyterlab/ui-components" "^3.1.0-alpha.8" "@lumino/algorithm" "^1.3.3" "@lumino/coreutils" "^1.5.3" "@lumino/disposable" "^1.4.3" @@ -502,24 +502,24 @@ react "^17.0.1" typestyle "^2.0.4" -"@jupyterlab/translation@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/translation/-/translation-3.1.0-alpha.7.tgz#47ec794622a9ea2910c70ad5d7c18086a6fcf696" - integrity sha512-Q2WOC6LEkNQpX52/j9ZPOiuaE9Tmc6AkNnpjoF2cu8m2K2HVot3FQVhddXa/d8O/VgQDPv11H4W9hhjwZQhzzw== +"@jupyterlab/translation@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/translation/-/translation-3.1.0-alpha.8.tgz#50166c8aa116d5858533b61357776e2a2a724a9a" + integrity sha512-mePAKKL6fUIpiNCKFTzj6muenZU5VcEr0dePrfcTB00AvKYyP8waDUWLnMv8oMMsZXUWVM8U4f+OevhgOew2Ag== dependencies: - "@jupyterlab/coreutils" "^5.1.0-alpha.7" - "@jupyterlab/services" "^6.1.0-alpha.7" - "@jupyterlab/statedb" "^3.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" + "@jupyterlab/services" "^6.1.0-alpha.8" + "@jupyterlab/statedb" "^3.1.0-alpha.8" "@lumino/coreutils" "^1.5.3" -"@jupyterlab/ui-components@^3.1.0-alpha.7": - version "3.1.0-alpha.7" - resolved "https://registry.yarnpkg.com/@jupyterlab/ui-components/-/ui-components-3.1.0-alpha.7.tgz#c4a63861d7c58da54bb11974c5387cbaa77f00d6" - integrity sha512-PQBknIk7gcajDXXT41a7kIZowTqtffjbIbwlwvCuW+KoS/kyGyh8eSeqaRCOrpHoc1JOonPCpHqo1m4wtBT43w== +"@jupyterlab/ui-components@^3.1.0-alpha.8": + version "3.1.0-alpha.8" + resolved "https://registry.yarnpkg.com/@jupyterlab/ui-components/-/ui-components-3.1.0-alpha.8.tgz#94085df820e05c3c2ebe35b852e6a1d950212aa2" + integrity sha512-e367PPgcwSLwvx4+y7+T8qculO/43zcm2SOF8Lx9ty0B1a8GA7lMkAE1ztop6+f+/su3WH8IqCWFsLegv3JvrA== dependencies: "@blueprintjs/core" "^3.36.0" "@blueprintjs/select" "^3.15.0" - "@jupyterlab/coreutils" "^5.1.0-alpha.7" + "@jupyterlab/coreutils" "^5.1.0-alpha.8" "@lumino/coreutils" "^1.5.3" "@lumino/signaling" "^1.4.3" "@lumino/virtualdom" "^1.8.0" @@ -737,9 +737,9 @@ integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== "@types/node@*": - version "15.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" - integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA== + version "15.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" + integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ== "@types/prop-types@*": version "15.7.3" @@ -1031,9 +1031,9 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: uri-js "^4.2.2" ajv@^8.0.1: - version "8.3.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.3.0.tgz#25ee7348e32cdc4a1dbb38256bf6bdc451dd577c" - integrity sha512-RYE7B5An83d7eWnDR8kbdaIFqmKCNsP16ay1hDbJEU+sa0e3H9SebskCt0Uufem6cfAVu7Col6ubcn/W+Sm8/Q== + version "8.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.4.0.tgz#48984fdb2ce225cab15795f0772a8d85669075e4" + integrity sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -1500,12 +1500,12 @@ dom-helpers@^3.4.0: "@babel/runtime" "^7.1.2" dom-serializer@^1.0.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.1.tgz#d845a1565d7c041a95e5dab62184ab41e3a519be" - integrity sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q== + version "1.3.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" + integrity sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig== dependencies: domelementtype "^2.0.1" - domhandler "^4.0.0" + domhandler "^4.2.0" entities "^2.0.0" dom4@^2.1.5: @@ -1550,9 +1550,9 @@ duplicate-package-checker-webpack-plugin@^3.0.0: semver "^5.4.1" electron-to-chromium@^1.3.723: - version "1.3.727" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf" - integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg== + version "1.3.730" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.730.tgz#6e1fad8f250827f5524672e572f823b34a6417e1" + integrity sha512-1Tr3h09wXhmqXnvDyrRe6MFgTeU0ZXy3+rMJWTrOHh/HNesWwBBrKnMxRJWZ86dzs8qQdw2c7ZE1/qeGHygImA== emoji-regex@^8.0.0: version "8.0.0" @@ -1857,6 +1857,11 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-xml-parser@^3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz#cb637ec3f3999f51406dd8ff0e6fc4d83e520d01" + integrity sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg== + fastest-levenshtein@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" @@ -2567,10 +2572,10 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lib0@^0.2.31, lib0@^0.2.35, lib0@^0.2.38, lib0@^0.2.41: - version "0.2.41" - resolved "https://registry.yarnpkg.com/lib0/-/lib0-0.2.41.tgz#57e6e9ffa2eb7c621c891946d150af50fac035bc" - integrity sha512-lZ0I6N81tIDgoPIlUTRhb6mNjPsG5BXIbaK/UbtjakcYnfR+O64bKtIrLXDDnfd7nAo4vpGeZ0mPzbTsNTREcg== +lib0@^0.2.31, lib0@^0.2.35, lib0@^0.2.41: + version "0.2.42" + resolved "https://registry.yarnpkg.com/lib0/-/lib0-0.2.42.tgz#6d8bf1fb8205dec37a953c521c5ee403fd8769b0" + integrity sha512-8BNM4MiokEKzMvSxTOC3gnCBisJH+jL67CnSnqzHv3jli3pUvGC8wz+0DQ2YvGr4wVQdb2R2uNNPw9LEpVvJ4Q== dependencies: isomorphic.js "^0.2.4" @@ -2846,9 +2851,9 @@ node-gyp-build@~4.1.0: integrity sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ== node-releases@^1.1.71: - version "1.1.71" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" - integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== + version "1.1.72" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" + integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== normalize-package-data@^2.3.2: version "2.5.0" @@ -3122,9 +3127,9 @@ postcss-modules-values@^4.0.0: icss-utils "^5.0.0" postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: - version "6.0.5" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz#042d74e137db83e6f294712096cb413f5aa612c4" - integrity sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg== + version "6.0.6" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz#2c5bba8174ac2f6981ab631a42ab0ee54af332ea" + integrity sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -3640,9 +3645,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" - integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== + version "3.0.8" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz#eb1e97ad99b11bf3f82a3b71a0472dd9a00f2ecf" + integrity sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g== sprintf-js@~1.0.2: version "1.0.3" @@ -3755,9 +3760,9 @@ svg-url-loader@~6.0.0: loader-utils "~2.0.0" table@^6.0.4: - version "6.7.0" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.0.tgz#26274751f0ee099c547f6cb91d3eff0d61d155b2" - integrity sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw== + version "6.7.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2" + integrity sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg== dependencies: ajv "^8.0.1" lodash.clonedeep "^4.5.0" @@ -3799,18 +3804,18 @@ terser-webpack-plugin@^4.1.0: webpack-sources "^1.4.3" terser-webpack-plugin@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz#7effadee06f7ecfa093dbbd3e9ab23f5f3ed8673" - integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q== + version "5.1.2" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.2.tgz#51d295eb7cc56785a67a372575fdc46e42d5c20c" + integrity sha512-6QhDaAiVHIQr5Ab3XUWZyDmrIPCHMiqJVljMF91YKyqwKkL5QHnYMkrMBy96v9Z7ev1hGhSEw1HQZc2p/s5Z8Q== dependencies: jest-worker "^26.6.2" p-limit "^3.1.0" schema-utils "^3.0.0" serialize-javascript "^5.0.1" source-map "^0.6.1" - terser "^5.5.1" + terser "^5.7.0" -terser@^5.3.4, terser@^5.5.1: +terser@^5.3.4, terser@^5.7.0: version "5.7.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.0.tgz#a761eeec206bc87b605ab13029876ead938ae693" integrity sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g== @@ -4161,11 +4166,11 @@ xtend@^4.0.2, xtend@~4.0.0: integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y-codemirror@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/y-codemirror/-/y-codemirror-2.1.0.tgz#905c85fececd6ffa784f9c4bcb69c22ff1ae696e" - integrity sha512-lwuXbZoUW1EmhSTFYR7Qkbi01ixn5/L2LpnZ/7/vSRcJL3PKnWLFJOxXdXTx6bNDGUjY8N0VjJe97fYL6ev00Q== + version "2.1.1" + resolved "https://registry.yarnpkg.com/y-codemirror/-/y-codemirror-2.1.1.tgz#e841fc3001b719d7fa457dd7a9748205e2874fe9" + integrity sha512-QXHaOkvEJs3pB82dkW1aGfWUd4S1RA1ORtXWtprHClbqBiCOY19VKiojScSTyl8rTaOZ/zblEq+SNH2sd3Umiw== dependencies: - lib0 "^0.2.35" + lib0 "^0.2.41" y-leveldb@^0.1.0: version "0.1.0" @@ -4175,7 +4180,7 @@ y-leveldb@^0.1.0: level "^6.0.1" lib0 "^0.2.31" -y-protocols@^1.0.3, y-protocols@^1.0.4: +y-protocols@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/y-protocols/-/y-protocols-1.0.4.tgz#810978c6172474be87457c3bcd669e529c5ba3a1" integrity sha512-5/Hd6DJ5Y2SlbqLIKq86BictdOS0iAcWJZCVop8MKqx0XWwA+BbMn4538n4Z0CGjFMUGnG1kGzagk3BKGz5SvQ== @@ -4183,13 +4188,13 @@ y-protocols@^1.0.3, y-protocols@^1.0.4: lib0 "^0.2.35" y-websocket@^1.3.11: - version "1.3.11" - resolved "https://registry.yarnpkg.com/y-websocket/-/y-websocket-1.3.11.tgz#b6e1357a2f63fe8d74ab8999991f85af88ed4221" - integrity sha512-Cvf85SE1mwFxrMRCokr4Rj16febCtfJziQWGn/F74h2W37SGPPpPNQjYZR9PFG7ryMAskoMF3ge7ZR1IEnL5CQ== + version "1.3.12" + resolved "https://registry.yarnpkg.com/y-websocket/-/y-websocket-1.3.12.tgz#eb7c58dfcbaebe70f603c9678c48f9b15e34d723" + integrity sha512-ZPFZ41aUG8WL87g8tIrSuB0NtWJhOsud/epRERd3h0T80cywTEP9gtJuHexJpZIZGI1LvN9F+bkowro/oAbfkg== dependencies: lib0 "^0.2.35" lodash.debounce "^4.0.8" - y-protocols "^1.0.3" + y-protocols "^1.0.4" optionalDependencies: ws "^6.2.1" y-leveldb "^0.1.0" @@ -4200,11 +4205,11 @@ yallist@^4.0.0: integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yjs@^13.5.3: - version "13.5.5" - resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.5.5.tgz#8a52a7354006e04a54dc62c9ffbbd7c606e20ded" - integrity sha512-sbE4G+bSP0jw71aJ9Hqi5UxOTy8JGkObIaCSpY6krRoNqssPCWq05rqV9PQcuMqcrHD3twzko92fVaF1S3id/Q== + version "13.5.6" + resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.5.6.tgz#37350d0b5ee5a7c80aa84771b4a5fb551a02c690" + integrity sha512-0ebPpLB/zizJbWaFUDRarWbXiXYD0OMDOCa8ZqkVVWQzeIoMRbmbNwB3suZ9YwD0bV4Su9RLn8M/bvGzIwX3hA== dependencies: - lib0 "^0.2.38" + lib0 "^0.2.41" yocto-queue@^0.1.0: version "0.1.0" From 516f029a50018490106684a473571b8f6264ca50 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 18 May 2021 14:42:25 +0200 Subject: [PATCH 04/11] Update to node 14 on CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37508c52..4ec98143 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - name: Install node uses: actions/setup-node@v1 with: - node-version: '10.x' + node-version: '14.x' - name: Install Python uses: actions/setup-python@v2 with: From f66b1c571b9b4007a7b08a0bd42c4e3c967cc916 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 18 May 2021 15:05:21 +0200 Subject: [PATCH 05/11] Install jupyterlab prerelease on CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ec98143..255382cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: python-version: '3.7' architecture: 'x64' - name: Install dependencies - run: python -m pip install jupyterlab + run: python -m pip install jupyterlab --pre - name: Build the extension run: | jlpm From adbb0c2c9155b233d721691250789e0689b4b1b5 Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Mon, 31 May 2021 10:45:06 +0200 Subject: [PATCH 06/11] Shared model --- package.json | 2 +- src/model.ts | 123 +++++++++++++++++++++++++++++++++------------ src/panel.ts | 4 +- testfiles/test.dio | 15 ++++++ yarn.lock | 2 +- 5 files changed, 111 insertions(+), 35 deletions(-) create mode 100644 testfiles/test.dio diff --git a/package.json b/package.json index c4498459..125bf056 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@jupyterlab/launcher": "^3.1.0-alpha.8", "@jupyterlab/mainmenu": "^3.1.0-alpha.8", "@jupyterlab/observables": "^4.1.0-alpha.8", - "@jupyterlab/services": "~6.1.0-alpha.8", + "@jupyterlab/services": "^6.1.0-alpha.8", "@jupyterlab/shared-models": "^3.1.0-alpha.8", "@jupyterlab/ui-components": "^3.1.0-alpha.8", "@lumino/commands": "^1.12.0", diff --git a/src/model.ts b/src/model.ts index 9607d138..532a6aa5 100644 --- a/src/model.ts +++ b/src/model.ts @@ -81,11 +81,8 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { toString(): string { // TODO: Return content from shared model - console.info( - 'DrawIODocumentModel.toString():', - this.sharedModel.getSource() - ); - throw new Error('not implemented'); + //console.info('DrawIODocumentModel.toString():', this.sharedModel.getSource()); + //throw new Error('not implemented'); return this.sharedModel.getSource(); } @@ -97,17 +94,26 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { toJSON(): PartialJSONValue { // TODO: Return content from shared model - console.warn('toJSON(): Not implemented'); - return {}; + console.info( + 'DrawIODocumentModel.toJSON():', + JSON.parse(this.sharedModel.getSource()) + ); + throw new Error('not implemented'); + return JSON.parse(this.sharedModel.getSource()); } fromJSON(value: ReadonlyPartialJSONValue): void { // TODO: Add content to shared model - console.warn('fromJSON(): Not implemented'); + console.info( + 'DrawIODocumentModel.fromJSON():', + value + ); + throw new Error('not implemented'); + this.sharedModel.setSource(value.toString()); } initialize(): void { - console.warn('fromJSON(): Not implemented'); + //console.warn('initialize(): Not implemented'); } private _dirty = false; @@ -160,11 +166,8 @@ export interface ISharedXMLFile extends ISharedDocument { export class XMLFile extends YDocument implements ISharedDocument { constructor() { super(); - console.debug('XMLFile:', this.ydoc); this._mxGraphAttributes = this.ydoc.getMap('attributes'); this._root = this.ydoc.getXmlFragment('root'); - console.debug(this._root instanceof Y.XmlFragment); - this._root.insert(0, [new Y.XmlElement('cell')]); this._mxGraphAttributes.observeDeep(this._modelObserver); this._root.observeDeep(this._cellsObserver); @@ -198,20 +201,37 @@ export class XMLFile extends YDocument implements ISharedDocument { * @returns Cell's source. */ public getSource(): string { - const serializer = new XMLSerializer(); - - const doc = new Y.XmlElement('mxGraphModel'); - - this._mxGraphAttributes.forEach((key, value) => { - console.debug('key:', key, 'value:', value); - doc.setAttribute(key, value); + let source = " { + source += ` ${key}="${value}"`; }); - - const root = this._root.get(0).clone() as Y.XmlElement; - root.nodeName = 'root'; - doc.insert(0, [root]); - - return serializer.serializeToString(doc.toDOM()); + source += ">"; + + for (let i=this._root.length-1; i>=0; i--) { + let mxCell = "${mxGeometry} />`; + } else { + mxCell += " />"; + } + + source += mxCell; + } + + source += ""; + return source; } /** @@ -220,15 +240,54 @@ export class XMLFile extends YDocument implements ISharedDocument { * @param value: New source. */ public setSource(value: string): void { - const doc = parse(value); - console.debug('setSource:', doc); + const doc = parse( + value, + { + attrNodeName: "attr", + textNodeName: "text", + attributeNamePrefix: "", + arrayMode: false, + ignoreAttributes: false, + parseAttributeValue: false, + }, + true + ); + + const attrs = doc['mxGraphModel']['attr']; + const cells = doc['mxGraphModel']['root']['mxCell']; + this.transact(() => { - console.debug(doc['mxGraphModel']); - doc['mxGraphModel'].attributes.map((key: string, value: any) => { - console.debug(key, value); + // Delete previus attribute entries + // this._mxGraphAttributes.entries.forEach( key => this._mxGraphAttributes.delete(key) ); + + // Inserting attributes + for (const [key, value] of Object.entries(attrs)) { + this._mxGraphAttributes.set(key, value); + } + + // Inserting mxCells + cells.forEach( (value: any) => { + const cellAttrs = value['attr']; + const cellGeometry = value['mxGeometry']; + + const mxCell = new Y.XmlElement('mxCell'); + // Inserting attributes + for (const [key, value] of Object.entries(cellAttrs)) { + //console.debug(key, value); + mxCell.setAttribute(key, value as string); + } + + if (cellGeometry) { + const geometryAttrs = cellGeometry['attr']; + const mxGeometry = new Y.XmlElement('mxGeometry'); + for (const [key, value] of Object.entries(geometryAttrs)) { + mxGeometry.setAttribute(key, value as string); + } + mxCell.push([mxGeometry]); + } + + this._root.insert(0, [mxCell]); }); - //this._source.delete(0, this._source.length); - //this._source.insert(0, [new XmlElement(value)]); }); } diff --git a/src/panel.ts b/src/panel.ts index 873803ca..0908a8cf 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -416,7 +416,8 @@ export class DrawIOWidget extends Widget { const graph = this._editor.editor.getGraphXml(); const xml = this._mx.mxUtils.getXml(graph); - this._context.model.sharedModel.setSource(xml); + console.debug("Save model: ", xml); + //this._context.model.sharedModel.setSource(xml); } ); @@ -458,6 +459,7 @@ export class DrawIOWidget extends Widget { ); const data = this._context.model.sharedModel.getSource(); + console.debug("Get Model:", data); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); this._ready.resolve(void 0); diff --git a/testfiles/test.dio b/testfiles/test.dio new file mode 100644 index 00000000..b21a25eb --- /dev/null +++ b/testfiles/test.dio @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ea3d0eb5..07fc761c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -427,7 +427,7 @@ lodash.escape "^4.0.1" marked "^2.0.0" -"@jupyterlab/services@^6.1.0-alpha.8", "@jupyterlab/services@~6.1.0-alpha.8": +"@jupyterlab/services@^6.1.0-alpha.8": version "6.1.0-alpha.8" resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-6.1.0-alpha.8.tgz#7d70cb26474aaba9979e9dc632539b21371266eb" integrity sha512-1OPIkdF7zC5rUklD0zfR7Ozyg1RHW5IyY1CKE2ksbxQsBPAB1aPDj9V4CLOyla3l6QBLkPTpm6MTlXgQh/MD8Q== From b8908da0b23ba8665dd8846fa152951a92b7664c Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Mon, 31 May 2021 11:05:38 +0200 Subject: [PATCH 07/11] lint --- src/model.ts | 39 +++++++++++++++++++-------------------- src/panel.ts | 4 ++-- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/model.ts b/src/model.ts index 532a6aa5..15f5e540 100644 --- a/src/model.ts +++ b/src/model.ts @@ -104,10 +104,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { fromJSON(value: ReadonlyPartialJSONValue): void { // TODO: Add content to shared model - console.info( - 'DrawIODocumentModel.fromJSON():', - value - ); + console.info('DrawIODocumentModel.fromJSON():', value); throw new Error('not implemented'); this.sharedModel.setSource(value.toString()); } @@ -201,14 +198,14 @@ export class XMLFile extends YDocument implements ISharedDocument { * @returns Cell's source. */ public getSource(): string { - let source = " { source += ` ${key}="${value}"`; }); - source += ">"; + source += '>'; - for (let i=this._root.length-1; i>=0; i--) { - let mxCell = "= 0; i--) { + let mxCell = ' implements ISharedDocument { } if (cellGeometry) { - let mxGeometry = "${mxGeometry} />`; } else { - mxCell += " />"; + mxCell += ' />'; } source += mxCell; } - - source += ""; + + source += ''; return source; } @@ -243,16 +242,16 @@ export class XMLFile extends YDocument implements ISharedDocument { const doc = parse( value, { - attrNodeName: "attr", - textNodeName: "text", - attributeNamePrefix: "", + attrNodeName: 'attr', + textNodeName: 'text', + attributeNamePrefix: '', arrayMode: false, ignoreAttributes: false, - parseAttributeValue: false, + parseAttributeValue: false }, true ); - + const attrs = doc['mxGraphModel']['attr']; const cells = doc['mxGraphModel']['root']['mxCell']; @@ -266,7 +265,7 @@ export class XMLFile extends YDocument implements ISharedDocument { } // Inserting mxCells - cells.forEach( (value: any) => { + cells.forEach((value: any) => { const cellAttrs = value['attr']; const cellGeometry = value['mxGeometry']; @@ -285,7 +284,7 @@ export class XMLFile extends YDocument implements ISharedDocument { } mxCell.push([mxGeometry]); } - + this._root.insert(0, [mxCell]); }); }); diff --git a/src/panel.ts b/src/panel.ts index 0908a8cf..ee84964c 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -416,7 +416,7 @@ export class DrawIOWidget extends Widget { const graph = this._editor.editor.getGraphXml(); const xml = this._mx.mxUtils.getXml(graph); - console.debug("Save model: ", xml); + console.debug('Save model: ', xml); //this._context.model.sharedModel.setSource(xml); } ); @@ -459,7 +459,7 @@ export class DrawIOWidget extends Widget { ); const data = this._context.model.sharedModel.getSource(); - console.debug("Get Model:", data); + console.debug('Get Model:', data); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); this._ready.resolve(void 0); From 91ee2cf76aa041a551699bd42a404f507cbf735f Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Thu, 3 Jun 2021 16:11:45 +0200 Subject: [PATCH 08/11] Dispose context --- src/index.ts | 16 +++++++++------- src/model.ts | 21 +++++++++++++-------- src/panel.ts | 12 +++++++++--- src/widget.ts | 4 +--- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/index.ts b/src/index.ts index 56110d9e..49d60524 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,7 +76,7 @@ export default extension; function activate( app: JupyterFrontEnd, browserFactory: IFileBrowserFactory, - restorer: ILayoutRestorer, + restorer: ILayoutRestorer | null, menu: IMainMenu, palette: ICommandPalette, launcher: ILauncher | null @@ -87,12 +87,14 @@ function activate( const tracker = new WidgetTracker({ namespace }); // Handle state restoration. - restorer.restore(tracker, { - command: 'docmanager:open', - args: widget => ({ path: widget.context.path, factory: FACTORY }), - name: widget => widget.context.path - }); - + if (restorer) { + restorer.restore(tracker, { + command: 'docmanager:open', + args: widget => ({ path: widget.context.path, factory: FACTORY }), + name: widget => widget.context.path + }); + } + const widgetFactory = new DrawIOWidgetFactory({ name: FACTORY, modelName: 'dio', diff --git a/src/model.ts b/src/model.ts index 15f5e540..60102292 100644 --- a/src/model.ts +++ b/src/model.ts @@ -76,19 +76,22 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { readonly sharedModel: ISharedXMLFile = XMLFile.create(); dispose(): void { + if (this._isDisposed) { + return; + } this._isDisposed = true; + Signal.clearData(this); } toString(): string { // TODO: Return content from shared model - //console.info('DrawIODocumentModel.toString():', this.sharedModel.getSource()); - //throw new Error('not implemented'); + console.info('DrawIODocumentModel.toString():', this.sharedModel.getSource()); return this.sharedModel.getSource(); } fromString(value: string): void { // TODO: Add content to shared model - //console.info("DrawIODocumentModel.fromString():", value); + console.info("DrawIODocumentModel.fromString():", value); this.sharedModel.setSource(value); } @@ -174,18 +177,18 @@ export class XMLFile extends YDocument implements ISharedDocument { * Handle a change to the _mxGraphModel. */ private _modelObserver = (events: Y.YEvent[]): void => { - const changes: XMLChange = {}; + //const changes: XMLChange = {}; //changes.graphChanged = events.find();.delta as any; - this._changed.emit(changes); + //this._changed.emit(changes); }; /** * Handle a change to the _mxGraphModel. */ private _cellsObserver = (events: Y.YEvent[]): void => { - const changes: XMLChange = {}; + //const changes: XMLChange = {}; //changes.graphChanged = events.find();.delta as any; - this._changed.emit(changes); + //this._changed.emit(changes); }; public static create(): XMLFile { @@ -198,6 +201,7 @@ export class XMLFile extends YDocument implements ISharedDocument { * @returns Cell's source. */ public getSource(): string { + console.debug("Model.getSource"); let source = ' { source += ` ${key}="${value}"`; @@ -239,6 +243,7 @@ export class XMLFile extends YDocument implements ISharedDocument { * @param value: New source. */ public setSource(value: string): void { + console.debug("Model.setSource"); const doc = parse( value, { @@ -251,7 +256,7 @@ export class XMLFile extends YDocument implements ISharedDocument { }, true ); - + console.debug(doc); const attrs = doc['mxGraphModel']['attr']; const cells = doc['mxGraphModel']['root']['mxCell']; diff --git a/src/panel.ts b/src/panel.ts index ee84964c..090d404d 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -63,7 +63,12 @@ export class DrawIOWidget extends Widget { * Dispose of the resources held by the widget. */ dispose(): void { + // Do nothing if already disposed. + if (this.isDisposed) { + return; + } this._editor.destroy(); + this._context = null; super.dispose(); } @@ -361,6 +366,7 @@ export class DrawIOWidget extends Widget { } private _onContentChanged(): void { + //debugger; console.debug('_onContentChanged'); const newValue = this._context.model.sharedModel.getSource(); if (this._editor === undefined) { @@ -371,6 +377,7 @@ export class DrawIOWidget extends Widget { if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { if (newValue.length) { + console.debug('Get Model:'); const xml = this._mx.mxUtils.parseXml(newValue); this._editor.editor.setGraphXml(xml.documentElement); } @@ -414,10 +421,10 @@ export class DrawIOWidget extends Widget { this._editor.editor.graph.stopEditing(); } + console.debug('Save model: '); const graph = this._editor.editor.getGraphXml(); const xml = this._mx.mxUtils.getXml(graph); - console.debug('Save model: ', xml); - //this._context.model.sharedModel.setSource(xml); + this._context.model.sharedModel.setSource(xml); } ); @@ -459,7 +466,6 @@ export class DrawIOWidget extends Widget { ); const data = this._context.model.sharedModel.getSource(); - console.debug('Get Model:', data); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); this._ready.resolve(void 0); diff --git a/src/widget.ts b/src/widget.ts index ed2bb046..2fb77949 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -22,8 +22,6 @@ import { undoIcon, redoIcon } from '@jupyterlab/ui-components'; import { CommandRegistry } from '@lumino/commands'; -import { Signal } from '@lumino/signaling'; - import { DrawIODocumentModel } from './model'; import { DrawIOWidget } from './panel'; @@ -104,7 +102,7 @@ export class DrawIODocumentWidget extends DocumentWidget< * Dispose of the resources held by the widget. */ dispose(): void { - Signal.clearData(this); + this.content.dispose(); super.dispose(); } From 145fe5ecb96946f1d63711c3699a801fbe2f9146 Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Sun, 6 Jun 2021 16:21:53 +0200 Subject: [PATCH 09/11] Generic shared model --- src/index.ts | 2 +- src/model.ts | 684 +++++++++++++++++++++++++++++++++++++-------- src/panel.ts | 144 ++++++++-- src/tokens.ts | 27 ++ testfiles/test.dio | 16 +- 5 files changed, 719 insertions(+), 154 deletions(-) create mode 100644 src/tokens.ts diff --git a/src/index.ts b/src/index.ts index 49d60524..ae6b9227 100644 --- a/src/index.ts +++ b/src/index.ts @@ -121,7 +121,7 @@ function activate( app.docRegistry.addFileType({ name: 'drawio', displayName: 'Diagram', - mimeTypes: ['application/dio', 'application/drawio'], + mimeTypes: ['text/xml', 'application/drawio', 'application/dio'], extensions: ['.dio', '.drawio'], iconClass: 'jp-MaterialIcon jp-ImageIcon', fileFormat: 'text', diff --git a/src/model.ts b/src/model.ts index 60102292..7b6eed64 100644 --- a/src/model.ts +++ b/src/model.ts @@ -31,7 +31,13 @@ import { ISignal, Signal } from '@lumino/signaling'; import * as Y from 'yjs'; -import { parse } from 'fast-xml-parser'; +import { parse, j2xParser, J2xOptions } from 'fast-xml-parser'; + +import { mxRoot, mxCell, mxGeometry } from './tokens'; + +type GraphObject = { + [key: string]: any; +}; export class DrawIODocumentModel implements DocumentRegistry.IModel { /** @@ -73,7 +79,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { readonly modelDB: IModelDB; - readonly sharedModel: ISharedXMLFile = XMLFile.create(); + readonly sharedModel: XMLFile = XMLFile.create(); dispose(): void { if (this._isDisposed) { @@ -81,32 +87,80 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } this._isDisposed = true; Signal.clearData(this); + this.sharedModel.dispose(); } toString(): string { - // TODO: Return content from shared model - console.info('DrawIODocumentModel.toString():', this.sharedModel.getSource()); - return this.sharedModel.getSource(); + console.info('DrawIODocumentModel.toString():'); + const yAttr = this.sharedModel.getAttr('mxGraphModel') as Y.Map; + + const root: any[] = []; + const yRoot = this.sharedModel.getRoot(); + yRoot.forEach( value => { + value.removeAttribute('mxElementName'); + root.push(this._parseYChild(value)); + }); + + const graph: GraphObject = {}; + graph['mxGraphModel'] = { + '#attrs': yAttr.toJSON(), + 'root': { + 'mxCell': root + } + }; + + const defaultOptions: Partial = + { + attrNodeName: '#attrs', + textNodeName: '#text', + attributeNamePrefix: '', + ignoreAttributes: false + }; + const parser = new j2xParser(defaultOptions); + return parser.parse(graph); } fromString(value: string): void { - // TODO: Add content to shared model console.info("DrawIODocumentModel.fromString():", value); - this.sharedModel.setSource(value); + const doc = parse( + value, + { + attrNodeName: '#attrs', + textNodeName: '#text', + attributeNamePrefix: '', + arrayMode: false, + ignoreAttributes: false, + parseAttributeValue: false + }, + true + ); + const attrs = doc['mxGraphModel']['#attrs']; + const root = doc['mxGraphModel']['root']; + + const yAttrs = new Y.Map(); + for (const [key, value] of Object.entries(attrs)) { + yAttrs.set(key, value as string); + } + + const yRoot = Array(); + root['mxCell'].forEach((value: any) => { + yRoot.push(this._parseJSONChild('mxCell', value)); + }); + + this.sharedModel.transact( () => { + this.sharedModel.setSource(value); + this.sharedModel.setAttr('mxGraphModel', yAttrs); + this.sharedModel.setRoot(yRoot); + }); } toJSON(): PartialJSONValue { - // TODO: Return content from shared model - console.info( - 'DrawIODocumentModel.toJSON():', - JSON.parse(this.sharedModel.getSource()) - ); + console.info('DrawIODocumentModel.toJSON():'); throw new Error('not implemented'); return JSON.parse(this.sharedModel.getSource()); } fromJSON(value: ReadonlyPartialJSONValue): void { - // TODO: Add content to shared model console.info('DrawIODocumentModel.fromJSON():', value); throw new Error('not implemented'); this.sharedModel.setSource(value.toString()); @@ -116,6 +170,383 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { //console.warn('initialize(): Not implemented'); } + getRoot(): mxRoot { + console.debug("Model.getRoot"); + const root = new Array(); + const yroot = this.sharedModel.root; + + for (let i = 0; i < yroot.length; i++) { + const yCell = yroot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + const yGeometry = yCellAttrs.firstChild; + + let geometry: mxGeometry | undefined = undefined; + + if (yGeometry) { + const yGeometryAttrs = yGeometry.getAttributes(); + geometry = { + x: yGeometryAttrs['x'], + y: yGeometryAttrs['y'], + width: yGeometryAttrs['width'], + height: yGeometryAttrs['height'], + as: yGeometryAttrs['as'] + }; + } + + const cell: mxCell = { + id: yCellAttrs['id'], + parent: yCellAttrs['parent'], + value: yCellAttrs['value'], + style: yCellAttrs['style'], + vertex: yCellAttrs['vertex'], + geometry: geometry + }; + + console.debug("cell:", cell); + root.push(cell); + } + + return root; + } + + setRoot(root: mxRoot): void { + console.debug("Model.setRoot", root); + const yCells = Array(); + + root.forEach( (cell: mxCell) => { + const yCell = new Y.XmlElement('mxCell'); + + yCell.setAttribute('id', cell.id.toString()); + if (cell.parent) { + yCell.setAttribute('parent', cell.parent.toString()); + } + if (cell.value) { + yCell.setAttribute('value', cell.value); + } + if (cell.style) { + yCell.setAttribute('style', cell.style); + } + if (cell.vertex) { + yCell.setAttribute('vertex', cell.vertex.toString()); + } + + if (cell.geometry) { + const geometry = cell.geometry; + const yGeometry = new Y.XmlElement('mxGeometry'); + yGeometry.setAttribute('x', geometry.x.toString()); + yGeometry.setAttribute('y', geometry.y.toString()); + yGeometry.setAttribute('width', geometry.width.toString()); + yGeometry.setAttribute('height', geometry.height.toString()); + yGeometry.setAttribute('as', geometry.as); + yCell.insert(0, [yGeometry]); + } + + yCells.push(yCell); + }); + + this.sharedModel.updateRoot(0, this.sharedModel.root.length, yCells); + } + + getCell(id: number): mxCell { + console.debug("Model.getCell", id); + const yRoot = this.sharedModel.root; + + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + + if (yCellAttrs['id'] == id) { + const yGeometry = yCellAttrs.firstChild; + let geometry: mxGeometry | undefined = undefined; + + if (yGeometry) { + const yGeometryAttrs = yGeometry.getAttributes(); + geometry = { + x: yGeometryAttrs['x'], + y: yGeometryAttrs['y'], + width: yGeometryAttrs['width'], + height: yGeometryAttrs['height'], + as: yGeometryAttrs['as'] + }; + } + + return { + id: yCellAttrs['id'], + parent: yCellAttrs['parent'], + value: yCellAttrs['value'], + style: yCellAttrs['style'], + vertex: yCellAttrs['vertex'], + geometry: geometry + }; + } + } + + return null; + } + + setCell(cell: mxCell): void { + console.debug("Model.setCell", cell); + const yRoot = this.sharedModel.root; + let index = -1; + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + if (yCellAttrs['id'] == cell.id) { + index = i; + break; + } + } + + const yCell = new Y.XmlElement('mxCell'); + yCell.setAttribute('id', cell.id.toString()); + if (cell.parent) { + yCell.setAttribute('parent', cell.parent.toString()); + } + if (cell.value) { + yCell.setAttribute('value', cell.value); + } + if (cell.style) { + yCell.setAttribute('style', cell.style); + } + if (cell.vertex) { + yCell.setAttribute('vertex', cell.vertex.toString()); + } + + if (cell.geometry) { + const geometry = cell.geometry; + const yGeometry = new Y.XmlElement('mxGeometry'); + yGeometry.setAttribute('x', geometry.x.toString()); + yGeometry.setAttribute('y', geometry.y.toString()); + yGeometry.setAttribute('width', geometry.width.toString()); + yGeometry.setAttribute('height', geometry.height.toString()); + yGeometry.setAttribute('as', geometry.as); + yCell.insert(0, [yGeometry]); + } + + console.debug(yCell); + this.sharedModel.updateRoot(index, 1, [yCell]); + } + + getGeometry(id: number): mxGeometry { + console.debug("Model.getGeometry", id); + const yRoot = this.sharedModel.root; + + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + + if (yCellAttrs['id'] == id) { + const yGeometry = yCellAttrs.firstChild; + + if (yGeometry) { + const yGeometryAttrs = yGeometry.getAttributes(); + return { + x: yGeometryAttrs['x'], + y: yGeometryAttrs['y'], + width: yGeometryAttrs['width'], + height: yGeometryAttrs['height'], + as: yGeometryAttrs['as'] + }; + } + + return null; + } + } + + return null; + } + + setGeometry(id: number, geometry: mxGeometry): void { + console.debug("Model.setGeometry", id, geometry); + const yRoot = this.sharedModel.root; + let index = -1; + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + if (yCellAttrs['id'] == id) { + index = i; + break; + } + } + + if (index == -1) { + return; + } + + const yGeometry = new Y.XmlElement('mxGeometry'); + yGeometry.setAttribute('x', geometry.x.toString()); + yGeometry.setAttribute('y', geometry.y.toString()); + yGeometry.setAttribute('width', geometry.width.toString()); + yGeometry.setAttribute('height', geometry.height.toString()); + yGeometry.setAttribute('as', geometry.as); + + this.sharedModel.transact(() => { + const yCell = yRoot.get(index) as Y.XmlElement; + yCell.delete(0, 1); + yCell.insert(0, [yGeometry]); + }); + } + + getValue(id: number): string { + console.debug("Model.getValue", id); + const yRoot = this.sharedModel.root; + + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + + if (yCellAttrs['id'] == id) { + + if (yCellAttrs['value']) { + return yCellAttrs['value'] + } + + return null; + } + } + + return null; + } + + setValue(id: number, value: string): void { + console.debug("Model.setValue", id, value); + const yRoot = this.sharedModel.root; + let index = -1; + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + if (yCellAttrs['id'] == id) { + index = i; + break; + } + } + + if (index == -1) { + return; + } + + this.sharedModel.transact(() => { + const yCell = yRoot.get(index) as Y.XmlElement; + yCell.setAttribute('value', value); + }); + } + + getStyle(id: number): string { + console.debug("Model.getValue", id); + const yRoot = this.sharedModel.root; + + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + + if (yCellAttrs['id'] == id) { + + if (yCellAttrs['style']) { + return yCellAttrs['style'] + } + + return null; + } + } + + return null; + } + + setStyle(id: number, style: string): void { + console.debug("Model.setStyle", id, style); + const yRoot = this.sharedModel.root; + let index = -1; + for (let i = 0; i < yRoot.length; i++) { + const yCell = yRoot.get(i) as Y.XmlElement; + const yCellAttrs = yCell.getAttributes(); + if (yCellAttrs['id'] == id) { + index = i; + break; + } + } + + if (index == -1) { + return; + } + + this.sharedModel.transact(() => { + const yCell = yRoot.get(index) as Y.XmlElement; + yCell.setAttribute('style', style); + }); + } + + private _parseJSONChild = (tag: string, element: any): Y.XmlText | Y.XmlElement => { + const yElement = new Y.XmlElement(tag); + yElement.setAttribute("mxElementName", tag); + + const attrs = element['#attrs']; + if (attrs) { + for (const [key, value] of Object.entries(attrs)) { + yElement.setAttribute(key, value as string); + } + } + + const text = element['#text']; + if (text) { + yElement.push([new Y.XmlText(text)]); + } + + for (const [key, child] of Object.entries(element)) { + if (key === '#attrs' || key === '#text') { + continue; + } + + if (child instanceof Array) { + child.forEach( value => { + yElement.push([this._parseJSONChild(key, value)]); + }); + + } else { + yElement.push([this._parseJSONChild(key, child)]); + } + } + + return yElement; + } + + private _parseYChild = (yElement: Y.XmlText | Y.XmlElement): GraphObject => { + const element: GraphObject = {}; + + const yAttrs = yElement.getAttributes(); + if (yAttrs) { + const attrs: GraphObject = {}; + for (const [key, value] of Object.entries(yAttrs)) { + attrs[key] = value; + } + element['#attrs'] = attrs; + } + + if (yElement instanceof Y.XmlText) { + element['#text'] = yElement.toJSON(); + } + + if (yElement instanceof Y.XmlElement) { + yElement.slice(0, yElement.length).forEach( yChild => { + const tag = yChild.getAttribute('mxElementName'); + yChild.removeAttribute('mxElementName'); + const child = this._parseYChild(yChild); + + if (element[tag] === undefined) { + element[tag] = child; + + } else if (element[tag] instanceof Array) { + element[tag].push(child); + + } else { + const aux = element[tag]; + element[tag] = [aux, child]; + } + }); + } + + return element; + } + private _dirty = false; private _readOnly = false; private _isDisposed = false; @@ -124,9 +555,19 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } export type XMLChange = { - graphChanged?: Delta; - rootChanged?: Delta; contextChange?: MapChange; + mxRootChange?: Delta; + mxChildChange?: Delta; + mxGeometryChange?: Delta; + mxTerminalChange?: Delta; + mxValueChange?: { + id: number; + value: string; + }; + mxStyleChange?: { + id: number; + style: string; + }; }; /** @@ -163,135 +604,123 @@ export interface ISharedXMLFile extends ISharedDocument { updateSource(start: number, end: number, value?: string): void; } -export class XMLFile extends YDocument implements ISharedDocument { +export class XMLFile extends YDocument implements ISharedXMLFile { constructor() { super(); - this._mxGraphAttributes = this.ydoc.getMap('attributes'); + this._attr = this.ydoc.getMap('attrs'); this._root = this.ydoc.getXmlFragment('root'); - this._mxGraphAttributes.observeDeep(this._modelObserver); + this._attr.observeDeep(this._modelObserver); this._root.observeDeep(this._cellsObserver); } - /** - * Handle a change to the _mxGraphModel. - */ - private _modelObserver = (events: Y.YEvent[]): void => { - //const changes: XMLChange = {}; - //changes.graphChanged = events.find();.delta as any; - //this._changed.emit(changes); - }; + get root(): Y.XmlFragment { + return this._root; + } /** - * Handle a change to the _mxGraphModel. + * Dispose of the resources. */ - private _cellsObserver = (events: Y.YEvent[]): void => { - //const changes: XMLChange = {}; - //changes.graphChanged = events.find();.delta as any; - //this._changed.emit(changes); - }; + dispose(): void { + this._attr.unobserveDeep(this._modelObserver); + this._root.unobserveDeep(this._cellsObserver); + } public static create(): XMLFile { return new XMLFile(); } /** - * Gets cell's source. + * Gets document's source. * - * @returns Cell's source. + * @returns Document's source. */ public getSource(): string { - console.debug("Model.getSource"); - let source = ' { - source += ` ${key}="${value}"`; - }); - source += '>'; - - for (let i = this._root.length - 1; i >= 0; i--) { - let mxCell = '${mxGeometry} />`; - } else { - mxCell += ' />'; - } - - source += mxCell; - } - - source += ''; - return source; + return this.source.toString(); } /** - * Sets cell's source. + * Sets document's source. * * @param value: New source. */ public setSource(value: string): void { - console.debug("Model.setSource"); - const doc = parse( - value, - { - attrNodeName: 'attr', - textNodeName: 'text', - attributeNamePrefix: '', - arrayMode: false, - ignoreAttributes: false, - parseAttributeValue: false - }, - true - ); - console.debug(doc); - const attrs = doc['mxGraphModel']['attr']; - const cells = doc['mxGraphModel']['root']['mxCell']; + this.transact(() => { + this.source.delete(0, this.source.length); + this.source.insert(0, value); + }); + } + /** + * Replace content from `start' to `end` with `value`. + * + * @param start: The start index of the range to replace (inclusive). + * + * @param end: The end index of the range to replace (exclusive). + * + * @param value: New source (optional). + */ + public updateSource(start: number, end: number, value = ''): void { this.transact(() => { - // Delete previus attribute entries - // this._mxGraphAttributes.entries.forEach( key => this._mxGraphAttributes.delete(key) ); + this.source.delete(start, end - start); + this.source.insert(0, value); + }); + } - // Inserting attributes - for (const [key, value] of Object.entries(attrs)) { - this._mxGraphAttributes.set(key, value); - } + /** + * Returns an attribute. + * + * @param key: The key of the attribute. + */ + public getAttr(key: string): any { + //console.debug("getAttrs:", key); + return this._attr.get(key); + } - // Inserting mxCells - cells.forEach((value: any) => { - const cellAttrs = value['attr']; - const cellGeometry = value['mxGeometry']; + /** + * Adds new attribute. + * + * @param key: The key of the attribute. + * + * @param value: New source. + */ + public setAttr(key: string, value: any): void { + //console.debug("setAttr:", key, value); + this._attr.set(key, value); + } - const mxCell = new Y.XmlElement('mxCell'); - // Inserting attributes - for (const [key, value] of Object.entries(cellAttrs)) { - //console.debug(key, value); - mxCell.setAttribute(key, value as string); - } + /** + * Replace attribute. + * + * @param key: The key of the attribute. + * + * @param value: New source. + */ + public updateAttr(key: string, value: any): void { + //console.debug("updateAttr:", key, value); + this._attr.set(key, value); + } - if (cellGeometry) { - const geometryAttrs = cellGeometry['attr']; - const mxGeometry = new Y.XmlElement('mxGeometry'); - for (const [key, value] of Object.entries(geometryAttrs)) { - mxGeometry.setAttribute(key, value as string); - } - mxCell.push([mxGeometry]); - } + /** + * Gets elements. + * + * @returns elements. + */ + public getRoot(): (Y.XmlElement | Y.XmlText)[] { + //console.debug("setRoot:", this._root.slice()); + return this._root.slice(); + } - this._root.insert(0, [mxCell]); - }); + /** + * Sets elements. + * + * @param root: New elements. + */ + public setRoot(root: (Y.XmlElement | Y.XmlText)[]): void { + //console.debug("setRoot:", root); + this.transact(() => { + this._root.delete(0, this._root.length); + this._root.insert(0, root); }); } @@ -304,13 +733,38 @@ export class XMLFile extends YDocument implements ISharedDocument { * * @param value: New source (optional). */ - public updateSource(start: number, end: number, value = ''): void { + public updateRoot(start: number, end: number, value: (Y.XmlElement | Y.XmlText)[]): void { + //console.debug("updateRoot:", start, end); + //console.debug(value); this.transact(() => { - //this._source.delete(start, end - start); - //this._source.insert(0, [new XmlElement(value)]); + this._root.delete(start, end - start); + this._root.insert(0, value); }); } - private _mxGraphAttributes: Y.Map; + /** + * Handle a change to the _mxGraphModel. + */ + private _modelObserver = (events: Y.YEvent[]): void => { + console.debug("_modelObserver:", events); + //const changes: XMLChange = {}; + //changes.graphChanged = events.find();.delta as any; + //this._changed.emit(changes); + }; + + /** + * Handle a change to the _mxGraphModel. + */ + private _cellsObserver = (events: Y.YEvent[]): void => { + console.debug("_cellsObserver:", events); + /* const changes: XMLChange = {}; + const event = events.find(event => event.target === this._root); + if (event) { + changes.mxRootChange = event.changes.delta as any; + } + this._changed.emit(changes); */ + }; + + private _attr: Y.Map; private _root: Y.XmlFragment; } diff --git a/src/panel.ts b/src/panel.ts index 090d404d..45fdf484 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -68,7 +68,7 @@ export class DrawIOWidget extends Widget { return; } this._editor.destroy(); - this._context = null; + //this._context = null; super.dispose(); } @@ -366,9 +366,8 @@ export class DrawIOWidget extends Widget { } private _onContentChanged(): void { - //debugger; console.debug('_onContentChanged'); - const newValue = this._context.model.sharedModel.getSource(); + const newValue = this._context.model.toString(); if (this._editor === undefined) { return; } @@ -382,6 +381,56 @@ export class DrawIOWidget extends Widget { this._editor.editor.setGraphXml(xml.documentElement); } } + + // mxRootChange + // cell Optional mxCell that specifies the child. + //this._editor.editor.graph.model.getRoot(cell); + // root mxCell that specifies the new root. + // Example + // var root = new mxCell(); + // root.insert(new mxCell()); + // model.setRoot(root); + // root mxCell that specifies the new root. + //this._editor.editor.graph.model.setRoot(root); + + // mxChildChanged + // cell mxCell that should be removed. + //this._editor.editor.graph.model.remove(cell); + // parent mxCell that specifies the parent to contain the child. + // child mxCell that specifies the child to be inserted. + // index Optional integer that specifies the index of the child. + //this._editor.editor.graph.model.add(parent, child, index); + + // mxGeometryChange + // cell mxCell whose geometry should be returned. + //this._editor.editor.graph.model.getGeometry(cell); + // cell mxCell whose geometry should be changed. + // geometry mxGeometry that defines the new geometry. + //this._editor.editor.graph.model.setGeometry(cell, geometry); + + // mxTerminalChange + // edge mxCell that specifies the edge. + // isSource Boolean indicating which end of the edge should be returned. + //this._editor.editor.graph.model.getTerminal(edge, isSource); + // edge mxCell that specifies the edge. + // terminal mxCell that specifies the new terminal. + // isSource Boolean indicating if the terminal is the new source or target terminal of the edge. + //this._editor.editor.graph.model.setTerminal(edge, terminal, isSource); + + // mxValueChange + // cell mxCell whose user object should be returned. + //this._editor.editor.graph.model.getValue(cell); + // cell mxCell whose user object should be changed. + // value Object that defines the new user object. + //this._editor.editor.graph.model.setValue(cell, value); + + // mxStyleChange + // cell mxCell whose style should be returned. + //this._editor.editor.graph.model.getStyle(cell); + // cell mxCell whose style should be changed. + // style String of the form [stylename;|key=value;] to specify the new cell style. + //this._editor.editor.graph.model.setStyle(cell, style); + } private _loadDrawIO(mx: Private.MX): void { @@ -404,46 +453,93 @@ export class DrawIOWidget extends Widget { this._editor = new this._mx.EditorUi(new Editor(false, themes), this.node); this._editor.refresh(); - //console.debug(this._mx.Editor); + //console.debug(this._mx); //console.debug(this._editor.editor.graph.model); this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { - console.debug('Event:', evt); - const changes: any[] = evt.properties.changes; + console.debug("DIO changed:", evt); + const changes = evt.getProperty('edit').changes; + for (let i = 0; i < changes.length; i++) { - if (changes[i].root) { + if (changes[i] instanceof this._mx.mxRootChange) { return; } } - if (this._editor.editor.graph.isEditing()) { - this._editor.editor.graph.stopEditing(); - } + //if (this._editor.editor.graph.isEditing()) { + // this._editor.editor.graph.stopEditing(); + //} - console.debug('Save model: '); const graph = this._editor.editor.getGraphXml(); + console.debug("Save graph", data); const xml = this._mx.mxUtils.getXml(graph); - this._context.model.sharedModel.setSource(xml); + this._context.model.fromString(xml); } ); /* this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { - var changes = evt.getProperty('edit').changes; + const changes = evt.getProperty('edit').changes; + console.debug("Graph changed:"); + console.debug(evt); - for (var i = 0; i < changes.length; i++) - { - var change = changes[i]; + for (let i = 0; i < changes.length; i++) { + const change = changes[i]; + console.debug(change); + + if (change instanceof this._mx.mxRootChange) { + console.log("Root changed:", change.root.id); + const children = change.root.children; + for (let j = 0; j < children.length; j++) { + console.log(children[j]); + } + } - if ( - change instanceof this._mx.mxChildChange && - change.change.previous == null - ) { - this._editor.editor.graph.startEditingAtCell(change.child); - break; + if (change instanceof this._mx.mxChildChange) { + console.log("Child changed:", change.child.id); + console.log(change.child); + // id = change.child.id + // value = change.cell.value + // style = change.cell.style + // parent = change.cell.parent + // vertex = change.cell.vertex } + + if (change instanceof this._mx.mxGeometryChange) { + console.log("Geometry changed:", change.cell.id); + console.log(change.geometry); + // x = change.geometry.x + // y = change.geometry.y + // width = change.geometry.width + // height = change.geometry.height + // as = "" + } + + if (change instanceof this._mx.mxTerminalChange) { + console.log("Terminal changed:", change.cell.id); + console.log(change.terminal); + } + + if (change instanceof this._mx.mxValueChange) { + console.log("Value changed:", change.cell.id); + console.log(change.geometry); + // value = change.cell.value + } + + if (change instanceof this._mx.mxStyleChange) { + console.log("Style changed:", change.cell.id); + console.log(change.geometry); + // style = change.cell.style + } + + //mxCellAttributeChange + //mxCollapseChange + //mxCurrentRootChange + //mxGenericChangeCodec + //mxSelectionChange + //mxVisibleChange } }); */ @@ -465,9 +561,11 @@ export class DrawIOWidget extends Widget { } ); - const data = this._context.model.sharedModel.getSource(); + const data = this._context.model.toString(); + console.debug("Load graph", data); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); + //this._editor.editor.graph.model.setRoot(root); this._ready.resolve(void 0); } diff --git a/src/tokens.ts b/src/tokens.ts new file mode 100644 index 00000000..99e3bc50 --- /dev/null +++ b/src/tokens.ts @@ -0,0 +1,27 @@ +export type mxRoot = mxCell[]; + +export type mxCell = { + id: number; + parent?: number; + value?: string; + style?: string; + vertex?: number; + edge?: boolean; + source?: number; + geometry?: mxGeometry; +}; + +export type mxGeometry = { + x?: number; + y?: number; + as: string; + width?: number; + height?: number; + relative?: boolean; +}; + +export type mxPoint = { + x: number; + y: number; + as: string; +}; \ No newline at end of file diff --git a/testfiles/test.dio b/testfiles/test.dio index b21a25eb..7d067739 100644 --- a/testfiles/test.dio +++ b/testfiles/test.dio @@ -1,15 +1 @@ - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file From 31ab82d45526bed4dcd93438be812d307ec8ebab Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Mon, 7 Jun 2021 14:45:11 +0200 Subject: [PATCH 10/11] works collaborative --- src/index.ts | 2 +- src/model.ts | 449 ++++++++++++++++---------------------------------- src/panel.ts | 189 +++++++++------------ src/tokens.ts | 36 ++-- 4 files changed, 234 insertions(+), 442 deletions(-) diff --git a/src/index.ts b/src/index.ts index ae6b9227..2f99225b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -94,7 +94,7 @@ function activate( name: widget => widget.context.path }); } - + const widgetFactory = new DrawIOWidgetFactory({ name: FACTORY, modelName: 'dio', diff --git a/src/model.ts b/src/model.ts index 7b6eed64..8bdf9849 100644 --- a/src/model.ts +++ b/src/model.ts @@ -18,7 +18,8 @@ import { ISharedDocument, YDocument, Delta, - MapChange + MapChange, + createMutex } from '@jupyterlab/shared-models'; import { IChangedArgs } from '@jupyterlab/coreutils'; @@ -33,8 +34,6 @@ import * as Y from 'yjs'; import { parse, j2xParser, J2xOptions } from 'fast-xml-parser'; -import { mxRoot, mxCell, mxGeometry } from './tokens'; - type GraphObject = { [key: string]: any; }; @@ -45,6 +44,8 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { */ constructor(languagePreference?: string, modelDB?: IModelDB) { this.modelDB = modelDB || new ModelDB(); + + this.sharedModel.changed.connect(this._onSharedModelChanged); } get dirty(): boolean { @@ -73,6 +74,10 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { return this._stateChanged; } + get sharedModelChanged(): ISignal { + return this._sharedModelChanged; + } + readonly defaultKernelName: string; readonly defaultKernelLanguage: string; @@ -81,6 +86,8 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { readonly sharedModel: XMLFile = XMLFile.create(); + readonly mutex = createMutex(); + dispose(): void { if (this._isDisposed) { return; @@ -94,23 +101,22 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { console.info('DrawIODocumentModel.toString():'); const yAttr = this.sharedModel.getAttr('mxGraphModel') as Y.Map; - const root: any[] = []; + const root: GraphObject[] = []; const yRoot = this.sharedModel.getRoot(); - yRoot.forEach( value => { - value.removeAttribute('mxElementName'); + yRoot.forEach(value => { + //value.removeAttribute('mxnodename'); root.push(this._parseYChild(value)); }); const graph: GraphObject = {}; graph['mxGraphModel'] = { '#attrs': yAttr.toJSON(), - 'root': { - 'mxCell': root + root: { + mxCell: root } }; - const defaultOptions: Partial = - { + const defaultOptions: Partial = { attrNodeName: '#attrs', textNodeName: '#text', attributeNamePrefix: '', @@ -121,7 +127,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } fromString(value: string): void { - console.info("DrawIODocumentModel.fromString():", value); + console.info('DrawIODocumentModel.fromString():', value); const doc = parse( value, { @@ -147,7 +153,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { yRoot.push(this._parseJSONChild('mxCell', value)); }); - this.sharedModel.transact( () => { + this.mutex(() => { this.sharedModel.setSource(value); this.sharedModel.setAttr('mxGraphModel', yAttrs); this.sharedModel.setRoot(yRoot); @@ -170,314 +176,138 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { //console.warn('initialize(): Not implemented'); } - getRoot(): mxRoot { - console.debug("Model.getRoot"); - const root = new Array(); - const yroot = this.sharedModel.root; - - for (let i = 0; i < yroot.length; i++) { - const yCell = yroot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - const yGeometry = yCellAttrs.firstChild; - - let geometry: mxGeometry | undefined = undefined; - - if (yGeometry) { - const yGeometryAttrs = yGeometry.getAttributes(); - geometry = { - x: yGeometryAttrs['x'], - y: yGeometryAttrs['y'], - width: yGeometryAttrs['width'], - height: yGeometryAttrs['height'], - as: yGeometryAttrs['as'] - }; - } - - const cell: mxCell = { - id: yCellAttrs['id'], - parent: yCellAttrs['parent'], - value: yCellAttrs['value'], - style: yCellAttrs['style'], - vertex: yCellAttrs['vertex'], - geometry: geometry - }; - - console.debug("cell:", cell); - root.push(cell); - } - - return root; + transact(cb: () => void): void { + this.sharedModel.transact(cb); } - setRoot(root: mxRoot): void { - console.debug("Model.setRoot", root); - const yCells = Array(); - - root.forEach( (cell: mxCell) => { - const yCell = new Y.XmlElement('mxCell'); - - yCell.setAttribute('id', cell.id.toString()); - if (cell.parent) { - yCell.setAttribute('parent', cell.parent.toString()); - } - if (cell.value) { - yCell.setAttribute('value', cell.value); - } - if (cell.style) { - yCell.setAttribute('style', cell.style); - } - if (cell.vertex) { - yCell.setAttribute('vertex', cell.vertex.toString()); - } - - if (cell.geometry) { - const geometry = cell.geometry; - const yGeometry = new Y.XmlElement('mxGeometry'); - yGeometry.setAttribute('x', geometry.x.toString()); - yGeometry.setAttribute('y', geometry.y.toString()); - yGeometry.setAttribute('width', geometry.width.toString()); - yGeometry.setAttribute('height', geometry.height.toString()); - yGeometry.setAttribute('as', geometry.as); - yCell.insert(0, [yGeometry]); - } + getRoot(): Node { + console.debug('Model.getRoot'); + const yRoot = this.sharedModel.getRoot(); + const root = document.createElement('root'); - yCells.push(yCell); + yRoot.forEach(yEl => { + // Clone element + //const yEl = this._parseJSONChild('mxCell', this._parseYChild(value)); + root.appendChild(yEl.toDOM()); }); - this.sharedModel.updateRoot(0, this.sharedModel.root.length, yCells); + console.debug(root); + return root; } - getCell(id: number): mxCell { - console.debug("Model.getCell", id); - const yRoot = this.sharedModel.root; + setRoot(root: string): void { + console.debug('Model.setRoot', root); - for (let i = 0; i < yRoot.length; i++) { - const yCell = yRoot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - - if (yCellAttrs['id'] == id) { - const yGeometry = yCellAttrs.firstChild; - let geometry: mxGeometry | undefined = undefined; - - if (yGeometry) { - const yGeometryAttrs = yGeometry.getAttributes(); - geometry = { - x: yGeometryAttrs['x'], - y: yGeometryAttrs['y'], - width: yGeometryAttrs['width'], - height: yGeometryAttrs['height'], - as: yGeometryAttrs['as'] - }; - } - - return { - id: yCellAttrs['id'], - parent: yCellAttrs['parent'], - value: yCellAttrs['value'], - style: yCellAttrs['style'], - vertex: yCellAttrs['vertex'], - geometry: geometry - }; - } - } - - return null; - } - - setCell(cell: mxCell): void { - console.debug("Model.setCell", cell); - const yRoot = this.sharedModel.root; - let index = -1; - for (let i = 0; i < yRoot.length; i++) { - const yCell = yRoot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - if (yCellAttrs['id'] == cell.id) { - index = i; - break; - } - } + const doc = parse( + root, + { + attrNodeName: '#attrs', + textNodeName: '#text', + attributeNamePrefix: '', + arrayMode: false, + ignoreAttributes: false, + parseAttributeValue: false + }, + true + ); - const yCell = new Y.XmlElement('mxCell'); - yCell.setAttribute('id', cell.id.toString()); - if (cell.parent) { - yCell.setAttribute('parent', cell.parent.toString()); - } - if (cell.value) { - yCell.setAttribute('value', cell.value); - } - if (cell.style) { - yCell.setAttribute('style', cell.style); - } - if (cell.vertex) { - yCell.setAttribute('vertex', cell.vertex.toString()); - } + console.debug(doc); - if (cell.geometry) { - const geometry = cell.geometry; - const yGeometry = new Y.XmlElement('mxGeometry'); - yGeometry.setAttribute('x', geometry.x.toString()); - yGeometry.setAttribute('y', geometry.y.toString()); - yGeometry.setAttribute('width', geometry.width.toString()); - yGeometry.setAttribute('height', geometry.height.toString()); - yGeometry.setAttribute('as', geometry.as); - yCell.insert(0, [yGeometry]); - } + /* const yRoot = Array(); + doc['mxCell'].forEach((value: any) => { + yRoot.push(this._parseJSONChild('mxCell', value)); + }); - console.debug(yCell); - this.sharedModel.updateRoot(index, 1, [yCell]); + console.debug(yRoot); */ + //this.sharedModel.updateRoot(0, this.sharedModel.root.length, yRoot); } - getGeometry(id: number): mxGeometry { - console.debug("Model.getGeometry", id); + getCell(id: number): Node { + console.debug('Model.getCell', id); const yRoot = this.sharedModel.root; for (let i = 0; i < yRoot.length; i++) { const yCell = yRoot.get(i) as Y.XmlElement; const yCellAttrs = yCell.getAttributes(); - - if (yCellAttrs['id'] == id) { - const yGeometry = yCellAttrs.firstChild; - - if (yGeometry) { - const yGeometryAttrs = yGeometry.getAttributes(); - return { - x: yGeometryAttrs['x'], - y: yGeometryAttrs['y'], - width: yGeometryAttrs['width'], - height: yGeometryAttrs['height'], - as: yGeometryAttrs['as'] - }; - } - - return null; + if (yCellAttrs['id'] === id) { + return yCell.toDOM(); } } return null; } - setGeometry(id: number, geometry: mxGeometry): void { - console.debug("Model.setGeometry", id, geometry); - const yRoot = this.sharedModel.root; - let index = -1; - for (let i = 0; i < yRoot.length; i++) { - const yCell = yRoot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - if (yCellAttrs['id'] == id) { - index = i; - break; - } - } + setCell(id: number, cell: string): void { + console.debug('Model.setCell', cell); - if (index == -1) { - return; - } - - const yGeometry = new Y.XmlElement('mxGeometry'); - yGeometry.setAttribute('x', geometry.x.toString()); - yGeometry.setAttribute('y', geometry.y.toString()); - yGeometry.setAttribute('width', geometry.width.toString()); - yGeometry.setAttribute('height', geometry.height.toString()); - yGeometry.setAttribute('as', geometry.as); - - this.sharedModel.transact(() => { - const yCell = yRoot.get(index) as Y.XmlElement; - yCell.delete(0, 1); - yCell.insert(0, [yGeometry]); - }); - } - - getValue(id: number): string { - console.debug("Model.getValue", id); - const yRoot = this.sharedModel.root; - - for (let i = 0; i < yRoot.length; i++) { - const yCell = yRoot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - - if (yCellAttrs['id'] == id) { - - if (yCellAttrs['value']) { - return yCellAttrs['value'] - } - - return null; - } - } - - return null; - } + const doc = parse( + cell, + { + attrNodeName: '#attrs', + textNodeName: '#text', + attributeNamePrefix: '', + arrayMode: false, + ignoreAttributes: false, + parseAttributeValue: false + }, + true + ); - setValue(id: number, value: string): void { - console.debug("Model.setValue", id, value); const yRoot = this.sharedModel.root; let index = -1; for (let i = 0; i < yRoot.length; i++) { const yCell = yRoot.get(i) as Y.XmlElement; const yCellAttrs = yCell.getAttributes(); - if (yCellAttrs['id'] == id) { + if (yCellAttrs['id'] === id) { index = i; break; } } - if (index == -1) { - return; - } - - this.sharedModel.transact(() => { - const yCell = yRoot.get(index) as Y.XmlElement; - yCell.setAttribute('value', value); - }); - } - - getStyle(id: number): string { - console.debug("Model.getValue", id); - const yRoot = this.sharedModel.root; + const yCell = this._parseJSONChild('mxCell', doc['mxCell']); - for (let i = 0; i < yRoot.length; i++) { - const yCell = yRoot.get(i) as Y.XmlElement; - const yCellAttrs = yCell.getAttributes(); - - if (yCellAttrs['id'] == id) { - - if (yCellAttrs['style']) { - return yCellAttrs['style'] - } - - return null; - } + if (index === -1) { + // Insert new + this.mutex(() => { + this.sharedModel.updateRoot(yRoot.length, yRoot.length, [yCell]); + }); + } else { + // Update + this.mutex(() => { + this.sharedModel.updateRoot(index, index + 1, [yCell]); + }); } - - return null; } - setStyle(id: number, style: string): void { - console.debug("Model.setStyle", id, style); + removeCell(id: number): void { + console.debug('Model.removeCell', id); const yRoot = this.sharedModel.root; let index = -1; for (let i = 0; i < yRoot.length; i++) { const yCell = yRoot.get(i) as Y.XmlElement; const yCellAttrs = yCell.getAttributes(); - if (yCellAttrs['id'] == id) { + if (yCellAttrs['id'] === id) { index = i; break; } } - - if (index == -1) { - return; + // Remove + console.debug(index); + if (index !== -1) { + console.debug(this.sharedModel.root.toDOM()); + this.mutex(() => { + this.sharedModel.updateRoot(index, index + 1, []); + }); + console.debug(this.sharedModel.root.toDOM()); } - - this.sharedModel.transact(() => { - const yCell = yRoot.get(index) as Y.XmlElement; - yCell.setAttribute('style', style); - }); } - private _parseJSONChild = (tag: string, element: any): Y.XmlText | Y.XmlElement => { + private _parseJSONChild = ( + tag: string, + element: any + ): Y.XmlText | Y.XmlElement => { const yElement = new Y.XmlElement(tag); - yElement.setAttribute("mxElementName", tag); + yElement.setAttribute('mxnodename', tag); const attrs = element['#attrs']; if (attrs) { @@ -490,26 +320,25 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { if (text) { yElement.push([new Y.XmlText(text)]); } - + for (const [key, child] of Object.entries(element)) { if (key === '#attrs' || key === '#text') { continue; } if (child instanceof Array) { - child.forEach( value => { + child.forEach(value => { yElement.push([this._parseJSONChild(key, value)]); }); - } else { yElement.push([this._parseJSONChild(key, child)]); } } - + return yElement; - } + }; - private _parseYChild = (yElement: Y.XmlText | Y.XmlElement): GraphObject => { + private _parseYChild = (yElement: Y.XmlText | Y.XmlElement): GraphObject => { const element: GraphObject = {}; const yAttrs = yElement.getAttributes(); @@ -526,48 +355,47 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } if (yElement instanceof Y.XmlElement) { - yElement.slice(0, yElement.length).forEach( yChild => { - const tag = yChild.getAttribute('mxElementName'); - yChild.removeAttribute('mxElementName'); + yElement.slice(0, yElement.length).forEach(yChild => { + const tag = yChild.getAttribute('mxnodename'); + //yChild.removeAttribute('mxnodename'); const child = this._parseYChild(yChild); if (element[tag] === undefined) { element[tag] = child; - } else if (element[tag] instanceof Array) { element[tag].push(child); - } else { const aux = element[tag]; element[tag] = [aux, child]; } }); } - + return element; - } + }; + + private _onSharedModelChanged = ( + sender: XMLFile, + changes: XMLChange + ): void => { + this._sharedModelChanged.emit(changes); + }; private _dirty = false; private _readOnly = false; private _isDisposed = false; private _contentChanged = new Signal(this); private _stateChanged = new Signal>(this); + private _sharedModelChanged = new Signal(this); } export type XMLChange = { contextChange?: MapChange; - mxRootChange?: Delta; - mxChildChange?: Delta; - mxGeometryChange?: Delta; - mxTerminalChange?: Delta; - mxValueChange?: { - id: number; - value: string; - }; - mxStyleChange?: { + mxChildChange?: Delta<{ id: number; - style: string; - }; + oldValue: Y.XmlElement | undefined; + newValue: Y.XmlElement | undefined; + }>; }; /** @@ -610,8 +438,8 @@ export class XMLFile extends YDocument implements ISharedXMLFile { this._attr = this.ydoc.getMap('attrs'); this._root = this.ydoc.getXmlFragment('root'); - this._attr.observeDeep(this._modelObserver); - this._root.observeDeep(this._cellsObserver); + this._attr.observe(this._modelObserver); + this._root.observe(this._cellsObserver); } get root(): Y.XmlFragment { @@ -622,8 +450,8 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * Dispose of the resources. */ dispose(): void { - this._attr.unobserveDeep(this._modelObserver); - this._root.unobserveDeep(this._cellsObserver); + this._attr.unobserve(this._modelObserver); + this._root.unobserve(this._cellsObserver); } public static create(): XMLFile { @@ -660,10 +488,10 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * * @param value: New source (optional). */ - public updateSource(start: number, end: number, value = ''): void { + public updateSource(start: number, end: number, value = ''): void { this.transact(() => { this.source.delete(start, end - start); - this.source.insert(0, value); + this.source.insert(start, value); }); } @@ -733,20 +561,24 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * * @param value: New source (optional). */ - public updateRoot(start: number, end: number, value: (Y.XmlElement | Y.XmlText)[]): void { + public updateRoot( + start: number, + end: number, + value: (Y.XmlElement | Y.XmlText)[] + ): void { //console.debug("updateRoot:", start, end); //console.debug(value); this.transact(() => { this._root.delete(start, end - start); - this._root.insert(0, value); + this._root.insert(start, value); }); } /** * Handle a change to the _mxGraphModel. */ - private _modelObserver = (events: Y.YEvent[]): void => { - console.debug("_modelObserver:", events); + private _modelObserver = (event: Y.YMapEvent): void => { + console.debug('_modelObserver:', event); //const changes: XMLChange = {}; //changes.graphChanged = events.find();.delta as any; //this._changed.emit(changes); @@ -755,14 +587,15 @@ export class XMLFile extends YDocument implements ISharedXMLFile { /** * Handle a change to the _mxGraphModel. */ - private _cellsObserver = (events: Y.YEvent[]): void => { - console.debug("_cellsObserver:", events); - /* const changes: XMLChange = {}; - const event = events.find(event => event.target === this._root); + private _cellsObserver = (event: Y.YXmlEvent): void => { + console.debug('_cellsObserver:', event); + const changes: XMLChange = {}; + /*const event = events.find( event => event.target === this._root); if (event) { - changes.mxRootChange = event.changes.delta as any; - } - this._changed.emit(changes); */ + console.debug(event); + changes.mxChildChange = event.changes.delta as any; + } */ + this._changed.emit(changes); }; private _attr: Y.Map; diff --git a/src/panel.ts b/src/panel.ts index 45fdf484..69201769 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -15,7 +15,7 @@ import './drawio/css/common.css'; import './drawio/styles/grapheditor.css'; -import { DrawIODocumentModel } from './model'; +import { DrawIODocumentModel, XMLChange } from './model'; import { grapheditorTxt, defaultXml } from './pack'; @@ -51,10 +51,7 @@ export class DrawIOWidget extends Widget { console.debug('DrawIOWidget context ready'); Private.ensureMx().then(mx => { this._loadDrawIO(mx); - this._context.model.sharedModel.changed.connect( - this._onContentChanged, - this - ); + this._context.model.sharedModelChanged.connect(this._onContentChanged); }); }); } @@ -67,6 +64,7 @@ export class DrawIOWidget extends Widget { if (this.isDisposed) { return; } + this._context.model.sharedModelChanged.disconnect(this._onContentChanged); this._editor.destroy(); //this._context = null; super.dispose(); @@ -365,21 +363,41 @@ export class DrawIOWidget extends Widget { }, true); } - private _onContentChanged(): void { - console.debug('_onContentChanged'); - const newValue = this._context.model.toString(); + private _onContentChanged = ( + sender: DrawIODocumentModel, + changes: XMLChange + ): void => { + console.debug('_onContentChanged', changes); if (this._editor === undefined) { return; } - const oldValue = this._mx.mxUtils.getXml(this._editor.editor.getGraphXml()); + const newValue = this._context.model.toString(); + const newXml = this._mx.mxUtils.parseXml(newValue); + const oldXml = this._editor.editor.getGraphXml(); + const oldValue = this._mx.mxUtils.getXml(oldXml); - if (oldValue !== newValue && !this._editor.editor.graph.isEditing()) { - if (newValue.length) { - console.debug('Get Model:'); - const xml = this._mx.mxUtils.parseXml(newValue); - this._editor.editor.setGraphXml(xml.documentElement); - } + if ( + oldValue !== newValue && + !this._editor.editor.graph.isEditing() && + newValue.length + ) { + this._context.model.mutex(() => { + this._editor.editor.setGraphXml(newXml.documentElement); + this._editor.editor.graph.startEditing(); + console.debug('Set Graph Model:', oldXml, newXml); + }); + /* const model = this._editor.editor.graph.getModel(); + + const newRoot = this._context.model.getRoot(); + const root = this._editor.editor.graph.model.getRoot(); + + const codec = new this._mx.mxCodec(); + const newModel = codec.decodeCell(newRoot); + + console.debug("ELements:"); + console.debug(root, newRoot, model, newModel); + this._editor.editor.graph.model.setRoot(newModel); */ } // mxRootChange @@ -400,38 +418,7 @@ export class DrawIOWidget extends Widget { // child mxCell that specifies the child to be inserted. // index Optional integer that specifies the index of the child. //this._editor.editor.graph.model.add(parent, child, index); - - // mxGeometryChange - // cell mxCell whose geometry should be returned. - //this._editor.editor.graph.model.getGeometry(cell); - // cell mxCell whose geometry should be changed. - // geometry mxGeometry that defines the new geometry. - //this._editor.editor.graph.model.setGeometry(cell, geometry); - - // mxTerminalChange - // edge mxCell that specifies the edge. - // isSource Boolean indicating which end of the edge should be returned. - //this._editor.editor.graph.model.getTerminal(edge, isSource); - // edge mxCell that specifies the edge. - // terminal mxCell that specifies the new terminal. - // isSource Boolean indicating if the terminal is the new source or target terminal of the edge. - //this._editor.editor.graph.model.setTerminal(edge, terminal, isSource); - - // mxValueChange - // cell mxCell whose user object should be returned. - //this._editor.editor.graph.model.getValue(cell); - // cell mxCell whose user object should be changed. - // value Object that defines the new user object. - //this._editor.editor.graph.model.setValue(cell, value); - - // mxStyleChange - // cell mxCell whose style should be returned. - //this._editor.editor.graph.model.getStyle(cell); - // cell mxCell whose style should be changed. - // style String of the form [stylename;|key=value;] to specify the new cell style. - //this._editor.editor.graph.model.setStyle(cell, style); - - } + }; private _loadDrawIO(mx: Private.MX): void { this._mx = mx; @@ -454,86 +441,59 @@ export class DrawIOWidget extends Widget { this._editor.refresh(); //console.debug(this._mx); + //console.debug(this._editor); + //console.debug(this._editor.editor); + //console.debug(this._editor.editor.graph); //console.debug(this._editor.editor.graph.model); - this._editor.editor.graph.model.addListener( - this._mx.mxEvent.NOTIFY, - (sender: any, evt: any) => { - console.debug("DIO changed:", evt); - const changes = evt.getProperty('edit').changes; - - for (let i = 0; i < changes.length; i++) { - if (changes[i] instanceof this._mx.mxRootChange) { - return; - } - } - - //if (this._editor.editor.graph.isEditing()) { - // this._editor.editor.graph.stopEditing(); - //} - - const graph = this._editor.editor.getGraphXml(); - console.debug("Save graph", data); - const xml = this._mx.mxUtils.getXml(graph); - this._context.model.fromString(xml); - } - ); - /* this._editor.editor.graph.model.addListener( + this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { + const oldXml = this._editor.editor.getGraphXml(); + console.debug('oldxml', oldXml); + console.debug('Graph changed:'); const changes = evt.getProperty('edit').changes; - console.debug("Graph changed:"); - console.debug(evt); + const encoder = new this._mx.mxCodec(); for (let i = 0; i < changes.length; i++) { const change = changes[i]; - console.debug(change); - - if (change instanceof this._mx.mxRootChange) { - console.log("Root changed:", change.root.id); - const children = change.root.children; - for (let j = 0; j < children.length; j++) { - console.log(children[j]); - } - } if (change instanceof this._mx.mxChildChange) { - console.log("Child changed:", change.child.id); - console.log(change.child); - // id = change.child.id - // value = change.cell.value - // style = change.cell.style - // parent = change.cell.parent - // vertex = change.cell.vertex - } - - if (change instanceof this._mx.mxGeometryChange) { - console.log("Geometry changed:", change.cell.id); - console.log(change.geometry); - // x = change.geometry.x - // y = change.geometry.y - // width = change.geometry.width - // height = change.geometry.height - // as = "" - } - - if (change instanceof this._mx.mxTerminalChange) { - console.log("Terminal changed:", change.cell.id); - console.log(change.terminal); + console.debug('mxChildChange:', change); + const el = encoder.encode(change.child); + const xml = this._mx.mxUtils.getXml(el); + if (change.index === undefined) { + this._context.model.removeCell(change.child.id); + } else { + this._context.model.setCell(change.child.id, xml); + } } - if (change instanceof this._mx.mxValueChange) { - console.log("Value changed:", change.cell.id); - console.log(change.geometry); - // value = change.cell.value + if ( + !(change instanceof this._mx.mxRootChange) && + !(change instanceof this._mx.mxChildChange) + ) { + console.debug('Other change:', change); + const el = encoder.encode(change.cell); + const xml = this._mx.mxUtils.getXml(el); + this._context.model.setCell(change.cell.id, xml); } - if (change instanceof this._mx.mxStyleChange) { - console.log("Style changed:", change.cell.id); - console.log(change.geometry); - // style = change.cell.style - } + /* if (change instanceof this._mx.mxRootChange) { + console.log("Root changed:", change.root.id, change); + const children = change.root.children; + for (let j = 0; j < children.length; j++) { + console.log("Child", children[j].id, children[j]); + const el = encoder.encode(children[j]); + const xml = this._mx.mxUtils.getXml(el); + this._context.model.setRoot(xml); + } + } */ + //mxGeometryChange + //mxTerminalChange + //mxValueChange + //mxStyleChange //mxCellAttributeChange //mxCollapseChange //mxCurrentRootChange @@ -541,7 +501,8 @@ export class DrawIOWidget extends Widget { //mxSelectionChange //mxVisibleChange } - }); */ + } + ); this._promptSpacing = this._mx.mxUtils.bind( this, @@ -562,10 +523,8 @@ export class DrawIOWidget extends Widget { ); const data = this._context.model.toString(); - console.debug("Load graph", data); const xml = this._mx.mxUtils.parseXml(data); this._editor.editor.setGraphXml(xml.documentElement); - //this._editor.editor.graph.model.setRoot(root); this._ready.resolve(void 0); } diff --git a/src/tokens.ts b/src/tokens.ts index 99e3bc50..11b20c89 100644 --- a/src/tokens.ts +++ b/src/tokens.ts @@ -1,27 +1,27 @@ export type mxRoot = mxCell[]; export type mxCell = { - id: number; - parent?: number; - value?: string; - style?: string; - vertex?: number; - edge?: boolean; - source?: number; - geometry?: mxGeometry; + id: number; + parent?: number; + value?: string; + style?: string; + vertex?: number; + edge?: boolean; + source?: number; + geometry?: mxGeometry; }; export type mxGeometry = { - x?: number; - y?: number; - as: string; - width?: number; - height?: number; - relative?: boolean; + x?: number; + y?: number; + as: string; + width?: number; + height?: number; + relative?: boolean; }; export type mxPoint = { - x: number; - y: number; - as: string; -}; \ No newline at end of file + x: number; + y: number; + as: string; +}; From 122c2d6ce6c944e2b392b9ccd2fcbc2a442da2e4 Mon Sep 17 00:00:00 2001 From: Carlos Herrero Date: Mon, 7 Jun 2021 20:58:01 +0200 Subject: [PATCH 11/11] clean up --- src/model.ts | 75 ++-------------------------------------------------- src/panel.ts | 21 --------------- 2 files changed, 2 insertions(+), 94 deletions(-) diff --git a/src/model.ts b/src/model.ts index 8bdf9849..5d710a47 100644 --- a/src/model.ts +++ b/src/model.ts @@ -98,7 +98,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } toString(): string { - console.info('DrawIODocumentModel.toString():'); const yAttr = this.sharedModel.getAttr('mxGraphModel') as Y.Map; const root: GraphObject[] = []; @@ -127,7 +126,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } fromString(value: string): void { - console.info('DrawIODocumentModel.fromString():', value); const doc = parse( value, { @@ -161,13 +159,11 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } toJSON(): PartialJSONValue { - console.info('DrawIODocumentModel.toJSON():'); throw new Error('not implemented'); return JSON.parse(this.sharedModel.getSource()); } fromJSON(value: ReadonlyPartialJSONValue): void { - console.info('DrawIODocumentModel.fromJSON():', value); throw new Error('not implemented'); this.sharedModel.setSource(value.toString()); } @@ -180,50 +176,7 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { this.sharedModel.transact(cb); } - getRoot(): Node { - console.debug('Model.getRoot'); - const yRoot = this.sharedModel.getRoot(); - const root = document.createElement('root'); - - yRoot.forEach(yEl => { - // Clone element - //const yEl = this._parseJSONChild('mxCell', this._parseYChild(value)); - root.appendChild(yEl.toDOM()); - }); - - console.debug(root); - return root; - } - - setRoot(root: string): void { - console.debug('Model.setRoot', root); - - const doc = parse( - root, - { - attrNodeName: '#attrs', - textNodeName: '#text', - attributeNamePrefix: '', - arrayMode: false, - ignoreAttributes: false, - parseAttributeValue: false - }, - true - ); - - console.debug(doc); - - /* const yRoot = Array(); - doc['mxCell'].forEach((value: any) => { - yRoot.push(this._parseJSONChild('mxCell', value)); - }); - - console.debug(yRoot); */ - //this.sharedModel.updateRoot(0, this.sharedModel.root.length, yRoot); - } - getCell(id: number): Node { - console.debug('Model.getCell', id); const yRoot = this.sharedModel.root; for (let i = 0; i < yRoot.length; i++) { @@ -238,8 +191,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } setCell(id: number, cell: string): void { - console.debug('Model.setCell', cell); - const doc = parse( cell, { @@ -280,7 +231,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } removeCell(id: number): void { - console.debug('Model.removeCell', id); const yRoot = this.sharedModel.root; let index = -1; for (let i = 0; i < yRoot.length; i++) { @@ -292,13 +242,10 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { } } // Remove - console.debug(index); if (index !== -1) { - console.debug(this.sharedModel.root.toDOM()); this.mutex(() => { this.sharedModel.updateRoot(index, index + 1, []); }); - console.debug(this.sharedModel.root.toDOM()); } } @@ -357,7 +304,6 @@ export class DrawIODocumentModel implements DocumentRegistry.IModel { if (yElement instanceof Y.XmlElement) { yElement.slice(0, yElement.length).forEach(yChild => { const tag = yChild.getAttribute('mxnodename'); - //yChild.removeAttribute('mxnodename'); const child = this._parseYChild(yChild); if (element[tag] === undefined) { @@ -501,7 +447,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * @param key: The key of the attribute. */ public getAttr(key: string): any { - //console.debug("getAttrs:", key); return this._attr.get(key); } @@ -513,7 +458,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * @param value: New source. */ public setAttr(key: string, value: any): void { - //console.debug("setAttr:", key, value); this._attr.set(key, value); } @@ -525,7 +469,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * @param value: New source. */ public updateAttr(key: string, value: any): void { - //console.debug("updateAttr:", key, value); this._attr.set(key, value); } @@ -535,7 +478,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * @returns elements. */ public getRoot(): (Y.XmlElement | Y.XmlText)[] { - //console.debug("setRoot:", this._root.slice()); return this._root.slice(); } @@ -545,7 +487,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * @param root: New elements. */ public setRoot(root: (Y.XmlElement | Y.XmlText)[]): void { - //console.debug("setRoot:", root); this.transact(() => { this._root.delete(0, this._root.length); this._root.insert(0, root); @@ -566,8 +507,6 @@ export class XMLFile extends YDocument implements ISharedXMLFile { end: number, value: (Y.XmlElement | Y.XmlText)[] ): void { - //console.debug("updateRoot:", start, end); - //console.debug(value); this.transact(() => { this._root.delete(start, end - start); this._root.insert(start, value); @@ -578,24 +517,14 @@ export class XMLFile extends YDocument implements ISharedXMLFile { * Handle a change to the _mxGraphModel. */ private _modelObserver = (event: Y.YMapEvent): void => { - console.debug('_modelObserver:', event); - //const changes: XMLChange = {}; - //changes.graphChanged = events.find();.delta as any; - //this._changed.emit(changes); + // Empty }; /** * Handle a change to the _mxGraphModel. */ private _cellsObserver = (event: Y.YXmlEvent): void => { - console.debug('_cellsObserver:', event); - const changes: XMLChange = {}; - /*const event = events.find( event => event.target === this._root); - if (event) { - console.debug(event); - changes.mxChildChange = event.changes.delta as any; - } */ - this._changed.emit(changes); + this._changed.emit({}); }; private _attr: Y.Map; diff --git a/src/panel.ts b/src/panel.ts index 69201769..713d0db4 100644 --- a/src/panel.ts +++ b/src/panel.ts @@ -367,7 +367,6 @@ export class DrawIOWidget extends Widget { sender: DrawIODocumentModel, changes: XMLChange ): void => { - console.debug('_onContentChanged', changes); if (this._editor === undefined) { return; } @@ -385,19 +384,7 @@ export class DrawIOWidget extends Widget { this._context.model.mutex(() => { this._editor.editor.setGraphXml(newXml.documentElement); this._editor.editor.graph.startEditing(); - console.debug('Set Graph Model:', oldXml, newXml); }); - /* const model = this._editor.editor.graph.getModel(); - - const newRoot = this._context.model.getRoot(); - const root = this._editor.editor.graph.model.getRoot(); - - const codec = new this._mx.mxCodec(); - const newModel = codec.decodeCell(newRoot); - - console.debug("ELements:"); - console.debug(root, newRoot, model, newModel); - this._editor.editor.graph.model.setRoot(newModel); */ } // mxRootChange @@ -441,17 +428,11 @@ export class DrawIOWidget extends Widget { this._editor.refresh(); //console.debug(this._mx); - //console.debug(this._editor); - //console.debug(this._editor.editor); - //console.debug(this._editor.editor.graph); //console.debug(this._editor.editor.graph.model); this._editor.editor.graph.model.addListener( this._mx.mxEvent.NOTIFY, (sender: any, evt: any) => { - const oldXml = this._editor.editor.getGraphXml(); - console.debug('oldxml', oldXml); - console.debug('Graph changed:'); const changes = evt.getProperty('edit').changes; const encoder = new this._mx.mxCodec(); @@ -459,7 +440,6 @@ export class DrawIOWidget extends Widget { const change = changes[i]; if (change instanceof this._mx.mxChildChange) { - console.debug('mxChildChange:', change); const el = encoder.encode(change.child); const xml = this._mx.mxUtils.getXml(el); if (change.index === undefined) { @@ -473,7 +453,6 @@ export class DrawIOWidget extends Widget { !(change instanceof this._mx.mxRootChange) && !(change instanceof this._mx.mxChildChange) ) { - console.debug('Other change:', change); const el = encoder.encode(change.cell); const xml = this._mx.mxUtils.getXml(el); this._context.model.setCell(change.cell.id, xml);