@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 CHANGED
@@ -65,7 +65,7 @@ Make sure you have the following dependencies installed on your system:
65
65
 
66
66
  The installation requires Node version >= 20.19.3, to avoid syntax errors during installation.
67
67
 
68
- Make sure that you are using Yarn version >= 2.0.0, so that you have access to [Yarn workspace ranges](https://yarnpkg.com/features/workspaces#workspace-ranges-workspace) functionality. If you are using [Volta](https://volta.sh/), it will automatically read this restriction from `package.json`.
68
+ Make sure that you are using Yarn version >= 2.0.0, so that you have access to [Yarn workspace ranges](https://yarnpkg.com/features/workspaces#workspace-ranges-workspace) functionality. If you are using [Volta](https://volta.sh/), it will automatically read this restriction from `package.json`.
69
69
 
70
70
  ### Setup
71
71
 
@@ -159,4 +159,4 @@ The output for all unit tests will be saved in the `packages/joint-core/coverage
159
159
 
160
160
  The *JointJS* library is licensed under the [Mozilla Public License 2.0](https://github.com/clientIO/joint/blob/master/LICENSE).
161
161
 
162
- Copyright © 2013-2025 client IO
162
+ Copyright © 2013-2026 client IO
package/dist/geometry.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.2.1 (2025-11-20) - JavaScript diagramming library
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
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.2.1 (2025-11-20) - JavaScript diagramming library
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
package/dist/joint.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.2.1 (2025-11-20) - JavaScript diagramming library
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
@@ -926,6 +926,7 @@ export declare namespace dia {
926
926
  constructor(attributes?: Graph.Attributes, opt?: {
927
927
  cellNamespace?: any,
928
928
  layerNamespace?: any,
929
+ ignoreLayers?: boolean,
929
930
  /** @deprecated use cellNamespace instead */
930
931
  cellModel?: typeof Cell
931
932
  });
@@ -1154,7 +1155,7 @@ export declare namespace dia {
1154
1155
  }
1155
1156
 
1156
1157
  export interface ExportOptions {
1157
- ignoreDefault?: boolean | string[];
1158
+ ignoreDefaults?: boolean | string[];
1158
1159
  ignoreEmptyAttributes?: boolean;
1159
1160
  }
1160
1161
 
@@ -2270,8 +2271,8 @@ export declare namespace dia {
2270
2271
  moveThreshold?: number;
2271
2272
  magnetThreshold?: number | string;
2272
2273
  // views
2273
- elementView?: typeof ElementView | ((element: Element) => typeof ElementView);
2274
- linkView?: typeof LinkView | ((link: Link) => typeof LinkView);
2274
+ elementView?: typeof ElementView<any> | ((element: Element) => typeof ElementView<any> | null | undefined);
2275
+ linkView?: typeof LinkView<any> | ((link: Link) => typeof LinkView<any> | null | undefined);
2275
2276
  measureNode?: MeasureNodeCallback;
2276
2277
  // embedding
2277
2278
  embeddingMode?: boolean;
@@ -5861,6 +5862,7 @@ export declare namespace util {
5861
5862
 
5862
5863
  export function toArray(value: any): any[];
5863
5864
 
5865
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
5864
5866
  export function debounce<T extends Function>(func: T, wait?: number, options?: { leading?: boolean, maxWait?: number, trailing?: boolean }): T & Cancelable;
5865
5867
 
5866
5868
  export function groupBy(collection: Collection, iteratee?: IterateeFunction<any>): object;
package/dist/joint.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.2.1 (2025-11-20) - JavaScript diagramming library
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
@@ -7208,7 +7208,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7208
7208
  };
7209
7209
  const initCloneArray = array => {
7210
7210
  const length = array.length;
7211
- let result = new array.constructor(length);
7211
+ const result = new array.constructor(length);
7212
7212
  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
7213
7213
  result.index = array.index;
7214
7214
  result.input = array.input;
@@ -7386,13 +7386,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7386
7386
  return baseIsEqualDeep(value, other, baseIsEqual, stack);
7387
7387
  };
7388
7388
  const baseIsEqualDeep = (object, other, equalFunc, stack) => {
7389
- let objIsArr = Array.isArray(object);
7389
+ const objIsArr = Array.isArray(object);
7390
7390
  const othIsArr = Array.isArray(other);
7391
7391
  let objTag = objIsArr ? arrayTag : getTag(object);
7392
7392
  let othTag = othIsArr ? arrayTag : getTag(other);
7393
7393
  objTag = objTag == argsTag ? objectTag : objTag;
7394
7394
  othTag = othTag == argsTag ? objectTag : othTag;
7395
- let objIsObj = objTag == objectTag;
7395
+ const objIsObj = objTag == objectTag;
7396
7396
  const othIsObj = othTag == objectTag;
7397
7397
  const isSameTag = objTag == othTag;
7398
7398
  if (isSameTag && !objIsObj) {
@@ -7527,7 +7527,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7527
7527
  };
7528
7528
  const mapToArray = map => {
7529
7529
  let index = -1;
7530
- let result = Array(map.size);
7530
+ const result = Array(map.size);
7531
7531
  map.forEach((value, key) => {
7532
7532
  result[++index] = [key, value];
7533
7533
  });
@@ -7637,7 +7637,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
7637
7637
  isCommon = false;
7638
7638
  values = new SetCache(values);
7639
7639
  }
7640
- outer: for (let key in array) {
7640
+ outer: for (const key in array) {
7641
7641
  let value = array[key];
7642
7642
  const computed = value;
7643
7643
  value = value !== 0 ? value : 0;
@@ -9051,7 +9051,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
9051
9051
  // User data storage
9052
9052
  $.data = dataUser;
9053
9053
  $.merge = function (first, second) {
9054
- let len = +second.length;
9054
+ const len = +second.length;
9055
9055
  let i = first.length;
9056
9056
  for (let j = 0; j < len; j++) {
9057
9057
  first[i++] = second[j];
@@ -9219,7 +9219,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
9219
9219
  data = data || selector;
9220
9220
  selector = undefined;
9221
9221
  }
9222
- for (let type in types) {
9222
+ for (const type in types) {
9223
9223
  $.event.on(elem, type, selector, data, types[type], one);
9224
9224
  }
9225
9225
  return elem;
@@ -12068,7 +12068,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12068
12068
  } else {
12069
12069
  styles = name;
12070
12070
  }
12071
- for (let style in styles) {
12071
+ for (const style in styles) {
12072
12072
  if (styles.hasOwnProperty(style)) {
12073
12073
  for (let i = 0; i < this.length; i++) {
12074
12074
  setCSSProperty(this[i], style, styles[style]);
@@ -12174,7 +12174,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12174
12174
  }
12175
12175
  if (typeof types === 'object') {
12176
12176
  // ( types-object [, selector] )
12177
- for (let type in types) {
12177
+ for (const type in types) {
12178
12178
  this.off(type, selector, types[type]);
12179
12179
  }
12180
12180
  return this;
@@ -12218,7 +12218,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12218
12218
  function position() {
12219
12219
  const [el] = this;
12220
12220
  if (!el) return;
12221
- let $el = $(el);
12221
+ const $el = $(el);
12222
12222
  let offsetParent;
12223
12223
  let offset;
12224
12224
  let doc;
@@ -12337,8 +12337,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12337
12337
  function animateNode(el, properties, opt = {}) {
12338
12338
  let {
12339
12339
  duration = 400,
12340
+ delay = 0
12341
+ } = opt;
12342
+ const {
12340
12343
  easing = 'ease-in-out',
12341
- delay = 0,
12342
12344
  complete
12343
12345
  } = opt;
12344
12346
  const delayId = setTimeout(function () {
@@ -12474,7 +12476,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12474
12476
  } else {
12475
12477
  attributes = name;
12476
12478
  }
12477
- for (let attr in attributes) {
12479
+ for (const attr in attributes) {
12478
12480
  if (attributes.hasOwnProperty(attr)) {
12479
12481
  const value = attributes[attr];
12480
12482
  if (propertiesMap[attr]) {
@@ -12628,11 +12630,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12628
12630
  // TagName
12629
12631
  if (!nodeDef.hasOwnProperty('tagName')) throw new Error('json-dom-parser: missing tagName');
12630
12632
  const tagName = nodeDef.tagName;
12631
- let node;
12632
12633
 
12633
12634
  // Namespace URI
12634
12635
  const ns = nodeDef.hasOwnProperty('namespaceURI') ? nodeDef.namespaceURI : parentNS;
12635
- node = document.createElementNS(ns, tagName);
12636
+ const node = document.createElementNS(ns, tagName);
12636
12637
  const svg = ns === svgNamespace;
12637
12638
  const wrapperNode = svg ? V(node) : $(node);
12638
12639
  // Attributes
@@ -12813,7 +12814,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12813
12814
  // If the event is a touch event, normalize it to a mouse event.
12814
12815
  const touch = originalEvent && originalEvent.changedTouches && originalEvent.changedTouches[0];
12815
12816
  if (touch) {
12816
- for (let property in touch) {
12817
+ for (const property in touch) {
12817
12818
  // copy all the properties from the first touch that are not
12818
12819
  // defined on TouchEvent (clientX, clientY, pageX, pageY, screenX, screenY, identifier, ...)
12819
12820
  if (evt[property] === undefined) {
@@ -14980,7 +14981,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
14980
14981
  let value = expression;
14981
14982
  let startSearchIndex = 0;
14982
14983
  do {
14983
- let calcIndex = value.indexOf(calcStart, startSearchIndex);
14984
+ const calcIndex = value.indexOf(calcStart, startSearchIndex);
14984
14985
  if (calcIndex === -1) return value;
14985
14986
  let calcEndIndex = calcIndex + calcStartOffset;
14986
14987
  let brackets = 1;
@@ -15643,7 +15644,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
15643
15644
  return finalAttributes;
15644
15645
  }
15645
15646
  let defaultAttributes = {};
15646
- let attributes = cloneDeep(this.attributes);
15647
+ const attributes = cloneDeep(this.attributes);
15647
15648
  if (ignoreDefaults === true) {
15648
15649
  // Compare all attributes with the defaults
15649
15650
  defaultAttributes = defaults;
@@ -16198,8 +16199,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
16198
16199
  const {
16199
16200
  _scheduledTransitionIds
16200
16201
  } = this;
16201
- let initialId;
16202
- var initiator = callback => {
16202
+ const initiator = callback => {
16203
16203
  if (_scheduledTransitionIds[transitionKey]) {
16204
16204
  _scheduledTransitionIds[transitionKey] = without(_scheduledTransitionIds[transitionKey], initialId);
16205
16205
  if (_scheduledTransitionIds[transitionKey].length === 0) {
@@ -16211,7 +16211,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
16211
16211
  this._transitionIds[transitionKey] = nextFrame(callback);
16212
16212
  this.trigger('transition:start', this, transitionKey);
16213
16213
  };
16214
- initialId = setTimeout(initiator, opt.delay, setter);
16214
+ const initialId = setTimeout(initiator, opt.delay, setter);
16215
16215
  _scheduledTransitionIds[transitionKey] || (_scheduledTransitionIds[transitionKey] = []);
16216
16216
  _scheduledTransitionIds[transitionKey].push(initialId);
16217
16217
  return initialId;
@@ -16386,11 +16386,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
16386
16386
  }, protoProps);
16387
16387
  var Cell = this.extend(protoProps, staticProps);
16388
16388
  // es5 backward compatibility
16389
- /* eslint-disable no-undef */
16389
+ // eslint-disable-next-line no-undef
16390
16390
  if (typeof joint !== 'undefined' && has(joint, 'shapes')) {
16391
+ // eslint-disable-next-line no-undef
16391
16392
  setByPath(joint.shapes, type, Cell, '.');
16392
16393
  }
16393
- /* eslint-enable no-undef */
16394
16394
  return Cell;
16395
16395
  }
16396
16396
  });
@@ -16739,7 +16739,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
16739
16739
  });
16740
16740
  }
16741
16741
  function argTransform(bbox, args) {
16742
- let {
16742
+ const {
16743
16743
  x,
16744
16744
  y,
16745
16745
  angle
@@ -17203,7 +17203,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
17203
17203
  } else {
17204
17204
  groupPortTransformations = this._getGroupPortTransformations(group, portsArgs, elBBox);
17205
17205
  }
17206
- let accumulator = {
17206
+ const accumulator = {
17207
17207
  ports: ports,
17208
17208
  result: {}
17209
17209
  };
@@ -17361,7 +17361,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
17361
17361
  evaluated.position = this._evaluatePortPositionProperty(group, evaluated);
17362
17362
  evaluated.label = this._evaluatePortLabelProperty(group, evaluated);
17363
17363
  evaluated.z = this._evaluatePortZProperty(group, evaluated);
17364
- evaluated.size = assign({}, group.size, evaluated.size);
17364
+ evaluated.size = assign({
17365
+ width: 0,
17366
+ height: 0
17367
+ }, group.size, evaluated.size);
17365
17368
  return evaluated;
17366
17369
  },
17367
17370
  _evaluatePortPositionProperty: function (group, port) {
@@ -20955,17 +20958,15 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
20955
20958
  const v2 = tpNext.difference(points[i]).normalize();
20956
20959
  const vAngle = angleBetweenVectors(v1, v2);
20957
20960
  let rot = (Math.PI - vAngle) / 2;
20958
- let t;
20959
20961
  const vectorDeterminant = determinant(v1, v2);
20960
- let pointsDeterminant;
20961
- pointsDeterminant = determinant(points[i].difference(points[i + 1]), points[i].difference(points[i - 1]));
20962
+ const pointsDeterminant = determinant(points[i].difference(points[i + 1]), points[i].difference(points[i - 1]));
20962
20963
  if (vectorDeterminant < 0) {
20963
20964
  rot = -rot;
20964
20965
  }
20965
20966
  if (vAngle < Math.PI / 2 && (rot < 0 && pointsDeterminant < 0 || rot > 0 && pointsDeterminant > 0)) {
20966
20967
  rot = rot - Math.PI;
20967
20968
  }
20968
- t = v2.clone();
20969
+ const t = v2.clone();
20969
20970
  rotateVector(t, rot);
20970
20971
  const t1 = t.clone();
20971
20972
  const t2 = t.clone();
@@ -21463,6 +21464,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
21463
21464
  }
21464
21465
  // signature 2 - (object, event, callback, context)
21465
21466
  else if (typeof evt === 'string' && typeof args[0] === 'function') {
21467
+ // eslint-disable-next-line prefer-const
21466
21468
  let [cb, context = null] = args;
21467
21469
  // Invoke the callback with callbackArguments passed first
21468
21470
  if (context || callbackArguments.length > 0) cb = cb.bind(context, ...callbackArguments);
@@ -22289,7 +22291,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
22289
22291
  // all highlighters
22290
22292
  const views = [];
22291
22293
  if (!refs) return views;
22292
- for (let hid in refs) {
22294
+ for (const hid in refs) {
22293
22295
  const ref = refs[hid];
22294
22296
  if (ref instanceof this) {
22295
22297
  views.push(ref);
@@ -22319,7 +22321,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
22319
22321
  if (!refs) return false;
22320
22322
  if (id === null) {
22321
22323
  // any highlighter
22322
- for (let hid in refs) {
22324
+ for (const hid in refs) {
22323
22325
  if (refs[hid] instanceof this) return true;
22324
22326
  }
22325
22327
  return false;
@@ -22364,7 +22366,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
22364
22366
  const refs = _views[cid];
22365
22367
  if (!refs) return;
22366
22368
  if (id) delete refs[id];
22367
- for (let _ in refs) return;
22369
+ for (const _ in refs) return;
22368
22370
  delete _views[cid];
22369
22371
  },
22370
22372
  remove(cellView, id = null) {
@@ -22377,8 +22379,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
22377
22379
  const {
22378
22380
  _views
22379
22381
  } = this;
22380
- for (let cid in _views) {
22381
- for (let hid in _views[cid]) {
22382
+ for (const cid in _views) {
22383
+ for (const hid in _views[cid]) {
22382
22384
  const view = _views[cid][hid];
22383
22385
  if (view.cellView.paper === paper && view instanceof this && (id === null || hid === id)) {
22384
22386
  views.push(view);
@@ -22950,7 +22952,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
22950
22952
  // Connection Points
22951
22953
 
22952
22954
  function anchorConnectionPoint(line, _view, _magnet, opt) {
22953
- let {
22955
+ const {
22954
22956
  offset,
22955
22957
  alignOffset,
22956
22958
  align
@@ -25223,8 +25225,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
25223
25225
  }];
25224
25226
  }
25225
25227
  let x;
25226
- let y1 = Math.min((sy1 + ty0) / 2, toy);
25227
- let y2 = Math.min((sy0 + ty1) / 2, soy);
25228
+ const y1 = Math.min((sy1 + ty0) / 2, toy);
25229
+ const y2 = Math.min((sy0 + ty1) / 2, soy);
25228
25230
  if (toy < soy) {
25229
25231
  // Use the shortest path along the connections on horizontal sides
25230
25232
  if (rightD > leftD) {
@@ -25266,8 +25268,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
25266
25268
  }];
25267
25269
  }
25268
25270
  let x;
25269
- let y1 = Math.max((sy0 + ty1) / 2, toy);
25270
- let y2 = Math.max((sy1 + ty0) / 2, soy);
25271
+ const y1 = Math.max((sy0 + ty1) / 2, toy);
25272
+ const y2 = Math.max((sy1 + ty0) / 2, soy);
25271
25273
  if (toy > soy) {
25272
25274
  // Use the shortest path along the connections on horizontal sides
25273
25275
  if (rightD > leftD) {
@@ -25309,8 +25311,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
25309
25311
  }];
25310
25312
  }
25311
25313
  let y;
25312
- let x1 = Math.min((sx1 + tx0) / 2, tox);
25313
- let x2 = Math.min((sx0 + tx1) / 2, sox);
25314
+ const x1 = Math.min((sx1 + tx0) / 2, tox);
25315
+ const x2 = Math.min((sx0 + tx1) / 2, sox);
25314
25316
  if (tox > sox) {
25315
25317
  if (topD <= bottomD) {
25316
25318
  y = Math.min(smy0, toy);
@@ -25351,8 +25353,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
25351
25353
  }];
25352
25354
  }
25353
25355
  let y;
25354
- let x1 = Math.max((sx0 + tx1) / 2, tox);
25355
- let x2 = Math.max((sx1 + tx0) / 2, sox);
25356
+ const x1 = Math.max((sx0 + tx1) / 2, tox);
25357
+ const x2 = Math.max((sx1 + tx0) / 2, sox);
25356
25358
  if (tox <= sox) {
25357
25359
  if (topD <= bottomD) {
25358
25360
  y = Math.min(smy0, toy);
@@ -26169,7 +26171,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
26169
26171
  const sourcePoint = pointDataFromAnchor(linkView.sourceView, linkView.sourceAnchor, linkView.sourceBBox, sourceDirection, isSourcePort, linkView.sourceAnchor, margin);
26170
26172
  const isTargetPort = !!linkView.model.target().port;
26171
26173
  const targetPoint = pointDataFromAnchor(linkView.targetView, linkView.targetAnchor, linkView.targetBBox, targetDirection, isTargetPort, linkView.targetAnchor, margin);
26172
- let resultVertices = [];
26174
+ const resultVertices = [];
26173
26175
  if (!useVertices || vertices.length === 0) {
26174
26176
  return simplifyPoints(routeBetweenPoints(sourcePoint, targetPoint));
26175
26177
  }
@@ -27072,9 +27074,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
27072
27074
  if (cellNamespace) {
27073
27075
  this.cellNamespace = cellNamespace;
27074
27076
  } else {
27075
- /* eslint-disable no-undef */
27077
+ // eslint-disable-next-line no-undef
27076
27078
  this.cellNamespace = typeof joint !== 'undefined' && has(joint, 'shapes') ? joint.shapes : null;
27077
- /* eslint-enable no-undef */
27078
27079
  }
27079
27080
  this.graph = graph;
27080
27081
  },
@@ -27568,6 +27569,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
27568
27569
  * @description The ID of the default layer.
27569
27570
  */
27570
27571
  defaultLayerId: DEFAULT_LAYER_ID,
27572
+ /**
27573
+ * @protected
27574
+ * @description If `true`, layer functionality is disabled
27575
+ * and all cells are assigned to the default layer.
27576
+ */
27577
+ ignoreLayers: false,
27571
27578
  initialize: function (attrs, options = {}) {
27572
27579
  const layerCollection = this.layerCollection = new GraphLayerCollection([], {
27573
27580
  layerNamespace: options.layerNamespace,
@@ -27596,6 +27603,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
27596
27603
  graph: this
27597
27604
  });
27598
27605
 
27606
+ // Option to ignore layers altogether.
27607
+ if (options.ignoreLayers) {
27608
+ this.ignoreLayers = true;
27609
+ }
27610
+
27599
27611
  // `Graph` keeps an internal data structure (an adjacency list)
27600
27612
  // for fast graph queries. All changes that affect the structure of the graph
27601
27613
  // must be reflected in the `al` object. This object provides fast answers to
@@ -27691,7 +27703,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
27691
27703
  // Backward compatibility: prior v4.2, z-index was not set during reset.
27692
27704
  if (opt && opt.ensureZIndex) {
27693
27705
  if (cellAttributes.z === undefined) {
27694
- const layerId = cellAttributes[config$3.layerAttribute] || this.defaultLayerId;
27706
+ const layerId = this.getCellLayerId(cellInit);
27695
27707
  const zIndex = this.maxZIndex(layerId) + 1;
27696
27708
  if (cellInit[CELL_MARKER]) {
27697
27709
  // Set with event in case there is a listener
@@ -27796,6 +27808,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
27796
27808
  if (!cellInit) {
27797
27809
  throw new Error('dia.Graph: No cell provided.');
27798
27810
  }
27811
+ if (this.ignoreLayers) {
27812
+ // When layers are ignored, all cells belong to the default layer.
27813
+ return this.defaultLayerId;
27814
+ }
27799
27815
  const cellAttributes = cellInit[CELL_MARKER] ? cellInit.attributes : cellInit;
27800
27816
  return cellAttributes[config$3.layerAttribute] || this.defaultLayerId;
27801
27817
  },
@@ -28036,9 +28052,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
28036
28052
  */
28037
28053
  _getBeforeLayerIdFromOptions(options, layer = null) {
28038
28054
  let {
28039
- before = null,
28040
28055
  index
28041
28056
  } = options;
28057
+ const {
28058
+ before = null
28059
+ } = options;
28042
28060
  if (before && index !== undefined) {
28043
28061
  throw new Error('dia.Graph: Options "before" and "index" are mutually exclusive.');
28044
28062
  }
@@ -28950,7 +28968,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
28950
28968
  }, {});
28951
28969
  function evalAttributes(attrs, refBBox) {
28952
28970
  const evalAttrs = {};
28953
- for (let attrName in attrs) {
28971
+ for (const attrName in attrs) {
28954
28972
  if (!attrs.hasOwnProperty(attrName)) continue;
28955
28973
  evalAttrs[attrName] = evalAttribute(attrName, attrs[attrName], refBBox);
28956
28974
  }
@@ -31796,7 +31814,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
31796
31814
  } = this;
31797
31815
  const selectors = _labelSelectors[index];
31798
31816
  if (!selectors) return;
31799
- for (let selector in selectors) {
31817
+ for (const selector in selectors) {
31800
31818
  const {
31801
31819
  id
31802
31820
  } = selectors[selector];
@@ -33076,7 +33094,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
33076
33094
  el,
33077
33095
  pivotNodes
33078
33096
  } = this;
33079
- for (let z in pivotNodes) el.removeChild(pivotNodes[z]);
33097
+ for (const z in pivotNodes) el.removeChild(pivotNodes[z]);
33080
33098
  this.pivotNodes = {};
33081
33099
  },
33082
33100
  isEmpty: function () {
@@ -34049,9 +34067,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34049
34067
  options
34050
34068
  } = this;
34051
34069
  if (!options.cellViewNamespace) {
34052
- /* eslint-disable no-undef */
34070
+ // eslint-disable-next-line no-undef
34053
34071
  options.cellViewNamespace = typeof joint !== 'undefined' && has(joint, 'shapes') ? joint.shapes : null;
34054
- /* eslint-enable no-undef */
34055
34072
  }
34056
34073
  const defaultLayerViewNamespace = {
34057
34074
  LayerView,
@@ -34115,6 +34132,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34115
34132
  var position = opt.position;
34116
34133
  if (this.isAsync() || !isNumber(position)) {
34117
34134
  this.renderView(cell, opt);
34135
+ // Wake up the paper in case it was idle
34136
+ // When using initializeUnmounted: true the paper won't wake up by itself
34137
+ this.wakeUp();
34118
34138
  } else {
34119
34139
  if (opt.maxPosition === position) this.freeze({
34120
34140
  key: 'addCells'
@@ -34260,11 +34280,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34260
34280
  } = options;
34261
34281
 
34262
34282
  // Default cellView namespace for ES5
34263
- /* eslint-disable no-undef */
34283
+ // eslint-disable-next-line no-undef
34264
34284
  if (!cellViewNamespace && typeof joint !== 'undefined' && has(joint, 'shapes')) {
34285
+ // eslint-disable-next-line no-undef
34265
34286
  options.cellViewNamespace = joint.shapes;
34266
34287
  }
34267
- /* eslint-enable no-undef */
34268
34288
 
34269
34289
  // Here if a function was provided, we can not clone it, as this would result in loosing the function.
34270
34290
  // If the default is used, the cloning is necessary in order to prevent modifying the options on prototype.
@@ -34492,8 +34512,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34492
34512
  * Helper method for addLayerView and moveLayerView methods
34493
34513
  */
34494
34514
  _getBeforeLayerViewFromOptions(layerView, options) {
34515
+ const {
34516
+ before = null
34517
+ } = options;
34495
34518
  let {
34496
- before = null,
34497
34519
  index
34498
34520
  } = options;
34499
34521
  if (before && index !== undefined) {
@@ -34939,7 +34961,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
34939
34961
  delete prevPriorityUpdates[cid];
34940
34962
  }
34941
34963
  }
34942
- let currentType = priorityUpdates[cid] || 0;
34964
+ const currentType = priorityUpdates[cid] || 0;
34943
34965
  // Prevent cycling
34944
34966
  if ((currentType & type) === type) return;
34945
34967
  if (!currentType) updates.count++;
@@ -35085,7 +35107,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
35085
35107
  let i = priorityIndexes.length;
35086
35108
  while (i > 0 && i--) {
35087
35109
  // a faster way how to check if an object is empty
35088
- for (let _key in priorities[priorityIndexes[i]]) return true;
35110
+ for (const _key in priorities[priorityIndexes[i]]) return true;
35089
35111
  }
35090
35112
  return false;
35091
35113
  },
@@ -35404,10 +35426,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
35404
35426
  var updates = this._updates;
35405
35427
  var unmountedList = updates.unmountedList;
35406
35428
  for (var i = 0, n = Math.min(unmountedList.length, batchSize); i < n; i++) {
35429
+ // stop if there are no more unmounted views
35430
+ // this can happen when another view was mounted in the onViewUpdate() callback
35431
+ if (unmountedList.length === 0) break;
35407
35432
  const {
35408
35433
  key: cid
35409
35434
  } = unmountedList.peekHead();
35410
- let view = views[cid] || this._viewPlaceholders[cid];
35435
+ const view = views[cid] || this._viewPlaceholders[cid];
35411
35436
  if (!view) {
35412
35437
  // This should not occur
35413
35438
  // Prevent looping over this invalid cid
@@ -35642,8 +35667,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
35642
35667
  width: currentWidth,
35643
35668
  height: currentHeight
35644
35669
  } = options;
35645
- let w = width === undefined ? currentWidth : width;
35646
- let h = height === undefined ? currentHeight : height;
35670
+ const w = width === undefined ? currentWidth : width;
35671
+ const h = height === undefined ? currentHeight : height;
35647
35672
  if (currentWidth === w && currentHeight === h) return;
35648
35673
  options.width = w;
35649
35674
  options.height = h;
@@ -36517,7 +36542,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
36517
36542
 
36518
36543
  resolveHighlighter: function (opt = {}) {
36519
36544
  let {
36520
- highlighter: highlighterDef,
36545
+ highlighter: highlighterDef
36546
+ } = opt;
36547
+ const {
36521
36548
  type
36522
36549
  } = opt;
36523
36550
  const {
@@ -38266,7 +38293,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
38266
38293
  const isSingleVertex = data.originalVertices.length === 1;
38267
38294
  const origVIndex = isSingleVertex ? 0 : handleIndex;
38268
38295
  const additionalOffset = data.firstHandleShifted && !isSingleVertex ? 1 : 0;
38269
- let nextVIndex = 1 + indexOffset;
38296
+ const nextVIndex = 1 + indexOffset;
38270
38297
  vertices.splice(handleIndex + nextVIndex, 0, data.originalVertices[origVIndex - additionalOffset]);
38271
38298
  }
38272
38299
  }
@@ -38868,7 +38895,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
38868
38895
  } = this;
38869
38896
  handleNode.setAttribute('transform', this.getHandleTransformString());
38870
38897
  if (handleAttributes) {
38871
- for (let attrName in handleAttributes) {
38898
+ for (const attrName in handleAttributes) {
38872
38899
  handleNode.setAttribute(attrName, handleAttributes[attrName]);
38873
38900
  }
38874
38901
  }
@@ -39066,7 +39093,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
39066
39093
  const labelPosition = this.getLabelPosition(label);
39067
39094
  const coords = view.getLabelCoordinates(labelPosition);
39068
39095
  let {
39069
- angle = 0,
39096
+ angle = 0
39097
+ } = labelPosition;
39098
+ const {
39070
39099
  args = {}
39071
39100
  } = labelPosition;
39072
39101
  const keepGradient = args.keepGradient;
@@ -39148,15 +39177,18 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
39148
39177
  const {
39149
39178
  relatedView: view
39150
39179
  } = this;
39180
+ const toolOptions = getToolOptions(this);
39151
39181
  let {
39152
39182
  x = 0,
39153
- y = 0,
39154
- offset = {},
39183
+ y = 0
39184
+ } = toolOptions;
39185
+ const {
39155
39186
  useModelGeometry,
39187
+ offset = {},
39156
39188
  rotate,
39157
39189
  scale,
39158
39190
  relative
39159
- } = getToolOptions(this);
39191
+ } = toolOptions;
39160
39192
  let bbox = getViewBBox(view, {
39161
39193
  useModelGeometry,
39162
39194
  relative
@@ -39594,11 +39626,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
39594
39626
  const {
39595
39627
  relatedView: view
39596
39628
  } = this;
39597
- let {
39629
+ const {
39598
39630
  useModelGeometry,
39599
39631
  relative,
39600
- trackPath = 'M 0 0 H calc(w) V calc(h) H 0 Z'
39632
+ trackPath: initialTrackPath = 'M 0 0 H calc(w) V calc(h) H 0 Z'
39601
39633
  } = getToolOptions(this);
39634
+ let trackPath = initialTrackPath;
39602
39635
  if (typeof trackPath === 'function') {
39603
39636
  trackPath = trackPath.call(this, view);
39604
39637
  }
@@ -39619,7 +39652,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
39619
39652
  const {
39620
39653
  relatedView: view
39621
39654
  } = this;
39622
- let {
39655
+ const {
39623
39656
  useModelGeometry,
39624
39657
  rotate
39625
39658
  } = getToolOptions(this);
@@ -39645,7 +39678,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
39645
39678
  Remove: Remove
39646
39679
  };
39647
39680
 
39648
- var version = "4.2.1";
39681
+ var version = "4.2.3";
39649
39682
 
39650
39683
  const Vectorizer = V;
39651
39684
  const layout$1 = {