Skip to content

Commit bdc50a9

Browse files
committed
Refactored everything...
1 parent 4316d4f commit bdc50a9

File tree

155 files changed

+3542
-3093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+3542
-3093
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"name": "mxgraph",
3-
"description": "mxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.",
4-
"version": "4.2.2",
5-
"homepage": "https://github.com/jgraph/mxgraph",
2+
"name": "maxgraph",
3+
"description": "max-graph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/maxGraph/maxGraph",
66
"author": {
7-
"name": "JGraph Ltd",
8-
"email": "[email protected]"
7+
"name": "",
8+
"email": ""
99
},
10-
"license": "Apache-2.0",
10+
"license": "MIT",
1111
"repository": {
1212
"type": "git",
13-
"url": "git+https://github.com/jgraph/mxgraph.git"
13+
"url": "git+https://github.com/maxGraph/maxGraph"
1414
},
1515
"bugs": {
16-
"url": "https://github.com/jgraph/mxgraph/issues"
16+
"url": "https://github.com/maxGraph/maxGraph/issues"
1717
},
1818
"main": "./javascript/dist/build.js",
1919
"scripts": {
@@ -23,21 +23,21 @@
2323
},
2424
"devDependencies": {
2525
"@babel/core": "^7.13.15",
26+
"@babel/plugin-proposal-class-properties": "^7.13.0",
2627
"@babel/preset-env": "^7.13.15",
2728
"@babel/preset-react": "^7.13.13",
2829
"@babel/preset-typescript": "^7.13.0",
29-
"@babel/plugin-proposal-class-properties": "^7.13.0",
30+
"@lerna/filter-options": "4.0.0",
3031
"babel-loader": "^8.2.2",
3132
"css-loader": "^5.2.1",
33+
"file-loader": "^6.2.0",
3234
"lerna": "^4.0.0",
33-
"@lerna/filter-options": "4.0.0",
3435
"prettier": "^2.2.1",
3536
"style-loader": "^2.0.0",
37+
"typescript": "^4.2.4",
3638
"url-loader": "^4.1.1",
37-
"file-loader": "^6.2.0",
3839
"webpack": "^5.32.0",
3940
"webpack-cli": "^4.6.0",
40-
"webpack-merge": "^5.7.3",
41-
"typescript": "^4.2.4"
41+
"webpack-merge": "^5.7.3"
4242
}
4343
}

packages/core/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"name": "@mxgraph/core",
2+
"name": "@maxgraph/core",
33
"version": "1.0.0",
44
"description": "",
5-
"module": "src/index.ts",
6-
"main": "dist/mxgraph.js",
7-
"types": "dist/mxgraph.d.ts",
5+
"module": "./src/index.ts",
6+
"main": "./dist/maxgraph.js",
7+
"types": "./dist/maxgraph.d.ts",
8+
"files": [
9+
"./dist"
10+
],
811
"scripts": {
912
"dev": "webpack --watch --mode=development",
1013
"build": "NODE_ENV=production webpack --mode=production",

packages/core/src/editor/mxDefaultToolbar.js

+5-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import mxClient from '../mxClient';
99
import mxToolbar from '../util/gui/mxToolbar';
1010
import Geometry from '../view/geometry/Geometry';
11-
import utils, { convertPoint } from '../util/Utils';
11+
import { convertPoint } from '../util/Utils';
1212
import InternalEvent from '../view/event/InternalEvent';
1313
import { getClientX, getClientY } from '../util/EventUtils';
1414
import { makeDraggable } from '../util/GestureUtils';
@@ -265,14 +265,7 @@ class mxDefaultToolbar {
265265
InternalEvent.consume(evt);
266266
};
267267

268-
const img = this.toolbar.addMode(
269-
title,
270-
icon,
271-
clickHandler,
272-
pressed,
273-
null,
274-
toggle
275-
);
268+
const img = this.toolbar.addMode(title, icon, clickHandler, pressed, null, toggle);
276269

277270
// Creates a wrapper function that calls the click handler without
278271
// the graph argument
@@ -307,10 +300,7 @@ class mxDefaultToolbar {
307300
!this.connectOnDrop ||
308301
!target.isConnectable()
309302
) {
310-
while (
311-
target != null &&
312-
!graph.isValidDropTarget(target, [vertex], evt)
313-
) {
303+
while (target != null && !graph.isValidDropTarget(target, [vertex], evt)) {
314304
target = target.getParent();
315305
}
316306
this.insert(vertex, evt, target);
@@ -337,10 +327,7 @@ class mxDefaultToolbar {
337327
const pt = convertPoint(graph.container, x, y);
338328

339329
// Splits the target edge or inserts into target group
340-
if (
341-
graph.isSplitEnabled() &&
342-
graph.isSplitTarget(target, [vertex], evt)
343-
) {
330+
if (graph.isSplitEnabled() && graph.isSplitTarget(target, [vertex], evt)) {
344331
return graph.splitEdge(target, [vertex], null, pt.x, pt.y);
345332
}
346333
return this.editor.addVertex(target, vertex, pt.x, pt.y);
@@ -428,7 +415,7 @@ class mxDefaultToolbar {
428415
sprite.setAttribute('src', img.getAttribute('src'));
429416

430417
// Handles delayed loading of the images
431-
const loader = evt => {
418+
const loader = (evt) => {
432419
// Preview uses the image node with double size. Later this can be
433420
// changed to use a separate preview and guides, but for this the
434421
// dropHandler must use the additional x- and y-arguments and the

0 commit comments

Comments
 (0)