@joint/core 4.1.2 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
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
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
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
package/dist/joint.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
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
@@ -1693,6 +1693,8 @@ export declare namespace dia {
1693
1693
 
1694
1694
  protected dragMagnetEnd(evt: dia.Event, x: number, y: number): void;
1695
1695
 
1696
+ protected snapToGrid(evt: dia.Event, x: number, y: number): dia.Point;
1697
+
1696
1698
  protected prepareEmbedding(data: any): void;
1697
1699
 
1698
1700
  protected processEmbedding(data: any, evt: dia.Event, x: number, y: number): void;
package/dist/joint.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! JointJS v4.1.2 (2025-01-16) - JavaScript diagramming library
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
@@ -12079,8 +12079,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
12079
12079
  const isStaticallyPositioned = el => {
12080
12080
  const {
12081
12081
  position
12082
- } = el.style;
12083
- return !position || position === 'static';
12082
+ } = getComputedStyle(el);
12083
+ return position === 'static';
12084
12084
  };
12085
12085
  while (offsetParent && offsetParent !== doc.documentElement && isStaticallyPositioned(offsetParent)) {
12086
12086
  offsetParent = offsetParent.offsetParent || doc.documentElement;
@@ -29168,9 +29168,15 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
29168
29168
  },
29169
29169
  // Drag Handlers
29170
29170
 
29171
+ snapToGrid: function (evt, x, y) {
29172
+ const grid = this.paper.options.gridSize;
29173
+ return {
29174
+ x: snapToGrid(x, grid),
29175
+ y: snapToGrid(y, grid)
29176
+ };
29177
+ },
29171
29178
  drag: function (evt, x, y) {
29172
29179
  var paper = this.paper;
29173
- var grid = paper.options.gridSize;
29174
29180
  var element = this.model;
29175
29181
  var data = this.eventData(evt);
29176
29182
  var {
@@ -29180,8 +29186,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
29180
29186
  } = data;
29181
29187
 
29182
29188
  // Make sure the new element's position always snaps to the current grid
29183
- var elX = snapToGrid(x + pointerOffset.x, grid);
29184
- var elY = snapToGrid(y + pointerOffset.y, grid);
29189
+ const {
29190
+ x: elX,
29191
+ y: elY
29192
+ } = this.snapToGrid(evt, x + pointerOffset.x, y + pointerOffset.y);
29185
29193
  element.position(elX, elY, {
29186
29194
  restrictedArea,
29187
29195
  deep: true,
@@ -36516,7 +36524,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
36516
36524
  Control: Control
36517
36525
  });
36518
36526
 
36519
- var version = "4.1.2";
36527
+ var version = "4.1.3";
36520
36528
 
36521
36529
  const Vectorizer = V;
36522
36530
  const layout = {