@joint/core 4.2.0-beta.2 → 4.2.0-beta.4

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.
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.2.0-beta.2 (2025-11-04) - JavaScript diagramming library
1
+ /*! JointJS v4.2.0-beta.4 (2025-11-07) - 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.0-beta.2 (2025-11-04) - JavaScript diagramming library
1
+ /*! JointJS v4.2.0-beta.4 (2025-11-07) - 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/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- var version = "4.2.0-beta.2";
1
+ var version = "4.2.0-beta.4";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joint/core",
3
3
  "title": "JointJS",
4
- "version": "4.2.0-beta.2",
4
+ "version": "4.2.0-beta.4",
5
5
  "description": "JavaScript diagramming library",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/joint.min.js",
@@ -28,7 +28,8 @@ export const LayerView = View.extend({
28
28
  },
29
29
 
30
30
  unsetPaperReference: function() {
31
- this.beforePaperReferenceUnset();
31
+ if (!this.paper) return;
32
+ this.beforePaperReferenceUnset(this.paper);
32
33
  this.paper = null;
33
34
  },
34
35
 
package/src/dia/Paper.mjs CHANGED
@@ -731,6 +731,9 @@ export const Paper = View.extend({
731
731
  const viewLike = this._getCellViewLike(cell);
732
732
  if (!viewLike) return;
733
733
  if (viewLike[CELL_VIEW_PLACEHOLDER_MARKER]) {
734
+ // It's a cell placeholder, it must be in the unmounted list.
735
+ // Remove it from there and unregister.
736
+ this._updates.unmountedList.delete(viewLike.cid);
734
737
  this._unregisterCellViewPlaceholder(viewLike);
735
738
  } else {
736
739
  this.requestViewUpdate(viewLike, this.FLAG_REMOVE, viewLike.UPDATE_PRIORITY, opt);
@@ -1299,7 +1302,7 @@ export const Paper = View.extend({
1299
1302
  const type = modelType + 'View';
1300
1303
 
1301
1304
  // For backward compatibility we use the LegacyGraphLayerView for the default `cells` layer.
1302
- if (this.model.layersController.legacyMode) {
1305
+ if (this.model.legacyMode) {
1303
1306
  viewConstructor = LegacyGraphLayerView;
1304
1307
  } else {
1305
1308
  viewConstructor = this.layerViewNamespace[type] || LayerView;
@@ -1484,17 +1487,21 @@ export const Paper = View.extend({
1484
1487
 
1485
1488
  requestConnectedLinksUpdate: function(view, priority, opt) {
1486
1489
  if (!view || !view[CELL_VIEW_MARKER]) return;
1487
- var model = view.model;
1488
- var links = this.model.getConnectedLinks(model);
1489
- for (var j = 0, n = links.length; j < n; j++) {
1490
- var link = links[j];
1491
- var linkView = this._getCellViewLike(link);
1490
+ const model = view.model;
1491
+ const links = this.model.getConnectedLinks(model);
1492
+ for (let j = 0, n = links.length; j < n; j++) {
1493
+ const link = links[j];
1494
+ const linkView = this._getCellViewLike(link);
1492
1495
  if (!linkView) continue;
1493
1496
  // We do not have to update placeholder views.
1494
1497
  // They will be updated on initial render.
1495
1498
  if (linkView[CELL_VIEW_PLACEHOLDER_MARKER]) continue;
1496
- var nextPriority = Math.max(priority + 1, linkView.UPDATE_PRIORITY);
1497
- this.scheduleViewUpdate(linkView, linkView.getFlag(LinkView.Flags.UPDATE), nextPriority, opt);
1499
+ const flagLabels = [LinkView.Flags.UPDATE];
1500
+ // We need to tell the link view which end requested this update.
1501
+ if (link.getTargetCell() === model) flagLabels.push(LinkView.Flags.TARGET);
1502
+ if (link.getSourceCell() === model) flagLabels.push(LinkView.Flags.SOURCE);
1503
+ const nextPriority = Math.max(priority + 1, linkView.UPDATE_PRIORITY);
1504
+ this.scheduleViewUpdate(linkView, linkView.getFlag(flagLabels), nextPriority, opt);
1498
1505
  }
1499
1506
  },
1500
1507
 
@@ -2027,6 +2034,8 @@ export const Paper = View.extend({
2027
2034
  let view = viewsRegistry[cid] || this._viewPlaceholders[cid];
2028
2035
  if (!view) {
2029
2036
  // This should not occur
2037
+ // Prevent looping over this invalid cid
2038
+ unmountedList.popHead();
2030
2039
  continue;
2031
2040
  }
2032
2041
  if (!this._evalCellVisibility(view, false, visibilityCb)) {
package/types/joint.d.ts CHANGED
@@ -1825,6 +1825,7 @@ export namespace dia {
1825
1825
  'link:snap:disconnect': (linkView: dia.LinkView, evt: dia.Event, prevCellView: dia.CellView, prevCellViewMagnet: SVGElement, arrowhead: dia.LinkEnd) => void;
1826
1826
  // render
1827
1827
  'render:done': (stats: UpdateStats, opt: any) => void;
1828
+ 'render:idle': (opt: Paper.UpdateViewsAsyncOptions) => void;
1828
1829
  // transformations
1829
1830
  'translate': (tx: number, ty: number, data: unknown) => void;
1830
1831
  'scale': (sx: number, sy: number, data: unknown) => void;