@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 +2 -2
- package/dist/geometry.js +1 -1
- package/dist/geometry.min.js +1 -1
- package/dist/joint.d.ts +6 -4
- package/dist/joint.js +106 -73
- package/dist/joint.min.js +2 -2
- package/dist/joint.nowrap.js +106 -73
- package/dist/joint.nowrap.min.js +2 -2
- package/dist/vectorizer.js +1 -1
- package/dist/vectorizer.min.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +6 -14
- package/src/cellTools/Button.mjs +3 -1
- package/src/cellTools/Control.mjs +1 -1
- package/src/connectionPoints/index.mjs +1 -1
- package/src/connectors/curve.mjs +2 -4
- package/src/dia/Cell.mjs +5 -6
- package/src/dia/Graph.mjs +19 -3
- package/src/dia/GraphLayerCollection.mjs +2 -3
- package/src/dia/HighlighterView.mjs +5 -5
- package/src/dia/LayerView.mjs +1 -1
- package/src/dia/LinkView.mjs +1 -1
- package/src/dia/Paper.mjs +21 -13
- package/src/dia/attributes/eval.mjs +1 -1
- package/src/dia/ports.mjs +2 -2
- package/src/elementTools/HoverConnect.mjs +4 -3
- package/src/layout/ports/port.mjs +1 -1
- package/src/linkTools/RotateLabel.mjs +2 -1
- package/src/linkTools/Segments.mjs +1 -1
- package/src/mvc/Dom/Dom.mjs +2 -2
- package/src/mvc/Dom/animations.mjs +2 -6
- package/src/mvc/Dom/methods.mjs +3 -3
- package/src/mvc/Dom/props.mjs +1 -1
- package/src/mvc/Listener.mjs +1 -0
- package/src/routers/rightAngle.mjs +9 -9
- package/src/util/calc.mjs +1 -1
- package/src/util/util.mjs +2 -4
- package/src/util/utilHelpers.mjs +5 -5
- package/types/joint.d.ts +7 -5
- package/types/vectorizer.d.ts +1 -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 (
|
|
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) {
|
package/src/util/utilHelpers.mjs
CHANGED
|
@@ -315,7 +315,7 @@ const isSymbol = (value) => {
|
|
|
315
315
|
|
|
316
316
|
const initCloneArray = (array) => {
|
|
317
317
|
const length = array.length;
|
|
318
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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
|
|
|
@@ -323,6 +323,7 @@ export namespace dia {
|
|
|
323
323
|
constructor(attributes?: Graph.Attributes, opt?: {
|
|
324
324
|
cellNamespace?: any,
|
|
325
325
|
layerNamespace?: any,
|
|
326
|
+
ignoreLayers?: boolean,
|
|
326
327
|
/** @deprecated use cellNamespace instead */
|
|
327
328
|
cellModel?: typeof Cell
|
|
328
329
|
});
|
|
@@ -551,7 +552,7 @@ export namespace dia {
|
|
|
551
552
|
}
|
|
552
553
|
|
|
553
554
|
interface ExportOptions {
|
|
554
|
-
|
|
555
|
+
ignoreDefaults?: boolean | string[];
|
|
555
556
|
ignoreEmptyAttributes?: boolean;
|
|
556
557
|
}
|
|
557
558
|
|
|
@@ -1667,8 +1668,8 @@ export namespace dia {
|
|
|
1667
1668
|
moveThreshold?: number;
|
|
1668
1669
|
magnetThreshold?: number | string;
|
|
1669
1670
|
// views
|
|
1670
|
-
elementView?: typeof ElementView | ((element: Element) => typeof ElementView);
|
|
1671
|
-
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);
|
|
1672
1673
|
measureNode?: MeasureNodeCallback;
|
|
1673
1674
|
// embedding
|
|
1674
1675
|
embeddingMode?: boolean;
|
|
@@ -3240,6 +3241,7 @@ export namespace util {
|
|
|
3240
3241
|
|
|
3241
3242
|
export function toArray(value: any): any[];
|
|
3242
3243
|
|
|
3244
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
3243
3245
|
export function debounce<T extends Function>(func: T, wait?: number, options?: { leading?: boolean, maxWait?: number, trailing?: boolean }): T & Cancelable;
|
|
3244
3246
|
|
|
3245
3247
|
export function groupBy(collection: Collection, iteratee?: IterateeFunction<any>): object;
|
package/types/vectorizer.d.ts
CHANGED