diff --git a/packages/core-js/babel.config.json b/packages/core-js/babel.config.json index 3d669db0..50b773af 100644 --- a/packages/core-js/babel.config.json +++ b/packages/core-js/babel.config.json @@ -6,13 +6,10 @@ "corejs": "3.15", "useBuiltIns": "usage", "targets": { - "browsers": [ - "last 5 versions", - "ie >= 8" - ] + "esmodules": true } } ] ], "sourceType": "unambiguous" -} +} \ No newline at end of file diff --git a/packages/mindplot/babel.config.json b/packages/mindplot/babel.config.json index 3d669db0..e79d68f4 100644 --- a/packages/mindplot/babel.config.json +++ b/packages/mindplot/babel.config.json @@ -6,10 +6,7 @@ "corejs": "3.15", "useBuiltIns": "usage", "targets": { - "browsers": [ - "last 5 versions", - "ie >= 8" - ] + "esmodules": true } } ] diff --git a/packages/mindplot/jsconfig.json b/packages/mindplot/jsconfig.json index a68c753c..8c0692b5 100644 --- a/packages/mindplot/jsconfig.json +++ b/packages/mindplot/jsconfig.json @@ -4,14 +4,7 @@ "module": "commonjs", "paths": { "@libraries/*": ["../../libraries/*"], - "@commands/*": ["./src/components/commands/*"], - "@layout/*": ["./src/components/layout/*"], - "@libs/*": ["./src/components/libraries/*"], - "@model/*": ["./src/components/model/*"], - "@persistence/*": ["./src/components/persistence/*"], - "@util/*": ["./src/components/util/*"], - "@widget/*": ["./src/components/widget/*"], - "@components/*": ["./src/components/*"] + "@wisemapping/web2d": ["../web2d/*"] } }, "exclude": ["node_modules"] diff --git a/packages/mindplot/src/components/CentralTopic.js b/packages/mindplot/src/components/CentralTopic.js index 9916bdb5..962b0b96 100644 --- a/packages/mindplot/src/components/CentralTopic.js +++ b/packages/mindplot/src/components/CentralTopic.js @@ -20,10 +20,6 @@ import Topic from './Topic'; import Shape from './util/Shape'; class CentralTopic extends Topic { - constructor(model, options) { - super(model, options); - } - _registerEvents() { super._registerEvents(); diff --git a/packages/mindplot/src/components/layout/RootedTreeSet.js b/packages/mindplot/src/components/layout/RootedTreeSet.js index 2bf119cb..7b29d893 100644 --- a/packages/mindplot/src/components/layout/RootedTreeSet.js +++ b/packages/mindplot/src/components/layout/RootedTreeSet.js @@ -135,7 +135,7 @@ const RootedTreeSet = new Class( }, _find(id, parent) { - if (parent.getId() == id) { + if (parent.getId() === id) { return parent; } @@ -203,7 +203,7 @@ const RootedTreeSet = new Class( if (!$defined(node._parent)) { return []; } - const siblings = node._parent._children.filter((child) => child != node); + const siblings = node._parent._children.filter((child) => child !== node); return siblings; }, @@ -220,18 +220,18 @@ const RootedTreeSet = new Class( _hasSinglePathToSingleLeaf(node) { const children = this.getChildren(node); - if (children.length == 1) { + if (children.length === 1) { return this._hasSinglePathToSingleLeaf(children[0]); } - return children.length == 0; + return children.length === 0; }, /** * @param node * @return {Boolean} whether the node is the start of a subbranch */ isStartOfSubBranch(node) { - return this.getSiblings(node).length > 0 && this.getChildren(node).length == 1; + return this.getSiblings(node).length > 0 && this.getChildren(node).length === 1; }, /** @@ -241,7 +241,7 @@ const RootedTreeSet = new Class( */ isLeaf(node) { $assert(node, 'node cannot be null'); - return this.getChildren(node).length == 0; + return this.getChildren(node).length === 0; }, /** @@ -375,7 +375,7 @@ const RootedTreeSet = new Class( const children = this.getChildren(node); const me = this; - children.forEach( (child) => { + children.forEach((child) => { me.shiftBranchPosition(child, xOffset, yOffset); }); }, @@ -397,10 +397,10 @@ const RootedTreeSet = new Class( }, /** - * @param node - * @param yOffset - * @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively - */ + * @param node + * @param yOffset + * @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively + */ getSiblingsInVerticalDirection(node, yOffset) { // 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); @@ -431,9 +431,9 @@ const RootedTreeSet = new Class( // 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(function (child) { + const branches = this.getChildren(rootNode).filter(((child) => { return this._find(node.getId(), child); - }, this); + }).bind(this)); const branch = branches[0]; const rootDescendants = this.getSiblings(branch).filter((sibling) => { diff --git a/packages/mindplot/src/components/widget/IconPanel.js b/packages/mindplot/src/components/widget/IconPanel.js index 19e94aa5..13b7fae3 100644 --- a/packages/mindplot/src/components/widget/IconPanel.js +++ b/packages/mindplot/src/components/widget/IconPanel.js @@ -35,12 +35,12 @@ class IconPanel extends ToolbarPaneItem { const familyIcons = ImageIcon.prototype.ICON_FAMILIES[i].icons; for (let j = 0; j < familyIcons.length; j += 1) { // Separate icons by line ... - var familyContent; + let familyContent; if ((count % 12) == 0) { familyContent = $('
'); content.append(familyContent); } - + const iconId = familyIcons[j]; const img = $('') .attr('id', iconId) @@ -51,10 +51,10 @@ class IconPanel extends ToolbarPaneItem { const panel = this; const model = this.getModel(); - img.on('click', function (event) { + img.on('click', ((event) => { model.setValue($(this).attr('id')); panel.hide(); - }); + }).bind(this)); count += 1; } diff --git a/packages/mindplot/src/components/widget/NoteEditor.js b/packages/mindplot/src/components/widget/NoteEditor.js index 570f8573..e0ffcd9c 100644 --- a/packages/mindplot/src/components/widget/NoteEditor.js +++ b/packages/mindplot/src/components/widget/NoteEditor.js @@ -15,20 +15,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import jQuery from 'jquery'; import BootstrapDialog from '../libraries/bootstrap/BootstrapDialog'; -class NoteEditor extends BootstrapDialog{ +class NoteEditor extends BootstrapDialog { constructor(model) { $assert(model, 'model can not be null'); - this._model = model; super($msg('Note'), { cancelButton: true, closeButton: true, acceptButton: true, removeButton: typeof model.getValue() !== 'undefined', - onEventData: { model: this._model } + onEventData: { model: model }, }); + this._model = model; this.css({ margin: '150px auto' }); const panel = this._buildPanel(model); this.setContent(panel); diff --git a/packages/mindplot/webpack.common.js b/packages/mindplot/webpack.common.js index 61430011..eaa28ed1 100644 --- a/packages/mindplot/webpack.common.js +++ b/packages/mindplot/webpack.common.js @@ -19,7 +19,6 @@ module.exports = { exclude: [ /node_modules/, path.resolve(__dirname, '../../libraries/mootools-core-1.4.5'), - path.resolve(__dirname, '../../libraries/underscore-min'), ], }, ], @@ -28,6 +27,7 @@ module.exports = { resolve: { alias: { '@libraries': path.resolve(__dirname, '../../libraries/'), + '@wisemapping/web2d': path.resolve(__dirname, '../web2d/'), }, extensions: ['.js', '.json'], }, diff --git a/packages/mindplot/webpack.playground.js b/packages/mindplot/webpack.playground.js index 56c5f4d2..09b6c8e0 100644 --- a/packages/mindplot/webpack.playground.js +++ b/packages/mindplot/webpack.playground.js @@ -35,7 +35,6 @@ module.exports = { exclude: [ /node_modules/, path.resolve(__dirname, '../../libraries/mootools-core-1.4.5'), - path.resolve(__dirname, '../../libraries/underscore-min'), /lib\/raphael/ig, ], }, diff --git a/packages/web2d/babel.config.json b/packages/web2d/babel.config.json index 61d50e9e..8dfc163a 100644 --- a/packages/web2d/babel.config.json +++ b/packages/web2d/babel.config.json @@ -6,10 +6,7 @@ "corejs": "3.15", "useBuiltIns": "usage", "targets": { - "browsers": [ - "last 5 versions", - "ie >= 8" - ] + "esmodules": true } } ] diff --git a/packages/web2d/jsconfig.json b/packages/web2d/jsconfig.json index d7ce2a30..13231242 100644 --- a/packages/web2d/jsconfig.json +++ b/packages/web2d/jsconfig.json @@ -2,9 +2,6 @@ "compilerOptions": { "baseUrl": ".", "module": "commonjs", - "paths": { - "@libraries/*": ["../../libraries/*"] - } }, "exclude": ["node_modules"] }