@joint/core 4.1.1 → 4.1.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/dist/geometry.js +1 -1
- package/dist/geometry.min.js +1 -1
- package/dist/joint.d.ts +3 -1
- package/dist/joint.js +66 -38
- package/dist/joint.min.js +2 -2
- package/dist/joint.nowrap.js +66 -38
- package/dist/joint.nowrap.min.js +2 -2
- package/dist/vectorizer.js +2 -2
- package/dist/vectorizer.min.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/V/index.mjs +1 -1
- package/src/dia/ElementView.mjs +10 -4
- package/src/dia/HighlighterView.mjs +5 -5
- package/src/mvc/Collection.mjs +6 -2
- package/src/mvc/Dom/Dom.mjs +2 -2
- package/src/mvc/Dom/methods.mjs +9 -7
- package/src/mvc/Listener.mjs +1 -2
- package/src/mvc/Model.mjs +6 -2
- package/src/mvc/ViewBase.mjs +6 -2
- package/src/util/util.mjs +5 -4
- package/src/util/utilHelpers.mjs +5 -5
- package/types/joint.d.ts +2 -0
package/dist/joint.nowrap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! JointJS v4.1.
|
|
1
|
+
/*! JointJS v4.1.3 (2025-02-04) - JavaScript diagramming library
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -7252,7 +7252,7 @@ var joint = (function (exports) {
|
|
|
7252
7252
|
const Constructor = object.constructor;
|
|
7253
7253
|
switch (tag) {
|
|
7254
7254
|
case arrayBufferTag:
|
|
7255
|
-
return cloneArrayBuffer(object
|
|
7255
|
+
return cloneArrayBuffer(object);
|
|
7256
7256
|
case boolTag:
|
|
7257
7257
|
case dateTag:
|
|
7258
7258
|
return new Constructor(+object);
|
|
@@ -7871,7 +7871,7 @@ var joint = (function (exports) {
|
|
|
7871
7871
|
}
|
|
7872
7872
|
assignMergeValue(object, key, newValue);
|
|
7873
7873
|
}
|
|
7874
|
-
}
|
|
7874
|
+
});
|
|
7875
7875
|
};
|
|
7876
7876
|
const baseMergeDeep = (object, source, key, srcIndex, mergeFunc, customizer, stack) => {
|
|
7877
7877
|
const objValue = safeGet(object, key);
|
|
@@ -7961,7 +7961,7 @@ var joint = (function (exports) {
|
|
|
7961
7961
|
const length = array == null ? 0 : array.length;
|
|
7962
7962
|
return length ? array[length - 1] : undefined;
|
|
7963
7963
|
}
|
|
7964
|
-
const createSet = Set && 1 / setToArray(new Set([undefined, -0]))[1] == 1 / 0 ? values => new Set(values) : () => {};
|
|
7964
|
+
const createSet = Set && 1 / setToArray(new Set([undefined, -0]))[1] == 1 / 0 ? values => new Set(values) : () => {/* no-op */};
|
|
7965
7965
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
7966
7966
|
if (isObject$1(objValue) && isObject$1(srcValue)) {
|
|
7967
7967
|
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
@@ -8755,8 +8755,8 @@ var joint = (function (exports) {
|
|
|
8755
8755
|
}
|
|
8756
8756
|
const groupBy = (collection, iteratee) => {
|
|
8757
8757
|
iteratee = getIteratee(iteratee, 2);
|
|
8758
|
-
return reduce(collection, (result, value
|
|
8759
|
-
key = iteratee(value);
|
|
8758
|
+
return reduce(collection, (result, value) => {
|
|
8759
|
+
const key = iteratee(value);
|
|
8760
8760
|
if (hasOwnProperty.call(result, key)) {
|
|
8761
8761
|
result[key].push(value);
|
|
8762
8762
|
} else {
|
|
@@ -9149,8 +9149,8 @@ var joint = (function (exports) {
|
|
|
9149
9149
|
}
|
|
9150
9150
|
return ret;
|
|
9151
9151
|
};
|
|
9152
|
-
$.fn.add = function (selector
|
|
9153
|
-
const newElements = $(selector
|
|
9152
|
+
$.fn.add = function (selector) {
|
|
9153
|
+
const newElements = $(selector).toArray();
|
|
9154
9154
|
const prevElements = this.toArray();
|
|
9155
9155
|
const ret = this.pushStack([]);
|
|
9156
9156
|
$.merge(ret, uniq(prevElements.concat(newElements)));
|
|
@@ -9966,8 +9966,8 @@ var joint = (function (exports) {
|
|
|
9966
9966
|
case 'bottom':
|
|
9967
9967
|
dy = -(0.25 * llMaxFont) - rLineHeights;
|
|
9968
9968
|
break;
|
|
9969
|
-
default:
|
|
9970
9969
|
case 'top':
|
|
9970
|
+
default:
|
|
9971
9971
|
dy = 0.8 * flMaxFont;
|
|
9972
9972
|
break;
|
|
9973
9973
|
}
|
|
@@ -11814,7 +11814,7 @@ var joint = (function (exports) {
|
|
|
11814
11814
|
if (!el) return null;
|
|
11815
11815
|
if (arguments.length === 0) return el.innerHTML;
|
|
11816
11816
|
if (html === undefined) return this; // do nothing
|
|
11817
|
-
cleanNodesData(
|
|
11817
|
+
cleanNodesData(el.getElementsByTagName('*'));
|
|
11818
11818
|
if (typeof html === 'string' || typeof html === 'number') {
|
|
11819
11819
|
el.innerHTML = html;
|
|
11820
11820
|
} else {
|
|
@@ -12073,17 +12073,21 @@ var joint = (function (exports) {
|
|
|
12073
12073
|
// when a statically positioned element is identified
|
|
12074
12074
|
doc = el.ownerDocument;
|
|
12075
12075
|
offsetParent = el.offsetParent || doc.documentElement;
|
|
12076
|
-
const
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12076
|
+
const isStaticallyPositioned = el => {
|
|
12077
|
+
const {
|
|
12078
|
+
position
|
|
12079
|
+
} = getComputedStyle(el);
|
|
12080
|
+
return position === 'static';
|
|
12081
|
+
};
|
|
12082
|
+
while (offsetParent && offsetParent !== doc.documentElement && isStaticallyPositioned(offsetParent)) {
|
|
12083
|
+
offsetParent = offsetParent.offsetParent || doc.documentElement;
|
|
12080
12084
|
}
|
|
12081
|
-
if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1) {
|
|
12085
|
+
if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1 && !isStaticallyPositioned(offsetParent)) {
|
|
12082
12086
|
// Incorporate borders into its offset, since they are outside its content origin
|
|
12083
12087
|
const offsetParentStyles = window.getComputedStyle(offsetParent);
|
|
12084
12088
|
const borderTopWidth = parseFloat(offsetParentStyles.borderTopWidth) || 0;
|
|
12085
12089
|
const borderLeftWidth = parseFloat(offsetParentStyles.borderLeftWidth) || 0;
|
|
12086
|
-
parentOffset = $
|
|
12090
|
+
parentOffset = $(offsetParent).offset();
|
|
12087
12091
|
parentOffset.top += borderTopWidth;
|
|
12088
12092
|
parentOffset.left += borderLeftWidth;
|
|
12089
12093
|
}
|
|
@@ -12442,9 +12446,9 @@ var joint = (function (exports) {
|
|
|
12442
12446
|
const selectors = {};
|
|
12443
12447
|
const groupSelectors = {};
|
|
12444
12448
|
const svgNamespace = V.namespace.svg;
|
|
12445
|
-
const
|
|
12449
|
+
const initialNS = namespace || svgNamespace;
|
|
12446
12450
|
const fragment = document.createDocumentFragment();
|
|
12447
|
-
const parseNode = function (siblingsDef, parentNode,
|
|
12451
|
+
const parseNode = function (siblingsDef, parentNode, parentNS) {
|
|
12448
12452
|
for (let i = 0; i < siblingsDef.length; i++) {
|
|
12449
12453
|
const nodeDef = siblingsDef[i];
|
|
12450
12454
|
|
|
@@ -12461,7 +12465,7 @@ var joint = (function (exports) {
|
|
|
12461
12465
|
let node;
|
|
12462
12466
|
|
|
12463
12467
|
// Namespace URI
|
|
12464
|
-
|
|
12468
|
+
const ns = nodeDef.hasOwnProperty('namespaceURI') ? nodeDef.namespaceURI : parentNS;
|
|
12465
12469
|
node = document.createElementNS(ns, tagName);
|
|
12466
12470
|
const svg = ns === svgNamespace;
|
|
12467
12471
|
const wrapperNode = svg ? V(node) : $(node);
|
|
@@ -12511,7 +12515,7 @@ var joint = (function (exports) {
|
|
|
12511
12515
|
}
|
|
12512
12516
|
}
|
|
12513
12517
|
};
|
|
12514
|
-
parseNode(json, fragment,
|
|
12518
|
+
parseNode(json, fragment, initialNS);
|
|
12515
12519
|
return {
|
|
12516
12520
|
fragment: fragment,
|
|
12517
12521
|
selectors: selectors,
|
|
@@ -13842,7 +13846,9 @@ var joint = (function (exports) {
|
|
|
13842
13846
|
} = opt || {};
|
|
13843
13847
|
return findDifference(object, base, 0, maxDepth);
|
|
13844
13848
|
}
|
|
13845
|
-
const noop = function () {
|
|
13849
|
+
const noop = function () {
|
|
13850
|
+
// Do nothing.
|
|
13851
|
+
};
|
|
13846
13852
|
|
|
13847
13853
|
// Events
|
|
13848
13854
|
// ---------------
|
|
@@ -14313,10 +14319,14 @@ var joint = (function (exports) {
|
|
|
14313
14319
|
cidPrefix: 'c',
|
|
14314
14320
|
// preinitialize is an empty function by default. You can override it with a function
|
|
14315
14321
|
// or object. preinitialize will run before any instantiation logic is run in the Model.
|
|
14316
|
-
preinitialize: function () {
|
|
14322
|
+
preinitialize: function () {
|
|
14323
|
+
// No implementation.
|
|
14324
|
+
},
|
|
14317
14325
|
// Initialize is an empty function by default. Override it with your own
|
|
14318
14326
|
// initialization logic.
|
|
14319
|
-
initialize: function () {
|
|
14327
|
+
initialize: function () {
|
|
14328
|
+
// No implementation.
|
|
14329
|
+
},
|
|
14320
14330
|
// Return a copy of the model's `attributes` object.
|
|
14321
14331
|
toJSON: function (options) {
|
|
14322
14332
|
return clone(this.attributes);
|
|
@@ -20533,10 +20543,14 @@ var joint = (function (exports) {
|
|
|
20533
20543
|
},
|
|
20534
20544
|
// preinitialize is an empty function by default. You can override it with a function
|
|
20535
20545
|
// or object. preinitialize will run before any instantiation logic is run in the View
|
|
20536
|
-
preinitialize: function () {
|
|
20546
|
+
preinitialize: function () {
|
|
20547
|
+
// No implementation.
|
|
20548
|
+
},
|
|
20537
20549
|
// Initialize is an empty function by default. Override it with your own
|
|
20538
20550
|
// initialization logic.
|
|
20539
|
-
initialize: function () {
|
|
20551
|
+
initialize: function () {
|
|
20552
|
+
// No implementation.
|
|
20553
|
+
},
|
|
20540
20554
|
// **render** is the core function that your view should override, in order
|
|
20541
20555
|
// to populate its element (`this.el`), with the appropriate HTML. The
|
|
20542
20556
|
// convention is for **render** to always return `this`.
|
|
@@ -20926,7 +20940,7 @@ var joint = (function (exports) {
|
|
|
20926
20940
|
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
20927
20941
|
args[_key2 - 2] = arguments[_key2];
|
|
20928
20942
|
}
|
|
20929
|
-
if (
|
|
20943
|
+
if (evt && typeof evt === 'object') {
|
|
20930
20944
|
const [context = null] = args;
|
|
20931
20945
|
Object.entries(evt).forEach(_ref => {
|
|
20932
20946
|
let [eventName, cb] = _ref;
|
|
@@ -21003,10 +21017,14 @@ var joint = (function (exports) {
|
|
|
21003
21017
|
model: Model,
|
|
21004
21018
|
// preinitialize is an empty function by default. You can override it with a function
|
|
21005
21019
|
// or object. preinitialize will run before any instantiation logic is run in the Collection.
|
|
21006
|
-
preinitialize: function () {
|
|
21020
|
+
preinitialize: function () {
|
|
21021
|
+
// No implementation.
|
|
21022
|
+
},
|
|
21007
21023
|
// Initialize is an empty function by default. Override it with your own
|
|
21008
21024
|
// initialization logic.
|
|
21009
|
-
initialize: function () {
|
|
21025
|
+
initialize: function () {
|
|
21026
|
+
// No implementation.
|
|
21027
|
+
},
|
|
21010
21028
|
// The JSON representation of a Collection is an array of the
|
|
21011
21029
|
// models' attributes.
|
|
21012
21030
|
toJSON: function (options) {
|
|
@@ -21524,13 +21542,13 @@ var joint = (function (exports) {
|
|
|
21524
21542
|
cellView,
|
|
21525
21543
|
nodeSelector
|
|
21526
21544
|
} = this;
|
|
21527
|
-
if (
|
|
21545
|
+
if (cellView.isMounted()) {
|
|
21546
|
+
this.update(cellView, nodeSelector);
|
|
21547
|
+
this.mount();
|
|
21548
|
+
this.transform();
|
|
21549
|
+
} else {
|
|
21528
21550
|
this.postponedUpdate = true;
|
|
21529
|
-
return 0;
|
|
21530
21551
|
}
|
|
21531
|
-
this.update(cellView, nodeSelector);
|
|
21532
|
-
this.mount();
|
|
21533
|
-
this.transform();
|
|
21534
21552
|
return 0;
|
|
21535
21553
|
},
|
|
21536
21554
|
findNode(cellView) {
|
|
@@ -28512,7 +28530,9 @@ var joint = (function (exports) {
|
|
|
28512
28530
|
/**
|
|
28513
28531
|
* @abstract
|
|
28514
28532
|
*/
|
|
28515
|
-
_initializePorts: function () {
|
|
28533
|
+
_initializePorts: function () {
|
|
28534
|
+
// implemented in ports.js
|
|
28535
|
+
},
|
|
28516
28536
|
update: function (_, renderingOnlyAttrs) {
|
|
28517
28537
|
this.cleanNodesCache();
|
|
28518
28538
|
|
|
@@ -29145,9 +29165,15 @@ var joint = (function (exports) {
|
|
|
29145
29165
|
},
|
|
29146
29166
|
// Drag Handlers
|
|
29147
29167
|
|
|
29168
|
+
snapToGrid: function (evt, x, y) {
|
|
29169
|
+
const grid = this.paper.options.gridSize;
|
|
29170
|
+
return {
|
|
29171
|
+
x: snapToGrid(x, grid),
|
|
29172
|
+
y: snapToGrid(y, grid)
|
|
29173
|
+
};
|
|
29174
|
+
},
|
|
29148
29175
|
drag: function (evt, x, y) {
|
|
29149
29176
|
var paper = this.paper;
|
|
29150
|
-
var grid = paper.options.gridSize;
|
|
29151
29177
|
var element = this.model;
|
|
29152
29178
|
var data = this.eventData(evt);
|
|
29153
29179
|
var {
|
|
@@ -29157,8 +29183,10 @@ var joint = (function (exports) {
|
|
|
29157
29183
|
} = data;
|
|
29158
29184
|
|
|
29159
29185
|
// Make sure the new element's position always snaps to the current grid
|
|
29160
|
-
|
|
29161
|
-
|
|
29186
|
+
const {
|
|
29187
|
+
x: elX,
|
|
29188
|
+
y: elY
|
|
29189
|
+
} = this.snapToGrid(evt, x + pointerOffset.x, y + pointerOffset.y);
|
|
29162
29190
|
element.position(elX, elY, {
|
|
29163
29191
|
restrictedArea,
|
|
29164
29192
|
deep: true,
|
|
@@ -36493,7 +36521,7 @@ var joint = (function (exports) {
|
|
|
36493
36521
|
Control: Control
|
|
36494
36522
|
});
|
|
36495
36523
|
|
|
36496
|
-
var version = "4.1.
|
|
36524
|
+
var version = "4.1.3";
|
|
36497
36525
|
|
|
36498
36526
|
const Vectorizer = V;
|
|
36499
36527
|
const layout = {
|