@joint/core 4.2.2 → 4.2.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.
Files changed (42) hide show
  1. package/README.md +2 -2
  2. package/dist/geometry.js +1 -1
  3. package/dist/geometry.min.js +1 -1
  4. package/dist/joint.d.ts +4 -3
  5. package/dist/joint.js +133 -89
  6. package/dist/joint.min.js +2 -2
  7. package/dist/joint.nowrap.js +133 -89
  8. package/dist/joint.nowrap.min.js +2 -2
  9. package/dist/vectorizer.js +26 -4
  10. package/dist/vectorizer.min.js +2 -2
  11. package/dist/version.mjs +1 -1
  12. package/package.json +6 -14
  13. package/src/V/transform.mjs +25 -3
  14. package/src/cellTools/Button.mjs +3 -1
  15. package/src/cellTools/Control.mjs +1 -1
  16. package/src/connectionPoints/index.mjs +1 -1
  17. package/src/connectors/curve.mjs +2 -4
  18. package/src/dia/Cell.mjs +5 -6
  19. package/src/dia/Graph.mjs +13 -13
  20. package/src/dia/GraphLayerCollection.mjs +2 -3
  21. package/src/dia/HighlighterView.mjs +5 -5
  22. package/src/dia/LayerView.mjs +1 -1
  23. package/src/dia/LinkView.mjs +1 -1
  24. package/src/dia/Paper.mjs +25 -15
  25. package/src/dia/attributes/eval.mjs +1 -1
  26. package/src/dia/ports.mjs +2 -2
  27. package/src/elementTools/HoverConnect.mjs +4 -3
  28. package/src/layout/ports/port.mjs +1 -1
  29. package/src/linkTools/RotateLabel.mjs +2 -1
  30. package/src/linkTools/Segments.mjs +1 -1
  31. package/src/mvc/Dom/Dom.mjs +2 -2
  32. package/src/mvc/Dom/animations.mjs +2 -6
  33. package/src/mvc/Dom/methods.mjs +3 -3
  34. package/src/mvc/Dom/props.mjs +1 -1
  35. package/src/mvc/Listener.mjs +1 -0
  36. package/src/mvc/Model.mjs +3 -1
  37. package/src/routers/rightAngle.mjs +9 -9
  38. package/src/util/calc.mjs +1 -1
  39. package/src/util/util.mjs +2 -4
  40. package/src/util/utilHelpers.mjs +5 -5
  41. package/types/joint.d.ts +5 -4
  42. package/types/vectorizer.d.ts +1 -1
package/src/util/calc.mjs CHANGED
@@ -104,7 +104,7 @@ export function evalCalcExpression(expression, rect) {
104
104
  let value = expression;
105
105
  let startSearchIndex = 0;
106
106
  do {
107
- let calcIndex = value.indexOf(calcStart, startSearchIndex);
107
+ const calcIndex = value.indexOf(calcStart, startSearchIndex);
108
108
  if (calcIndex === -1) return value;
109
109
  let calcEndIndex = calcIndex + calcStartOffset;
110
110
  let brackets = 1;
package/src/util/util.mjs CHANGED
@@ -97,11 +97,9 @@ export const parseDOMJSON = function(json, namespace) {
97
97
  if (!nodeDef.hasOwnProperty('tagName')) throw new Error('json-dom-parser: missing tagName');
98
98
  const tagName = nodeDef.tagName;
99
99
 
100
- let node;
101
-
102
100
  // Namespace URI
103
101
  const ns = (nodeDef.hasOwnProperty('namespaceURI')) ? nodeDef.namespaceURI : parentNS;
104
- node = document.createElementNS(ns, tagName);
102
+ const node = document.createElementNS(ns, tagName);
105
103
  const svg = (ns === svgNamespace);
106
104
 
107
105
  const wrapperNode = (svg) ? V(node) : $(node);
@@ -316,7 +314,7 @@ export const normalizeEvent = function(evt) {
316
314
  // If the event is a touch event, normalize it to a mouse event.
317
315
  const touch = originalEvent && originalEvent.changedTouches && originalEvent.changedTouches[0];
318
316
  if (touch) {
319
- for (let property in touch) {
317
+ for (const property in touch) {
320
318
  // copy all the properties from the first touch that are not
321
319
  // defined on TouchEvent (clientX, clientY, pageX, pageY, screenX, screenY, identifier, ...)
322
320
  if (evt[property] === undefined) {
@@ -315,7 +315,7 @@ const isSymbol = (value) => {
315
315
 
316
316
  const initCloneArray = (array) => {
317
317
  const length = array.length;
318
- let result = new array.constructor(length);
318
+ const result = new array.constructor(length);
319
319
 
320
320
  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
321
321
  result.index = array.index;
@@ -538,7 +538,7 @@ const baseIsEqual = (value, other, stack) => {
538
538
  };
539
539
 
540
540
  const baseIsEqualDeep = (object, other, equalFunc, stack) => {
541
- let objIsArr = Array.isArray(object);
541
+ const objIsArr = Array.isArray(object);
542
542
  const othIsArr = Array.isArray(other);
543
543
  let objTag = objIsArr ? arrayTag : getTag(object);
544
544
  let othTag = othIsArr ? arrayTag : getTag(other);
@@ -546,7 +546,7 @@ const baseIsEqualDeep = (object, other, equalFunc, stack) => {
546
546
  objTag = objTag == argsTag ? objectTag : objTag;
547
547
  othTag = othTag == argsTag ? objectTag : othTag;
548
548
 
549
- let objIsObj = objTag == objectTag;
549
+ const objIsObj = objTag == objectTag;
550
550
  const othIsObj = othTag == objectTag;
551
551
  const isSameTag = objTag == othTag;
552
552
 
@@ -710,7 +710,7 @@ const equalByTag = (object, other, tag, equalFunc, stack) => {
710
710
 
711
711
  const mapToArray = (map) => {
712
712
  let index = -1;
713
- let result = Array(map.size);
713
+ const result = Array(map.size);
714
714
 
715
715
  map.forEach((value, key) => {
716
716
  result[++index] = [key, value];
@@ -852,7 +852,7 @@ const diff = (array, values) => {
852
852
  }
853
853
 
854
854
  outer:
855
- for (let key in array) {
855
+ for (const key in array) {
856
856
  let value = array[key];
857
857
  const computed = value;
858
858
 
package/types/joint.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { g } from './geometry';
2
- import { Vectorizer } from './vectorizer';
1
+ import type { g } from './geometry';
2
+ import type { Vectorizer } from './vectorizer';
3
3
 
4
4
  export const version: string;
5
5
 
@@ -1668,8 +1668,8 @@ export namespace dia {
1668
1668
  moveThreshold?: number;
1669
1669
  magnetThreshold?: number | string;
1670
1670
  // views
1671
- elementView?: typeof ElementView | ((element: Element) => typeof ElementView);
1672
- linkView?: typeof LinkView | ((link: Link) => typeof LinkView);
1671
+ elementView?: typeof ElementView<any> | ((element: Element) => typeof ElementView<any> | null | undefined);
1672
+ linkView?: typeof LinkView<any> | ((link: Link) => typeof LinkView<any> | null | undefined);
1673
1673
  measureNode?: MeasureNodeCallback;
1674
1674
  // embedding
1675
1675
  embeddingMode?: boolean;
@@ -3241,6 +3241,7 @@ export namespace util {
3241
3241
 
3242
3242
  export function toArray(value: any): any[];
3243
3243
 
3244
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
3244
3245
  export function debounce<T extends Function>(func: T, wait?: number, options?: { leading?: boolean, maxWait?: number, trailing?: boolean }): T & Cancelable;
3245
3246
 
3246
3247
  export function groupBy(collection: Collection, iteratee?: IterateeFunction<any>): object;
@@ -1,4 +1,4 @@
1
- import { g } from './geometry';
1
+ import type { g } from './geometry';
2
2
 
3
3
  export const V: VCallable;
4
4
  export type V = VElement;