From b5fd708971cbbaee6bf52f158d098bf7ab463593 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Mon, 20 Dec 2021 20:54:31 +0000 Subject: [PATCH] Merged in feature/mindplot-lint (pull request #11) mindplot lint * fix eqeqeq * fix max-len * fix max-len, guard-for-in * fix import/no-named-as-default-member * misc fixes * fix no-shadow * fix no-param-reassign * fix issues introduced with "fix no-param-reassign" * Merge 'origin/develop' into feature/mindplot-lint * lint and docs fixes after merge Approved-by: Paulo Veiga --- .eslintcache | 1 - README.md | 5 +- package.json | 1 + packages/mindplot/.eslintignore | 1 + packages/mindplot/.eslintrc.json | 13 +- packages/mindplot/package.json | 5 +- .../mindplot/src/components/CommandContext.js | 17 +- .../mindplot/src/components/ConnectionLine.js | 7 +- .../mindplot/src/components/ControlPoint.js | 2 +- packages/mindplot/src/components/Designer.js | 13 +- .../src/components/DesignerKeyboard.js | 2 +- .../src/components/DesignerUndoManager.js | 6 +- .../mindplot/src/components/DragConnector.js | 13 +- .../mindplot/src/components/DragManager.js | 24 +- packages/mindplot/src/components/DragPivot.js | 6 +- packages/mindplot/src/components/DragTopic.js | 18 +- .../src/components/DragTopicConfig.js | 2 +- .../mindplot/src/components/EditorOptions.js | 26 -- packages/mindplot/src/components/Events.js | 4 +- packages/mindplot/src/components/IconGroup.js | 2 +- .../src/components/IconGroupRemoveTip.js | 3 +- packages/mindplot/src/components/ImageIcon.js | 12 +- packages/mindplot/src/components/Keyboard.js | 7 +- .../src/components/MultilineTextEditor.js | 17 +- packages/mindplot/src/components/NodeGraph.js | 2 +- packages/mindplot/src/components/NoteIcon.js | 20 +- packages/mindplot/src/components/Options.js | 11 +- .../src/components/PersistenceManager.js | 6 +- .../mindplot/src/components/Relationship.js | 3 +- .../src/components/RestPersistenceManager.js | 6 +- .../components/StandaloneActionDispatcher.js | 24 +- .../mindplot/src/components/TextEditor.js | 259 --------------- .../src/components/TextEditorFactory.js | 30 -- packages/mindplot/src/components/Topic.js | 35 +- .../mindplot/src/components/TopicConfig.js | 8 +- .../mindplot/src/components/TopicFeature.js | 12 +- packages/mindplot/src/components/Workspace.js | 12 +- .../src/components/commands/DeleteCommand.js | 7 +- .../components/commands/DragTopicCommand.js | 2 +- .../commands/GenericFunctionCommand.js | 7 +- .../mindplot/src/components/lang/Bundle.js | 1 + .../components/layout/AbstractBasicSorter.js | 4 +- .../src/components/layout/BalancedSorter.js | 38 ++- .../components/layout/EventBusDispatcher.js | 8 +- .../src/components/layout/GridSorter.js | 6 +- .../src/components/layout/LayoutManager.js | 13 +- .../src/components/layout/OriginalLayout.js | 8 +- .../src/components/layout/RootedTreeSet.js | 21 +- .../src/components/layout/SymmetricSorter.js | 19 +- .../libraries/bootstrap/BootstrapDialog.js | 4 +- .../bootstrap/BootstrapDialogRequest.js | 11 +- .../src/components/model/INodeModel.js | 22 +- .../mindplot/src/components/model/Mindmap.js | 3 +- .../src/components/model/NodeModel.js | 2 + .../persistence/XMLSerializerFactory.js | 19 +- .../persistence/XMLSerializer_Pela.js | 4 +- .../mindplot/src/components/util/Shape.js | 4 +- .../src/components/widget/IconPanel.js | 5 +- .../src/components/widget/LinkEditor.js | 2 +- .../mindplot/src/components/widget/Menu.js | 19 +- packages/mindplot/webpack.common.js | 2 +- packages/web2d/package.json | 1 - packages/web2d/webpack.common.js | 2 +- yarn.lock | 305 ++++++++++++++---- 64 files changed, 550 insertions(+), 624 deletions(-) delete mode 100644 .eslintcache delete mode 100644 packages/mindplot/src/components/EditorOptions.js delete mode 100644 packages/mindplot/src/components/TextEditor.js delete mode 100644 packages/mindplot/src/components/TextEditorFactory.js diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index 713ce843..00000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/Users/pveiga/repos/wisemapping-react/src/Footer.js":"1","/Users/pveiga/repos/wisemapping-react/src/Header.js":"2","/Users/pveiga/repos/wisemapping-react/src/index.js":"3","/Users/pveiga/repos/wisemapping-react/src/LoginPage.js":"4","/Users/pveiga/repos/wisemapping-react/src/RegistrationPage.js":"5"},{"size":1609,"mtime":1607011308675,"results":"6","hashOfConfig":"7"},{"size":1924,"mtime":1607015196109,"results":"8","hashOfConfig":"7"},{"size":1385,"mtime":1607144319143,"results":"9","hashOfConfig":"7"},{"size":3345,"mtime":1607147386381,"results":"10","hashOfConfig":"7"},{"size":4573,"mtime":1607143971378,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xegajf",{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/pveiga/repos/wisemapping-react/src/Footer.js",[],"/Users/pveiga/repos/wisemapping-react/src/Header.js",[],"/Users/pveiga/repos/wisemapping-react/src/index.js",[],"/Users/pveiga/repos/wisemapping-react/src/LoginPage.js",[],"/Users/pveiga/repos/wisemapping-react/src/RegistrationPage.js",[]] \ No newline at end of file diff --git a/README.md b/README.md index 0d967620..5be5b197 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you want to contribute, please check out [CONTRIBUTING.md](./CONTRIBUTING.md) ## Scripts Each package might provide the following scripts. -You can run these for all packages by running it from the root folder. Alternatively you can run it for a specific package from inside the package folder you want to. +You can run these for all packages by running it from the root folder. Alternatively you can run it for a specific package by passing the `--scope` option. ### build @@ -39,7 +39,8 @@ You can run these for all packages by running it from the root folder. Alternati > start a devServer with some browsable examples -`yarn playground` +`yarn playground --scope @wisemapping/web2d` +`yarn playground --scope @wisemapping/mindplot` ## test diff --git a/package.json b/package.json index 78cd7640..a016a9e0 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "build": "lerna run build", "clean": "lerna clean && rm -rf node_modules", "lint": "lerna run lint --stream", + "playground": "lerna run playground --stream", "test": "lerna run test --stream", "test:unit": "lerna run test:unit --stream", "test:integration": "lerna run test:integration --stream" diff --git a/packages/mindplot/.eslintignore b/packages/mindplot/.eslintignore index 1eae0cf6..1b15895d 100644 --- a/packages/mindplot/.eslintignore +++ b/packages/mindplot/.eslintignore @@ -1,2 +1,3 @@ dist/ node_modules/ +src/components/libraries/bootstrap/js \ No newline at end of file diff --git a/packages/mindplot/.eslintrc.json b/packages/mindplot/.eslintrc.json index 4bca880b..cc825f6d 100644 --- a/packages/mindplot/.eslintrc.json +++ b/packages/mindplot/.eslintrc.json @@ -8,14 +8,23 @@ "airbnb-base", "plugin:cypress/recommended" ], - "plugins": ["only-warn"], + "globals": { + // Browser is a mootools polyfill. Remove when moving from browser checks to feature detection + "Browser": true, + // designer is a global currently used as a hack. Remove this when fixing the hack. + "designer": true + }, "rules": { "no-underscore-dangle": "off", "no-plusplus": "off", "no-param-reassign": "off", "max-len": [1,250], "class-methods-use-this": "off", - "import/no-extraneous-dependencies": ["error", {"devDependencies": ["!cypress/**/*.js"]}] + "import/no-extraneous-dependencies": ["error", {"devDependencies": ["!cypress/**/*.js"]}], + "func-names": ["error", "as-needed"], + "no-unused-vars": ["error", { "args": "none" }], + "camelcase": ["error", {"allow": ["XML"]}], + "new-cap": ["error", { "properties": false }] }, "settings": { "import/resolver": { diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index 5d3aef5f..c46706f5 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -46,13 +46,12 @@ "core-js": "^3.15.2", "cypress": "^8.4.1", "cypress-image-snapshot": "^4.0.1", - "eslint": "^5.16.0", + "eslint": "^8.4.1", "eslint-config-airbnb-base": "^14.2.1", "eslint-config-standard": "^16.0.3", - "eslint-loader": "^4.0.2", + "eslint-nibble": "^8.0.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.24.2", - "eslint-plugin-only-warn": "^1.0.3", "html-webpack-plugin": "^5.3.2", "jest-webpack": "^0.5.1", "less": "^4.1.2", diff --git a/packages/mindplot/src/components/CommandContext.js b/packages/mindplot/src/components/CommandContext.js index 1376e962..f89bddb0 100644 --- a/packages/mindplot/src/components/CommandContext.js +++ b/packages/mindplot/src/components/CommandContext.js @@ -26,12 +26,9 @@ class CommandContext { } /** */ - findTopics(topicsIds) { - $assert($defined(topicsIds), 'topicsIds can not be null'); - if (!(topicsIds instanceof Array)) { - topicsIds = [topicsIds]; - } - + findTopics(topicIds) { + $assert($defined(topicIds), 'topicsIds can not be null'); + const topicsIds = Array.isArray(topicIds) ? topicIds : [topicIds]; const designerTopics = this._designer.getModel().getTopics(); const result = designerTopics.filter((topic) => topicsIds.includes(topic.getId())); @@ -93,11 +90,9 @@ class CommandContext { } /** */ - findRelationships(relIds) { - $assert($defined(relIds), 'relId can not be null'); - if (!(relIds instanceof Array)) { - relIds = [relIds]; - } + findRelationships(relationshipIds) { + $assert($defined(relationshipIds), 'relId can not be null'); + const relIds = Array.isArray(relationshipIds) ? relationshipIds : [relationshipIds]; const designerRel = this._designer.getModel().getRelationships(); return designerRel.filter((rel) => relIds.includes(rel.getId())); diff --git a/packages/mindplot/src/components/ConnectionLine.js b/packages/mindplot/src/components/ConnectionLine.js index 5a0da452..2307edef 100644 --- a/packages/mindplot/src/components/ConnectionLine.js +++ b/packages/mindplot/src/components/ConnectionLine.js @@ -58,11 +58,8 @@ class ConnectionLine { return [new Point(deltaX, 0), new Point(-deltaX, 0)]; } - _createLine(lineType, defaultStyle) { - if (!$defined(lineType)) { - lineType = defaultStyle; - } - lineType = parseInt(lineType, 10); + _createLine(lineTypeParam, defaultStyle) { + const lineType = $defined(lineTypeParam) ? parseInt(lineTypeParam, 10) : defaultStyle; this._lineType = lineType; let line = null; switch (lineType) { diff --git a/packages/mindplot/src/components/ControlPoint.js b/packages/mindplot/src/components/ControlPoint.js index 9da65cdc..34242835 100644 --- a/packages/mindplot/src/components/ControlPoint.js +++ b/packages/mindplot/src/components/ControlPoint.js @@ -137,7 +137,7 @@ class ControlPoint { const pos = screen.getWorkspaceMousePosition(event); let cords; - if (point == 0) { + if (point === 0) { cords = Shape.calculateRelationShipPointCoordinates(this._line.getSourceTopic(), pos); this._line.setFrom(cords.x, cords.y); this._line.setSrcControlPoint(new Point(pos.x - cords.x, pos.y - cords.y)); diff --git a/packages/mindplot/src/components/Designer.js b/packages/mindplot/src/components/Designer.js index 4dd1f0ec..634fb3a4 100644 --- a/packages/mindplot/src/components/Designer.js +++ b/packages/mindplot/src/components/Designer.js @@ -342,11 +342,7 @@ class Designer extends Events { * @param {Number=} factor * zoom out by the given factor, or 1.2, if undefined */ - zoomOut(factor) { - if (!factor) { - factor = 1.2; - } - + zoomOut(factor = 1.2) { const model = this.getModel(); const scale = model.getZoom() * factor; if (scale <= 1.9) { @@ -361,9 +357,7 @@ class Designer extends Events { * @param {Number=} factor * zoom in by the given factor, or 1.2, if undefined */ - zoomIn(factor) { - if (!factor) factor = 1.2; - + zoomIn(factor = 1.2) { const model = this.getModel(); const scale = model.getZoom() / factor; @@ -935,7 +929,8 @@ class Designer extends Events { /** */ changeTopicShape(shape) { - const validateFunc = (topic) => !(topic.getType() === INodeModel.CENTRAL_TOPIC_TYPE && shape === TopicShape.LINE + const validateFunc = (topic) => !( + topic.getType() === INodeModel.CENTRAL_TOPIC_TYPE && shape === TopicShape.LINE ); const validateError = 'Central Topic shape can not be changed to line figure.'; diff --git a/packages/mindplot/src/components/DesignerKeyboard.js b/packages/mindplot/src/components/DesignerKeyboard.js index 3b8c45c0..0c8bae05 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.js +++ b/packages/mindplot/src/components/DesignerKeyboard.js @@ -15,8 +15,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { $assert } from '@wisemapping/core-js'; import $ from 'jquery'; +import { $assert } from '@wisemapping/core-js'; import Keyboard from './Keyboard'; class DesignerKeyboard extends Keyboard { diff --git a/packages/mindplot/src/components/DesignerUndoManager.js b/packages/mindplot/src/components/DesignerUndoManager.js index fdc7388d..c4f54adf 100644 --- a/packages/mindplot/src/components/DesignerUndoManager.js +++ b/packages/mindplot/src/components/DesignerUndoManager.js @@ -30,7 +30,7 @@ class DesignerUndoManager { if (command.discardDuplicated && length > 0) { // Skip duplicated events ... const lastItem = this._undoQueue[length - 1]; - if (lastItem.discardDuplicated != command.discardDuplicated) { + if (lastItem.discardDuplicated !== command.discardDuplicated) { this._undoQueue.push(command); } } else { @@ -73,11 +73,11 @@ class DesignerUndoManager { hasBeenChanged() { let result = true; const undoLength = this._undoQueue.length; - if (undoLength == 0 && this._baseId == 0) { + if (undoLength === 0 && this._baseId === 0) { result = false; } else if (undoLength > 0) { const command = this._undoQueue[undoLength - 1]; - result = (this._baseId != command.getId()); + result = (this._baseId !== command.getId()); } return result; } diff --git a/packages/mindplot/src/components/DragConnector.js b/packages/mindplot/src/components/DragConnector.js index cc3ce37e..553d56b5 100644 --- a/packages/mindplot/src/components/DragConnector.js +++ b/packages/mindplot/src/components/DragConnector.js @@ -28,13 +28,11 @@ class DragConnector { } checkConnection(dragTopic) { - const topics = this._designerModel.getTopics(); - // Must be disconnected from their current connection ?. const candidates = this._searchConnectionCandidates(dragTopic); const currentConnection = dragTopic.getConnectedToTopic(); - if (currentConnection && (candidates.length == 0 || candidates[0] != currentConnection)) { + if (currentConnection && (candidates.length === 0 || candidates[0] !== currentConnection)) { dragTopic.disconnect(this._workspace); } @@ -71,7 +69,8 @@ class DragConnector { // * The x distance greater the vertical tolerated distance topics = topics.filter((topic) => { const tpos = topic.getPosition(); - // Center topic has different alignment than the rest of the nodes. That's why i need to divide it by two... + // Center topic has different alignment than the rest of the nodes. + // That's why i need to divide it by two... const txborder = tpos.x + (topic.getSize().width / 2) * Math.sign(sPos.x); const distance = (sPos.x - txborder) * Math.sign(sPos.x); return distance > 0 && (distance < DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE); @@ -90,14 +89,16 @@ class DragConnector { const av = me._isVerticallyAligned(a.getSize(), aPos, sPos); const bv = me._isVerticallyAligned(b.getSize(), bPos, sPos); - return me._proximityWeight(av, a, sPos, currentConnection) - me._proximityWeight(bv, b, sPos, currentConnection); + return me._proximityWeight(av, a, sPos, currentConnection) + - me._proximityWeight(bv, b, sPos, currentConnection); }); return topics; } _proximityWeight(isAligned, target, sPos, currentConnection) { const tPos = target.getPosition(); - return (isAligned ? 0 : 200) + Math.abs(tPos.x - sPos.x) + Math.abs(tPos.y - sPos.y) + (currentConnection == target ? 0 : 100); + return (isAligned ? 0 : 200) + Math.abs(tPos.x - sPos.x) + + Math.abs(tPos.y - sPos.y) + (currentConnection === target ? 0 : 100); } _isVerticallyAligned(targetSize, targetPosition, sourcePosition) { diff --git a/packages/mindplot/src/components/DragManager.js b/packages/mindplot/src/components/DragManager.js index c5942cda..34555d9f 100644 --- a/packages/mindplot/src/components/DragManager.js +++ b/packages/mindplot/src/components/DragManager.js @@ -44,11 +44,15 @@ class DragManager { const dragNode = node.createDragNode(layoutManager); // Register mouse move listener ... - const mouseMoveListener = dragManager._buildMouseMoveListener(workspace, dragNode, dragManager); + const mouseMoveListener = dragManager._buildMouseMoveListener( + workspace, dragNode, dragManager, + ); screen.addEvent('mousemove', mouseMoveListener); // Register mouse up listeners ... - const mouseUpListener = dragManager._buildMouseUpListener(workspace, node, dragNode, dragManager); + const mouseUpListener = dragManager._buildMouseUpListener( + workspace, node, dragNode, dragManager, + ); screen.addEvent('mouseup', mouseUpListener); // Change cursor. @@ -59,15 +63,7 @@ class DragManager { } remove(node) { - const nodes = this._topics; - let contained = false; - let index = -1; - for (let i = 0; i < nodes.length; i++) { - if (nodes[i] == node) { - contained = true; - index = i; - } - } + throw new Error('Not implemented: DragManager.prototype.remove'); } _buildMouseMoveListener(workspace, dragNode, dragManager) { @@ -96,6 +92,8 @@ class DragManager { event.preventDefault(); }; + // allowed param reassign to avoid risks of existing code relying in this side-effect + // eslint-disable-next-line no-param-reassign dragManager._mouseMoveListener = result; return result; } @@ -111,8 +109,11 @@ class DragManager { screen.removeEvent('mouseup', dragManager._mouseUpListener); // Help GC + // allowed param reassign to avoid risks of existing code relying in this side-effect + /* eslint-disable no-param-reassign */ dragManager._mouseMoveListener = null; dragManager._mouseUpListener = null; + /* eslint-enable no-param-reassign */ workspace.enableWorkspaceEvents(true); // Change the cursor to the default. @@ -129,6 +130,7 @@ class DragManager { me._isDragInProcess = false; } }; + // eslint-disable-next-line no-param-reassign dragManager._mouseUpListener = result; return result; } diff --git a/packages/mindplot/src/components/DragPivot.js b/packages/mindplot/src/components/DragPivot.js index 72c3c484..3f653fde 100644 --- a/packages/mindplot/src/components/DragPivot.js +++ b/packages/mindplot/src/components/DragPivot.js @@ -125,7 +125,7 @@ class DragPivot { } setVisibility(value) { - if (this.isVisible() != value) { + if (this.isVisible() !== value) { const pivotRect = this._getPivotRect(); pivotRect.setVisibility(value); @@ -145,7 +145,7 @@ class DragPivot { let result = null; const parentTopic = this._targetTopic; if (parentTopic) { - if (parentTopic.getType() == INodeModel.CENTRAL_TOPIC_TYPE) { + if (parentTopic.getType() === INodeModel.CENTRAL_TOPIC_TYPE) { result = this._straightLine; } else { result = this._curvedLine; @@ -198,7 +198,7 @@ class DragPivot { connectTo(targetTopic, position) { $assert(!this._outgoingLine, 'Could not connect an already connected node'); - $assert(targetTopic != this, 'Circular connection are not allowed'); + $assert(targetTopic !== this, 'Circular connection are not allowed'); $assert(position, 'position can not be null'); $assert(targetTopic, 'parent can not be null'); diff --git a/packages/mindplot/src/components/DragTopic.js b/packages/mindplot/src/components/DragTopic.js index 56ffa162..efb56989 100644 --- a/packages/mindplot/src/components/DragTopic.js +++ b/packages/mindplot/src/components/DragTopic.js @@ -71,7 +71,7 @@ class DragTopic { this._draggedNode.getId(), this.getPosition(), ); - if (this._order != predict.order) { + if (this._order !== predict.order) { const dragPivot = this._getDragPivot(); const pivotPosition = predict.position; dragPivot.connectTo(parent, pivotPosition); @@ -81,8 +81,10 @@ class DragTopic { } updateFreeLayout(event) { - const isFreeEnabled = (event.metaKey && Browser.Platform.mac) || (event.ctrlKey && !Browser.Platform.mac); - if (this.isFreeLayoutOn() != isFreeEnabled) { + const isFreeEnabled = (event.metaKey && Browser.Platform.mac) + || (event.ctrlKey && !Browser.Platform.mac); + + if (this.isFreeLayoutOn() !== isFreeEnabled) { const dragPivot = this._getDragPivot(); dragPivot.setVisibility(!isFreeEnabled); this._isFreeLayoutEnabled = isFreeEnabled; @@ -114,7 +116,8 @@ class DragTopic { // Where it should be connected ? - // @todo: This is a hack for the access of the editor. It's required to review why this is needed forcing the declaration of a global variable. + // @todo: This is a hack for the access of the editor. + // It's required to review why this is needed forcing the declaration of a global variable. const predict = designer._eventBussDispatcher._layoutManager.predict( parent.getId(), this._draggedNode.getId(), @@ -139,7 +142,8 @@ class DragTopic { // Remove drag shadow. workspace.removeChild(this._elem2d); - // Remove pivot shape. To improve performance it will not be removed. Only the visibility will be changed. + // Remove pivot shape. To improve performance it will not be removed. + // Only the visibility will be changed. const dragPivot = this._getDragPivot(); dragPivot.setVisibility(false); @@ -213,13 +217,13 @@ class DragTopic { } } -DragTopic.init = function (workspace) { +DragTopic.init = function init(workspace) { $assert(workspace, 'workspace can not be null'); const pivot = DragTopic.__getDragPivot(); workspace.append(pivot); }; -DragTopic.__getDragPivot = function () { +DragTopic.__getDragPivot = function __getDragPivot() { let result = DragTopic._dragPivot; if (!$defined(result)) { result = new DragPivot(); diff --git a/packages/mindplot/src/components/DragTopicConfig.js b/packages/mindplot/src/components/DragTopicConfig.js index ef339928..6f2d6a03 100644 --- a/packages/mindplot/src/components/DragTopicConfig.js +++ b/packages/mindplot/src/components/DragTopicConfig.js @@ -1,4 +1,4 @@ -export const PIVOT_SIZE = { width: 50, height: 6 }; +const PIVOT_SIZE = { width: 50, height: 6 }; export default { PIVOT_SIZE, diff --git a/packages/mindplot/src/components/EditorOptions.js b/packages/mindplot/src/components/EditorOptions.js deleted file mode 100644 index 5bb66573..00000000 --- a/packages/mindplot/src/components/EditorOptions.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -const EditorOptions = { - LayoutManager: 'OriginalLayout', - // LayoutManager:"FreeMindLayout", - textEditor: 'TextEditor', -// textEditor:"RichTextEditor" -}; - -export default EditorOptions; diff --git a/packages/mindplot/src/components/Events.js b/packages/mindplot/src/components/Events.js index b79c53e0..ddd48836 100644 --- a/packages/mindplot/src/components/Events.js +++ b/packages/mindplot/src/components/Events.js @@ -41,12 +41,12 @@ class Events { return this; } - fireEvent(typeName, args, delay) { + fireEvent(typeName, eventArgs, delay) { const type = Events._removeOn(typeName); const events = this.$events[type]; if (!events) return this; - args = Array.isArray(args) ? args : [args]; + const args = Array.isArray(eventArgs) ? eventArgs : [eventArgs]; events.forEach(((fn) => { if (delay) { fn.delay(delay, this, args); diff --git a/packages/mindplot/src/components/IconGroup.js b/packages/mindplot/src/components/IconGroup.js index 29da65c9..abf2d660 100644 --- a/packages/mindplot/src/components/IconGroup.js +++ b/packages/mindplot/src/components/IconGroup.js @@ -17,7 +17,7 @@ */ // eslint-disable-next-line max-classes-per-file import { $assert, $defined } from '@wisemapping/core-js'; -import { Group, Rect, Line } from '@wisemapping/web2d'; +import { Group } from '@wisemapping/web2d'; import IconGroupRemoveTip from './IconGroupRemoveTip'; import Icon from './Icon'; diff --git a/packages/mindplot/src/components/IconGroupRemoveTip.js b/packages/mindplot/src/components/IconGroupRemoveTip.js index 7793044f..710e8e9f 100644 --- a/packages/mindplot/src/components/IconGroupRemoveTip.js +++ b/packages/mindplot/src/components/IconGroupRemoveTip.js @@ -1,6 +1,6 @@ -import { Group, Rect, Line } from '@wisemapping/web2d'; import $ from 'jquery'; import { $assert, $defined } from '@wisemapping/core-js'; +import { Group, Rect, Line } from '@wisemapping/web2d'; export default class RemoveTip { /** @lends IconGroup.RemoveTip */ @@ -160,6 +160,7 @@ export default class RemoveTip { icon.addEvent('mouseout', () => { me.hide(); }); + // eslint-disable-next-line no-param-reassign icon.__remove = true; } } diff --git a/packages/mindplot/src/components/ImageIcon.js b/packages/mindplot/src/components/ImageIcon.js index fbd15d45..70b85844 100644 --- a/packages/mindplot/src/components/ImageIcon.js +++ b/packages/mindplot/src/components/ImageIcon.js @@ -37,12 +37,11 @@ class ImageIcon extends Icon { const image = this.getImage(); const me = this; image.addEvent('click', () => { - const iconType = iconModel.getIconType(); - const newIconType = ImageIcon._getNextFamilyIconId(iconType); + const iconTypeClick = iconModel.getIconType(); + const newIconType = ImageIcon._getNextFamilyIconId(iconTypeClick); iconModel.setIconType(newIconType); - const imgUrl = ImageIcon._getImageUrl(newIconType); - me._image.setHref(imgUrl); + me._image.setHref(ImageIcon._getImageUrl(newIconType)); }); this._image.setCursor('pointer'); } @@ -65,7 +64,7 @@ class ImageIcon extends Icon { if (familyIcons[i] === iconId) { // Is last one? if (i === (familyIcons.length - 1)) { - result = familyIcons[0]; + [result] = familyIcons; } else { result = familyIcons[i + 1]; } @@ -150,7 +149,8 @@ ImageIcon.prototype.ICON_FAMILIES = [ { id: 'tag', icons: ['tag_blue', 'tag_green', 'tag_orange', 'tag_red', 'tag_pink', 'tag_yellow'] }, { id: 'object', - icons: ['object_bell', 'object_clanbomber', 'object_key', 'object_pencil', 'object_phone', 'object_magnifier', 'object_clip', 'object_music', 'object_star', 'object_wizard', 'object_house', 'object_cake', 'object_camera', 'object_palette', 'object_rainbow'], + icons: ['object_bell', 'object_clanbomber', 'object_key', 'object_pencil', 'object_phone', 'object_magnifier', 'object_clip', + 'object_music', 'object_star', 'object_wizard', 'object_house', 'object_cake', 'object_camera', 'object_palette', 'object_rainbow'], }, { id: 'weather', diff --git a/packages/mindplot/src/components/Keyboard.js b/packages/mindplot/src/components/Keyboard.js index bafe7ca2..30b97144 100644 --- a/packages/mindplot/src/components/Keyboard.js +++ b/packages/mindplot/src/components/Keyboard.js @@ -18,12 +18,9 @@ import $ from 'jquery'; class Keyboard { - // eslint-disable-next-line class-methods-use-this addShortcut(shortcuts, callback) { - if (!Array.isArray(shortcuts)) { - shortcuts = [shortcuts]; - } - shortcuts.forEach((shortcut) => { + const shortcutsArray = Array.isArray(shortcuts) ? shortcuts : [shortcuts]; + shortcutsArray.forEach((shortcut) => { $(document).bind('keydown', shortcut, callback); }); } diff --git a/packages/mindplot/src/components/MultilineTextEditor.js b/packages/mindplot/src/components/MultilineTextEditor.js index 2008d765..f2160680 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.js +++ b/packages/mindplot/src/components/MultilineTextEditor.js @@ -17,6 +17,8 @@ */ import { $defined } from '@wisemapping/core-js'; import $ from 'jquery'; +// TODO: use jquery.hotkeys from npm or setup eslint-import-resolver-alias plugin +// eslint-disable-next-line import/no-unresolved, import/no-extraneous-dependencies import initHotKeyPluggin from '@libraries/jquery.hotkeys'; import Events from './Events'; import ActionDispatcher from './ActionDispatcher'; @@ -56,6 +58,8 @@ class MultilineTextEditor extends Events { _registerEvents(containerElem) { const textareaElem = this._getTextareaElem(); const me = this; + let start; + let end; textareaElem.on('keydown', function keydown(event) { switch ($.hotkeys.specialKeys[event.keyCode]) { case 'esc': @@ -92,8 +96,8 @@ class MultilineTextEditor extends Events { break; case 'tab': { event.preventDefault(); - const start = $(this).get(0).selectionStart; - const end = $(this).get(0).selectionEnd; + start = $(this).get(0).selectionStart; + end = $(this).get(0).selectionEnd; // set textarea value to: text before caret + tab + text after caret $(this).val(`${$(this).val().substring(0, start)}\t${$(this).val().substring(end)}`); @@ -157,7 +161,7 @@ class MultilineTextEditor extends Events { } _updateModel() { - if (this._topic.getText() != this._getText()) { + if (this._topic.getText() !== this._getText()) { const text = this._getText(); const topicId = this._topic.getId(); @@ -223,6 +227,8 @@ class MultilineTextEditor extends Events { _setStyle(fontStyle) { const inputField = this._getTextareaElem(); + // allowed param reassign to avoid risks of existing code relying in this side-effect + /* eslint-disable no-param-reassign */ if (!$defined(fontStyle.font)) { fontStyle.font = 'Arial'; } @@ -235,6 +241,7 @@ class MultilineTextEditor extends Events { if (!$defined(fontStyle.size)) { fontStyle.size = 12; } + /* eslint-enable no-param-reassign */ const style = { fontSize: `${fontStyle.size}px`, fontFamily: fontStyle.font, @@ -276,8 +283,12 @@ class MultilineTextEditor extends Events { const range = textareaElem.createTextRange(); range.move('character', lengh); } else { + // allowed param reassign to avoid risks of existing code relying in this side-effect + /* eslint-disable no-param-reassign */ textareaElem.selectionStart = lengh; textareaElem.selectionEnd = lengh; + /* eslint-enable no-param-reassign */ + textareaElem.focus(); } } diff --git a/packages/mindplot/src/components/NodeGraph.js b/packages/mindplot/src/components/NodeGraph.js index abbbf9f1..a57ede5a 100644 --- a/packages/mindplot/src/components/NodeGraph.js +++ b/packages/mindplot/src/components/NodeGraph.js @@ -52,7 +52,7 @@ class NodeGraph { * @throws will throw an error if the topic id is not a number */ setId(id) { - $assert(typeof topic.getId() === 'number', `id is not a number:${id}`); + $assert(typeof id === 'number', `id is not a number:${id}`); this.getModel().setId(id); } diff --git a/packages/mindplot/src/components/NoteIcon.js b/packages/mindplot/src/components/NoteIcon.js index 53990af9..3fa9ecca 100644 --- a/packages/mindplot/src/components/NoteIcon.js +++ b/packages/mindplot/src/components/NoteIcon.js @@ -61,17 +61,17 @@ class NoteIcon extends Icon { if ($('body').find('#textPopoverNote').length === 1) { const text = $('body').find('#textPopoverNote'); text.text(this._linksModel.getText()); - } else { - const result = $('
').css({ padding: '5px' }); - - const text = $('
').text(this._linksModel.getText()) - .css({ - 'white-space': 'pre-wrap', - 'word-wrap': 'break-word', - }); - result.append(text); - return result; + return text; } + const result = $('
').css({ padding: '5px' }); + + const text = $('
').text(this._linksModel.getText()) + .css({ + 'white-space': 'pre-wrap', + 'word-wrap': 'break-word', + }); + result.append(text); + return result; } getModel() { diff --git a/packages/mindplot/src/components/Options.js b/packages/mindplot/src/components/Options.js index 45c6c303..a22f1866 100644 --- a/packages/mindplot/src/components/Options.js +++ b/packages/mindplot/src/components/Options.js @@ -6,12 +6,13 @@ class Options { this.options = options; if (this.addEvent) { - for (const option in options) { - if (typeof (options[option]) !== 'function' || !(/^on[A-Z]/).test(option)) { - continue; + const optionsKeys = Object.keys(options); + for (let index = 0; index < optionsKeys.length; index++) { + const option = optionsKeys[index]; + if (typeof (options[option]) === 'function' && (/^on[A-Z]/).test(option)) { + this.addEvent(option, options[option]); + delete options[option]; } - this.addEvent(option, options[option]); - delete options[option]; } } return this; diff --git a/packages/mindplot/src/components/PersistenceManager.js b/packages/mindplot/src/components/PersistenceManager.js index 4e356333..8344a7b3 100644 --- a/packages/mindplot/src/components/PersistenceManager.js +++ b/packages/mindplot/src/components/PersistenceManager.js @@ -63,13 +63,11 @@ class PersistenceManager { } } -PersistenceManager.init = function init(instance) { +PersistenceManager.init = (instance) => { PersistenceManager._instance = instance; }; -PersistenceManager.getInstance = function getInstance() { - return PersistenceManager._instance; -}; +PersistenceManager.getInstance = () => PersistenceManager._instance; PersistenceManager.loadFromDom = function loadFromDom(mapId, mapDom) { $assert(mapId, 'mapId can not be null'); diff --git a/packages/mindplot/src/components/Relationship.js b/packages/mindplot/src/components/Relationship.js index df98715a..04c77472 100644 --- a/packages/mindplot/src/components/Relationship.js +++ b/packages/mindplot/src/components/Relationship.js @@ -229,7 +229,8 @@ class Relationship extends ConnectionLine { this._focusShape.updateLine(); } - addEvent(type, listener) { + addEvent(eventType, listener) { + let type = eventType; // Translate to web 2d events ... if (type === 'onfocus') { type = 'mousedown'; diff --git a/packages/mindplot/src/components/RestPersistenceManager.js b/packages/mindplot/src/components/RestPersistenceManager.js index 0a24b14e..a912369a 100644 --- a/packages/mindplot/src/components/RestPersistenceManager.js +++ b/packages/mindplot/src/components/RestPersistenceManager.js @@ -64,8 +64,8 @@ class RESTPersistenceManager extends PersistenceManager { contentType: 'application/json; charset=utf-8', async: !sync, - success(data, textStatus, jqXHRresponseText) { - persistence.timestamp = data; + success(successData, textStatus, jqXHRresponseText) { + persistence.timestamp = successData; events.onSuccess(); }, error(jqXHR, textStatus, errorThrown) { @@ -92,7 +92,7 @@ class RESTPersistenceManager extends PersistenceManager { // Message could not be decoded ... } userMsg = persistence._buildError(serverMsg); - } else if (this.status == 405) { + } else if (this.status === 405) { userMsg = { severity: 'SEVERE', message: $msg('SESSION_EXPIRED') }; } events.onError(userMsg); diff --git a/packages/mindplot/src/components/StandaloneActionDispatcher.js b/packages/mindplot/src/components/StandaloneActionDispatcher.js index 3a7fbedf..581d59f6 100644 --- a/packages/mindplot/src/components/StandaloneActionDispatcher.js +++ b/packages/mindplot/src/components/StandaloneActionDispatcher.js @@ -115,9 +115,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicIds, 'topicIds can not be null'); $assert(fontFamily, 'fontFamily can not be null'); - const commandFunc = (topic, fontFamily) => { + const commandFunc = (topic, commandFontFamily) => { const result = topic.getFontFamily(); - topic.setFontFamily(fontFamily, true); + topic.setFontFamily(commandFontFamily, true); topic._adjustShapes(); return result; @@ -132,9 +132,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicsIds, 'topicIds can not be null'); $assert(color, 'color can not be null'); - const commandFunc = (topic, color) => { + const commandFunc = (topic, commandColor) => { const result = topic.getFontColor(); - topic.setFontColor(color, true); + topic.setFontColor(commandColor, true); return result; }; @@ -148,9 +148,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicsIds, 'topicIds can not be null'); $assert(color, 'color can not be null'); - const commandFunc = (topic, color) => { + const commandFunc = (topic, commandColor) => { const result = topic.getBackgroundColor(); - topic.setBackgroundColor(color); + topic.setBackgroundColor(commandColor); return result; }; @@ -164,9 +164,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicsIds, 'topicIds can not be null'); $assert(color, 'topicIds can not be null'); - const commandFunc = (topic, color) => { + const commandFunc = (topic, commandColor) => { const result = topic.getBorderColor(); - topic.setBorderColor(color); + topic.setBorderColor(commandColor); return result; }; @@ -180,9 +180,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicsIds, 'topicIds can not be null'); $assert(size, 'size can not be null'); - const commandFunc = (topic, size) => { + const commandFunc = (topic, commandSize) => { const result = topic.getFontSize(); - topic.setFontSize(size, true); + topic.setFontSize(commandSize, true); topic._adjustShapes(); return result; @@ -197,9 +197,9 @@ class StandaloneActionDispatcher extends ActionDispatcher { $assert(topicsIds, 'topicsIds can not be null'); $assert(shapeType, 'shapeType can not be null'); - const commandFunc = (topic, shapeType) => { + const commandFunc = (topic, commandShapeType) => { const result = topic.getShapeType(); - topic.setShapeType(shapeType, true); + topic.setShapeType(commandShapeType, true); return result; }; diff --git a/packages/mindplot/src/components/TextEditor.js b/packages/mindplot/src/components/TextEditor.js deleted file mode 100644 index 3d0c6345..00000000 --- a/packages/mindplot/src/components/TextEditor.js +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * 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 { $defined } from '@wisemapping/core-js'; -import { TransformUtil } from '@wisemapping/web2d'; -import ActionDispatcher from './ActionDispatcher'; - -// FIXME: Not used! -class TextEditor { - constructor(topic) { - this._topic = topic; - } - - _buildEditor() { - this._size = { width: 500, height: 100 }; - const result = new Element('div'); - result.setStyles({ - position: 'absolute', - display: 'none', - zIndex: '8', - width: '500px', - height: '100px', - }); - - const inputContainer = new Element('div'); - inputContainer.setStyles({ - border: 'none', - overflow: 'auto', - }); - inputContainer.inject(result); - - const inputText = new Element('input', { - type: 'text', - tabindex: '-1', - value: '', - }); - inputText.setStyles({ - border: 'none', - background: 'transparent', - }); - inputText.inject(inputContainer); - - const spanContainer = new Element('div'); - spanContainer.setStyle('visibility', 'hidden'); - spanContainer.inject(result); - - const spanElem = new Element('span', { tabindex: '-1' }); - spanElem.setStyle('white-space', 'nowrap'); - spanElem.setStyle('nowrap', 'nowrap'); - spanElem.inject(spanContainer); - - return result; - } - - _registerEvents(divElem) { - const inputElem = this._getTextareaElem(); - const spanElem = this._getSpanElem(); - const me = this; - - divElem.addEvent('keydown', (event) => { - switch (event.key) { - case 'esc': - me.close(false); - break; - case 'enter': - me.close(true); - break; - default: - spanElem.innerHTML = inputElem.value; - var size = inputElem.value.length + 1; - - inputElem.size = size; - if (spanElem.offsetWidth > parseInt(divElem.style.width, 10) - 100) { - divElem.style.width = `${spanElem.offsetWidth + 100}px`; - } - break; - } - event.stopPropagation(); - }); - - // If the user clicks on the input, all event must be ignored ... - divElem.addEvent('click', (event) => { - event.stopPropagation(); - }); - divElem.addEvent('dblclick', (event) => { - event.stopPropagation(); - }); - divElem.addEvent('mousedown', (event) => { - event.stopPropagation(); - }); - } - - isVisible() { - return $defined(this._containerElem) && this._containerElem.getStyle('display') === 'block'; - } - - _updateModel() { - if (this._topic.getText() !== this._getText()) { - const text = this._getText(); - const topicId = this._topic.getId(); - - const actionDispatcher = ActionDispatcher.getInstance(); - actionDispatcher.changeTextToTopic([topicId], text); - } - } - - show(text) { - if (!this.isVisible()) { - // Create editor ui - const editorElem = this._buildEditor(); - editorElem.inject($(document.body)[0]); - - this._containerElem = editorElem; - this._registerEvents(editorElem); - this._showEditor(text); - } - } - - _showEditor(defaultText) { - const topic = this._topic; - - // Hide topic text ... - topic.getTextShape().setVisibility(false); - - // Set Editor Style - const nodeText = topic.getTextShape(); - const font = nodeText.getFont(); - font.size = nodeText.getHtmlFontSize(); - font.color = nodeText.getColor(); - this._setStyle(font); - - // Set editor's initial text - const text = $defined(defaultText) ? defaultText : topic.getText(); - this._setText(text); - - const me = this; - // Set editor's initial size - const displayFunc = function () { - // Position the editor and set the size... - const textShape = me._topic.getTextShape(); - - me._containerElem.css('display', 'block'); - - me._containerElem.offset(textShape.getNativePosition()); - // Set size ... - const elemSize = topic.getSize(); - me._setEditorSize(elemSize.width, elemSize.height); - - const textareaElem = me._getTextareaElem(); - textareaElem.focus(); - me._positionCursor(textareaElem, !$defined(defaultText)); - }; - - displayFunc.delay(10); - } - - _setStyle(fontStyle) { - const inputField = this._getTextareaElem(); - const spanField = this._getSpanElem(); - if (!$defined(fontStyle.font)) { - fontStyle.font = 'Arial'; - } - if (!$defined(fontStyle.style)) { - fontStyle.style = 'normal'; - } - if (!$defined(fontStyle.weight)) { - fontStyle.weight = 'normal'; - } - if (!$defined(fontStyle.size)) { - fontStyle.size = 12; - } - inputField.style.fontSize = `${fontStyle.size}px`; - inputField.style.fontFamily = fontStyle.font; - inputField.style.fontStyle = fontStyle.style; - inputField.style.fontWeight = fontStyle.weight; - inputField.style.color = fontStyle.color; - spanField.style.fontFamily = fontStyle.font; - spanField.style.fontStyle = fontStyle.style; - spanField.style.fontWeight = fontStyle.weight; - spanField.style.fontSize = `${fontStyle.size}px`; - } - - _setText(text) { - const inputField = this._getTextareaElem(); - inputField.size = text.length + 1; - this._containerElem.style.width = `${inputField.size * parseInt(inputField.style.fontSize, 10) + 100 - }px`; - const spanField = this._getSpanElem(); - spanField.innerHTML = text; - inputField.value = text; - } - - _getText() { - return this._getTextareaElem().value; - } - - _getTextareaElem() { - return this._containerElem.getElement('input'); - } - - _getSpanElem() { - return this._containerElem.getElement('span'); - } - - _setEditorSize(width, height) { - const textShape = this._topic.getTextShape(); - const scale = TransformUtil.workoutScale(textShape.peer); - this._size = { width: width * scale.width, height: height * scale.height }; - this._containerElem.style.width = `${this._size.width * 2}px`; - this._containerElem.style.height = `${this._size.height}px`; - } - - _positionCursor(inputElem, selectText) { - // Select text if it's required ... - if (inputElem.createTextRange) { - // ie - const range = inputElem.createTextRange(); - const pos = inputElem.value.length; - if (!selectText) { - range.select(); - range.move('character', pos); - } else { - range.move('character', pos); - range.select(); - } - } else if (!selectText) { - inputElem.setSelectionRange(0, inputElem.value.length); - } - } - - close(update) { - if (this.isVisible()) { - // Update changes ... - if (!$defined(update) || update) { - this._updateModel(); - } - - // Let make the visible text in the node visible again ... - this._topic.getTextShape().setVisibility(true); - - // Remove it form the screen ... - this._containerElem.dispose(); - this._containerElem = null; - } - } -} - -export default TextEditor; diff --git a/packages/mindplot/src/components/TextEditorFactory.js b/packages/mindplot/src/components/TextEditorFactory.js deleted file mode 100644 index ff9ed8fa..00000000 --- a/packages/mindplot/src/components/TextEditorFactory.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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 TextEditor from './TextEditor'; - -const TextEditorFactory = {}; - -TextEditorFactory.getTextEditorFromName = function (name) { - let editorClass = null; - if (name == 'RichTextEditor') { - editorClass = RichTextEditor; - } else { - editorClass = TextEditor; - } - return editorClass; -}; diff --git a/packages/mindplot/src/components/Topic.js b/packages/mindplot/src/components/Topic.js index 1bf954ba..6340f691 100644 --- a/packages/mindplot/src/components/Topic.js +++ b/packages/mindplot/src/components/Topic.js @@ -15,9 +15,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { $assert, $defined } from '@wisemapping/core-js'; -import { Rect, Image, Line, Text, Group } from '@wisemapping/web2d'; import $ from 'jquery'; +import { $assert, $defined } from '@wisemapping/core-js'; +import { + Rect, Image, Line, Text, Group, +} from '@wisemapping/web2d'; import NodeGraph from './NodeGraph'; import TopicConfig from './TopicConfig'; @@ -507,10 +509,11 @@ class Topic extends NodeGraph { setText(text) { // Avoid empty nodes ... if (!text || $.trim(text).length === 0) { - text = null; + this._setText(null, true); + } else { + this._setText(text, true); } - this._setText(text, true); this._adjustShapes(); } @@ -825,7 +828,10 @@ class Topic extends NodeGraph { */ setPosition(point) { $assert(point, 'position can not be null'); + // allowed param reassign to avoid risks of existing code relying in this side-effect + // eslint-disable-next-line no-param-reassign point.x = Math.ceil(point.x); + // eslint-disable-next-line no-param-reassign point.y = Math.ceil(point.y); // Update model's position ... @@ -1006,11 +1012,11 @@ class Topic extends NodeGraph { const children = this.getChildren(); const model = this.getModel(); - isVisible = isVisible ? !model.areChildrenShrunken() : isVisible; + const visibility = isVisible ? !model.areChildrenShrunken() : isVisible; children.forEach((child) => { - child.setVisibility(isVisible); + child.setVisibility(visibility); const outgoingLine = child.getOutgoingLine(); - outgoingLine.setVisibility(isVisible); + outgoingLine.setVisibility(visibility); }); } @@ -1030,26 +1036,27 @@ class Topic extends NodeGraph { setSize(size, force) { $assert(size, 'size can not be null'); $assert($defined(size.width), 'size seem not to be a valid element'); - size = { width: Math.ceil(size.width), height: Math.ceil(size.height) }; + const roundedSize = { width: Math.ceil(size.width), height: Math.ceil(size.height) }; const oldSize = this.getSize(); - const hasSizeChanged = oldSize.width !== size.width || oldSize.height !== size.height; + const hasSizeChanged = oldSize.width !== roundedSize.width + || oldSize.height !== roundedSize.height; if (hasSizeChanged || force) { - NodeGraph.prototype.setSize.call(this, size); + NodeGraph.prototype.setSize.call(this, roundedSize); const outerShape = this.getOuterShape(); const innerShape = this.getInnerShape(); - outerShape.setSize(size.width + 4, size.height + 6); - innerShape.setSize(size.width, size.height); + outerShape.setSize(roundedSize.width + 4, roundedSize.height + 6); + innerShape.setSize(roundedSize.width, roundedSize.height); // Update the figure position(ej: central topic must be centered) and children position. - this._updatePositionOnChangeSize(oldSize, size); + this._updatePositionOnChangeSize(oldSize, roundedSize); if (hasSizeChanged) { EventBus.instance.fireEvent(EventBus.events.NodeResizeEvent, { node: this.getModel(), - size, + size: roundedSize, }); } } diff --git a/packages/mindplot/src/components/TopicConfig.js b/packages/mindplot/src/components/TopicConfig.js index 731511d2..d1a94b8f 100644 --- a/packages/mindplot/src/components/TopicConfig.js +++ b/packages/mindplot/src/components/TopicConfig.js @@ -3,13 +3,13 @@ * @type {Number} * @default */ -export const CONNECTOR_WIDTH = 6; +const CONNECTOR_WIDTH = 6; /** * @constant * @type {Object} * @default */ -export const OUTER_SHAPE_ATTRIBUTES = { +const OUTER_SHAPE_ATTRIBUTES = { fillColor: 'rgb(252,235,192)', stroke: '1 dot rgb(241,163,39)', x: 0, @@ -20,13 +20,13 @@ export const OUTER_SHAPE_ATTRIBUTES = { * @type {Object} * @default */ -export const OUTER_SHAPE_ATTRIBUTES_FOCUS = { fillColor: 'rgb(244,184,45)', x: 0, y: 0 }; +const OUTER_SHAPE_ATTRIBUTES_FOCUS = { fillColor: 'rgb(244,184,45)', x: 0, y: 0 }; /** * @constant * @type {Object} * @default * */ -export const INNER_RECT_ATTRIBUTES = { stroke: '2 solid' }; +const INNER_RECT_ATTRIBUTES = { stroke: '2 solid' }; export default { CONNECTOR_WIDTH, diff --git a/packages/mindplot/src/components/TopicFeature.js b/packages/mindplot/src/components/TopicFeature.js index af841f81..e5555211 100644 --- a/packages/mindplot/src/components/TopicFeature.js +++ b/packages/mindplot/src/components/TopicFeature.js @@ -66,9 +66,9 @@ const TopicFeature = { $assert(type, 'type can not be null'); $assert(attributes, 'attributes can not be null'); - const { model } = TopicFeature._featuresMetadataById.filter((elem) => elem.id === type)[0]; - // eslint-disable-next-line new-cap - return new model(attributes); + const { model: Model } = TopicFeature._featuresMetadataById + .filter((elem) => elem.id === type)[0]; + return new Model(attributes); }, /** @@ -83,9 +83,9 @@ const TopicFeature = { $assert(topic, 'topic can not be null'); $assert(model, 'model can not be null'); - const { icon } = TopicFeature._featuresMetadataById.filter((elem) => elem.id === model.getType())[0]; - // eslint-disable-next-line new-cap - return new icon(topic, model, readOnly); + const { icon: Icon } = TopicFeature._featuresMetadataById + .filter((elem) => elem.id === model.getType())[0]; + return new Icon(topic, model, readOnly); }, }; diff --git a/packages/mindplot/src/components/Workspace.js b/packages/mindplot/src/components/Workspace.js index 1dc46898..cd9630e7 100644 --- a/packages/mindplot/src/components/Workspace.js +++ b/packages/mindplot/src/components/Workspace.js @@ -105,8 +105,8 @@ class Workspace { // View port coords ... if (this._viewPort) { - this._viewPort.width = this._viewPort.width * zoom; - this._viewPort.height = this._viewPort.height * zoom; + this._viewPort.width *= zoom; + this._viewPort.height *= zoom; } // Center topic.... @@ -166,8 +166,8 @@ class Workspace { const originalCoordOrigin = workspace.getCoordOrigin(); let wasDragged = false; - workspace._mouseMoveListener = function _mouseMoveListener(event) { - const currentMousePosition = screenManager.getWorkspaceMousePosition(event); + workspace._mouseMoveListener = (mouseMoveEvent) => { + const currentMousePosition = screenManager.getWorkspaceMousePosition(mouseMoveEvent); const offsetX = currentMousePosition.x - mouseDownPosition.x; const coordOriginX = -offsetX + originalCoordOrigin.x; @@ -183,7 +183,7 @@ class Workspace { } else { window.document.body.style.cursor = 'move'; } - event.preventDefault(); + mouseMoveEvent.preventDefault(); // Fire drag event ... screenManager.fireEvent('update'); @@ -192,7 +192,7 @@ class Workspace { screenManager.addEvent('mousemove', workspace._mouseMoveListener); // Register mouse up listeners ... - workspace._mouseUpListener = function mouseUpListener() { + workspace._mouseUpListener = () => { screenManager.removeEvent('mousemove', workspace._mouseMoveListener); screenManager.removeEvent('mouseup', workspace._mouseUpListener); workspace._mouseUpListener = null; diff --git a/packages/mindplot/src/components/commands/DeleteCommand.js b/packages/mindplot/src/components/commands/DeleteCommand.js index 4164a296..a868336a 100644 --- a/packages/mindplot/src/components/commands/DeleteCommand.js +++ b/packages/mindplot/src/components/commands/DeleteCommand.js @@ -53,7 +53,9 @@ class DeleteCommand extends Command { // Delete relationships const relationships = this._collectInDepthRelationships(topic); - this._deletedRelModel = this._deletedRelModel.concat(relationships.map((rel) => rel.getModel().clone())); + this._deletedRelModel = this._deletedRelModel.concat( + relationships.map((rel) => rel.getModel().clone()), + ); relationships.forEach((relationship) => { commandContext.deleteRelationship(relationship); @@ -162,7 +164,8 @@ class DeleteCommand extends Command { // Filter for unique ... result = result.sort((a, b) => a.getModel().getId() - b.getModel().getId()); const ret = [result[0]]; - for (let i = 1; i < result.length; i++) { // start loop at 1 as element 0 can never be a duplicate + // start loop at 1 as element 0 can never be a duplicate + for (let i = 1; i < result.length; i++) { if (result[i - 1] !== result[i]) { ret.push(result[i]); } diff --git a/packages/mindplot/src/components/commands/DragTopicCommand.js b/packages/mindplot/src/components/commands/DragTopicCommand.js index 8e9a8607..0bdeede3 100644 --- a/packages/mindplot/src/components/commands/DragTopicCommand.js +++ b/packages/mindplot/src/components/commands/DragTopicCommand.js @@ -24,7 +24,7 @@ class DragTopicCommand extends Command { * @constructs * @param {String} topicId id of the topic to drag * @param {Object} position - * @param {Number} order the order property (children of one node are displayed in order from 0 to n) + * @param {Number} order the order property (children are displayed in order from 0 to n) * @param {mindplot.Topic} parentTopic the topic to be made the dragged topic's new parent * @extends mindplot.Command */ diff --git a/packages/mindplot/src/components/commands/GenericFunctionCommand.js b/packages/mindplot/src/components/commands/GenericFunctionCommand.js index a28aadf8..98a9f8c0 100644 --- a/packages/mindplot/src/components/commands/GenericFunctionCommand.js +++ b/packages/mindplot/src/components/commands/GenericFunctionCommand.js @@ -50,11 +50,12 @@ class GenericFunctionCommand extends Command { try { topics = commandContext.findTopics(this._topicsId); } catch (e) { - if (this._commandFunc.commandType != 'changeTextToTopic') { + if (this._commandFunc.commandType !== 'changeTextToTopic') { // Workaround: For some reason, there is a combination of events that involves // making some modification and firing out of focus event. This is causing - // that a remove node try to be removed. In some other life, I will come with the solution. - // Almost aways occurs with IE9. I could be related with some change of order in sets o something similar. + // that a remove node try to be removed. + // In some other life, I will come with the solution. Almost aways occurs with IE9. + // I could be related with some change of order in sets o something similar. throw e; } } diff --git a/packages/mindplot/src/components/lang/Bundle.js b/packages/mindplot/src/components/lang/Bundle.js index bbbbfa65..d76b54e4 100644 --- a/packages/mindplot/src/components/lang/Bundle.js +++ b/packages/mindplot/src/components/lang/Bundle.js @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ /* * Copyright [2015] [wisemapping] * diff --git a/packages/mindplot/src/components/layout/AbstractBasicSorter.js b/packages/mindplot/src/components/layout/AbstractBasicSorter.js index 9f33cd78..212215a1 100644 --- a/packages/mindplot/src/components/layout/AbstractBasicSorter.js +++ b/packages/mindplot/src/components/layout/AbstractBasicSorter.js @@ -34,7 +34,8 @@ class AbstractBasicSorter extends ChildrenSorterStrategy { } _computeChildrenHeight(treeSet, node, heightCache) { - const height = node.getSize().height + this._getVerticalPadding() * 2; // 2* Top and down padding; + // 2* Top and down padding; + const height = node.getSize().height + this._getVerticalPadding() * 2; let result; const children = treeSet.getChildren(node); @@ -51,6 +52,7 @@ class AbstractBasicSorter extends ChildrenSorterStrategy { } if (heightCache) { + // eslint-disable-next-line no-param-reassign heightCache[node.getId()] = result; } diff --git a/packages/mindplot/src/components/layout/BalancedSorter.js b/packages/mindplot/src/components/layout/BalancedSorter.js index b42944f6..61a2930e 100644 --- a/packages/mindplot/src/components/layout/BalancedSorter.js +++ b/packages/mindplot/src/components/layout/BalancedSorter.js @@ -42,14 +42,16 @@ class BalancedSorter extends AbstractBasicSorter { + node.getSize().width / 2 + BalancedSorter.INTERNODE_HORIZONTAL_PADDING); - const xPos = direction > 0 - ? position.x >= limitXPos - ? position.x - : limitXPos - : position.x <= limitXPos + let xPos; + if (direction > 0) { + xPos = position.x >= limitXPos ? position.x : limitXPos; - + } else { + xPos = position.x <= limitXPos + ? position.x + : limitXPos; + } return [0, { x: xPos, y: position.y }]; } @@ -80,17 +82,21 @@ class BalancedSorter extends AbstractBasicSorter { left = this._getChildrenForOrder(parent, graph, 1); } // Filter nodes on one side.. - const order = position - ? position.x > rootNode.getPosition().x + let order; + if (position) { + order = position.x > rootNode.getPosition().x ? 0 - : 1 - : right.length - left.length > 0 + : 1; + } else { + order = right.length - left.length > 0 ? 1 : 0; + } const direction = order % 2 === 0 ? 1 : -1; // Exclude the dragged node (if set) - const children = this._getChildrenForOrder(parent, graph, order).filter((child) => child !== node); + const children = this._getChildrenForOrder(parent, graph, order) + .filter((child) => child !== node); // No children? if (children.length === 0) { @@ -110,10 +116,10 @@ class BalancedSorter extends AbstractBasicSorter { // Try to fit within ... let result = null; const last = children[children.length - 1]; - position = position || { x: last.getPosition().x, y: last.getPosition().y + 1 }; + const newestPosition = position || { x: last.getPosition().x, y: last.getPosition().y + 1 }; children.forEach((child, index) => { const cpos = child.getPosition(); - if (position.y > cpos.y) { + if (newestPosition.y > cpos.y) { const yOffset = child === last ? child.getSize().height + BalancedSorter.INTERNODE_VERTICAL_PADDING * 2 : (children[index + 1].getPosition().y - child.getPosition().y) / 2; @@ -205,7 +211,8 @@ class BalancedSorter extends AbstractBasicSorter { order: child.getOrder(), width: child.getSize().width, height: this._computeChildrenHeight(treeSet, child), - })).reverse(); + })) + .reverse(); // Compute the center of the branch ... let totalPHeight = 0; @@ -289,7 +296,8 @@ class BalancedSorter extends AbstractBasicSorter { } _getChildrenForOrder(parent, graph, order) { - return this._getSortedChildren(graph, parent).filter((child) => child.getOrder() % 2 === order % 2); + return this._getSortedChildren(graph, parent) + .filter((child) => child.getOrder() % 2 === order % 2); } _getVerticalPadding() { diff --git a/packages/mindplot/src/components/layout/EventBusDispatcher.js b/packages/mindplot/src/components/layout/EventBusDispatcher.js index e76c1064..16af76c1 100644 --- a/packages/mindplot/src/components/layout/EventBusDispatcher.js +++ b/packages/mindplot/src/components/layout/EventBusDispatcher.js @@ -37,7 +37,9 @@ class EventBusDispatcher { EventBus.instance.addEvent(EventBus.events.NodeRemoved, this._nodeRemoved.bind(this)); EventBus.instance.addEvent(EventBus.events.NodeResizeEvent, this._nodeResizeEvent.bind(this)); EventBus.instance.addEvent(EventBus.events.NodeMoveEvent, this._nodeMoveEvent.bind(this)); - EventBus.instance.addEvent(EventBus.events.NodeDisconnectEvent, this._nodeDisconnectEvent.bind(this)); + EventBus.instance.addEvent( + EventBus.events.NodeDisconnectEvent, this._nodeDisconnectEvent.bind(this), + ); EventBus.instance.addEvent(EventBus.events.NodeConnectEvent, this._nodeConnectEvent.bind(this)); EventBus.instance.addEvent(EventBus.events.NodeShrinkEvent, this._nodeShrinkEvent.bind(this)); EventBus.instance.addEvent(EventBus.events.DoLayout, this._doLayout.bind(this)); @@ -56,7 +58,9 @@ class EventBusDispatcher { } _nodeConnectEvent(args) { - this._layoutManager.connectNode(args.parentNode.getId(), args.childNode.getId(), args.childNode.getOrder()); + this._layoutManager.connectNode( + args.parentNode.getId(), args.childNode.getId(), args.childNode.getOrder(), + ); } _nodeShrinkEvent(node) { diff --git a/packages/mindplot/src/components/layout/GridSorter.js b/packages/mindplot/src/components/layout/GridSorter.js index e3ee350f..005bd7de 100644 --- a/packages/mindplot/src/components/layout/GridSorter.js +++ b/packages/mindplot/src/components/layout/GridSorter.js @@ -40,14 +40,14 @@ class GridSorter extends AbstractBasicSorter { // Calculate the offsets ... const result = {}; for (let i = 0; i < heights.length; i++) { - const even = i % 2 == 0 ? 1 : -1; + const even = i % 2 === 0 ? 1 : -1; - const zeroHeight = i == 0 ? 0 : heights[0].height / 2 * even; + const zeroHeight = i === 0 ? 0 : ((heights[0].height / 2) * even); let middleHeight = 0; for (let j = i - 2; j > 0; j -= 2) { middleHeight += heights[j].height * even; } - const finalHeight = i == 0 ? 0 : heights[i].height / 2 * even; + const finalHeight = i === 0 ? 0 : ((heights[i].height / 2) * even); const yOffset = zeroHeight + middleHeight + finalHeight; const xOffset = node.getSize().width + GridSorter.GRID_HORIZONTAR_SIZE; diff --git a/packages/mindplot/src/components/layout/LayoutManager.js b/packages/mindplot/src/components/layout/LayoutManager.js index 8f476890..f7060b0a 100644 --- a/packages/mindplot/src/components/layout/LayoutManager.js +++ b/packages/mindplot/src/components/layout/LayoutManager.js @@ -90,7 +90,9 @@ class LayoutManager extends Events { const node = this._treeSet.find(id); // @Todo: this should not be here. This is broking the isolated node support... // node.setFree(true); - // node.setFreeDisplacement({x:position.x - node.getPosition().x, y:position.y - node.getPosition().y}); + // node.setFreeDisplacement( + // {x:position.x - node.getPosition().x, y:position.y - node.getPosition().y} + // ); node.setPosition(position); } @@ -193,14 +195,13 @@ class LayoutManager extends Events { * @throws will throw an error if containerId is null or undefined * @return canvas */ - plot(containerId, size) { + plot(containerId, size = { width: 200, height: 200 }) { // this method is only used from tests that include Raphael if (!global.Raphael) { console.warn('Raphael.js not found, exiting plot()'); return null; } $assert(containerId, 'containerId cannot be null'); - size = size || { width: 200, height: 200 }; const squaresize = 10; const canvas = global.Raphael(containerId, size.width, size.height); canvas.drawGrid( @@ -243,11 +244,9 @@ class LayoutManager extends Events { } _collectChanges(nodes) { - if (!nodes) { - nodes = this._treeSet.getTreeRoots(); - } + const nodesToCollect = nodes || this._treeSet.getTreeRoots(); - nodes.forEach(((node) => { + nodesToCollect.forEach(((node) => { if (node.hasOrderChanged() || node.hasPositionChanged()) { // Find or create a event ... const id = node.getId(); diff --git a/packages/mindplot/src/components/layout/OriginalLayout.js b/packages/mindplot/src/components/layout/OriginalLayout.js index fcc28f4e..eed88b33 100644 --- a/packages/mindplot/src/components/layout/OriginalLayout.js +++ b/packages/mindplot/src/components/layout/OriginalLayout.js @@ -101,6 +101,7 @@ class OriginalLayout { const parentHeightChanged = $defined(parent) ? parent._heightChanged : false; const heightChanged = node._branchHeight !== newBranchHeight; + // eslint-disable-next-line no-param-reassign node._heightChanged = heightChanged || parentHeightChanged; if (childrenOrderMoved || childrenSizeChanged || heightChanged || parentHeightChanged) { @@ -139,6 +140,7 @@ class OriginalLayout { me._treeSet.updateBranchPosition(child, newPos); }); + // eslint-disable-next-line no-param-reassign node._branchHeight = newBranchHeight; } @@ -212,9 +214,9 @@ class OriginalLayout { ); siblingsToShift.forEach(((sibling) => { - const overlappingOccurs = shiftedBranches - // eslint-disable-next-line max-len - .some(((shiftedBranch) => OriginalLayout._branchesOverlap(shiftedBranch, sibling, heightById))); + const overlappingOccurs = shiftedBranches.some( + ((shiftedBranch) => OriginalLayout._branchesOverlap(shiftedBranch, sibling, heightById)), + ); if (!sibling.isFree() || overlappingOccurs) { const sAmount = node.getFreeDisplacement().y; diff --git a/packages/mindplot/src/components/layout/RootedTreeSet.js b/packages/mindplot/src/components/layout/RootedTreeSet.js index e2e79a33..8d30edd1 100644 --- a/packages/mindplot/src/components/layout/RootedTreeSet.js +++ b/packages/mindplot/src/components/layout/RootedTreeSet.js @@ -37,6 +37,7 @@ class RootedTreeSet { } _decodate(node) { + // eslint-disable-next-line no-param-reassign node._children = []; return node; } @@ -112,7 +113,7 @@ class RootedTreeSet { * @throws will throw an error if node cannot be found * @return node */ - find(id, validate) { + find(id, validate = true) { $assert($defined(id), 'id can not be null'); const graphs = this._rootNodes; @@ -124,7 +125,6 @@ class RootedTreeSet { break; } } - validate = !$defined(validate) ? true : validate; $assert( validate ? result : true, `node could not be found id:${id}\n,RootedTreeSet${this.dump()}`, @@ -299,11 +299,14 @@ class RootedTreeSet { `${node.getId()}[${order}]`, ); text.attr('fill', '#FFF'); - const fillColor = this._rootNodes.includes(node) - ? '#000' - : node.isFree() + let fillColor; + if (this._rootNodes.includes(node)) { + fillColor = '#000'; + } else { + fillColor = node.isFree() ? '#abc' : '#c00'; + } rect.attr('fill', fillColor); const rectPosition = { @@ -397,10 +400,11 @@ class RootedTreeSet { /** * @param node * @param yOffset - * @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively + * @return siblings in the offset (vertical) direction, i.e. with lower or higher order */ getSiblingsInVerticalDirection(node, yOffset) { - // siblings with lower or higher order, depending on the direction of the offset and on the same side as their parent + // siblings with lower or higher order + // (depending on the direction of the offset and on the same side as their parent) const parent = this.getParent(node); const siblings = this.getSiblings(node).filter((sibling) => { const sameSide = node.getPosition().x > parent.getPosition().x @@ -429,7 +433,8 @@ class RootedTreeSet { // direct descendants of the root that do not contain the node and are on the same side // and on the direction of the offset const rootNode = this.getRootNode(node); - const branches = this.getChildren(rootNode).filter(((child) => this._find(node.getId(), child))); + const branches = this.getChildren(rootNode) + .filter(((child) => this._find(node.getId(), child))); const branch = branches[0]; const rootDescendants = this.getSiblings(branch).filter((sibling) => { diff --git a/packages/mindplot/src/components/layout/SymmetricSorter.js b/packages/mindplot/src/components/layout/SymmetricSorter.js index 3cefa27a..885ccaff 100644 --- a/packages/mindplot/src/components/layout/SymmetricSorter.js +++ b/packages/mindplot/src/components/layout/SymmetricSorter.js @@ -49,15 +49,16 @@ class SymmetricSorter extends AbstractBasicSorter { + node.getSize().width / 2 + SymmetricSorter.INTERNODE_HORIZONTAL_PADDING); - // eslint-disable-next-line no-nested-ternary - const xPos = direction > 0 - ? position.x >= limitXPos - ? position.x - : limitXPos - : position.x <= limitXPos + let xPos; + if (direction > 0) { + xPos = position.x >= limitXPos ? position.x : limitXPos; - + } else { + xPos = position.x <= limitXPos + ? position.x + : limitXPos; + } return [0, { x: xPos, y: position.y }]; } @@ -97,7 +98,9 @@ class SymmetricSorter extends AbstractBasicSorter { if (parentChildren.length === 0) { // Fit as a child of the parent node... const result = { - x: parent.getPosition().x + positionDirection * (parent.getSize().width + SymmetricSorter.INTERNODE_HORIZONTAL_PADDING), + x: parent.getPosition().x + + positionDirection + * (parent.getSize().width + SymmetricSorter.INTERNODE_HORIZONTAL_PADDING), y: parent.getPosition().y, }; diff --git a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js index 11b146a3..d2fdcf36 100644 --- a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js +++ b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js @@ -97,13 +97,13 @@ class BootstrapDialog extends Options { } onAcceptClick(event) { - throw 'Unsupported operation'; + throw new Error('Unsupported operation'); } onDialogShown() {} onRemoveClick(event) { - throw 'Unsupported operation'; + throw new Error('Unsupported operation'); } show() { diff --git a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialogRequest.js b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialogRequest.js index f9a0d81e..fcbc0537 100644 --- a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialogRequest.js +++ b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialogRequest.js @@ -16,6 +16,7 @@ * limitations under the License. */ import $ from 'jquery'; +import { $defined } from '@wisemapping/core-js'; import BootstrapDialog from './BootstrapDialog'; class BootstrapDialogRequest extends BootstrapDialog { @@ -48,9 +49,11 @@ class BootstrapDialogRequest extends BootstrapDialog { this._native.find('.modal-body').load(url, () => { me.acceptButton.unbind('click').click(() => { - submitDialogForm(); + if ($defined(global.submitDialogForm) && typeof (global.submitDialogForm) === 'function') { + global.submitDialogForm(); + } }); - me._native.on('hidden.bs.modal', () => { + me._native.on('hidden.bs.modal', function onModalHide() { $(this).remove(); }); me.show(); @@ -58,8 +61,8 @@ class BootstrapDialogRequest extends BootstrapDialog { } onDialogShown() { - if (onDialogShown instanceof Function) { - onDialogShown(); + if ($defined(global.onDialogShown) && typeof (global.onDialogShown) === 'function') { + global.onDialogShown(); } } } diff --git a/packages/mindplot/src/components/model/INodeModel.js b/packages/mindplot/src/components/model/INodeModel.js index 2cd19d8b..4a86585e 100644 --- a/packages/mindplot/src/components/model/INodeModel.js +++ b/packages/mindplot/src/components/model/INodeModel.js @@ -18,6 +18,9 @@ */ import { $assert, $defined } from '@wisemapping/core-js'; +// regex taken from https://stackoverflow.com/a/34763398/58128 +const parseJsObject = (str) => JSON.parse(str.replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/g, '"$2": ')); + class INodeModel { constructor(mindmap) { $assert(mindmap && mindmap.getBranches, 'mindmap can not be null'); @@ -31,15 +34,16 @@ class INodeModel { /** */ setId(id) { - if ($defined(id) && id > INodeModel._uuid) { - $assert(Number.isFinite(id)); - INodeModel._uuid = id; - } if (!$defined(id)) { - id = INodeModel._nextUUID(); + const newId = INodeModel._nextUUID(); + this.putProperty('id', newId); + } else { + if (id > INodeModel._uuid) { + $assert(Number.isFinite(id)); + INodeModel._uuid = id; + } + this.putProperty('id', id); } - - this.putProperty('id', id); } /** */ @@ -74,7 +78,7 @@ class INodeModel { const value = this.getProperty('position'); let result = null; if (value != null) { - result = eval(`(${value})`); + result = parseJsObject(value); } return result; } @@ -89,7 +93,7 @@ class INodeModel { const value = this.getProperty('imageSize'); let result = null; if (value != null) { - result = eval(`(${value})`); + result = parseJsObject(value); } return result; } diff --git a/packages/mindplot/src/components/model/Mindmap.js b/packages/mindplot/src/components/model/Mindmap.js index bf3760ab..0ae5ce07 100644 --- a/packages/mindplot/src/components/model/Mindmap.js +++ b/packages/mindplot/src/components/model/Mindmap.js @@ -121,8 +121,7 @@ class Mindmap extends IMindmap { * @param id * @return the node model created */ - createNode(type, id) { - type = !$defined(type) ? INodeModel.MAIN_TOPIC_TYPE : type; + createNode(type = INodeModel.MAIN_TOPIC_TYPE, id) { return new NodeModel(type, this, id); } diff --git a/packages/mindplot/src/components/model/NodeModel.js b/packages/mindplot/src/components/model/NodeModel.js index f2211703..363674bb 100644 --- a/packages/mindplot/src/components/model/NodeModel.js +++ b/packages/mindplot/src/components/model/NodeModel.js @@ -152,6 +152,7 @@ class NodeModel extends INodeModel { append(child) { $assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object'); this._children.push(child); + // eslint-disable-next-line no-param-reassign child._parent = this; } @@ -162,6 +163,7 @@ class NodeModel extends INodeModel { removeChild(child) { $assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.'); this._children = this._children.filter((c) => c !== child); + // eslint-disable-next-line no-param-reassign child._parent = null; } diff --git a/packages/mindplot/src/components/persistence/XMLSerializerFactory.js b/packages/mindplot/src/components/persistence/XMLSerializerFactory.js index c5da9018..3d85e4c7 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerFactory.js +++ b/packages/mindplot/src/components/persistence/XMLSerializerFactory.js @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { $defined } from '@wisemapping/core-js'; import ModelCodeName from './ModelCodeName'; import Beta2PelaMigrator from './Beta2PelaMigrator'; import Pela2TangoMigrator from './Pela2TangoMigrator'; @@ -33,15 +32,14 @@ const XMLSerializerFactory = {}; * @return {mindplot.persistence.XMLSerializer_Beta|mindplot.persistence.XMLSerializer_Pela| * mindplot.persistence.XMLSerializer_Tango} serializer corresponding to the mindmap's version */ -XMLSerializerFactory.getSerializerFromMindmap = function getSerializerFromMindmap(mindmap) { - return XMLSerializerFactory.getSerializer(mindmap.getVersion()); -}; +XMLSerializerFactory.getSerializerFromMindmap = (mindmap) => XMLSerializerFactory + .getSerializer(mindmap.getVersion()); /** * @param domDocument * @return serializer corresponding to the mindmap's version */ -XMLSerializerFactory.getSerializerFromDocument = function getSerializerFromDocument(domDocument) { +XMLSerializerFactory.getSerializerFromDocument = (domDocument) => { const rootElem = domDocument.documentElement; return XMLSerializerFactory.getSerializer(rootElem.getAttribute('version')); }; @@ -53,20 +51,17 @@ XMLSerializerFactory.getSerializerFromDocument = function getSerializerFromDocum * @param {String} version the version name * @return serializer */ -XMLSerializerFactory.getSerializer = function getSerializer(version) { - if (!$defined(version)) { - version = ModelCodeName.BETA; - } +XMLSerializerFactory.getSerializer = function getSerializer(version = ModelCodeName.BETA) { const codeNames = XMLSerializerFactory._codeNames; let found = false; let serializer = null; for (let i = 0; i < codeNames.length; i++) { if (!found) { - found = codeNames[i].codeName == version; + found = codeNames[i].codeName === version; if (found) serializer = new (codeNames[i].serializer)(); } else { - const { migrator } = codeNames[i]; - serializer = new migrator(serializer); + const { migrator: Migrator } = codeNames[i]; + serializer = new Migrator(serializer); } } diff --git a/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js b/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js index bd67e74e..fae94228 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js +++ b/packages/mindplot/src/components/persistence/XMLSerializer_Pela.js @@ -157,7 +157,9 @@ class XMLSerializer_Pela { const featureDom = document.createElement(featureType); const attributes = feature.getAttributes(); - for (const key in attributes) { + const attributesKeys = Object.keys(attributes); + for (let attrIndex = 0; attrIndex < attributesKeys.length; attrIndex++) { + const key = attributesKeys[attrIndex]; const value = attributes[key]; if (key === 'text') { const cdata = document.createCDATASection(this.rmXmlInv(value)); diff --git a/packages/mindplot/src/components/util/Shape.js b/packages/mindplot/src/components/util/Shape.js index 86db400f..69a28c08 100644 --- a/packages/mindplot/src/components/util/Shape.js +++ b/packages/mindplot/src/components/util/Shape.js @@ -18,7 +18,7 @@ import { Point } from '@wisemapping/web2d'; import { $assert, $defined } from '@wisemapping/core-js'; import { TopicShape } from '../model/INodeModel'; -import { CONNECTOR_WIDTH } from '../TopicConfig'; +import TopicConfig from '../TopicConfig'; const Shape = { isAtRight(sourcePoint, targetPoint) { @@ -124,7 +124,7 @@ const Shape = { } // Move a little the position... - const offset = CONNECTOR_WIDTH / 2; + const offset = TopicConfig.CONNECTOR_WIDTH / 2; if (!isAtRight) { result.x += offset; } else { diff --git a/packages/mindplot/src/components/widget/IconPanel.js b/packages/mindplot/src/components/widget/IconPanel.js index 357d0d77..99546892 100644 --- a/packages/mindplot/src/components/widget/IconPanel.js +++ b/packages/mindplot/src/components/widget/IconPanel.js @@ -31,12 +31,11 @@ class IconPanel extends ToolbarPaneItem { }); let count = 0; + let familyContent; for (let i = 0; i < ImageIcon.prototype.ICON_FAMILIES.length; i += 1) { const familyIcons = ImageIcon.prototype.ICON_FAMILIES[i].icons; for (let j = 0; j < familyIcons.length; j += 1) { - // @TODO: This is a bug, for some reason is working because is a var. This must change to let. - var familyContent; - if ((count % 12) == 0) { + if ((count % 12) === 0) { familyContent = $('
'); content.append(familyContent); } diff --git a/packages/mindplot/src/components/widget/LinkEditor.js b/packages/mindplot/src/components/widget/LinkEditor.js index 8a4c2fa7..2cf9e711 100644 --- a/packages/mindplot/src/components/widget/LinkEditor.js +++ b/packages/mindplot/src/components/widget/LinkEditor.js @@ -115,7 +115,7 @@ class LinkEditor extends BootstrapDialog { * @return {Boolean} true if the url is valid */ checkURL(url) { - const regex = /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i; + const regex = /^(http|https|ftp):\/\/[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i; return (regex.test(url)); } diff --git a/packages/mindplot/src/components/widget/Menu.js b/packages/mindplot/src/components/widget/Menu.js index 97f60c62..35764290 100644 --- a/packages/mindplot/src/components/widget/Menu.js +++ b/packages/mindplot/src/components/widget/Menu.js @@ -16,7 +16,6 @@ * limitations under the License. */ import $ from 'jquery'; -import { $defined } from '@wisemapping/core-js'; import { $msg } from '../Messages'; import BootstrapDialogRequest from '../libraries/bootstrap/BootstrapDialogRequest'; import IMenu from './IMenu'; @@ -29,11 +28,10 @@ import ToolbarItem from './ToolbarItem'; import KeyboardShortcutTooltip from './KeyboardShortcutTooltip'; class Menu extends IMenu { - constructor(designer, containerId, mapId, readOnly, baseUrl) { + constructor(designer, containerId, mapId, readOnly, baseUrl = '') { super(designer, containerId, mapId); const saveElem = $('#save'); - baseUrl = !$defined(baseUrl) ? '' : baseUrl; const widgetsBaseUrl = `${baseUrl}css/widget`; // Stop event propagation ... @@ -225,8 +223,8 @@ class Menu extends IMenu { this._addButton('print', false, false, () => { me.save(saveElem, designer, false); - const url = window.location.href.substring(0, window.location.href.lastIndexOf('c/maps/')); - window.open(`${url}c/maps/${mapId}/print`); + const urlPrefix = window.location.href.substring(0, window.location.href.lastIndexOf('c/maps/')); + window.open(`${urlPrefix}c/maps/${mapId}/print`); }); Menu._registerTooltip('print', $msg('PRINT')); @@ -398,8 +396,8 @@ class Menu extends IMenu { if (videoElem) { const width = 900; const height = 500; - const left = (screen.width / 2) - (width / 2); - const top = (screen.height / 2) - (height / 2); + const left = (window.screen.width / 2) - (width / 2); + const top = (window.screen.height / 2) - (height / 2); videoElem.bind('click', (event) => { window.open('https://www.youtube.com/tv?vq=medium#/watch?v=rKxZwNKs9cE', '_blank', `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=${width}, height=${height}, top=${top}, left=${left}`); @@ -476,11 +474,14 @@ class Menu extends IMenu { if ($(`#${buttonId}`)) { let tooltip = text; if (shortcut) { - shortcut = navigator.appVersion.indexOf('Mac') !== -1 ? shortcut.replace('meta+', '⌘') : shortcut.replace('meta+', 'ctrl+'); - tooltip = `${tooltip} (${shortcut})`; + const platformedShortcut = navigator.appVersion.indexOf('Mac') !== -1 + ? shortcut.replace('meta+', '⌘') + : shortcut.replace('meta+', 'ctrl+'); + tooltip = `${tooltip} (${platformedShortcut})`; } return new KeyboardShortcutTooltip($(`#${buttonId}`), tooltip); } + return undefined; } } diff --git a/packages/mindplot/webpack.common.js b/packages/mindplot/webpack.common.js index 05013f63..a6f6e865 100644 --- a/packages/mindplot/webpack.common.js +++ b/packages/mindplot/webpack.common.js @@ -16,7 +16,7 @@ module.exports = { module: { rules: [ { - use: ['babel-loader', 'eslint-loader'], + use: ['babel-loader'], test: /.(js$)/, exclude: [ /node_modules/, diff --git a/packages/web2d/package.json b/packages/web2d/package.json index 073bcf98..4c8240e8 100644 --- a/packages/web2d/package.json +++ b/packages/web2d/package.json @@ -37,7 +37,6 @@ "eslint-config-airbnb-base": "^14.2.1", "eslint-config-standard": "^16.0.3", "eslint-import-resolver-webpack": "^0.13.2", - "eslint-loader": "^4.0.2", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.25.3", "nodemon": "^2.0.12", diff --git a/packages/web2d/webpack.common.js b/packages/web2d/webpack.common.js index 3666324f..2eef0947 100644 --- a/packages/web2d/webpack.common.js +++ b/packages/web2d/webpack.common.js @@ -16,7 +16,7 @@ module.exports = { module: { rules: [ { - use: ['babel-loader', 'eslint-loader'], + use: ['babel-loader'], test: /.(js)$/, exclude: [ /node_modules/, diff --git a/yarn.lock b/yarn.lock index ae5c3f5c..7f5e89f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -249,7 +256,7 @@ "@babel/traverse" "^7.16.3" "@babel/types" "^7.16.0" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.0": +"@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4", "@babel/highlight@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== @@ -1007,6 +1014,21 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.2.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" @@ -1174,11 +1196,28 @@ debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.0": +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0", "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@ianvs/eslint-stats@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@ianvs/eslint-stats/-/eslint-stats-2.0.0.tgz#068a4a1508cfdfc21fd0b9931ae0921c5053ac29" + integrity sha512-DnIVVAiXR4tfWERTiQxr1Prrs/uFEbC1C4gTGORMvbF4k7ENyVQeLcoUfNyhlAj2MB/OeorCrN3wSnYuDOUS6Q== + dependencies: + chalk "^2.4.2" + lodash "^4.17.15" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2447,7 +2486,7 @@ dependencies: "@types/node" "*" -"@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1": +"@types/hoist-non-react-statics@*", "@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== @@ -2551,6 +2590,13 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== +"@types/react-dom@^17.0.0": + version "17.0.11" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.11.tgz#e1eadc3c5e86bdb5f7684e00274ae228e7bcc466" + integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q== + dependencies: + "@types/react" "*" + "@types/react-redux@^7.1.20": version "7.1.20" resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.20.tgz#42f0e61ababb621e12c66c96dda94c58423bd7df" @@ -2568,7 +2614,7 @@ dependencies: "@types/react" "*" -"@types/react@*": +"@types/react@*", "@types/react@^17.0.0": version "17.0.37" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959" integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg== @@ -2602,6 +2648,15 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/styled-components@^5.1.4": + version "5.1.18" + resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.18.tgz#1c361130f76a52f1cb4851c2a32aa328267e5b78" + integrity sha512-xPTYmWP7Mxk5TAD3pYsqjwA9G5fAI8e/S51QUJEl7EQD1siKCdiYXIWiH2lzoHRl+QqbQCJMcGv3YTF3OmyPdQ== + dependencies: + "@types/hoist-non-react-statics" "*" + "@types/react" "*" + csstype "^3.0.2" + "@types/tapable@^1": version "1.0.8" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" @@ -3023,7 +3078,7 @@ acorn@^7.1.1, 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, acorn@^8.2.4, acorn@^8.4.1: +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== @@ -3643,7 +3698,7 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^4.0.3: +bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== @@ -4013,7 +4068,16 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^1.1.3: +chalk@2.4.2, chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= @@ -4024,16 +4088,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -4195,6 +4250,11 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" +cli-spinners@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-table3@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.0.tgz#b7b1bc65ca8e7b5cef9124e13dc2b21e2ce4faee" @@ -4218,6 +4278,11 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== +cli-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== + cliui@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" @@ -5606,6 +5671,24 @@ eslint-config-standard@^16.0.3: resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== +eslint-filtered-fix@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eslint-filtered-fix/-/eslint-filtered-fix-0.2.0.tgz#f3d9e10c028ef74b878296948f9c20e836816203" + integrity sha512-XdaG7foK2Xu4EORAwtgBRv25eLv50XGbeiCDVeUui8Mp51HBd1h+HR/Od40U2rhQmFqnCK0hIPknltoCKq8xew== + dependencies: + optionator "^0.9.1" + +eslint-formatter-friendly@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/eslint-formatter-friendly/-/eslint-formatter-friendly-7.0.0.tgz#32a4998ababa0a39994aed629b831fda7dabc864" + integrity sha512-WXg2D5kMHcRxIZA3ulxdevi8/BGTXu72pfOO5vXHqcAfClfIWDSlOljROjCSOCcKvilgmHz1jDWbvFCZHjMQ5w== + dependencies: + "@babel/code-frame" "7.0.0" + chalk "2.4.2" + extend "3.0.2" + strip-ansi "5.2.0" + text-table "0.2.0" + eslint-import-resolver-node@^0.3.6: version "0.3.6" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" @@ -5631,17 +5714,6 @@ eslint-import-resolver-webpack@^0.13.2: resolve "^1.20.0" semver "^5.7.1" -eslint-loader@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-4.0.2.tgz#386a1e21bcb613b3cf2d252a3b708023ccfb41ec" - integrity sha512-EDpXor6lsjtTzZpLUn7KmXs02+nIjGcgees9BYjNkWra3jVq5vVa8IoCKgzT2M7dNNeoMBtaSG83Bd40N3poLw== - dependencies: - find-cache-dir "^3.3.1" - fs-extra "^8.1.0" - loader-utils "^2.0.0" - object-hash "^2.0.3" - schema-utils "^2.6.5" - eslint-module-utils@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz#b435001c9f8dd4ab7f6d0efcae4b9696d4c24b7c" @@ -5651,6 +5723,19 @@ eslint-module-utils@^2.7.1: find-up "^2.1.0" pkg-dir "^2.0.0" +eslint-nibble@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/eslint-nibble/-/eslint-nibble-8.0.0.tgz#667e1f9b64492c90058c1f9b2236a97682d83924" + integrity sha512-Og/0EGKxwEtNPNN4eo84GxgzpD4a4+LcvBd72j0OL55aTHtfR7vdnp3qJ9RQ0Qh4mXLUlC0O13sQZxLtx9ZDvA== + dependencies: + "@ianvs/eslint-stats" "^2.0.0" + chalk "^4.1.1" + eslint-filtered-fix "^0.2.0" + eslint-formatter-friendly "^7.0.0" + eslint-summary "^1.0.0" + inquirer "8.1.1" + optionator "^0.9.1" + eslint-plugin-cypress@^2.12.1: version "2.12.1" resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632" @@ -5677,11 +5762,6 @@ eslint-plugin-import@^2.24.2, eslint-plugin-import@^2.25.3: resolve "^1.20.0" tsconfig-paths "^3.11.0" -eslint-plugin-only-warn@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.0.3.tgz#a75f3a9ded7f03e9808e75ec27f22b644084506e" - integrity sha512-XQOX/TfLoLw6h8ky51d29uUjXRTQHqBGXPylDEmy5fe/w7LIOnp8MA24b1OSMEn9BQoKow1q3g1kLe5/9uBTvw== - eslint-plugin-react-hooks@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172" @@ -5723,6 +5803,22 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-summary@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-summary/-/eslint-summary-1.0.0.tgz#b811f00437016b20c0f6f5234479bd6395b57886" + integrity sha1-uBHwBDcBayDA9vUjRHm9Y5W1eIY= + dependencies: + chalk "^1.0.0" + text-table "^0.2.0" + eslint-utils@^1.3.1: version "1.4.3" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" @@ -5754,6 +5850,11 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== +eslint-visitor-keys@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" + integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== + eslint@^5.16.0: version "5.16.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" @@ -5842,6 +5943,50 @@ eslint@^7.14.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" +eslint@^8.4.1: + version "8.4.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.1.tgz#d6531bbf3e598dffd7c0c7d35ec52a0b30fdfa2d" + integrity sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg== + dependencies: + "@eslint/eslintrc" "^1.0.5" + "@humanwhocodes/config-array" "^0.9.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.2.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.2.0" + semver "^7.2.1" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + espree@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" @@ -5860,6 +6005,15 @@ espree@^7.3.0, espree@^7.3.1: acorn-jsx "^5.3.1" eslint-visitor-keys "^1.3.0" +espree@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" + integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== + dependencies: + acorn "^8.6.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.1.0" + esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -6093,7 +6247,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.2: +extend@3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -6225,7 +6379,7 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -figures@^3.2.0: +figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -7450,6 +7604,26 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" +inquirer@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.1.1.tgz#7c53d94c6d03011c7bb2a947f0dca3b98246c26a" + integrity sha512-hUDjc3vBkh/uk1gPfMAD/7Z188Q8cvTGl0nxwaCdwSbzFh6ZKkZh+s2ozVxbE5G9ZNRyeY0+lgbAIOUFsFf98w== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^5.3.0" + run-async "^2.4.0" + rxjs "^6.6.6" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + inquirer@^6.2.0, inquirer@^6.2.2: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" @@ -7751,6 +7925,11 @@ is-installed-globally@^0.4.0, is-installed-globally@~0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" @@ -8496,7 +8675,7 @@ js-sha3@0.8.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@4.1.0: +js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -9083,7 +9262,7 @@ lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@4.1.0, log-symbols@^4.0.0: +log-symbols@4.1.0, log-symbols@^4.0.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -9661,7 +9840,7 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -mute-stream@~0.0.4: +mute-stream@0.0.8, mute-stream@~0.0.4: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== @@ -10008,11 +10187,6 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-hash@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" - integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== - object-inspect@^1.11.0, object-inspect@^1.9.0: version "1.11.1" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.1.tgz#d4bd7d7de54b9a75599f59a00bd698c1f1c6549b" @@ -10188,6 +10362,21 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +ora@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + original@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" @@ -11068,7 +11257,7 @@ react-async-script@^1.1.1: hoist-non-react-statics "^3.3.0" prop-types "^15.5.0" -react-dom@^17.0.0: +react-dom@^17.0.0, react-dom@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== @@ -11178,7 +11367,7 @@ react-transition-group@^4.4.0: loose-envify "^1.4.0" prop-types "^15.6.2" -react@^17.0.0: +react@^17.0.0, react@^17.0.1: 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== @@ -11413,7 +11602,7 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -regexpp@^3.1.0: +regexpp@^3.1.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -11691,7 +11880,7 @@ rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: dependencies: glob "^7.1.3" -run-async@^2.2.0: +run-async@^2.2.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== @@ -11710,7 +11899,7 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.4.0: +rxjs@^6.4.0, rxjs@^6.6.6: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -12489,6 +12678,13 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" +strip-ansi@5.2.0, strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -12503,13 +12699,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -12590,7 +12779,7 @@ style-loader@^2.0.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -styled-components@^5.1.7: +styled-components@^5.1.7, styled-components@^5.2.1: version "5.3.3" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.3.tgz#312a3d9a549f4708f0fb0edc829eb34bde032743" integrity sha512-++4iHwBM7ZN+x6DtPPWkCI4vdtwumQ+inA/DdAsqYd4SVgUKJie5vXyzotA00ttcFdQkCng7zc6grwlfIfw+lw== @@ -12789,7 +12978,7 @@ text-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== -text-table@^0.2.0: +text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= @@ -13464,7 +13653,7 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.0: +wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=