- Clean webpack and babel configuration

- Babel configure to jsmodule
This commit is contained in:
Paulo Gustavo Veiga 2021-12-05 15:09:07 -08:00
parent 69054fcd9c
commit cd2236eca1
11 changed files with 26 additions and 51 deletions

View File

@ -6,10 +6,7 @@
"corejs": "3.15",
"useBuiltIns": "usage",
"targets": {
"browsers": [
"last 5 versions",
"ie >= 8"
]
"esmodules": true
}
}
]

View File

@ -6,10 +6,7 @@
"corejs": "3.15",
"useBuiltIns": "usage",
"targets": {
"browsers": [
"last 5 versions",
"ie >= 8"
]
"esmodules": true
}
}
]

View File

@ -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"]

View File

@ -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();

View File

@ -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);
});
},
@ -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) => {

View File

@ -35,7 +35,7 @@ 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 = $('<div></div>');
content.append(familyContent);
@ -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;
}

View File

@ -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);

View File

@ -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'],
},

View File

@ -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,
],
},

View File

@ -6,10 +6,7 @@
"corejs": "3.15",
"useBuiltIns": "usage",
"targets": {
"browsers": [
"last 5 versions",
"ie >= 8"
]
"esmodules": true
}
}
]

View File

@ -2,9 +2,6 @@
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"paths": {
"@libraries/*": ["../../libraries/*"]
}
},
"exclude": ["node_modules"]
}