@joint/core 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/geometry.js +1 -1
- package/dist/geometry.min.js +1 -1
- package/dist/joint.d.ts +6 -4
- package/dist/joint.js +106 -73
- package/dist/joint.min.js +2 -2
- package/dist/joint.nowrap.js +106 -73
- package/dist/joint.nowrap.min.js +2 -2
- package/dist/vectorizer.js +1 -1
- package/dist/vectorizer.min.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +6 -14
- package/src/cellTools/Button.mjs +3 -1
- package/src/cellTools/Control.mjs +1 -1
- package/src/connectionPoints/index.mjs +1 -1
- package/src/connectors/curve.mjs +2 -4
- package/src/dia/Cell.mjs +5 -6
- package/src/dia/Graph.mjs +19 -3
- package/src/dia/GraphLayerCollection.mjs +2 -3
- package/src/dia/HighlighterView.mjs +5 -5
- package/src/dia/LayerView.mjs +1 -1
- package/src/dia/LinkView.mjs +1 -1
- package/src/dia/Paper.mjs +21 -13
- package/src/dia/attributes/eval.mjs +1 -1
- package/src/dia/ports.mjs +2 -2
- package/src/elementTools/HoverConnect.mjs +4 -3
- package/src/layout/ports/port.mjs +1 -1
- package/src/linkTools/RotateLabel.mjs +2 -1
- package/src/linkTools/Segments.mjs +1 -1
- package/src/mvc/Dom/Dom.mjs +2 -2
- package/src/mvc/Dom/animations.mjs +2 -6
- package/src/mvc/Dom/methods.mjs +3 -3
- package/src/mvc/Dom/props.mjs +1 -1
- package/src/mvc/Listener.mjs +1 -0
- package/src/routers/rightAngle.mjs +9 -9
- package/src/util/calc.mjs +1 -1
- package/src/util/util.mjs +2 -4
- package/src/util/utilHelpers.mjs +5 -5
- package/types/joint.d.ts +7 -5
- package/types/vectorizer.d.ts +1 -1
package/dist/joint.nowrap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! JointJS v4.2.
|
|
1
|
+
/*! JointJS v4.2.3 (2026-01-21) - JavaScript diagramming library
|
|
2
2
|
|
|
3
3
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
4
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
@@ -7205,7 +7205,7 @@ var joint = (function (exports) {
|
|
|
7205
7205
|
};
|
|
7206
7206
|
const initCloneArray = array => {
|
|
7207
7207
|
const length = array.length;
|
|
7208
|
-
|
|
7208
|
+
const result = new array.constructor(length);
|
|
7209
7209
|
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
|
7210
7210
|
result.index = array.index;
|
|
7211
7211
|
result.input = array.input;
|
|
@@ -7383,13 +7383,13 @@ var joint = (function (exports) {
|
|
|
7383
7383
|
return baseIsEqualDeep(value, other, baseIsEqual, stack);
|
|
7384
7384
|
};
|
|
7385
7385
|
const baseIsEqualDeep = (object, other, equalFunc, stack) => {
|
|
7386
|
-
|
|
7386
|
+
const objIsArr = Array.isArray(object);
|
|
7387
7387
|
const othIsArr = Array.isArray(other);
|
|
7388
7388
|
let objTag = objIsArr ? arrayTag : getTag(object);
|
|
7389
7389
|
let othTag = othIsArr ? arrayTag : getTag(other);
|
|
7390
7390
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
7391
7391
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
7392
|
-
|
|
7392
|
+
const objIsObj = objTag == objectTag;
|
|
7393
7393
|
const othIsObj = othTag == objectTag;
|
|
7394
7394
|
const isSameTag = objTag == othTag;
|
|
7395
7395
|
if (isSameTag && !objIsObj) {
|
|
@@ -7524,7 +7524,7 @@ var joint = (function (exports) {
|
|
|
7524
7524
|
};
|
|
7525
7525
|
const mapToArray = map => {
|
|
7526
7526
|
let index = -1;
|
|
7527
|
-
|
|
7527
|
+
const result = Array(map.size);
|
|
7528
7528
|
map.forEach((value, key) => {
|
|
7529
7529
|
result[++index] = [key, value];
|
|
7530
7530
|
});
|
|
@@ -7634,7 +7634,7 @@ var joint = (function (exports) {
|
|
|
7634
7634
|
isCommon = false;
|
|
7635
7635
|
values = new SetCache(values);
|
|
7636
7636
|
}
|
|
7637
|
-
outer: for (
|
|
7637
|
+
outer: for (const key in array) {
|
|
7638
7638
|
let value = array[key];
|
|
7639
7639
|
const computed = value;
|
|
7640
7640
|
value = value !== 0 ? value : 0;
|
|
@@ -9048,7 +9048,7 @@ var joint = (function (exports) {
|
|
|
9048
9048
|
// User data storage
|
|
9049
9049
|
$.data = dataUser;
|
|
9050
9050
|
$.merge = function (first, second) {
|
|
9051
|
-
|
|
9051
|
+
const len = +second.length;
|
|
9052
9052
|
let i = first.length;
|
|
9053
9053
|
for (let j = 0; j < len; j++) {
|
|
9054
9054
|
first[i++] = second[j];
|
|
@@ -9216,7 +9216,7 @@ var joint = (function (exports) {
|
|
|
9216
9216
|
data = data || selector;
|
|
9217
9217
|
selector = undefined;
|
|
9218
9218
|
}
|
|
9219
|
-
for (
|
|
9219
|
+
for (const type in types) {
|
|
9220
9220
|
$.event.on(elem, type, selector, data, types[type], one);
|
|
9221
9221
|
}
|
|
9222
9222
|
return elem;
|
|
@@ -12065,7 +12065,7 @@ var joint = (function (exports) {
|
|
|
12065
12065
|
} else {
|
|
12066
12066
|
styles = name;
|
|
12067
12067
|
}
|
|
12068
|
-
for (
|
|
12068
|
+
for (const style in styles) {
|
|
12069
12069
|
if (styles.hasOwnProperty(style)) {
|
|
12070
12070
|
for (let i = 0; i < this.length; i++) {
|
|
12071
12071
|
setCSSProperty(this[i], style, styles[style]);
|
|
@@ -12171,7 +12171,7 @@ var joint = (function (exports) {
|
|
|
12171
12171
|
}
|
|
12172
12172
|
if (typeof types === 'object') {
|
|
12173
12173
|
// ( types-object [, selector] )
|
|
12174
|
-
for (
|
|
12174
|
+
for (const type in types) {
|
|
12175
12175
|
this.off(type, selector, types[type]);
|
|
12176
12176
|
}
|
|
12177
12177
|
return this;
|
|
@@ -12215,7 +12215,7 @@ var joint = (function (exports) {
|
|
|
12215
12215
|
function position() {
|
|
12216
12216
|
const [el] = this;
|
|
12217
12217
|
if (!el) return;
|
|
12218
|
-
|
|
12218
|
+
const $el = $(el);
|
|
12219
12219
|
let offsetParent;
|
|
12220
12220
|
let offset;
|
|
12221
12221
|
let doc;
|
|
@@ -12334,8 +12334,10 @@ var joint = (function (exports) {
|
|
|
12334
12334
|
function animateNode(el, properties, opt = {}) {
|
|
12335
12335
|
let {
|
|
12336
12336
|
duration = 400,
|
|
12337
|
+
delay = 0
|
|
12338
|
+
} = opt;
|
|
12339
|
+
const {
|
|
12337
12340
|
easing = 'ease-in-out',
|
|
12338
|
-
delay = 0,
|
|
12339
12341
|
complete
|
|
12340
12342
|
} = opt;
|
|
12341
12343
|
const delayId = setTimeout(function () {
|
|
@@ -12471,7 +12473,7 @@ var joint = (function (exports) {
|
|
|
12471
12473
|
} else {
|
|
12472
12474
|
attributes = name;
|
|
12473
12475
|
}
|
|
12474
|
-
for (
|
|
12476
|
+
for (const attr in attributes) {
|
|
12475
12477
|
if (attributes.hasOwnProperty(attr)) {
|
|
12476
12478
|
const value = attributes[attr];
|
|
12477
12479
|
if (propertiesMap[attr]) {
|
|
@@ -12625,11 +12627,10 @@ var joint = (function (exports) {
|
|
|
12625
12627
|
// TagName
|
|
12626
12628
|
if (!nodeDef.hasOwnProperty('tagName')) throw new Error('json-dom-parser: missing tagName');
|
|
12627
12629
|
const tagName = nodeDef.tagName;
|
|
12628
|
-
let node;
|
|
12629
12630
|
|
|
12630
12631
|
// Namespace URI
|
|
12631
12632
|
const ns = nodeDef.hasOwnProperty('namespaceURI') ? nodeDef.namespaceURI : parentNS;
|
|
12632
|
-
node = document.createElementNS(ns, tagName);
|
|
12633
|
+
const node = document.createElementNS(ns, tagName);
|
|
12633
12634
|
const svg = ns === svgNamespace;
|
|
12634
12635
|
const wrapperNode = svg ? V(node) : $(node);
|
|
12635
12636
|
// Attributes
|
|
@@ -12810,7 +12811,7 @@ var joint = (function (exports) {
|
|
|
12810
12811
|
// If the event is a touch event, normalize it to a mouse event.
|
|
12811
12812
|
const touch = originalEvent && originalEvent.changedTouches && originalEvent.changedTouches[0];
|
|
12812
12813
|
if (touch) {
|
|
12813
|
-
for (
|
|
12814
|
+
for (const property in touch) {
|
|
12814
12815
|
// copy all the properties from the first touch that are not
|
|
12815
12816
|
// defined on TouchEvent (clientX, clientY, pageX, pageY, screenX, screenY, identifier, ...)
|
|
12816
12817
|
if (evt[property] === undefined) {
|
|
@@ -14977,7 +14978,7 @@ var joint = (function (exports) {
|
|
|
14977
14978
|
let value = expression;
|
|
14978
14979
|
let startSearchIndex = 0;
|
|
14979
14980
|
do {
|
|
14980
|
-
|
|
14981
|
+
const calcIndex = value.indexOf(calcStart, startSearchIndex);
|
|
14981
14982
|
if (calcIndex === -1) return value;
|
|
14982
14983
|
let calcEndIndex = calcIndex + calcStartOffset;
|
|
14983
14984
|
let brackets = 1;
|
|
@@ -15640,7 +15641,7 @@ var joint = (function (exports) {
|
|
|
15640
15641
|
return finalAttributes;
|
|
15641
15642
|
}
|
|
15642
15643
|
let defaultAttributes = {};
|
|
15643
|
-
|
|
15644
|
+
const attributes = cloneDeep(this.attributes);
|
|
15644
15645
|
if (ignoreDefaults === true) {
|
|
15645
15646
|
// Compare all attributes with the defaults
|
|
15646
15647
|
defaultAttributes = defaults;
|
|
@@ -16195,8 +16196,7 @@ var joint = (function (exports) {
|
|
|
16195
16196
|
const {
|
|
16196
16197
|
_scheduledTransitionIds
|
|
16197
16198
|
} = this;
|
|
16198
|
-
|
|
16199
|
-
var initiator = callback => {
|
|
16199
|
+
const initiator = callback => {
|
|
16200
16200
|
if (_scheduledTransitionIds[transitionKey]) {
|
|
16201
16201
|
_scheduledTransitionIds[transitionKey] = without(_scheduledTransitionIds[transitionKey], initialId);
|
|
16202
16202
|
if (_scheduledTransitionIds[transitionKey].length === 0) {
|
|
@@ -16208,7 +16208,7 @@ var joint = (function (exports) {
|
|
|
16208
16208
|
this._transitionIds[transitionKey] = nextFrame(callback);
|
|
16209
16209
|
this.trigger('transition:start', this, transitionKey);
|
|
16210
16210
|
};
|
|
16211
|
-
initialId = setTimeout(initiator, opt.delay, setter);
|
|
16211
|
+
const initialId = setTimeout(initiator, opt.delay, setter);
|
|
16212
16212
|
_scheduledTransitionIds[transitionKey] || (_scheduledTransitionIds[transitionKey] = []);
|
|
16213
16213
|
_scheduledTransitionIds[transitionKey].push(initialId);
|
|
16214
16214
|
return initialId;
|
|
@@ -16383,11 +16383,11 @@ var joint = (function (exports) {
|
|
|
16383
16383
|
}, protoProps);
|
|
16384
16384
|
var Cell = this.extend(protoProps, staticProps);
|
|
16385
16385
|
// es5 backward compatibility
|
|
16386
|
-
|
|
16386
|
+
// eslint-disable-next-line no-undef
|
|
16387
16387
|
if (typeof joint !== 'undefined' && has(joint, 'shapes')) {
|
|
16388
|
+
// eslint-disable-next-line no-undef
|
|
16388
16389
|
setByPath(joint.shapes, type, Cell, '.');
|
|
16389
16390
|
}
|
|
16390
|
-
/* eslint-enable no-undef */
|
|
16391
16391
|
return Cell;
|
|
16392
16392
|
}
|
|
16393
16393
|
});
|
|
@@ -16736,7 +16736,7 @@ var joint = (function (exports) {
|
|
|
16736
16736
|
});
|
|
16737
16737
|
}
|
|
16738
16738
|
function argTransform(bbox, args) {
|
|
16739
|
-
|
|
16739
|
+
const {
|
|
16740
16740
|
x,
|
|
16741
16741
|
y,
|
|
16742
16742
|
angle
|
|
@@ -17200,7 +17200,7 @@ var joint = (function (exports) {
|
|
|
17200
17200
|
} else {
|
|
17201
17201
|
groupPortTransformations = this._getGroupPortTransformations(group, portsArgs, elBBox);
|
|
17202
17202
|
}
|
|
17203
|
-
|
|
17203
|
+
const accumulator = {
|
|
17204
17204
|
ports: ports,
|
|
17205
17205
|
result: {}
|
|
17206
17206
|
};
|
|
@@ -17358,7 +17358,10 @@ var joint = (function (exports) {
|
|
|
17358
17358
|
evaluated.position = this._evaluatePortPositionProperty(group, evaluated);
|
|
17359
17359
|
evaluated.label = this._evaluatePortLabelProperty(group, evaluated);
|
|
17360
17360
|
evaluated.z = this._evaluatePortZProperty(group, evaluated);
|
|
17361
|
-
evaluated.size = assign({
|
|
17361
|
+
evaluated.size = assign({
|
|
17362
|
+
width: 0,
|
|
17363
|
+
height: 0
|
|
17364
|
+
}, group.size, evaluated.size);
|
|
17362
17365
|
return evaluated;
|
|
17363
17366
|
},
|
|
17364
17367
|
_evaluatePortPositionProperty: function (group, port) {
|
|
@@ -20952,17 +20955,15 @@ var joint = (function (exports) {
|
|
|
20952
20955
|
const v2 = tpNext.difference(points[i]).normalize();
|
|
20953
20956
|
const vAngle = angleBetweenVectors(v1, v2);
|
|
20954
20957
|
let rot = (Math.PI - vAngle) / 2;
|
|
20955
|
-
let t;
|
|
20956
20958
|
const vectorDeterminant = determinant(v1, v2);
|
|
20957
|
-
|
|
20958
|
-
pointsDeterminant = determinant(points[i].difference(points[i + 1]), points[i].difference(points[i - 1]));
|
|
20959
|
+
const pointsDeterminant = determinant(points[i].difference(points[i + 1]), points[i].difference(points[i - 1]));
|
|
20959
20960
|
if (vectorDeterminant < 0) {
|
|
20960
20961
|
rot = -rot;
|
|
20961
20962
|
}
|
|
20962
20963
|
if (vAngle < Math.PI / 2 && (rot < 0 && pointsDeterminant < 0 || rot > 0 && pointsDeterminant > 0)) {
|
|
20963
20964
|
rot = rot - Math.PI;
|
|
20964
20965
|
}
|
|
20965
|
-
t = v2.clone();
|
|
20966
|
+
const t = v2.clone();
|
|
20966
20967
|
rotateVector(t, rot);
|
|
20967
20968
|
const t1 = t.clone();
|
|
20968
20969
|
const t2 = t.clone();
|
|
@@ -21460,6 +21461,7 @@ var joint = (function (exports) {
|
|
|
21460
21461
|
}
|
|
21461
21462
|
// signature 2 - (object, event, callback, context)
|
|
21462
21463
|
else if (typeof evt === 'string' && typeof args[0] === 'function') {
|
|
21464
|
+
// eslint-disable-next-line prefer-const
|
|
21463
21465
|
let [cb, context = null] = args;
|
|
21464
21466
|
// Invoke the callback with callbackArguments passed first
|
|
21465
21467
|
if (context || callbackArguments.length > 0) cb = cb.bind(context, ...callbackArguments);
|
|
@@ -22286,7 +22288,7 @@ var joint = (function (exports) {
|
|
|
22286
22288
|
// all highlighters
|
|
22287
22289
|
const views = [];
|
|
22288
22290
|
if (!refs) return views;
|
|
22289
|
-
for (
|
|
22291
|
+
for (const hid in refs) {
|
|
22290
22292
|
const ref = refs[hid];
|
|
22291
22293
|
if (ref instanceof this) {
|
|
22292
22294
|
views.push(ref);
|
|
@@ -22316,7 +22318,7 @@ var joint = (function (exports) {
|
|
|
22316
22318
|
if (!refs) return false;
|
|
22317
22319
|
if (id === null) {
|
|
22318
22320
|
// any highlighter
|
|
22319
|
-
for (
|
|
22321
|
+
for (const hid in refs) {
|
|
22320
22322
|
if (refs[hid] instanceof this) return true;
|
|
22321
22323
|
}
|
|
22322
22324
|
return false;
|
|
@@ -22361,7 +22363,7 @@ var joint = (function (exports) {
|
|
|
22361
22363
|
const refs = _views[cid];
|
|
22362
22364
|
if (!refs) return;
|
|
22363
22365
|
if (id) delete refs[id];
|
|
22364
|
-
for (
|
|
22366
|
+
for (const _ in refs) return;
|
|
22365
22367
|
delete _views[cid];
|
|
22366
22368
|
},
|
|
22367
22369
|
remove(cellView, id = null) {
|
|
@@ -22374,8 +22376,8 @@ var joint = (function (exports) {
|
|
|
22374
22376
|
const {
|
|
22375
22377
|
_views
|
|
22376
22378
|
} = this;
|
|
22377
|
-
for (
|
|
22378
|
-
for (
|
|
22379
|
+
for (const cid in _views) {
|
|
22380
|
+
for (const hid in _views[cid]) {
|
|
22379
22381
|
const view = _views[cid][hid];
|
|
22380
22382
|
if (view.cellView.paper === paper && view instanceof this && (id === null || hid === id)) {
|
|
22381
22383
|
views.push(view);
|
|
@@ -22947,7 +22949,7 @@ var joint = (function (exports) {
|
|
|
22947
22949
|
// Connection Points
|
|
22948
22950
|
|
|
22949
22951
|
function anchorConnectionPoint(line, _view, _magnet, opt) {
|
|
22950
|
-
|
|
22952
|
+
const {
|
|
22951
22953
|
offset,
|
|
22952
22954
|
alignOffset,
|
|
22953
22955
|
align
|
|
@@ -25220,8 +25222,8 @@ var joint = (function (exports) {
|
|
|
25220
25222
|
}];
|
|
25221
25223
|
}
|
|
25222
25224
|
let x;
|
|
25223
|
-
|
|
25224
|
-
|
|
25225
|
+
const y1 = Math.min((sy1 + ty0) / 2, toy);
|
|
25226
|
+
const y2 = Math.min((sy0 + ty1) / 2, soy);
|
|
25225
25227
|
if (toy < soy) {
|
|
25226
25228
|
// Use the shortest path along the connections on horizontal sides
|
|
25227
25229
|
if (rightD > leftD) {
|
|
@@ -25263,8 +25265,8 @@ var joint = (function (exports) {
|
|
|
25263
25265
|
}];
|
|
25264
25266
|
}
|
|
25265
25267
|
let x;
|
|
25266
|
-
|
|
25267
|
-
|
|
25268
|
+
const y1 = Math.max((sy0 + ty1) / 2, toy);
|
|
25269
|
+
const y2 = Math.max((sy1 + ty0) / 2, soy);
|
|
25268
25270
|
if (toy > soy) {
|
|
25269
25271
|
// Use the shortest path along the connections on horizontal sides
|
|
25270
25272
|
if (rightD > leftD) {
|
|
@@ -25306,8 +25308,8 @@ var joint = (function (exports) {
|
|
|
25306
25308
|
}];
|
|
25307
25309
|
}
|
|
25308
25310
|
let y;
|
|
25309
|
-
|
|
25310
|
-
|
|
25311
|
+
const x1 = Math.min((sx1 + tx0) / 2, tox);
|
|
25312
|
+
const x2 = Math.min((sx0 + tx1) / 2, sox);
|
|
25311
25313
|
if (tox > sox) {
|
|
25312
25314
|
if (topD <= bottomD) {
|
|
25313
25315
|
y = Math.min(smy0, toy);
|
|
@@ -25348,8 +25350,8 @@ var joint = (function (exports) {
|
|
|
25348
25350
|
}];
|
|
25349
25351
|
}
|
|
25350
25352
|
let y;
|
|
25351
|
-
|
|
25352
|
-
|
|
25353
|
+
const x1 = Math.max((sx0 + tx1) / 2, tox);
|
|
25354
|
+
const x2 = Math.max((sx1 + tx0) / 2, sox);
|
|
25353
25355
|
if (tox <= sox) {
|
|
25354
25356
|
if (topD <= bottomD) {
|
|
25355
25357
|
y = Math.min(smy0, toy);
|
|
@@ -26166,7 +26168,7 @@ var joint = (function (exports) {
|
|
|
26166
26168
|
const sourcePoint = pointDataFromAnchor(linkView.sourceView, linkView.sourceAnchor, linkView.sourceBBox, sourceDirection, isSourcePort, linkView.sourceAnchor, margin);
|
|
26167
26169
|
const isTargetPort = !!linkView.model.target().port;
|
|
26168
26170
|
const targetPoint = pointDataFromAnchor(linkView.targetView, linkView.targetAnchor, linkView.targetBBox, targetDirection, isTargetPort, linkView.targetAnchor, margin);
|
|
26169
|
-
|
|
26171
|
+
const resultVertices = [];
|
|
26170
26172
|
if (!useVertices || vertices.length === 0) {
|
|
26171
26173
|
return simplifyPoints(routeBetweenPoints(sourcePoint, targetPoint));
|
|
26172
26174
|
}
|
|
@@ -27069,9 +27071,8 @@ var joint = (function (exports) {
|
|
|
27069
27071
|
if (cellNamespace) {
|
|
27070
27072
|
this.cellNamespace = cellNamespace;
|
|
27071
27073
|
} else {
|
|
27072
|
-
|
|
27074
|
+
// eslint-disable-next-line no-undef
|
|
27073
27075
|
this.cellNamespace = typeof joint !== 'undefined' && has(joint, 'shapes') ? joint.shapes : null;
|
|
27074
|
-
/* eslint-enable no-undef */
|
|
27075
27076
|
}
|
|
27076
27077
|
this.graph = graph;
|
|
27077
27078
|
},
|
|
@@ -27565,6 +27566,12 @@ var joint = (function (exports) {
|
|
|
27565
27566
|
* @description The ID of the default layer.
|
|
27566
27567
|
*/
|
|
27567
27568
|
defaultLayerId: DEFAULT_LAYER_ID,
|
|
27569
|
+
/**
|
|
27570
|
+
* @protected
|
|
27571
|
+
* @description If `true`, layer functionality is disabled
|
|
27572
|
+
* and all cells are assigned to the default layer.
|
|
27573
|
+
*/
|
|
27574
|
+
ignoreLayers: false,
|
|
27568
27575
|
initialize: function (attrs, options = {}) {
|
|
27569
27576
|
const layerCollection = this.layerCollection = new GraphLayerCollection([], {
|
|
27570
27577
|
layerNamespace: options.layerNamespace,
|
|
@@ -27593,6 +27600,11 @@ var joint = (function (exports) {
|
|
|
27593
27600
|
graph: this
|
|
27594
27601
|
});
|
|
27595
27602
|
|
|
27603
|
+
// Option to ignore layers altogether.
|
|
27604
|
+
if (options.ignoreLayers) {
|
|
27605
|
+
this.ignoreLayers = true;
|
|
27606
|
+
}
|
|
27607
|
+
|
|
27596
27608
|
// `Graph` keeps an internal data structure (an adjacency list)
|
|
27597
27609
|
// for fast graph queries. All changes that affect the structure of the graph
|
|
27598
27610
|
// must be reflected in the `al` object. This object provides fast answers to
|
|
@@ -27688,7 +27700,7 @@ var joint = (function (exports) {
|
|
|
27688
27700
|
// Backward compatibility: prior v4.2, z-index was not set during reset.
|
|
27689
27701
|
if (opt && opt.ensureZIndex) {
|
|
27690
27702
|
if (cellAttributes.z === undefined) {
|
|
27691
|
-
const layerId =
|
|
27703
|
+
const layerId = this.getCellLayerId(cellInit);
|
|
27692
27704
|
const zIndex = this.maxZIndex(layerId) + 1;
|
|
27693
27705
|
if (cellInit[CELL_MARKER]) {
|
|
27694
27706
|
// Set with event in case there is a listener
|
|
@@ -27793,6 +27805,10 @@ var joint = (function (exports) {
|
|
|
27793
27805
|
if (!cellInit) {
|
|
27794
27806
|
throw new Error('dia.Graph: No cell provided.');
|
|
27795
27807
|
}
|
|
27808
|
+
if (this.ignoreLayers) {
|
|
27809
|
+
// When layers are ignored, all cells belong to the default layer.
|
|
27810
|
+
return this.defaultLayerId;
|
|
27811
|
+
}
|
|
27796
27812
|
const cellAttributes = cellInit[CELL_MARKER] ? cellInit.attributes : cellInit;
|
|
27797
27813
|
return cellAttributes[config$3.layerAttribute] || this.defaultLayerId;
|
|
27798
27814
|
},
|
|
@@ -28033,9 +28049,11 @@ var joint = (function (exports) {
|
|
|
28033
28049
|
*/
|
|
28034
28050
|
_getBeforeLayerIdFromOptions(options, layer = null) {
|
|
28035
28051
|
let {
|
|
28036
|
-
before = null,
|
|
28037
28052
|
index
|
|
28038
28053
|
} = options;
|
|
28054
|
+
const {
|
|
28055
|
+
before = null
|
|
28056
|
+
} = options;
|
|
28039
28057
|
if (before && index !== undefined) {
|
|
28040
28058
|
throw new Error('dia.Graph: Options "before" and "index" are mutually exclusive.');
|
|
28041
28059
|
}
|
|
@@ -28947,7 +28965,7 @@ var joint = (function (exports) {
|
|
|
28947
28965
|
}, {});
|
|
28948
28966
|
function evalAttributes(attrs, refBBox) {
|
|
28949
28967
|
const evalAttrs = {};
|
|
28950
|
-
for (
|
|
28968
|
+
for (const attrName in attrs) {
|
|
28951
28969
|
if (!attrs.hasOwnProperty(attrName)) continue;
|
|
28952
28970
|
evalAttrs[attrName] = evalAttribute(attrName, attrs[attrName], refBBox);
|
|
28953
28971
|
}
|
|
@@ -31793,7 +31811,7 @@ var joint = (function (exports) {
|
|
|
31793
31811
|
} = this;
|
|
31794
31812
|
const selectors = _labelSelectors[index];
|
|
31795
31813
|
if (!selectors) return;
|
|
31796
|
-
for (
|
|
31814
|
+
for (const selector in selectors) {
|
|
31797
31815
|
const {
|
|
31798
31816
|
id
|
|
31799
31817
|
} = selectors[selector];
|
|
@@ -33073,7 +33091,7 @@ var joint = (function (exports) {
|
|
|
33073
33091
|
el,
|
|
33074
33092
|
pivotNodes
|
|
33075
33093
|
} = this;
|
|
33076
|
-
for (
|
|
33094
|
+
for (const z in pivotNodes) el.removeChild(pivotNodes[z]);
|
|
33077
33095
|
this.pivotNodes = {};
|
|
33078
33096
|
},
|
|
33079
33097
|
isEmpty: function () {
|
|
@@ -34046,9 +34064,8 @@ var joint = (function (exports) {
|
|
|
34046
34064
|
options
|
|
34047
34065
|
} = this;
|
|
34048
34066
|
if (!options.cellViewNamespace) {
|
|
34049
|
-
|
|
34067
|
+
// eslint-disable-next-line no-undef
|
|
34050
34068
|
options.cellViewNamespace = typeof joint !== 'undefined' && has(joint, 'shapes') ? joint.shapes : null;
|
|
34051
|
-
/* eslint-enable no-undef */
|
|
34052
34069
|
}
|
|
34053
34070
|
const defaultLayerViewNamespace = {
|
|
34054
34071
|
LayerView,
|
|
@@ -34112,6 +34129,9 @@ var joint = (function (exports) {
|
|
|
34112
34129
|
var position = opt.position;
|
|
34113
34130
|
if (this.isAsync() || !isNumber(position)) {
|
|
34114
34131
|
this.renderView(cell, opt);
|
|
34132
|
+
// Wake up the paper in case it was idle
|
|
34133
|
+
// When using initializeUnmounted: true the paper won't wake up by itself
|
|
34134
|
+
this.wakeUp();
|
|
34115
34135
|
} else {
|
|
34116
34136
|
if (opt.maxPosition === position) this.freeze({
|
|
34117
34137
|
key: 'addCells'
|
|
@@ -34257,11 +34277,11 @@ var joint = (function (exports) {
|
|
|
34257
34277
|
} = options;
|
|
34258
34278
|
|
|
34259
34279
|
// Default cellView namespace for ES5
|
|
34260
|
-
|
|
34280
|
+
// eslint-disable-next-line no-undef
|
|
34261
34281
|
if (!cellViewNamespace && typeof joint !== 'undefined' && has(joint, 'shapes')) {
|
|
34282
|
+
// eslint-disable-next-line no-undef
|
|
34262
34283
|
options.cellViewNamespace = joint.shapes;
|
|
34263
34284
|
}
|
|
34264
|
-
/* eslint-enable no-undef */
|
|
34265
34285
|
|
|
34266
34286
|
// Here if a function was provided, we can not clone it, as this would result in loosing the function.
|
|
34267
34287
|
// If the default is used, the cloning is necessary in order to prevent modifying the options on prototype.
|
|
@@ -34489,8 +34509,10 @@ var joint = (function (exports) {
|
|
|
34489
34509
|
* Helper method for addLayerView and moveLayerView methods
|
|
34490
34510
|
*/
|
|
34491
34511
|
_getBeforeLayerViewFromOptions(layerView, options) {
|
|
34512
|
+
const {
|
|
34513
|
+
before = null
|
|
34514
|
+
} = options;
|
|
34492
34515
|
let {
|
|
34493
|
-
before = null,
|
|
34494
34516
|
index
|
|
34495
34517
|
} = options;
|
|
34496
34518
|
if (before && index !== undefined) {
|
|
@@ -34936,7 +34958,7 @@ var joint = (function (exports) {
|
|
|
34936
34958
|
delete prevPriorityUpdates[cid];
|
|
34937
34959
|
}
|
|
34938
34960
|
}
|
|
34939
|
-
|
|
34961
|
+
const currentType = priorityUpdates[cid] || 0;
|
|
34940
34962
|
// Prevent cycling
|
|
34941
34963
|
if ((currentType & type) === type) return;
|
|
34942
34964
|
if (!currentType) updates.count++;
|
|
@@ -35082,7 +35104,7 @@ var joint = (function (exports) {
|
|
|
35082
35104
|
let i = priorityIndexes.length;
|
|
35083
35105
|
while (i > 0 && i--) {
|
|
35084
35106
|
// a faster way how to check if an object is empty
|
|
35085
|
-
for (
|
|
35107
|
+
for (const _key in priorities[priorityIndexes[i]]) return true;
|
|
35086
35108
|
}
|
|
35087
35109
|
return false;
|
|
35088
35110
|
},
|
|
@@ -35401,10 +35423,13 @@ var joint = (function (exports) {
|
|
|
35401
35423
|
var updates = this._updates;
|
|
35402
35424
|
var unmountedList = updates.unmountedList;
|
|
35403
35425
|
for (var i = 0, n = Math.min(unmountedList.length, batchSize); i < n; i++) {
|
|
35426
|
+
// stop if there are no more unmounted views
|
|
35427
|
+
// this can happen when another view was mounted in the onViewUpdate() callback
|
|
35428
|
+
if (unmountedList.length === 0) break;
|
|
35404
35429
|
const {
|
|
35405
35430
|
key: cid
|
|
35406
35431
|
} = unmountedList.peekHead();
|
|
35407
|
-
|
|
35432
|
+
const view = views[cid] || this._viewPlaceholders[cid];
|
|
35408
35433
|
if (!view) {
|
|
35409
35434
|
// This should not occur
|
|
35410
35435
|
// Prevent looping over this invalid cid
|
|
@@ -35639,8 +35664,8 @@ var joint = (function (exports) {
|
|
|
35639
35664
|
width: currentWidth,
|
|
35640
35665
|
height: currentHeight
|
|
35641
35666
|
} = options;
|
|
35642
|
-
|
|
35643
|
-
|
|
35667
|
+
const w = width === undefined ? currentWidth : width;
|
|
35668
|
+
const h = height === undefined ? currentHeight : height;
|
|
35644
35669
|
if (currentWidth === w && currentHeight === h) return;
|
|
35645
35670
|
options.width = w;
|
|
35646
35671
|
options.height = h;
|
|
@@ -36514,7 +36539,9 @@ var joint = (function (exports) {
|
|
|
36514
36539
|
|
|
36515
36540
|
resolveHighlighter: function (opt = {}) {
|
|
36516
36541
|
let {
|
|
36517
|
-
highlighter: highlighterDef
|
|
36542
|
+
highlighter: highlighterDef
|
|
36543
|
+
} = opt;
|
|
36544
|
+
const {
|
|
36518
36545
|
type
|
|
36519
36546
|
} = opt;
|
|
36520
36547
|
const {
|
|
@@ -38263,7 +38290,7 @@ var joint = (function (exports) {
|
|
|
38263
38290
|
const isSingleVertex = data.originalVertices.length === 1;
|
|
38264
38291
|
const origVIndex = isSingleVertex ? 0 : handleIndex;
|
|
38265
38292
|
const additionalOffset = data.firstHandleShifted && !isSingleVertex ? 1 : 0;
|
|
38266
|
-
|
|
38293
|
+
const nextVIndex = 1 + indexOffset;
|
|
38267
38294
|
vertices.splice(handleIndex + nextVIndex, 0, data.originalVertices[origVIndex - additionalOffset]);
|
|
38268
38295
|
}
|
|
38269
38296
|
}
|
|
@@ -38865,7 +38892,7 @@ var joint = (function (exports) {
|
|
|
38865
38892
|
} = this;
|
|
38866
38893
|
handleNode.setAttribute('transform', this.getHandleTransformString());
|
|
38867
38894
|
if (handleAttributes) {
|
|
38868
|
-
for (
|
|
38895
|
+
for (const attrName in handleAttributes) {
|
|
38869
38896
|
handleNode.setAttribute(attrName, handleAttributes[attrName]);
|
|
38870
38897
|
}
|
|
38871
38898
|
}
|
|
@@ -39063,7 +39090,9 @@ var joint = (function (exports) {
|
|
|
39063
39090
|
const labelPosition = this.getLabelPosition(label);
|
|
39064
39091
|
const coords = view.getLabelCoordinates(labelPosition);
|
|
39065
39092
|
let {
|
|
39066
|
-
angle = 0
|
|
39093
|
+
angle = 0
|
|
39094
|
+
} = labelPosition;
|
|
39095
|
+
const {
|
|
39067
39096
|
args = {}
|
|
39068
39097
|
} = labelPosition;
|
|
39069
39098
|
const keepGradient = args.keepGradient;
|
|
@@ -39145,15 +39174,18 @@ var joint = (function (exports) {
|
|
|
39145
39174
|
const {
|
|
39146
39175
|
relatedView: view
|
|
39147
39176
|
} = this;
|
|
39177
|
+
const toolOptions = getToolOptions(this);
|
|
39148
39178
|
let {
|
|
39149
39179
|
x = 0,
|
|
39150
|
-
y = 0
|
|
39151
|
-
|
|
39180
|
+
y = 0
|
|
39181
|
+
} = toolOptions;
|
|
39182
|
+
const {
|
|
39152
39183
|
useModelGeometry,
|
|
39184
|
+
offset = {},
|
|
39153
39185
|
rotate,
|
|
39154
39186
|
scale,
|
|
39155
39187
|
relative
|
|
39156
|
-
} =
|
|
39188
|
+
} = toolOptions;
|
|
39157
39189
|
let bbox = getViewBBox(view, {
|
|
39158
39190
|
useModelGeometry,
|
|
39159
39191
|
relative
|
|
@@ -39591,11 +39623,12 @@ var joint = (function (exports) {
|
|
|
39591
39623
|
const {
|
|
39592
39624
|
relatedView: view
|
|
39593
39625
|
} = this;
|
|
39594
|
-
|
|
39626
|
+
const {
|
|
39595
39627
|
useModelGeometry,
|
|
39596
39628
|
relative,
|
|
39597
|
-
trackPath = 'M 0 0 H calc(w) V calc(h) H 0 Z'
|
|
39629
|
+
trackPath: initialTrackPath = 'M 0 0 H calc(w) V calc(h) H 0 Z'
|
|
39598
39630
|
} = getToolOptions(this);
|
|
39631
|
+
let trackPath = initialTrackPath;
|
|
39599
39632
|
if (typeof trackPath === 'function') {
|
|
39600
39633
|
trackPath = trackPath.call(this, view);
|
|
39601
39634
|
}
|
|
@@ -39616,7 +39649,7 @@ var joint = (function (exports) {
|
|
|
39616
39649
|
const {
|
|
39617
39650
|
relatedView: view
|
|
39618
39651
|
} = this;
|
|
39619
|
-
|
|
39652
|
+
const {
|
|
39620
39653
|
useModelGeometry,
|
|
39621
39654
|
rotate
|
|
39622
39655
|
} = getToolOptions(this);
|
|
@@ -39642,7 +39675,7 @@ var joint = (function (exports) {
|
|
|
39642
39675
|
Remove: Remove
|
|
39643
39676
|
};
|
|
39644
39677
|
|
|
39645
|
-
var version = "4.2.
|
|
39678
|
+
var version = "4.2.3";
|
|
39646
39679
|
|
|
39647
39680
|
const Vectorizer = V;
|
|
39648
39681
|
const layout$1 = {
|