@xyflow/system 0.0.51 → 0.0.53
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/esm/constants.d.ts +1 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/index.js +117 -11
- package/dist/esm/index.mjs +117 -11
- package/dist/esm/types/general.d.ts +14 -4
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/utils/general.d.ts +4 -4
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/esm/utils/graph.d.ts +1 -2
- package/dist/esm/utils/graph.d.ts.map +1 -1
- package/dist/esm/utils/store.d.ts +1 -1
- package/dist/esm/utils/store.d.ts.map +1 -1
- package/dist/umd/constants.d.ts +1 -0
- package/dist/umd/constants.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types/general.d.ts +14 -4
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/utils/general.d.ts +4 -4
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/dist/umd/utils/graph.d.ts +1 -2
- package/dist/umd/utils/graph.d.ts.map +1 -1
- package/dist/umd/utils/store.d.ts +1 -1
- package/dist/umd/utils/store.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/esm/constants.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare const errorMessages: {
|
|
|
18
18
|
error012: (id: string) => string;
|
|
19
19
|
error013: (lib?: string) => string;
|
|
20
20
|
error014: () => string;
|
|
21
|
+
error015: () => string;
|
|
21
22
|
};
|
|
22
23
|
export declare const infiniteExtent: CoordinateExtent;
|
|
23
24
|
export declare const elementSelectionKeys: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU,sCACc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;yBAMzF,MAAM;mBACZ,MAAM;qBAEL,MAAM;;;CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -17,6 +17,7 @@ const errorMessages = {
|
|
|
17
17
|
error012: (id) => `Node with id "${id}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
|
|
18
18
|
error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,
|
|
19
19
|
error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',
|
|
20
|
+
error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',
|
|
20
21
|
};
|
|
21
22
|
const infiniteExtent = [
|
|
22
23
|
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
|
@@ -406,11 +407,12 @@ function getFitViewNodes(nodeLookup, options) {
|
|
|
406
407
|
});
|
|
407
408
|
return fitViewNodes;
|
|
408
409
|
}
|
|
409
|
-
async function
|
|
410
|
+
async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {
|
|
410
411
|
if (nodes.size === 0) {
|
|
411
|
-
return Promise.resolve(
|
|
412
|
+
return Promise.resolve(true);
|
|
412
413
|
}
|
|
413
|
-
const
|
|
414
|
+
const nodesToFit = getFitViewNodes(nodes, options);
|
|
415
|
+
const bounds = getInternalNodesBounds(nodesToFit);
|
|
414
416
|
const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);
|
|
415
417
|
await panZoom.setViewport(viewport, { duration: options?.duration });
|
|
416
418
|
return Promise.resolve(true);
|
|
@@ -451,10 +453,13 @@ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin =
|
|
|
451
453
|
const positionAbsolute = isCoordinateExtent(extent)
|
|
452
454
|
? clampPosition(nextPosition, extent, node.measured)
|
|
453
455
|
: nextPosition;
|
|
456
|
+
if (node.measured.width === undefined || node.measured.height === undefined) {
|
|
457
|
+
onError?.('015', errorMessages['error015']());
|
|
458
|
+
}
|
|
454
459
|
return {
|
|
455
460
|
position: {
|
|
456
|
-
x: positionAbsolute.x - parentX + node.measured.width * origin[0],
|
|
457
|
-
y: positionAbsolute.y - parentY + node.measured.height * origin[1],
|
|
461
|
+
x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],
|
|
462
|
+
y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],
|
|
458
463
|
},
|
|
459
464
|
positionAbsolute,
|
|
460
465
|
};
|
|
@@ -618,6 +623,85 @@ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
|
618
623
|
y: y * tScale + ty,
|
|
619
624
|
};
|
|
620
625
|
};
|
|
626
|
+
/**
|
|
627
|
+
* Parses a single padding value to a number
|
|
628
|
+
* @internal
|
|
629
|
+
* @param padding - Padding to parse
|
|
630
|
+
* @param viewport - Width or height of the viewport
|
|
631
|
+
* @returns The padding in pixels
|
|
632
|
+
*/
|
|
633
|
+
function parsePadding(padding, viewport) {
|
|
634
|
+
if (typeof padding === 'number') {
|
|
635
|
+
return Math.floor(viewport - viewport / (1 + padding));
|
|
636
|
+
}
|
|
637
|
+
if (typeof padding === 'string' && padding.endsWith('px')) {
|
|
638
|
+
const paddingValue = parseFloat(padding);
|
|
639
|
+
if (!Number.isNaN(paddingValue)) {
|
|
640
|
+
return Math.floor(paddingValue);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (typeof padding === 'string' && padding.endsWith('%')) {
|
|
644
|
+
const paddingValue = parseFloat(padding);
|
|
645
|
+
if (!Number.isNaN(paddingValue)) {
|
|
646
|
+
return Math.floor(viewport * paddingValue * 0.01);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`);
|
|
650
|
+
return 0;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Parses the paddings to an object with top, right, bottom, left, x and y paddings
|
|
654
|
+
* @internal
|
|
655
|
+
* @param padding - Padding to parse
|
|
656
|
+
* @param width - Width of the viewport
|
|
657
|
+
* @param height - Height of the viewport
|
|
658
|
+
* @returns An object with the paddings in pixels
|
|
659
|
+
*/
|
|
660
|
+
function parsePaddings(padding, width, height) {
|
|
661
|
+
if (typeof padding === 'string' || typeof padding === 'number') {
|
|
662
|
+
const paddingY = parsePadding(padding, height);
|
|
663
|
+
const paddingX = parsePadding(padding, width);
|
|
664
|
+
return {
|
|
665
|
+
top: paddingY,
|
|
666
|
+
right: paddingX,
|
|
667
|
+
bottom: paddingY,
|
|
668
|
+
left: paddingX,
|
|
669
|
+
x: paddingX * 2,
|
|
670
|
+
y: paddingY * 2,
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
if (typeof padding === 'object') {
|
|
674
|
+
const top = parsePadding(padding.top ?? padding.y ?? 0, height);
|
|
675
|
+
const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);
|
|
676
|
+
const left = parsePadding(padding.left ?? padding.x ?? 0, width);
|
|
677
|
+
const right = parsePadding(padding.right ?? padding.x ?? 0, width);
|
|
678
|
+
return { top, right, bottom, left, x: left + right, y: top + bottom };
|
|
679
|
+
}
|
|
680
|
+
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Calculates the resulting paddings if the new viewport is applied
|
|
684
|
+
* @internal
|
|
685
|
+
* @param bounds - Bounds to fit inside viewport
|
|
686
|
+
* @param x - X position of the viewport
|
|
687
|
+
* @param y - Y position of the viewport
|
|
688
|
+
* @param zoom - Zoom level of the viewport
|
|
689
|
+
* @param width - Width of the viewport
|
|
690
|
+
* @param height - Height of the viewport
|
|
691
|
+
* @returns An object with the minimum padding required to fit the bounds inside the viewport
|
|
692
|
+
*/
|
|
693
|
+
function calculateAppliedPaddings(bounds, x, y, zoom, width, height) {
|
|
694
|
+
const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);
|
|
695
|
+
const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);
|
|
696
|
+
const right = width - boundRight;
|
|
697
|
+
const bottom = height - boundBottom;
|
|
698
|
+
return {
|
|
699
|
+
left: Math.floor(left),
|
|
700
|
+
top: Math.floor(top),
|
|
701
|
+
right: Math.floor(right),
|
|
702
|
+
bottom: Math.floor(bottom),
|
|
703
|
+
};
|
|
704
|
+
}
|
|
621
705
|
/**
|
|
622
706
|
* Returns a viewport that encloses the given bounds with optional padding.
|
|
623
707
|
* @public
|
|
@@ -631,19 +715,35 @@ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
|
631
715
|
* @returns A transforned {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}
|
|
632
716
|
* @example
|
|
633
717
|
* const { x, y, zoom } = getViewportForBounds(
|
|
634
|
-
*{ x: 0, y: 0, width: 100, height: 100},
|
|
635
|
-
*1200, 800, 0.5, 2);
|
|
718
|
+
* { x: 0, y: 0, width: 100, height: 100},
|
|
719
|
+
* 1200, 800, 0.5, 2);
|
|
636
720
|
*/
|
|
637
721
|
const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
|
|
638
|
-
|
|
639
|
-
const
|
|
722
|
+
// First we resolve all the paddings to actual pixel values
|
|
723
|
+
const p = parsePaddings(padding, width, height);
|
|
724
|
+
const xZoom = (width - p.x) / bounds.width;
|
|
725
|
+
const yZoom = (height - p.y) / bounds.height;
|
|
726
|
+
// We calculate the new x, y, zoom for a centered view
|
|
640
727
|
const zoom = Math.min(xZoom, yZoom);
|
|
641
728
|
const clampedZoom = clamp(zoom, minZoom, maxZoom);
|
|
642
729
|
const boundsCenterX = bounds.x + bounds.width / 2;
|
|
643
730
|
const boundsCenterY = bounds.y + bounds.height / 2;
|
|
644
731
|
const x = width / 2 - boundsCenterX * clampedZoom;
|
|
645
732
|
const y = height / 2 - boundsCenterY * clampedZoom;
|
|
646
|
-
|
|
733
|
+
// Then we calculate the minimum padding, to respect asymmetric paddings
|
|
734
|
+
const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);
|
|
735
|
+
// We only want to have an offset if the newPadding is smaller than the required padding
|
|
736
|
+
const offset = {
|
|
737
|
+
left: Math.min(newPadding.left - p.left, 0),
|
|
738
|
+
top: Math.min(newPadding.top - p.top, 0),
|
|
739
|
+
right: Math.min(newPadding.right - p.right, 0),
|
|
740
|
+
bottom: Math.min(newPadding.bottom - p.bottom, 0),
|
|
741
|
+
};
|
|
742
|
+
return {
|
|
743
|
+
x: x - offset.left + offset.right,
|
|
744
|
+
y: y - offset.top + offset.bottom,
|
|
745
|
+
zoom: clampedZoom,
|
|
746
|
+
};
|
|
647
747
|
};
|
|
648
748
|
const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
|
|
649
749
|
function isCoordinateExtent(extent) {
|
|
@@ -1387,6 +1487,7 @@ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
|
|
|
1387
1487
|
}
|
|
1388
1488
|
function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
1389
1489
|
const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
|
|
1490
|
+
let nodesInitialized = true;
|
|
1390
1491
|
const tmpLookup = new Map(nodeLookup);
|
|
1391
1492
|
const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0;
|
|
1392
1493
|
nodeLookup.clear();
|
|
@@ -1417,10 +1518,15 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
|
1417
1518
|
};
|
|
1418
1519
|
nodeLookup.set(userNode.id, internalNode);
|
|
1419
1520
|
}
|
|
1521
|
+
if ((!internalNode.measured || !internalNode.measured.width || !internalNode.measured.height) &&
|
|
1522
|
+
!internalNode.hidden) {
|
|
1523
|
+
nodesInitialized = false;
|
|
1524
|
+
}
|
|
1420
1525
|
if (userNode.parentId) {
|
|
1421
1526
|
updateChildNode(internalNode, nodeLookup, parentLookup, options);
|
|
1422
1527
|
}
|
|
1423
1528
|
}
|
|
1529
|
+
return nodesInitialized;
|
|
1424
1530
|
}
|
|
1425
1531
|
function updateParentLookup(node, parentLookup) {
|
|
1426
1532
|
if (!node.parentId) {
|
|
@@ -3182,4 +3288,4 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
3182
3288
|
};
|
|
3183
3289
|
}
|
|
3184
3290
|
|
|
3185
|
-
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition,
|
|
3291
|
+
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -17,6 +17,7 @@ const errorMessages = {
|
|
|
17
17
|
error012: (id) => `Node with id "${id}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
|
|
18
18
|
error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,
|
|
19
19
|
error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',
|
|
20
|
+
error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',
|
|
20
21
|
};
|
|
21
22
|
const infiniteExtent = [
|
|
22
23
|
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
|
@@ -406,11 +407,12 @@ function getFitViewNodes(nodeLookup, options) {
|
|
|
406
407
|
});
|
|
407
408
|
return fitViewNodes;
|
|
408
409
|
}
|
|
409
|
-
async function
|
|
410
|
+
async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {
|
|
410
411
|
if (nodes.size === 0) {
|
|
411
|
-
return Promise.resolve(
|
|
412
|
+
return Promise.resolve(true);
|
|
412
413
|
}
|
|
413
|
-
const
|
|
414
|
+
const nodesToFit = getFitViewNodes(nodes, options);
|
|
415
|
+
const bounds = getInternalNodesBounds(nodesToFit);
|
|
414
416
|
const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);
|
|
415
417
|
await panZoom.setViewport(viewport, { duration: options?.duration });
|
|
416
418
|
return Promise.resolve(true);
|
|
@@ -451,10 +453,13 @@ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin =
|
|
|
451
453
|
const positionAbsolute = isCoordinateExtent(extent)
|
|
452
454
|
? clampPosition(nextPosition, extent, node.measured)
|
|
453
455
|
: nextPosition;
|
|
456
|
+
if (node.measured.width === undefined || node.measured.height === undefined) {
|
|
457
|
+
onError?.('015', errorMessages['error015']());
|
|
458
|
+
}
|
|
454
459
|
return {
|
|
455
460
|
position: {
|
|
456
|
-
x: positionAbsolute.x - parentX + node.measured.width * origin[0],
|
|
457
|
-
y: positionAbsolute.y - parentY + node.measured.height * origin[1],
|
|
461
|
+
x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],
|
|
462
|
+
y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],
|
|
458
463
|
},
|
|
459
464
|
positionAbsolute,
|
|
460
465
|
};
|
|
@@ -618,6 +623,85 @@ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
|
618
623
|
y: y * tScale + ty,
|
|
619
624
|
};
|
|
620
625
|
};
|
|
626
|
+
/**
|
|
627
|
+
* Parses a single padding value to a number
|
|
628
|
+
* @internal
|
|
629
|
+
* @param padding - Padding to parse
|
|
630
|
+
* @param viewport - Width or height of the viewport
|
|
631
|
+
* @returns The padding in pixels
|
|
632
|
+
*/
|
|
633
|
+
function parsePadding(padding, viewport) {
|
|
634
|
+
if (typeof padding === 'number') {
|
|
635
|
+
return Math.floor(viewport - viewport / (1 + padding));
|
|
636
|
+
}
|
|
637
|
+
if (typeof padding === 'string' && padding.endsWith('px')) {
|
|
638
|
+
const paddingValue = parseFloat(padding);
|
|
639
|
+
if (!Number.isNaN(paddingValue)) {
|
|
640
|
+
return Math.floor(paddingValue);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (typeof padding === 'string' && padding.endsWith('%')) {
|
|
644
|
+
const paddingValue = parseFloat(padding);
|
|
645
|
+
if (!Number.isNaN(paddingValue)) {
|
|
646
|
+
return Math.floor(viewport * paddingValue * 0.01);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`);
|
|
650
|
+
return 0;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Parses the paddings to an object with top, right, bottom, left, x and y paddings
|
|
654
|
+
* @internal
|
|
655
|
+
* @param padding - Padding to parse
|
|
656
|
+
* @param width - Width of the viewport
|
|
657
|
+
* @param height - Height of the viewport
|
|
658
|
+
* @returns An object with the paddings in pixels
|
|
659
|
+
*/
|
|
660
|
+
function parsePaddings(padding, width, height) {
|
|
661
|
+
if (typeof padding === 'string' || typeof padding === 'number') {
|
|
662
|
+
const paddingY = parsePadding(padding, height);
|
|
663
|
+
const paddingX = parsePadding(padding, width);
|
|
664
|
+
return {
|
|
665
|
+
top: paddingY,
|
|
666
|
+
right: paddingX,
|
|
667
|
+
bottom: paddingY,
|
|
668
|
+
left: paddingX,
|
|
669
|
+
x: paddingX * 2,
|
|
670
|
+
y: paddingY * 2,
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
if (typeof padding === 'object') {
|
|
674
|
+
const top = parsePadding(padding.top ?? padding.y ?? 0, height);
|
|
675
|
+
const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);
|
|
676
|
+
const left = parsePadding(padding.left ?? padding.x ?? 0, width);
|
|
677
|
+
const right = parsePadding(padding.right ?? padding.x ?? 0, width);
|
|
678
|
+
return { top, right, bottom, left, x: left + right, y: top + bottom };
|
|
679
|
+
}
|
|
680
|
+
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Calculates the resulting paddings if the new viewport is applied
|
|
684
|
+
* @internal
|
|
685
|
+
* @param bounds - Bounds to fit inside viewport
|
|
686
|
+
* @param x - X position of the viewport
|
|
687
|
+
* @param y - Y position of the viewport
|
|
688
|
+
* @param zoom - Zoom level of the viewport
|
|
689
|
+
* @param width - Width of the viewport
|
|
690
|
+
* @param height - Height of the viewport
|
|
691
|
+
* @returns An object with the minimum padding required to fit the bounds inside the viewport
|
|
692
|
+
*/
|
|
693
|
+
function calculateAppliedPaddings(bounds, x, y, zoom, width, height) {
|
|
694
|
+
const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);
|
|
695
|
+
const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);
|
|
696
|
+
const right = width - boundRight;
|
|
697
|
+
const bottom = height - boundBottom;
|
|
698
|
+
return {
|
|
699
|
+
left: Math.floor(left),
|
|
700
|
+
top: Math.floor(top),
|
|
701
|
+
right: Math.floor(right),
|
|
702
|
+
bottom: Math.floor(bottom),
|
|
703
|
+
};
|
|
704
|
+
}
|
|
621
705
|
/**
|
|
622
706
|
* Returns a viewport that encloses the given bounds with optional padding.
|
|
623
707
|
* @public
|
|
@@ -631,19 +715,35 @@ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
|
631
715
|
* @returns A transforned {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}
|
|
632
716
|
* @example
|
|
633
717
|
* const { x, y, zoom } = getViewportForBounds(
|
|
634
|
-
*{ x: 0, y: 0, width: 100, height: 100},
|
|
635
|
-
*1200, 800, 0.5, 2);
|
|
718
|
+
* { x: 0, y: 0, width: 100, height: 100},
|
|
719
|
+
* 1200, 800, 0.5, 2);
|
|
636
720
|
*/
|
|
637
721
|
const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
|
|
638
|
-
|
|
639
|
-
const
|
|
722
|
+
// First we resolve all the paddings to actual pixel values
|
|
723
|
+
const p = parsePaddings(padding, width, height);
|
|
724
|
+
const xZoom = (width - p.x) / bounds.width;
|
|
725
|
+
const yZoom = (height - p.y) / bounds.height;
|
|
726
|
+
// We calculate the new x, y, zoom for a centered view
|
|
640
727
|
const zoom = Math.min(xZoom, yZoom);
|
|
641
728
|
const clampedZoom = clamp(zoom, minZoom, maxZoom);
|
|
642
729
|
const boundsCenterX = bounds.x + bounds.width / 2;
|
|
643
730
|
const boundsCenterY = bounds.y + bounds.height / 2;
|
|
644
731
|
const x = width / 2 - boundsCenterX * clampedZoom;
|
|
645
732
|
const y = height / 2 - boundsCenterY * clampedZoom;
|
|
646
|
-
|
|
733
|
+
// Then we calculate the minimum padding, to respect asymmetric paddings
|
|
734
|
+
const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);
|
|
735
|
+
// We only want to have an offset if the newPadding is smaller than the required padding
|
|
736
|
+
const offset = {
|
|
737
|
+
left: Math.min(newPadding.left - p.left, 0),
|
|
738
|
+
top: Math.min(newPadding.top - p.top, 0),
|
|
739
|
+
right: Math.min(newPadding.right - p.right, 0),
|
|
740
|
+
bottom: Math.min(newPadding.bottom - p.bottom, 0),
|
|
741
|
+
};
|
|
742
|
+
return {
|
|
743
|
+
x: x - offset.left + offset.right,
|
|
744
|
+
y: y - offset.top + offset.bottom,
|
|
745
|
+
zoom: clampedZoom,
|
|
746
|
+
};
|
|
647
747
|
};
|
|
648
748
|
const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
|
|
649
749
|
function isCoordinateExtent(extent) {
|
|
@@ -1387,6 +1487,7 @@ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
|
|
|
1387
1487
|
}
|
|
1388
1488
|
function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
1389
1489
|
const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
|
|
1490
|
+
let nodesInitialized = true;
|
|
1390
1491
|
const tmpLookup = new Map(nodeLookup);
|
|
1391
1492
|
const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0;
|
|
1392
1493
|
nodeLookup.clear();
|
|
@@ -1417,10 +1518,15 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
|
1417
1518
|
};
|
|
1418
1519
|
nodeLookup.set(userNode.id, internalNode);
|
|
1419
1520
|
}
|
|
1521
|
+
if ((!internalNode.measured || !internalNode.measured.width || !internalNode.measured.height) &&
|
|
1522
|
+
!internalNode.hidden) {
|
|
1523
|
+
nodesInitialized = false;
|
|
1524
|
+
}
|
|
1420
1525
|
if (userNode.parentId) {
|
|
1421
1526
|
updateChildNode(internalNode, nodeLookup, parentLookup, options);
|
|
1422
1527
|
}
|
|
1423
1528
|
}
|
|
1529
|
+
return nodesInitialized;
|
|
1424
1530
|
}
|
|
1425
1531
|
function updateParentLookup(node, parentLookup) {
|
|
1426
1532
|
if (!node.parentId) {
|
|
@@ -3182,4 +3288,4 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
3182
3288
|
};
|
|
3183
3289
|
}
|
|
3184
3290
|
|
|
3185
|
-
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition,
|
|
3291
|
+
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals };
|
|
@@ -31,13 +31,13 @@ export type Connection = {
|
|
|
31
31
|
targetHandle: string | null;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* The `HandleConnection` type is an
|
|
34
|
+
* The `HandleConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`.
|
|
35
35
|
*/
|
|
36
36
|
export type HandleConnection = Connection & {
|
|
37
37
|
edgeId: string;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
* The `NodeConnection` type is an
|
|
40
|
+
* The `NodeConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`.
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
43
|
export type NodeConnection = Connection & {
|
|
@@ -74,11 +74,21 @@ export type FitViewParamsBase<NodeType extends NodeBase> = {
|
|
|
74
74
|
minZoom: number;
|
|
75
75
|
maxZoom: number;
|
|
76
76
|
};
|
|
77
|
+
export type PaddingUnit = 'px' | '%';
|
|
78
|
+
export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
|
|
79
|
+
export type Padding = PaddingWithUnit | {
|
|
80
|
+
top?: PaddingWithUnit;
|
|
81
|
+
right?: PaddingWithUnit;
|
|
82
|
+
bottom?: PaddingWithUnit;
|
|
83
|
+
left?: PaddingWithUnit;
|
|
84
|
+
x?: PaddingWithUnit;
|
|
85
|
+
y?: PaddingWithUnit;
|
|
86
|
+
};
|
|
77
87
|
/**
|
|
78
88
|
* @inline
|
|
79
89
|
*/
|
|
80
90
|
export type FitViewOptionsBase<NodeType extends NodeBase = NodeBase> = {
|
|
81
|
-
padding?:
|
|
91
|
+
padding?: Padding;
|
|
82
92
|
includeHiddenNodes?: boolean;
|
|
83
93
|
minZoom?: number;
|
|
84
94
|
maxZoom?: number;
|
|
@@ -143,7 +153,7 @@ export type UpdateNodeInternals = (nodeId: string | string[]) => void;
|
|
|
143
153
|
*
|
|
144
154
|
* @public
|
|
145
155
|
*/
|
|
146
|
-
export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
156
|
+
export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right';
|
|
147
157
|
export type ProOptions = {
|
|
148
158
|
account?: string;
|
|
149
159
|
hideAttribution: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,M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AS,GAAG,cAAc,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,EAC5G,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform, InternalNodeBase, NodeLookup } from '../types';
|
|
1
|
+
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform, InternalNodeBase, NodeLookup, Padding } from '../types';
|
|
2
2
|
import { type Viewport } from '../types';
|
|
3
3
|
export declare const clamp: (val: number, min?: number, max?: number) => number;
|
|
4
4
|
export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent, dimensions: Partial<Dimensions>) => {
|
|
@@ -36,10 +36,10 @@ export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScal
|
|
|
36
36
|
* @returns A transforned {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}
|
|
37
37
|
* @example
|
|
38
38
|
* const { x, y, zoom } = getViewportForBounds(
|
|
39
|
-
*{ x: 0, y: 0, width: 100, height: 100},
|
|
40
|
-
*1200, 800, 0.5, 2);
|
|
39
|
+
* { x: 0, y: 0, width: 100, height: 100},
|
|
40
|
+
* 1200, 800, 0.5, 2);
|
|
41
41
|
*/
|
|
42
|
-
export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding:
|
|
42
|
+
export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: Padding) => Viewport;
|
|
43
43
|
export declare const isMacOs: () => boolean;
|
|
44
44
|
export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent'): extent is CoordinateExtent;
|
|
45
45
|
export declare function getNodeDimensions(node: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,UAAU,
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa,2EAGZ,QAAQ,UAAU,CAAC;;;CAI/B,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAC7D,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,UAAU,EAC3B,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC;;;EAanC;AAoBD,eAAO,MAAM,WAAW,QACjB,UAAU,UACP,UAAU,UACX,MAAM,aACH,MAAM,KACf,MAAM,EAKR,C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;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKpC;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAK/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,UAAU,EACpB,UAAU;;;aAA+D,EACzE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACrB,UAAU,CAWZ;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,WAY1D"}
|
|
@@ -147,8 +147,7 @@ export declare const getNodesInside: <NodeType extends NodeBase = NodeBase>(node
|
|
|
147
147
|
*```
|
|
148
148
|
*/
|
|
149
149
|
export declare const getConnectedEdges: <NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[];
|
|
150
|
-
export declare function
|
|
151
|
-
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom }: Params, options?: Omit<Options, 'nodes' | 'includeHiddenNodes'>): Promise<boolean>;
|
|
150
|
+
export declare function fitViewport<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom }: Params, options?: Omit<Options, 'nodes' | 'includeHiddenNodes'>): Promise<boolean>;
|
|
152
151
|
/**
|
|
153
152
|
* This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.
|
|
154
153
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,kDAAmD,GAAG,wBACd,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,kDAAmD,GAAG,wBACiB,CAAC;AAE/F,eAAO,MAAM,kBAAkB,kEACpB,GAAG,wBACyG,CAAC;AAExH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,qFAChB,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAaV,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,qFAChB,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAYV,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,QAAQ,8BAAoC,UAU3F,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACvE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;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E,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACzD,GAAG,OAAO,CAAC;IACV,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC,CA+CD"}
|
|
@@ -8,7 +8,7 @@ type UpdateNodesOptions<NodeType extends NodeBase> = {
|
|
|
8
8
|
defaults?: Partial<NodeType>;
|
|
9
9
|
checkEquality?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare function adoptUserNodes<NodeType extends NodeBase>(nodes: NodeType[], nodeLookup: NodeLookup<InternalNodeBase<NodeType>>, parentLookup: ParentLookup<InternalNodeBase<NodeType>>, options?: UpdateNodesOptions<NodeType>):
|
|
11
|
+
export declare function adoptUserNodes<NodeType extends NodeBase>(nodes: NodeType[], nodeLookup: NodeLookup<InternalNodeBase<NodeType>>, parentLookup: ParentLookup<InternalNodeBase<NodeType>>, options?: UpdateNodesOptions<NodeType>): boolean;
|
|
12
12
|
export declare function handleExpandParent(children: ParentExpandChild[], nodeLookup: NodeLookup, parentLookup: ParentLookup, nodeOrigin?: NodeOrigin): (NodeDimensionChange | NodePositionChange)[];
|
|
13
13
|
export declare function updateNodeInternals<NodeType extends InternalNodeBase>(updates: Map<string, InternalNodeUpdate>, nodeLookup: NodeLookup<NodeType>, parentLookup: ParentLookup<NodeType>, domNode: HTMLElement | null, nodeOrigin?: NodeOrigin, nodeExtent?: CoordinateExtent): {
|
|
14
14
|
changes: (NodeDimensionChange | NodePositionChange)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,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CAAC,EAChC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,EACpC,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,UAAU,CAAC,EAAE,UAAU,EACvB,UAAU,CAAC,EAAE,gBAAgB,GAC5B;IAAE,OAAO,EAAE,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAgGtF;AAED,wBAAsB,KAAK,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,gBAAgB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnB;AAwCD,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAgBnH"}
|
package/dist/umd/constants.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare const errorMessages: {
|
|
|
18
18
|
error012: (id: string) => string;
|
|
19
19
|
error013: (lib?: string) => string;
|
|
20
20
|
error014: () => string;
|
|
21
|
+
error015: () => string;
|
|
21
22
|
};
|
|
22
23
|
export declare const infiniteExtent: CoordinateExtent;
|
|
23
24
|
export declare const elementSelectionKeys: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU,sCACc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;yBAMzF,MAAM;mBACZ,MAAM;qBAEL,MAAM;;;CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2B,CAAC"}
|