@likec4/diagram 1.36.1 → 1.37.0
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/bundle/{chunk-DHvr-RGh.js → chunk-DSORWspW.js} +1008 -988
- package/bundle/custom.js +64 -56
- package/bundle/index.js +3539 -3315
- package/dist/LikeC4Diagram.props.d.ts +5 -5
- package/dist/LikeC4Styles.js +17 -15
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/StaticLikeC4Diagram.js +3 -0
- package/dist/base/BaseXYFlow.d.ts +1 -1
- package/dist/base/BaseXYFlow.js +25 -27
- package/dist/base/const.d.ts +4 -4
- package/dist/base/const.js +5 -4
- package/dist/base/primitives/MarkdownBlock.js +4 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +27 -42
- package/dist/base/primitives/compound/CompoundDetailsButton.js +23 -48
- package/dist/base/primitives/compound/CompoundNodeContainer.js +16 -48
- package/dist/base/primitives/compound/CompoundTitle.js +5 -80
- package/dist/base/primitives/compound/actionbtns.css.js +1 -13
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/customNode.d.ts +4 -4
- package/dist/base/primitives/customNode.js +7 -7
- package/dist/base/primitives/edge/EdgeLabel.d.ts +5 -4
- package/dist/base/primitives/edge/EdgeLabel.js +39 -21
- package/dist/base/primitives/edge/EdgeLabelContainer.js +11 -23
- package/dist/base/primitives/edge/edge.css.js +19 -11
- package/dist/base/primitives/element/ElementShape.js +38 -18
- package/dist/base/primitives/element/ElementTags.js +7 -4
- package/dist/base/primitives/element/ElementTitle.js +10 -2
- package/dist/base/types.d.ts +17 -21
- package/dist/bundle/LikeC4View.d.ts +2 -2
- package/dist/bundle/LikeC4View.js +4 -1
- package/dist/bundle/LikeC4View.props.d.ts +2 -2
- package/dist/bundle/ReactLikeC4.d.ts +3 -3
- package/dist/bundle/custom.js +2 -1
- package/dist/bundle/index.js +2 -1
- package/dist/components/Link.js +3 -2
- package/dist/context/ReduceGraphics.js +2 -5
- package/dist/context/RootContainer.js +1 -5
- package/dist/custom/customNodes.d.ts +32 -26
- package/dist/custom/customNodes.js +12 -8
- package/dist/custom/hooks.d.ts +2 -1
- package/dist/custom/index.js +2 -1
- package/dist/globals.css.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useDiagram.d.ts +18 -1
- package/dist/hooks/useDiagram.js +18 -2
- package/dist/hooks/useXYFlow.d.ts +40 -21
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/likec4diagram/DiagramUI.js +5 -2
- package/dist/likec4diagram/DiagramXYFlow.js +9 -9
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +3 -3
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +27 -44
- package/dist/likec4diagram/custom/index.js +3 -3
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +8 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -14
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +2 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +441 -0
- package/dist/likec4diagram/relationship-popover/actor.d.ts +177 -0
- package/dist/likec4diagram/relationship-popover/actor.js +155 -0
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +2 -0
- package/dist/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.js → relationship-popover/styles.css.js} +4 -17
- package/dist/likec4diagram/useLayoutConstraints.js +0 -1
- package/dist/likec4model/useLikeC4ElementsTree.js +1 -1
- package/dist/likec4model/useLikeC4Project.js +15 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +1 -2
- package/dist/navigationpanel/actor.js +1 -2
- package/dist/navigationpanel/controls/NavigationButtons.js +1 -5
- package/dist/navigationpanel/controls/ViewDetailsCard.js +2 -0
- package/dist/overlays/element-details/actor.d.ts +564 -8
- package/dist/overlays/overlay/Overlay.css.d.ts +1 -1
- package/dist/overlays/relationship-details/actor.d.ts +3 -1
- package/dist/overlays/relationship-details/hooks.d.ts +19 -1
- package/dist/overlays/relationship-details/layout-to-xyflow.js +0 -1
- package/dist/overlays/relationship-details/layout.js +1 -2
- package/dist/overlays/relationships-browser/actor.d.ts +26 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +16 -0
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +18 -8
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/state/DiagramActorProvider.js +2 -19
- package/dist/state/assign.js +24 -10
- package/dist/state/diagram-machine.d.ts +149 -474
- package/dist/state/diagram-machine.js +94 -54
- package/dist/state/types.d.ts +1 -1
- package/dist/styles-min.css +1 -1
- package/dist/styles-xyflow.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/roundDpr.d.ts +1 -0
- package/dist/utils/roundDpr.js +20 -0
- package/dist/utils/xyflow.d.ts +0 -1
- package/dist/utils/xyflow.js +1 -7
- package/package.json +11 -10
- package/panda.buildinfo.json +90 -155
- package/src/LikeC4Diagram.props.ts +5 -5
- package/src/LikeC4Styles.tsx +22 -14
- package/src/StaticLikeC4Diagram.tsx +3 -0
- package/src/base/BaseXYFlow.tsx +26 -29
- package/src/base/const.ts +5 -4
- package/src/base/primitives/MarkdownBlock.tsx +6 -1
- package/src/base/primitives/compound/CompoundActionButton.tsx +31 -43
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +26 -48
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +15 -43
- package/src/base/primitives/compound/CompoundTitle.tsx +4 -76
- package/src/base/primitives/compound/actionbtns.css.ts +0 -12
- package/src/base/primitives/customEdge.ts +1 -1
- package/src/base/primitives/customNode.tsx +20 -24
- package/src/base/primitives/edge/EdgeLabel.tsx +23 -8
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +9 -21
- package/src/base/primitives/edge/edge.css.ts +19 -11
- package/src/base/primitives/element/ElementShape.tsx +40 -18
- package/src/base/primitives/element/ElementTags.tsx +7 -4
- package/src/base/primitives/element/ElementTitle.tsx +23 -11
- package/src/base/types.ts +21 -25
- package/src/bundle/LikeC4View.props.ts +2 -2
- package/src/bundle/LikeC4View.tsx +8 -5
- package/src/bundle/ReactLikeC4.tsx +3 -3
- package/src/components/Link.tsx +3 -2
- package/src/context/RootContainer.tsx +1 -5
- package/src/context/TagStylesContext.tsx +2 -0
- package/src/custom/{customNodes.tsx → customNodes.ts} +58 -52
- package/src/custom/hooks.ts +7 -0
- package/src/globals.css +58 -5
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useDiagram.ts +39 -5
- package/src/hooks/useXYFlow.ts +3 -1
- package/src/index.ts +1 -0
- package/src/likec4diagram/DiagramUI.tsx +3 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +9 -11
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +25 -49
- package/src/likec4diagram/custom/index.ts +5 -4
- package/src/likec4diagram/custom/nodes/nodes.tsx +13 -11
- package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +3 -2
- package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +535 -0
- package/src/likec4diagram/relationship-popover/actor.ts +192 -0
- package/src/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.ts → relationship-popover/styles.css.ts} +3 -19
- package/src/likec4diagram/useLayoutConstraints.ts +0 -1
- package/src/likec4model/useLikeC4ElementsTree.ts +1 -1
- package/src/navigationpanel/NavigationPanelDropdown.tsx +1 -2
- package/src/navigationpanel/actor.ts +2 -2
- package/src/navigationpanel/controls/NavigationButtons.tsx +1 -5
- package/src/navigationpanel/controls/ViewDetailsCard.tsx +2 -0
- package/src/overlays/relationship-details/layout-to-xyflow.ts +0 -1
- package/src/overlays/relationship-details/layout.ts +4 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +22 -8
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +0 -1
- package/src/state/DiagramActorProvider.tsx +2 -20
- package/src/state/assign.ts +24 -10
- package/src/state/diagram-machine.ts +101 -53
- package/src/state/types.ts +4 -1
- package/src/utils/index.ts +2 -1
- package/src/utils/roundDpr.ts +27 -0
- package/src/utils/xyflow.ts +0 -7
- package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +0 -35
- package/dist/base/primitives/compound/CompoundNodeContainer.css.js +0 -132
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -7
- package/dist/base/primitives/edge/EdgeLabel.css.js +0 -57
- package/dist/base/primitives/element/ElementShape.css.d.ts +0 -6
- package/dist/base/primitives/element/ElementShape.css.js +0 -107
- package/dist/likec4diagram/custom/edges/NotePopover.css.js +0 -21
- package/dist/likec4diagram/custom/edges/NotePopover.js +0 -91
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +0 -5
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +0 -13
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +0 -215
- package/dist/likec4diagram/custom/index.d.ts +0 -62
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +0 -10
- package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -138
- package/src/base/primitives/edge/EdgeLabel.css.ts +0 -64
- package/src/base/primitives/element/ElementShape.css.ts +0 -112
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +0 -281
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import React__default, { useState, Fragment, createContext, useContext, useRef, useEffect, useMemo, useCallback, useLayoutEffect, useId as useId$2, forwardRef, cloneElement, Children, createElement, useInsertionEffect as useInsertionEffect$1, memo as memo$1,
|
|
2
|
+
import React__default, { useState, Fragment, createContext, useContext, useRef, useEffect, useMemo, useCallback, useLayoutEffect, useId as useId$2, forwardRef, cloneElement, Children, createElement, useInsertionEffect as useInsertionEffect$1, memo as memo$1, createRef } from "react";
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import ReactDOM__default, { createPortal } from "react-dom";
|
|
@@ -790,8 +790,8 @@ var ReactRemoveScroll = React.forwardRef(function(props, ref) {
|
|
|
790
790
|
return React.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar }));
|
|
791
791
|
});
|
|
792
792
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
793
|
-
function keys$1(
|
|
794
|
-
return Object.keys(
|
|
793
|
+
function keys$1(object2) {
|
|
794
|
+
return Object.keys(object2);
|
|
795
795
|
}
|
|
796
796
|
function isObject(item) {
|
|
797
797
|
return item && typeof item == "object" && !Array.isArray(item);
|
|
@@ -848,7 +848,7 @@ function isNumberLike(value) {
|
|
|
848
848
|
}
|
|
849
849
|
return !1;
|
|
850
850
|
}
|
|
851
|
-
function isElement$
|
|
851
|
+
function isElement$2(value) {
|
|
852
852
|
return Array.isArray(value) || value === null ? !1 : typeof value == "object" ? value.type !== Fragment : !1;
|
|
853
853
|
}
|
|
854
854
|
function createSafeContext(errorMessage) {
|
|
@@ -2772,114 +2772,52 @@ const DirectionContext = createContext({
|
|
|
2772
2772
|
function useDirection() {
|
|
2773
2773
|
return useContext(DirectionContext);
|
|
2774
2774
|
}
|
|
2775
|
-
function hasWindow() {
|
|
2775
|
+
function hasWindow$1() {
|
|
2776
2776
|
return typeof window < "u";
|
|
2777
2777
|
}
|
|
2778
|
-
function getNodeName(node) {
|
|
2779
|
-
return isNode$
|
|
2778
|
+
function getNodeName$1(node) {
|
|
2779
|
+
return isNode$2(node) ? (node.nodeName || "").toLowerCase() : "#document";
|
|
2780
2780
|
}
|
|
2781
|
-
function getWindow(node) {
|
|
2781
|
+
function getWindow$1(node) {
|
|
2782
2782
|
var _node$ownerDocument;
|
|
2783
2783
|
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
2784
2784
|
}
|
|
2785
|
-
function getDocumentElement(node) {
|
|
2785
|
+
function getDocumentElement$1(node) {
|
|
2786
2786
|
var _ref;
|
|
2787
|
-
return (_ref = (isNode$
|
|
2788
|
-
}
|
|
2789
|
-
function isNode$1(value) {
|
|
2790
|
-
return hasWindow() ? value instanceof Node || value instanceof getWindow(value).Node : !1;
|
|
2791
|
-
}
|
|
2792
|
-
function isElement(value) {
|
|
2793
|
-
return hasWindow() ? value instanceof Element || value instanceof getWindow(value).Element : !1;
|
|
2794
|
-
}
|
|
2795
|
-
function isHTMLElement(value) {
|
|
2796
|
-
return hasWindow() ? value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement : !1;
|
|
2787
|
+
return (_ref = (isNode$2(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
2797
2788
|
}
|
|
2798
|
-
function
|
|
2799
|
-
return
|
|
2800
|
-
}
|
|
2801
|
-
function isOverflowElement(element) {
|
|
2802
|
-
const {
|
|
2803
|
-
overflow,
|
|
2804
|
-
overflowX,
|
|
2805
|
-
overflowY,
|
|
2806
|
-
display
|
|
2807
|
-
} = getComputedStyle(element);
|
|
2808
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
2809
|
-
}
|
|
2810
|
-
function isTableElement(element) {
|
|
2811
|
-
return ["table", "td", "th"].includes(getNodeName(element));
|
|
2789
|
+
function isNode$2(value) {
|
|
2790
|
+
return hasWindow$1() ? value instanceof Node || value instanceof getWindow$1(value).Node : !1;
|
|
2812
2791
|
}
|
|
2813
|
-
function
|
|
2814
|
-
return
|
|
2815
|
-
try {
|
|
2816
|
-
return element.matches(selector2);
|
|
2817
|
-
} catch {
|
|
2818
|
-
return !1;
|
|
2819
|
-
}
|
|
2820
|
-
});
|
|
2792
|
+
function isElement$1(value) {
|
|
2793
|
+
return hasWindow$1() ? value instanceof Element || value instanceof getWindow$1(value).Element : !1;
|
|
2821
2794
|
}
|
|
2822
|
-
function
|
|
2823
|
-
|
|
2824
|
-
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css2[value] ? css2[value] !== "none" : !1) || (css2.containerType ? css2.containerType !== "normal" : !1) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : !1) || !webkit && (css2.filter ? css2.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
|
|
2795
|
+
function isHTMLElement$1(value) {
|
|
2796
|
+
return hasWindow$1() ? value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement : !1;
|
|
2825
2797
|
}
|
|
2826
|
-
function
|
|
2827
|
-
|
|
2828
|
-
for (; isHTMLElement(currentNode) && !isLastTraversableNode(currentNode); ) {
|
|
2829
|
-
if (isContainingBlock(currentNode))
|
|
2830
|
-
return currentNode;
|
|
2831
|
-
if (isTopLayer(currentNode))
|
|
2832
|
-
return null;
|
|
2833
|
-
currentNode = getParentNode(currentNode);
|
|
2834
|
-
}
|
|
2835
|
-
return null;
|
|
2798
|
+
function isShadowRoot$1(value) {
|
|
2799
|
+
return !hasWindow$1() || typeof ShadowRoot > "u" ? !1 : value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
|
|
2836
2800
|
}
|
|
2837
|
-
function isWebKit() {
|
|
2801
|
+
function isWebKit$1() {
|
|
2838
2802
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2839
2803
|
}
|
|
2840
|
-
function isLastTraversableNode(node) {
|
|
2841
|
-
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
2842
|
-
}
|
|
2843
|
-
function getComputedStyle(element) {
|
|
2844
|
-
return getWindow(element).getComputedStyle(element);
|
|
2804
|
+
function isLastTraversableNode$1(node) {
|
|
2805
|
+
return ["html", "body", "#document"].includes(getNodeName$1(node));
|
|
2845
2806
|
}
|
|
2846
|
-
function
|
|
2847
|
-
return
|
|
2848
|
-
scrollLeft: element.scrollLeft,
|
|
2849
|
-
scrollTop: element.scrollTop
|
|
2850
|
-
} : {
|
|
2851
|
-
scrollLeft: element.scrollX,
|
|
2852
|
-
scrollTop: element.scrollY
|
|
2853
|
-
};
|
|
2807
|
+
function getComputedStyle$1(element) {
|
|
2808
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
2854
2809
|
}
|
|
2855
|
-
function getParentNode(node) {
|
|
2856
|
-
if (getNodeName(node) === "html")
|
|
2810
|
+
function getParentNode$1(node) {
|
|
2811
|
+
if (getNodeName$1(node) === "html")
|
|
2857
2812
|
return node;
|
|
2858
2813
|
const result = (
|
|
2859
2814
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
2860
2815
|
node.assignedSlot || // DOM Element detected.
|
|
2861
2816
|
node.parentNode || // ShadowRoot detected.
|
|
2862
|
-
isShadowRoot(node) && node.host || // Fallback.
|
|
2863
|
-
getDocumentElement(node)
|
|
2817
|
+
isShadowRoot$1(node) && node.host || // Fallback.
|
|
2818
|
+
getDocumentElement$1(node)
|
|
2864
2819
|
);
|
|
2865
|
-
return isShadowRoot(result) ? result.host : result;
|
|
2866
|
-
}
|
|
2867
|
-
function getNearestOverflowAncestor(node) {
|
|
2868
|
-
const parentNode = getParentNode(node);
|
|
2869
|
-
return isLastTraversableNode(parentNode) ? node.ownerDocument ? node.ownerDocument.body : node.body : isHTMLElement(parentNode) && isOverflowElement(parentNode) ? parentNode : getNearestOverflowAncestor(parentNode);
|
|
2870
|
-
}
|
|
2871
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
2872
|
-
var _node$ownerDocument2;
|
|
2873
|
-
list === void 0 && (list = []), traverseIframes === void 0 && (traverseIframes = !0);
|
|
2874
|
-
const scrollableAncestor = getNearestOverflowAncestor(node), isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body), win2 = getWindow(scrollableAncestor);
|
|
2875
|
-
if (isBody) {
|
|
2876
|
-
const frameElement = getFrameElement(win2);
|
|
2877
|
-
return list.concat(win2, win2.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
2878
|
-
}
|
|
2879
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
2880
|
-
}
|
|
2881
|
-
function getFrameElement(win2) {
|
|
2882
|
-
return win2.parent && Object.getPrototypeOf(win2.parent) ? win2.frameElement : null;
|
|
2820
|
+
return isShadowRoot$1(result) ? result.host : result;
|
|
2883
2821
|
}
|
|
2884
2822
|
function activeElement(doc) {
|
|
2885
2823
|
let activeElement2 = doc.activeElement;
|
|
@@ -2895,7 +2833,7 @@ function contains(parent, child) {
|
|
|
2895
2833
|
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
2896
2834
|
if (parent.contains(child))
|
|
2897
2835
|
return !0;
|
|
2898
|
-
if (rootNode && isShadowRoot(rootNode)) {
|
|
2836
|
+
if (rootNode && isShadowRoot$1(rootNode)) {
|
|
2899
2837
|
let next = child;
|
|
2900
2838
|
for (; next; ) {
|
|
2901
2839
|
if (parent === next)
|
|
@@ -2962,9 +2900,9 @@ function getTarget(event) {
|
|
|
2962
2900
|
}
|
|
2963
2901
|
const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
2964
2902
|
function isTypeableElement(element) {
|
|
2965
|
-
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
|
|
2903
|
+
return isHTMLElement$1(element) && element.matches(TYPEABLE_SELECTOR);
|
|
2966
2904
|
}
|
|
2967
|
-
const sides = ["top", "right", "bottom", "left"], min$1 = Math.min, max$1 = Math.max, round = Math.round, floor = Math.floor, createCoords = (v) => ({
|
|
2905
|
+
const sides = ["top", "right", "bottom", "left"], alignments = ["start", "end"], placements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []), min$1 = Math.min, max$1 = Math.max, round = Math.round, floor = Math.floor, createCoords = (v) => ({
|
|
2968
2906
|
x: v,
|
|
2969
2907
|
y: v
|
|
2970
2908
|
}), oppositeSideMap = {
|
|
@@ -2994,8 +2932,9 @@ function getOppositeAxis(axis) {
|
|
|
2994
2932
|
function getAxisLength(axis) {
|
|
2995
2933
|
return axis === "y" ? "height" : "width";
|
|
2996
2934
|
}
|
|
2935
|
+
const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
2997
2936
|
function getSideAxis(placement) {
|
|
2998
|
-
return
|
|
2937
|
+
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
2999
2938
|
}
|
|
3000
2939
|
function getAlignmentAxis(placement) {
|
|
3001
2940
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -3013,15 +2952,15 @@ function getExpandedPlacements(placement) {
|
|
|
3013
2952
|
function getOppositeAlignmentPlacement(placement) {
|
|
3014
2953
|
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
3015
2954
|
}
|
|
2955
|
+
const lrPlacement = ["left", "right"], rlPlacement = ["right", "left"], tbPlacement = ["top", "bottom"], btPlacement = ["bottom", "top"];
|
|
3016
2956
|
function getSideList(side, isStart, rtl) {
|
|
3017
|
-
const lr = ["left", "right"], rl = ["right", "left"], tb = ["top", "bottom"], bt = ["bottom", "top"];
|
|
3018
2957
|
switch (side) {
|
|
3019
2958
|
case "top":
|
|
3020
2959
|
case "bottom":
|
|
3021
|
-
return rtl ? isStart ?
|
|
2960
|
+
return rtl ? isStart ? rlPlacement : lrPlacement : isStart ? lrPlacement : rlPlacement;
|
|
3022
2961
|
case "left":
|
|
3023
2962
|
case "right":
|
|
3024
|
-
return isStart ?
|
|
2963
|
+
return isStart ? tbPlacement : btPlacement;
|
|
3025
2964
|
default:
|
|
3026
2965
|
return [];
|
|
3027
2966
|
}
|
|
@@ -3260,7 +3199,79 @@ const arrow$3 = (options) => ({
|
|
|
3260
3199
|
reset: shouldAddOffset
|
|
3261
3200
|
};
|
|
3262
3201
|
}
|
|
3263
|
-
})
|
|
3202
|
+
});
|
|
3203
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
3204
|
+
return (alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement)).filter((placement) => alignment ? getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : !1) : !0);
|
|
3205
|
+
}
|
|
3206
|
+
const autoPlacement$1 = function(options) {
|
|
3207
|
+
return options === void 0 && (options = {}), {
|
|
3208
|
+
name: "autoPlacement",
|
|
3209
|
+
options,
|
|
3210
|
+
async fn(state) {
|
|
3211
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
3212
|
+
const {
|
|
3213
|
+
rects,
|
|
3214
|
+
middlewareData,
|
|
3215
|
+
placement,
|
|
3216
|
+
platform: platform2,
|
|
3217
|
+
elements
|
|
3218
|
+
} = state, {
|
|
3219
|
+
crossAxis = !1,
|
|
3220
|
+
alignment,
|
|
3221
|
+
allowedPlacements = placements,
|
|
3222
|
+
autoAlignment = !0,
|
|
3223
|
+
...detectOverflowOptions
|
|
3224
|
+
} = evaluate(options, state), placements$1 = alignment !== void 0 || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements, overflow = await detectOverflow(state, detectOverflowOptions), currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0, currentPlacement = placements$1[currentIndex];
|
|
3225
|
+
if (currentPlacement == null)
|
|
3226
|
+
return {};
|
|
3227
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)));
|
|
3228
|
+
if (placement !== currentPlacement)
|
|
3229
|
+
return {
|
|
3230
|
+
reset: {
|
|
3231
|
+
placement: placements$1[0]
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]], allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
|
|
3235
|
+
placement: currentPlacement,
|
|
3236
|
+
overflows: currentOverflows
|
|
3237
|
+
}], nextPlacement = placements$1[currentIndex + 1];
|
|
3238
|
+
if (nextPlacement)
|
|
3239
|
+
return {
|
|
3240
|
+
data: {
|
|
3241
|
+
index: currentIndex + 1,
|
|
3242
|
+
overflows: allOverflows
|
|
3243
|
+
},
|
|
3244
|
+
reset: {
|
|
3245
|
+
placement: nextPlacement
|
|
3246
|
+
}
|
|
3247
|
+
};
|
|
3248
|
+
const placementsSortedByMostSpace = allOverflows.map((d2) => {
|
|
3249
|
+
const alignment2 = getAlignment(d2.placement);
|
|
3250
|
+
return [d2.placement, alignment2 && crossAxis ? (
|
|
3251
|
+
// Check along the mainAxis and main crossAxis side.
|
|
3252
|
+
d2.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
|
|
3253
|
+
) : (
|
|
3254
|
+
// Check only the mainAxis.
|
|
3255
|
+
d2.overflows[0]
|
|
3256
|
+
), d2.overflows];
|
|
3257
|
+
}).sort((a, b) => a[1] - b[1]), resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((d2) => d2[2].slice(
|
|
3258
|
+
0,
|
|
3259
|
+
// Aligned placements should not check their opposite crossAxis
|
|
3260
|
+
// side.
|
|
3261
|
+
getAlignment(d2[0]) ? 2 : 3
|
|
3262
|
+
).every((v) => v <= 0))[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
3263
|
+
return resetPlacement !== placement ? {
|
|
3264
|
+
data: {
|
|
3265
|
+
index: currentIndex + 1,
|
|
3266
|
+
overflows: allOverflows
|
|
3267
|
+
},
|
|
3268
|
+
reset: {
|
|
3269
|
+
placement: resetPlacement
|
|
3270
|
+
}
|
|
3271
|
+
} : {};
|
|
3272
|
+
}
|
|
3273
|
+
};
|
|
3274
|
+
}, flip$2 = function(options) {
|
|
3264
3275
|
return options === void 0 && (options = {}), {
|
|
3265
3276
|
name: "flip",
|
|
3266
3277
|
options,
|
|
@@ -3286,7 +3297,7 @@ const arrow$3 = (options) => ({
|
|
|
3286
3297
|
return {};
|
|
3287
3298
|
const side = getSide(placement), initialSideAxis = getSideAxis(initialPlacement), isBasePlacement = getSide(initialPlacement) === initialPlacement, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)), fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)), hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
3288
3299
|
!specifiedFallbackPlacements && hasFallbackAxisSideDirection && fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
3289
|
-
const
|
|
3300
|
+
const placements2 = [initialPlacement, ...fallbackPlacements], overflow = await detectOverflow(state, detectOverflowOptions), overflows = [];
|
|
3290
3301
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
3291
3302
|
if (checkMainAxis && overflows.push(overflow[side]), checkCrossAxis) {
|
|
3292
3303
|
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
@@ -3297,21 +3308,19 @@ const arrow$3 = (options) => ({
|
|
|
3297
3308
|
overflows
|
|
3298
3309
|
}], !overflows.every((side2) => side2 <= 0)) {
|
|
3299
3310
|
var _middlewareData$flip2, _overflowsData$filter;
|
|
3300
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement =
|
|
3301
|
-
if (nextPlacement)
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
};
|
|
3314
|
-
}
|
|
3311
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
|
|
3312
|
+
if (nextPlacement && (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3313
|
+
// overflows the main axis.
|
|
3314
|
+
overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : !0)))
|
|
3315
|
+
return {
|
|
3316
|
+
data: {
|
|
3317
|
+
index: nextIndex,
|
|
3318
|
+
overflows: overflowsData
|
|
3319
|
+
},
|
|
3320
|
+
reset: {
|
|
3321
|
+
placement: nextPlacement
|
|
3322
|
+
}
|
|
3323
|
+
};
|
|
3315
3324
|
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
3316
3325
|
if (!resetPlacement)
|
|
3317
3326
|
switch (fallbackStrategy) {
|
|
@@ -3476,13 +3485,13 @@ const inline$2 = function(options) {
|
|
|
3476
3485
|
} : {};
|
|
3477
3486
|
}
|
|
3478
3487
|
};
|
|
3479
|
-
};
|
|
3488
|
+
}, originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
3480
3489
|
async function convertValueToCoords(state, options) {
|
|
3481
3490
|
const {
|
|
3482
3491
|
placement,
|
|
3483
3492
|
platform: platform2,
|
|
3484
3493
|
elements
|
|
3485
|
-
} = state, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)), side = getSide(placement), alignment = getAlignment(placement), isVertical = getSideAxis(placement) === "y", mainAxisMulti =
|
|
3494
|
+
} = state, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)), side = getSide(placement), alignment = getAlignment(placement), isVertical = getSideAxis(placement) === "y", mainAxisMulti = originSides.has(side) ? -1 : 1, crossAxisMulti = rtl && isVertical ? -1 : 1, rawValue = evaluate(options, state);
|
|
3486
3495
|
let {
|
|
3487
3496
|
mainAxis,
|
|
3488
3497
|
crossAxis,
|
|
@@ -3615,7 +3624,7 @@ const offset$3 = function(options) {
|
|
|
3615
3624
|
}
|
|
3616
3625
|
if (checkCrossAxis) {
|
|
3617
3626
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
3618
|
-
const len = mainAxis === "y" ? "width" : "height", isOriginSide =
|
|
3627
|
+
const len = mainAxis === "y" ? "width" : "height", isOriginSide = originSides.has(getSide(placement)), limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide && ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0) + (isOriginSide ? 0 : computedOffset.crossAxis), limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
3619
3628
|
crossAxisCoord < limitMin ? crossAxisCoord = limitMin : crossAxisCoord > limitMax && (crossAxisCoord = limitMax);
|
|
3620
3629
|
}
|
|
3621
3630
|
return {
|
|
@@ -3665,6 +3674,120 @@ const offset$3 = function(options) {
|
|
|
3665
3674
|
}
|
|
3666
3675
|
};
|
|
3667
3676
|
};
|
|
3677
|
+
function hasWindow() {
|
|
3678
|
+
return typeof window < "u";
|
|
3679
|
+
}
|
|
3680
|
+
function getNodeName(node) {
|
|
3681
|
+
return isNode$1(node) ? (node.nodeName || "").toLowerCase() : "#document";
|
|
3682
|
+
}
|
|
3683
|
+
function getWindow(node) {
|
|
3684
|
+
var _node$ownerDocument;
|
|
3685
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
3686
|
+
}
|
|
3687
|
+
function getDocumentElement(node) {
|
|
3688
|
+
var _ref;
|
|
3689
|
+
return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
3690
|
+
}
|
|
3691
|
+
function isNode$1(value) {
|
|
3692
|
+
return hasWindow() ? value instanceof Node || value instanceof getWindow(value).Node : !1;
|
|
3693
|
+
}
|
|
3694
|
+
function isElement(value) {
|
|
3695
|
+
return hasWindow() ? value instanceof Element || value instanceof getWindow(value).Element : !1;
|
|
3696
|
+
}
|
|
3697
|
+
function isHTMLElement(value) {
|
|
3698
|
+
return hasWindow() ? value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement : !1;
|
|
3699
|
+
}
|
|
3700
|
+
function isShadowRoot(value) {
|
|
3701
|
+
return !hasWindow() || typeof ShadowRoot > "u" ? !1 : value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
3702
|
+
}
|
|
3703
|
+
const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
3704
|
+
function isOverflowElement(element) {
|
|
3705
|
+
const {
|
|
3706
|
+
overflow,
|
|
3707
|
+
overflowX,
|
|
3708
|
+
overflowY,
|
|
3709
|
+
display
|
|
3710
|
+
} = getComputedStyle(element);
|
|
3711
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
3712
|
+
}
|
|
3713
|
+
const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
3714
|
+
function isTableElement(element) {
|
|
3715
|
+
return tableElements.has(getNodeName(element));
|
|
3716
|
+
}
|
|
3717
|
+
const topLayerSelectors = [":popover-open", ":modal"];
|
|
3718
|
+
function isTopLayer(element) {
|
|
3719
|
+
return topLayerSelectors.some((selector2) => {
|
|
3720
|
+
try {
|
|
3721
|
+
return element.matches(selector2);
|
|
3722
|
+
} catch {
|
|
3723
|
+
return !1;
|
|
3724
|
+
}
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"], willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"], containValues = ["paint", "layout", "strict", "content"];
|
|
3728
|
+
function isContainingBlock(elementOrCss) {
|
|
3729
|
+
const webkit = isWebKit(), css2 = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
3730
|
+
return transformProperties.some((value) => css2[value] ? css2[value] !== "none" : !1) || (css2.containerType ? css2.containerType !== "normal" : !1) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : !1) || !webkit && (css2.filter ? css2.filter !== "none" : !1) || willChangeValues.some((value) => (css2.willChange || "").includes(value)) || containValues.some((value) => (css2.contain || "").includes(value));
|
|
3731
|
+
}
|
|
3732
|
+
function getContainingBlock(element) {
|
|
3733
|
+
let currentNode = getParentNode(element);
|
|
3734
|
+
for (; isHTMLElement(currentNode) && !isLastTraversableNode(currentNode); ) {
|
|
3735
|
+
if (isContainingBlock(currentNode))
|
|
3736
|
+
return currentNode;
|
|
3737
|
+
if (isTopLayer(currentNode))
|
|
3738
|
+
return null;
|
|
3739
|
+
currentNode = getParentNode(currentNode);
|
|
3740
|
+
}
|
|
3741
|
+
return null;
|
|
3742
|
+
}
|
|
3743
|
+
function isWebKit() {
|
|
3744
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
3745
|
+
}
|
|
3746
|
+
const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
3747
|
+
function isLastTraversableNode(node) {
|
|
3748
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
3749
|
+
}
|
|
3750
|
+
function getComputedStyle(element) {
|
|
3751
|
+
return getWindow(element).getComputedStyle(element);
|
|
3752
|
+
}
|
|
3753
|
+
function getNodeScroll(element) {
|
|
3754
|
+
return isElement(element) ? {
|
|
3755
|
+
scrollLeft: element.scrollLeft,
|
|
3756
|
+
scrollTop: element.scrollTop
|
|
3757
|
+
} : {
|
|
3758
|
+
scrollLeft: element.scrollX,
|
|
3759
|
+
scrollTop: element.scrollY
|
|
3760
|
+
};
|
|
3761
|
+
}
|
|
3762
|
+
function getParentNode(node) {
|
|
3763
|
+
if (getNodeName(node) === "html")
|
|
3764
|
+
return node;
|
|
3765
|
+
const result = (
|
|
3766
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
3767
|
+
node.assignedSlot || // DOM Element detected.
|
|
3768
|
+
node.parentNode || // ShadowRoot detected.
|
|
3769
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
3770
|
+
getDocumentElement(node)
|
|
3771
|
+
);
|
|
3772
|
+
return isShadowRoot(result) ? result.host : result;
|
|
3773
|
+
}
|
|
3774
|
+
function getNearestOverflowAncestor(node) {
|
|
3775
|
+
const parentNode = getParentNode(node);
|
|
3776
|
+
return isLastTraversableNode(parentNode) ? node.ownerDocument ? node.ownerDocument.body : node.body : isHTMLElement(parentNode) && isOverflowElement(parentNode) ? parentNode : getNearestOverflowAncestor(parentNode);
|
|
3777
|
+
}
|
|
3778
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
3779
|
+
var _node$ownerDocument2;
|
|
3780
|
+
list === void 0 && (list = []), traverseIframes === void 0 && (traverseIframes = !0);
|
|
3781
|
+
const scrollableAncestor = getNearestOverflowAncestor(node), isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body), win2 = getWindow(scrollableAncestor);
|
|
3782
|
+
if (isBody) {
|
|
3783
|
+
const frameElement = getFrameElement(win2);
|
|
3784
|
+
return list.concat(win2, win2.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
3785
|
+
}
|
|
3786
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3787
|
+
}
|
|
3788
|
+
function getFrameElement(win2) {
|
|
3789
|
+
return win2.parent && Object.getPrototypeOf(win2.parent) ? win2.frameElement : null;
|
|
3790
|
+
}
|
|
3668
3791
|
function getCssDimensions(element) {
|
|
3669
3792
|
const css2 = getComputedStyle(element);
|
|
3670
3793
|
let width = parseFloat(css2.width) || 0, height = parseFloat(css2.height) || 0;
|
|
@@ -3797,6 +3920,7 @@ function getViewportRect(element, strategy) {
|
|
|
3797
3920
|
y: y2
|
|
3798
3921
|
};
|
|
3799
3922
|
}
|
|
3923
|
+
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
3800
3924
|
function getInnerBoundingClientRect(element, strategy) {
|
|
3801
3925
|
const clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1), width = element.clientWidth * scale2.x, height = element.clientHeight * scale2.y, x = left * scale2.x, y2 = top * scale2.y;
|
|
3802
3926
|
return {
|
|
@@ -3838,7 +3962,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3838
3962
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
3839
3963
|
for (; isElement(currentNode) && !isLastTraversableNode(currentNode); ) {
|
|
3840
3964
|
const computedStyle = getComputedStyle(currentNode), currentNodeIsContaining = isContainingBlock(currentNode);
|
|
3841
|
-
!currentNodeIsContaining && computedStyle.position === "fixed" && (currentContainingBlockComputedStyle = null), (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle &&
|
|
3965
|
+
!currentNodeIsContaining && computedStyle.position === "fixed" && (currentContainingBlockComputedStyle = null), (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) ? result = result.filter((ancestor) => ancestor !== currentNode) : currentContainingBlockComputedStyle = computedStyle, currentNode = getParentNode(currentNode);
|
|
3842
3966
|
}
|
|
3843
3967
|
return cache.set(element, result), result;
|
|
3844
3968
|
}
|
|
@@ -4035,7 +4159,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
4035
4159
|
}), cleanupIo?.(), (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(), resizeObserver = null, animationFrame && cancelAnimationFrame(frameId);
|
|
4036
4160
|
};
|
|
4037
4161
|
}
|
|
4038
|
-
const offset$2 = offset$3, shift$1 = shift$2, flip$1 = flip$2, size$1 = size$2, hide$1 = hide$2, arrow$2 = arrow$3, inline$1 = inline$2, limitShift$1 = limitShift$2, computePosition = (reference, floating, options) => {
|
|
4162
|
+
const offset$2 = offset$3, autoPlacement = autoPlacement$1, shift$1 = shift$2, flip$1 = flip$2, size$1 = size$2, hide$1 = hide$2, arrow$2 = arrow$3, inline$1 = inline$2, limitShift$1 = limitShift$2, computePosition = (reference, floating, options) => {
|
|
4039
4163
|
const cache = /* @__PURE__ */ new Map(), mergedOptions = {
|
|
4040
4164
|
platform,
|
|
4041
4165
|
...options
|
|
@@ -4407,7 +4531,7 @@ function useHover(context2, props) {
|
|
|
4407
4531
|
}
|
|
4408
4532
|
})(event));
|
|
4409
4533
|
}
|
|
4410
|
-
if (isElement(elements.domReference)) {
|
|
4534
|
+
if (isElement$1(elements.domReference)) {
|
|
4411
4535
|
var _elements$floating;
|
|
4412
4536
|
const ref = elements.domReference;
|
|
4413
4537
|
return open && ref.addEventListener("mouseleave", onScrollMouseLeave), (_elements$floating = elements.floating) == null || _elements$floating.addEventListener("mouseleave", onScrollMouseLeave), move && ref.addEventListener("mousemove", onMouseEnter, {
|
|
@@ -4422,7 +4546,7 @@ function useHover(context2, props) {
|
|
|
4422
4546
|
if (enabled && open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {
|
|
4423
4547
|
performedPointerEventsMutationRef.current = !0;
|
|
4424
4548
|
const floatingEl = elements.floating;
|
|
4425
|
-
if (isElement(elements.domReference) && floatingEl) {
|
|
4549
|
+
if (isElement$1(elements.domReference) && floatingEl) {
|
|
4426
4550
|
var _tree$nodesRef$curren;
|
|
4427
4551
|
const body2 = getDocument(elements.floating).body;
|
|
4428
4552
|
body2.setAttribute(safePolygonIdentifier, "");
|
|
@@ -4638,22 +4762,22 @@ function useDismiss(context2, props) {
|
|
|
4638
4762
|
if (endedOrStartedInsideRef.current = !1, outsidePressEvent === "click" && endedOrStartedInside || insideReactTree || typeof outsidePress == "function" && !outsidePress(event))
|
|
4639
4763
|
return;
|
|
4640
4764
|
const target = getTarget(event), inertSelector = "[" + createAttribute("inert") + "]", markers = getDocument(elements.floating).querySelectorAll(inertSelector);
|
|
4641
|
-
let targetRootAncestor = isElement(target) ? target : null;
|
|
4642
|
-
for (; targetRootAncestor && !isLastTraversableNode(targetRootAncestor); ) {
|
|
4643
|
-
const nextParent = getParentNode(targetRootAncestor);
|
|
4644
|
-
if (isLastTraversableNode(nextParent) || !isElement(nextParent))
|
|
4765
|
+
let targetRootAncestor = isElement$1(target) ? target : null;
|
|
4766
|
+
for (; targetRootAncestor && !isLastTraversableNode$1(targetRootAncestor); ) {
|
|
4767
|
+
const nextParent = getParentNode$1(targetRootAncestor);
|
|
4768
|
+
if (isLastTraversableNode$1(nextParent) || !isElement$1(nextParent))
|
|
4645
4769
|
break;
|
|
4646
4770
|
targetRootAncestor = nextParent;
|
|
4647
4771
|
}
|
|
4648
|
-
if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
4772
|
+
if (markers.length && isElement$1(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
4649
4773
|
!contains(target, elements.floating) && // If the target root element contains none of the markers, then the
|
|
4650
4774
|
// element was injected after the floating element rendered.
|
|
4651
4775
|
Array.from(markers).every((marker) => !contains(targetRootAncestor, marker)))
|
|
4652
4776
|
return;
|
|
4653
|
-
if (isHTMLElement(target) && floating) {
|
|
4777
|
+
if (isHTMLElement$1(target) && floating) {
|
|
4654
4778
|
const canScrollX = target.clientWidth > 0 && target.scrollWidth > target.clientWidth, canScrollY = target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
|
|
4655
4779
|
let xCond = canScrollY && event.offsetX > target.clientWidth;
|
|
4656
|
-
if (canScrollY && getComputedStyle(target).direction === "rtl" && (xCond = event.offsetX <= target.offsetWidth - target.clientWidth), xCond || canScrollX && event.offsetY > target.clientHeight)
|
|
4780
|
+
if (canScrollY && getComputedStyle$1(target).direction === "rtl" && (xCond = event.offsetX <= target.offsetWidth - target.clientWidth), xCond || canScrollX && event.offsetY > target.clientHeight)
|
|
4657
4781
|
return;
|
|
4658
4782
|
}
|
|
4659
4783
|
const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId, targetIsInsideChildren = tree && getChildren$1(tree.nodesRef.current, nodeId).some((node) => {
|
|
@@ -4701,13 +4825,13 @@ function useDismiss(context2, props) {
|
|
|
4701
4825
|
},
|
|
4702
4826
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
4703
4827
|
// Only apply to WebKit for the test to remain 0ms.
|
|
4704
|
-
isWebKit() ? 5 : 0
|
|
4828
|
+
isWebKit$1() ? 5 : 0
|
|
4705
4829
|
);
|
|
4706
4830
|
}
|
|
4707
4831
|
const doc = getDocument(elements.floating);
|
|
4708
4832
|
escapeKey && (doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture), doc.addEventListener("compositionstart", handleCompositionStart), doc.addEventListener("compositionend", handleCompositionEnd)), outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
|
|
4709
4833
|
let ancestors = [];
|
|
4710
|
-
return ancestorScroll && (isElement(elements.domReference) && (ancestors = getOverflowAncestors(elements.domReference)), isElement(elements.floating) && (ancestors = ancestors.concat(getOverflowAncestors(elements.floating))), !isElement(elements.reference) && elements.reference && elements.reference.contextElement && (ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement)))), ancestors = ancestors.filter((ancestor) => {
|
|
4834
|
+
return ancestorScroll && (isElement$1(elements.domReference) && (ancestors = getOverflowAncestors(elements.domReference)), isElement$1(elements.floating) && (ancestors = ancestors.concat(getOverflowAncestors(elements.floating))), !isElement$1(elements.reference) && elements.reference && elements.reference.contextElement && (ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement)))), ancestors = ancestors.filter((ancestor) => {
|
|
4711
4835
|
var _doc$defaultView;
|
|
4712
4836
|
return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
|
|
4713
4837
|
}), ancestors.forEach((ancestor) => {
|
|
@@ -4797,16 +4921,16 @@ function useFloating(options) {
|
|
|
4797
4921
|
}
|
|
4798
4922
|
}
|
|
4799
4923
|
}), setPositionReference = React.useCallback((node) => {
|
|
4800
|
-
const computedPositionReference = isElement(node) ? {
|
|
4924
|
+
const computedPositionReference = isElement$1(node) ? {
|
|
4801
4925
|
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
4802
4926
|
contextElement: node
|
|
4803
4927
|
} : node;
|
|
4804
4928
|
_setPositionReference(computedPositionReference), position.refs.setReference(computedPositionReference);
|
|
4805
4929
|
}, [position.refs]), setReference = React.useCallback((node) => {
|
|
4806
|
-
(isElement(node) || node === null) && (domReferenceRef.current = node, setDomReference(node)), (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
4930
|
+
(isElement$1(node) || node === null) && (domReferenceRef.current = node, setDomReference(node)), (isElement$1(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
4807
4931
|
// `null` to support `positionReference` + an unstable `reference`
|
|
4808
4932
|
// callback ref.
|
|
4809
|
-
node !== null && !isElement(node)) && position.refs.setReference(node);
|
|
4933
|
+
node !== null && !isElement$1(node)) && position.refs.setReference(node);
|
|
4810
4934
|
}, [position.refs]), refs = React.useMemo(() => ({
|
|
4811
4935
|
...position.refs,
|
|
4812
4936
|
setReference,
|
|
@@ -4847,9 +4971,9 @@ function useFocus(context2, props) {
|
|
|
4847
4971
|
} = props, blockFocusRef = React.useRef(!1), timeoutRef = React.useRef(), keyboardModalityRef = React.useRef(!0);
|
|
4848
4972
|
React.useEffect(() => {
|
|
4849
4973
|
if (!enabled) return;
|
|
4850
|
-
const win2 = getWindow(elements.domReference);
|
|
4974
|
+
const win2 = getWindow$1(elements.domReference);
|
|
4851
4975
|
function onBlur() {
|
|
4852
|
-
!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference)) && (blockFocusRef.current = !0);
|
|
4976
|
+
!open && isHTMLElement$1(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference)) && (blockFocusRef.current = !0);
|
|
4853
4977
|
}
|
|
4854
4978
|
function onKeyDown() {
|
|
4855
4979
|
keyboardModalityRef.current = !0;
|
|
@@ -4881,7 +5005,7 @@ function useFocus(context2, props) {
|
|
|
4881
5005
|
onFocus(event) {
|
|
4882
5006
|
if (blockFocusRef.current) return;
|
|
4883
5007
|
const target = getTarget(event.nativeEvent);
|
|
4884
|
-
if (visibleOnly && isElement(target))
|
|
5008
|
+
if (visibleOnly && isElement$1(target))
|
|
4885
5009
|
try {
|
|
4886
5010
|
if (isSafari() && isMac()) throw Error();
|
|
4887
5011
|
if (!target.matches(":focus-visible")) return;
|
|
@@ -4893,7 +5017,7 @@ function useFocus(context2, props) {
|
|
|
4893
5017
|
},
|
|
4894
5018
|
onBlur(event) {
|
|
4895
5019
|
blockFocusRef.current = !1;
|
|
4896
|
-
const relatedTarget = event.relatedTarget, nativeEvent = event.nativeEvent, movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
|
5020
|
+
const relatedTarget = event.relatedTarget, nativeEvent = event.nativeEvent, movedToFocusGuard = isElement$1(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
|
4897
5021
|
timeoutRef.current = window.setTimeout(() => {
|
|
4898
5022
|
var _dataRef$current$floa;
|
|
4899
5023
|
const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);
|
|
@@ -5575,7 +5699,7 @@ function FocusTrap({
|
|
|
5575
5699
|
innerRef
|
|
5576
5700
|
}) {
|
|
5577
5701
|
const focusTrapRef = useFocusTrap(active), ref = useMergedRef(focusTrapRef, innerRef);
|
|
5578
|
-
return isElement$
|
|
5702
|
+
return isElement$2(children2) ? cloneElement(children2, { [refProp]: ref }) : children2;
|
|
5579
5703
|
}
|
|
5580
5704
|
function FocusTrapInitialFocus(props) {
|
|
5581
5705
|
return /* @__PURE__ */ jsx(VisuallyHidden, { tabIndex: -1, "data-autofocus": !0, ...props });
|
|
@@ -5688,7 +5812,7 @@ const defaultProps$h = {
|
|
|
5688
5812
|
defaultProps$h,
|
|
5689
5813
|
props
|
|
5690
5814
|
);
|
|
5691
|
-
if (!isElement$
|
|
5815
|
+
if (!isElement$2(children2))
|
|
5692
5816
|
throw new Error(
|
|
5693
5817
|
"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"
|
|
5694
5818
|
);
|
|
@@ -6082,8 +6206,8 @@ Loader.displayName = "@mantine/core/Loader";
|
|
|
6082
6206
|
var classes$c = { root: "m_8d3f4000", icon: "m_8d3afb97", loader: "m_302b9fb1", group: "m_1a0f1b21", groupSection: "m_437b6484" };
|
|
6083
6207
|
const defaultProps$e = {
|
|
6084
6208
|
orientation: "horizontal"
|
|
6085
|
-
}, varsResolver$f = (_, { borderWidth
|
|
6086
|
-
group: { "--ai-border-width": rem(
|
|
6209
|
+
}, varsResolver$f = (_, { borderWidth }) => ({
|
|
6210
|
+
group: { "--ai-border-width": rem(borderWidth) }
|
|
6087
6211
|
}), ActionIconGroup = factory((_props, ref) => {
|
|
6088
6212
|
const props = useProps("ActionIconGroup", defaultProps$e, _props), {
|
|
6089
6213
|
className,
|
|
@@ -6093,7 +6217,7 @@ const defaultProps$e = {
|
|
|
6093
6217
|
unstyled,
|
|
6094
6218
|
orientation,
|
|
6095
6219
|
vars,
|
|
6096
|
-
borderWidth
|
|
6220
|
+
borderWidth,
|
|
6097
6221
|
variant,
|
|
6098
6222
|
mod,
|
|
6099
6223
|
attributes,
|
|
@@ -6625,8 +6749,8 @@ function CheckIcon({ size: size2, style: style2, ...others }) {
|
|
|
6625
6749
|
var classes$7 = { root: "m_77c9d27d", inner: "m_80f1301b", label: "m_811560b9", section: "m_a74036a", loader: "m_a25b86ee", group: "m_80d6d844", groupSection: "m_70be2a01" };
|
|
6626
6750
|
const defaultProps$b = {
|
|
6627
6751
|
orientation: "horizontal"
|
|
6628
|
-
}, varsResolver$9 = (_, { borderWidth
|
|
6629
|
-
group: { "--button-border-width": rem(
|
|
6752
|
+
}, varsResolver$9 = (_, { borderWidth }) => ({
|
|
6753
|
+
group: { "--button-border-width": rem(borderWidth) }
|
|
6630
6754
|
}), ButtonGroup = factory((_props, ref) => {
|
|
6631
6755
|
const props = useProps("ButtonGroup", defaultProps$b, _props), {
|
|
6632
6756
|
className,
|
|
@@ -6636,7 +6760,7 @@ const defaultProps$b = {
|
|
|
6636
6760
|
unstyled,
|
|
6637
6761
|
orientation,
|
|
6638
6762
|
vars,
|
|
6639
|
-
borderWidth
|
|
6763
|
+
borderWidth,
|
|
6640
6764
|
variant,
|
|
6641
6765
|
mod,
|
|
6642
6766
|
attributes,
|
|
@@ -7177,7 +7301,7 @@ const MenuSubItem = polymorphicFactory((props, ref) => {
|
|
|
7177
7301
|
MenuSubItem.classes = classes$4;
|
|
7178
7302
|
MenuSubItem.displayName = "@mantine/core/MenuSubItem";
|
|
7179
7303
|
function MenuSubTarget({ children: children2, refProp }) {
|
|
7180
|
-
if (!isElement$
|
|
7304
|
+
if (!isElement$2(children2))
|
|
7181
7305
|
throw new Error(
|
|
7182
7306
|
"Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"
|
|
7183
7307
|
);
|
|
@@ -7230,7 +7354,7 @@ const defaultProps$7 = {
|
|
|
7230
7354
|
refProp: "ref"
|
|
7231
7355
|
}, MenuTarget = forwardRef((props, ref) => {
|
|
7232
7356
|
const { children: children2, refProp, ...others } = useProps("MenuTarget", defaultProps$7, props);
|
|
7233
|
-
if (!isElement$
|
|
7357
|
+
if (!isElement$2(children2))
|
|
7234
7358
|
throw new Error(
|
|
7235
7359
|
"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"
|
|
7236
7360
|
);
|
|
@@ -7471,7 +7595,7 @@ const defaultProps$5 = {
|
|
|
7471
7595
|
position,
|
|
7472
7596
|
defaultOpened
|
|
7473
7597
|
});
|
|
7474
|
-
if (!isElement$
|
|
7598
|
+
if (!isElement$2(children2))
|
|
7475
7599
|
throw new Error(
|
|
7476
7600
|
"[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"
|
|
7477
7601
|
);
|
|
@@ -7697,7 +7821,7 @@ const defaultProps$3 = {
|
|
|
7697
7821
|
vars,
|
|
7698
7822
|
varsResolver: varsResolver$3
|
|
7699
7823
|
});
|
|
7700
|
-
if (!target && !isElement$
|
|
7824
|
+
if (!target && !isElement$2(children2))
|
|
7701
7825
|
return null;
|
|
7702
7826
|
if (target) {
|
|
7703
7827
|
const transition2 = getTransitionProps(transitionProps, { duration: 100, transition: "fade" });
|
|
@@ -9897,12 +10021,12 @@ function* selection_iterator() {
|
|
|
9897
10021
|
for (var group = groups[j], i2 = 0, n2 = group.length, node; i2 < n2; ++i2)
|
|
9898
10022
|
(node = group[i2]) && (yield node);
|
|
9899
10023
|
}
|
|
9900
|
-
var root
|
|
10024
|
+
var root = [null];
|
|
9901
10025
|
function Selection$1(groups, parents) {
|
|
9902
10026
|
this._groups = groups, this._parents = parents;
|
|
9903
10027
|
}
|
|
9904
10028
|
function selection() {
|
|
9905
|
-
return new Selection$1([[document.documentElement]], root
|
|
10029
|
+
return new Selection$1([[document.documentElement]], root);
|
|
9906
10030
|
}
|
|
9907
10031
|
function selection_selection() {
|
|
9908
10032
|
return this;
|
|
@@ -9946,7 +10070,7 @@ Selection$1.prototype = selection.prototype = {
|
|
|
9946
10070
|
[Symbol.iterator]: selection_iterator
|
|
9947
10071
|
};
|
|
9948
10072
|
function select(selector2) {
|
|
9949
|
-
return typeof selector2 == "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root
|
|
10073
|
+
return typeof selector2 == "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root);
|
|
9950
10074
|
}
|
|
9951
10075
|
function sourceEvent(event) {
|
|
9952
10076
|
let sourceEvent2;
|
|
@@ -10458,11 +10582,47 @@ const interpolateRgb = function rgbGamma(y2) {
|
|
|
10458
10582
|
}
|
|
10459
10583
|
return rgb$1.gamma = rgbGamma, rgb$1;
|
|
10460
10584
|
}(1);
|
|
10585
|
+
function numberArray(a, b) {
|
|
10586
|
+
b || (b = []);
|
|
10587
|
+
var n2 = a ? Math.min(b.length, a.length) : 0, c = b.slice(), i2;
|
|
10588
|
+
return function(t2) {
|
|
10589
|
+
for (i2 = 0; i2 < n2; ++i2) c[i2] = a[i2] * (1 - t2) + b[i2] * t2;
|
|
10590
|
+
return c;
|
|
10591
|
+
};
|
|
10592
|
+
}
|
|
10593
|
+
function isNumberArray(x) {
|
|
10594
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
10595
|
+
}
|
|
10596
|
+
function genericArray(a, b) {
|
|
10597
|
+
var nb = b ? b.length : 0, na = a ? Math.min(nb, a.length) : 0, x = new Array(na), c = new Array(nb), i2;
|
|
10598
|
+
for (i2 = 0; i2 < na; ++i2) x[i2] = interpolate$1(a[i2], b[i2]);
|
|
10599
|
+
for (; i2 < nb; ++i2) c[i2] = b[i2];
|
|
10600
|
+
return function(t2) {
|
|
10601
|
+
for (i2 = 0; i2 < na; ++i2) c[i2] = x[i2](t2);
|
|
10602
|
+
return c;
|
|
10603
|
+
};
|
|
10604
|
+
}
|
|
10605
|
+
function date(a, b) {
|
|
10606
|
+
var d2 = /* @__PURE__ */ new Date();
|
|
10607
|
+
return a = +a, b = +b, function(t2) {
|
|
10608
|
+
return d2.setTime(a * (1 - t2) + b * t2), d2;
|
|
10609
|
+
};
|
|
10610
|
+
}
|
|
10461
10611
|
function interpolateNumber(a, b) {
|
|
10462
10612
|
return a = +a, b = +b, function(t2) {
|
|
10463
10613
|
return a * (1 - t2) + b * t2;
|
|
10464
10614
|
};
|
|
10465
10615
|
}
|
|
10616
|
+
function object(a, b) {
|
|
10617
|
+
var i2 = {}, c = {}, k;
|
|
10618
|
+
(a === null || typeof a != "object") && (a = {}), (b === null || typeof b != "object") && (b = {});
|
|
10619
|
+
for (k in b)
|
|
10620
|
+
k in a ? i2[k] = interpolate$1(a[k], b[k]) : c[k] = b[k];
|
|
10621
|
+
return function(t2) {
|
|
10622
|
+
for (k in i2) c[k] = i2[k](t2);
|
|
10623
|
+
return c;
|
|
10624
|
+
};
|
|
10625
|
+
}
|
|
10466
10626
|
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
|
|
10467
10627
|
function zero(b) {
|
|
10468
10628
|
return function() {
|
|
@@ -10483,6 +10643,10 @@ function interpolateString(a, b) {
|
|
|
10483
10643
|
return s2.join("");
|
|
10484
10644
|
});
|
|
10485
10645
|
}
|
|
10646
|
+
function interpolate$1(a, b) {
|
|
10647
|
+
var t2 = typeof b, c;
|
|
10648
|
+
return b == null || t2 === "boolean" ? constant$1(b) : (t2 === "number" ? interpolateNumber : t2 === "string" ? (c = color(b)) ? (b = c, interpolateRgb) : interpolateString : b instanceof color ? interpolateRgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf != "function" && typeof b.toString != "function" || isNaN(b) ? object : interpolateNumber)(a, b);
|
|
10649
|
+
}
|
|
10486
10650
|
var degrees = 180 / Math.PI, identity$2 = {
|
|
10487
10651
|
translateX: 0,
|
|
10488
10652
|
translateY: 0,
|
|
@@ -11463,7 +11627,22 @@ const errorMessages = {
|
|
|
11463
11627
|
}, infiniteExtent = [
|
|
11464
11628
|
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
|
11465
11629
|
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]
|
|
11466
|
-
], elementSelectionKeys = ["Enter", " ", "Escape"]
|
|
11630
|
+
], elementSelectionKeys = ["Enter", " ", "Escape"], defaultAriaLabelConfig = {
|
|
11631
|
+
"node.a11yDescription.default": "Press enter or space to select a node. Press delete to remove it and escape to cancel.",
|
|
11632
|
+
"node.a11yDescription.keyboardDisabled": "Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.",
|
|
11633
|
+
"node.a11yDescription.ariaLiveMessage": ({ direction, x, y: y2 }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y2}`,
|
|
11634
|
+
"edge.a11yDescription.default": "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.",
|
|
11635
|
+
// Control elements
|
|
11636
|
+
"controls.ariaLabel": "Control Panel",
|
|
11637
|
+
"controls.zoomIn.ariaLabel": "Zoom In",
|
|
11638
|
+
"controls.zoomOut.ariaLabel": "Zoom Out",
|
|
11639
|
+
"controls.fitView.ariaLabel": "Fit View",
|
|
11640
|
+
"controls.interactive.ariaLabel": "Toggle Interactivity",
|
|
11641
|
+
// Mini map
|
|
11642
|
+
"minimap.ariaLabel": "Mini Map",
|
|
11643
|
+
// Handle
|
|
11644
|
+
"handle.ariaLabel": "Handle"
|
|
11645
|
+
};
|
|
11467
11646
|
var ConnectionMode;
|
|
11468
11647
|
(function(ConnectionMode2) {
|
|
11469
11648
|
ConnectionMode2.Strict = "strict", ConnectionMode2.Loose = "loose";
|
|
@@ -11566,11 +11745,15 @@ async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom },
|
|
|
11566
11745
|
if (nodes.size === 0)
|
|
11567
11746
|
return Promise.resolve(!0);
|
|
11568
11747
|
const nodesToFit = getFitViewNodes(nodes, options), bounds = getInternalNodesBounds(nodesToFit), viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);
|
|
11569
|
-
return await panZoom.setViewport(viewport, {
|
|
11748
|
+
return await panZoom.setViewport(viewport, {
|
|
11749
|
+
duration: options?.duration,
|
|
11750
|
+
ease: options?.ease,
|
|
11751
|
+
interpolate: options?.interpolate
|
|
11752
|
+
}), Promise.resolve(!0);
|
|
11570
11753
|
}
|
|
11571
11754
|
function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError }) {
|
|
11572
11755
|
const node = nodeLookup.get(nodeId), parentNode = node.parentId ? nodeLookup.get(node.parentId) : void 0, { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 }, origin = node.origin ?? nodeOrigin;
|
|
11573
|
-
let extent = nodeExtent;
|
|
11756
|
+
let extent = node.extent || nodeExtent;
|
|
11574
11757
|
if (node.extent === "parent" && !node.expandParent)
|
|
11575
11758
|
if (!parentNode)
|
|
11576
11759
|
onError?.("005", errorMessages.error005());
|
|
@@ -11767,6 +11950,9 @@ function withResolvers() {
|
|
|
11767
11950
|
resolve = res, reject = rej;
|
|
11768
11951
|
}), resolve, reject };
|
|
11769
11952
|
}
|
|
11953
|
+
function mergeAriaLabelConfig(partial) {
|
|
11954
|
+
return { ...defaultAriaLabelConfig, ...partial || {} };
|
|
11955
|
+
}
|
|
11770
11956
|
function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = !1, transform: transform2, containerBounds }) {
|
|
11771
11957
|
const { x, y: y2 } = getEventPosition(event), pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y2 - (containerBounds?.top ?? 0) }, transform2), { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;
|
|
11772
11958
|
return {
|
|
@@ -11860,11 +12046,11 @@ function getEdgeCenter({ sourceX, sourceY, targetX, targetY }) {
|
|
|
11860
12046
|
const xOffset = Math.abs(targetX - sourceX) / 2, centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset, yOffset = Math.abs(targetY - sourceY) / 2, centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;
|
|
11861
12047
|
return [centerX, centerY, xOffset, yOffset];
|
|
11862
12048
|
}
|
|
11863
|
-
function getElevatedEdgeZIndex({ sourceNode, targetNode, selected: selected2 = !1, zIndex
|
|
11864
|
-
if (
|
|
12049
|
+
function getElevatedEdgeZIndex({ sourceNode, targetNode, selected: selected2 = !1, zIndex, elevateOnSelect = !1 }) {
|
|
12050
|
+
if (zIndex !== void 0)
|
|
11865
12051
|
return zIndex;
|
|
11866
|
-
const
|
|
11867
|
-
return
|
|
12052
|
+
const edgeZ = elevateOnSelect && selected2 ? 1e3 : 0, nodeZ = Math.max(sourceNode.parentId ? sourceNode.internals.z : 0, targetNode.parentId ? targetNode.internals.z : 0);
|
|
12053
|
+
return edgeZ + nodeZ;
|
|
11868
12054
|
}
|
|
11869
12055
|
function isEdgeVisible({ sourceNode, targetNode, width, height, transform: transform2 }) {
|
|
11870
12056
|
const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));
|
|
@@ -11901,21 +12087,21 @@ const handleDirections = {
|
|
|
11901
12087
|
[Position.Top]: { x: 0, y: -1 },
|
|
11902
12088
|
[Position.Bottom]: { x: 0, y: 1 }
|
|
11903
12089
|
}, getDirection = ({ source, sourcePosition = Position.Bottom, target }) => sourcePosition === Position.Left || sourcePosition === Position.Right ? source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 }, distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));
|
|
11904
|
-
function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset: offset2 }) {
|
|
12090
|
+
function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset: offset2, stepPosition }) {
|
|
11905
12091
|
const sourceDir = handleDirections[sourcePosition], targetDir = handleDirections[targetPosition], sourceGapped = { x: source.x + sourceDir.x * offset2, y: source.y + sourceDir.y * offset2 }, targetGapped = { x: target.x + targetDir.x * offset2, y: target.y + targetDir.y * offset2 }, dir = getDirection({
|
|
11906
12092
|
source: sourceGapped,
|
|
11907
12093
|
sourcePosition,
|
|
11908
12094
|
target: targetGapped
|
|
11909
12095
|
}), dirAccessor = dir.x !== 0 ? "x" : "y", currDir = dir[dirAccessor];
|
|
11910
12096
|
let points = [], centerX, centerY;
|
|
11911
|
-
const sourceGapOffset = { x: 0, y: 0 }, targetGapOffset = { x: 0, y: 0 }, [
|
|
12097
|
+
const sourceGapOffset = { x: 0, y: 0 }, targetGapOffset = { x: 0, y: 0 }, [, , defaultOffsetX, defaultOffsetY] = getEdgeCenter({
|
|
11912
12098
|
sourceX: source.x,
|
|
11913
12099
|
sourceY: source.y,
|
|
11914
12100
|
targetX: target.x,
|
|
11915
12101
|
targetY: target.y
|
|
11916
12102
|
});
|
|
11917
12103
|
if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {
|
|
11918
|
-
centerX = center.x ??
|
|
12104
|
+
dirAccessor === "x" ? (centerX = center.x ?? sourceGapped.x + (targetGapped.x - sourceGapped.x) * stepPosition, centerY = center.y ?? (sourceGapped.y + targetGapped.y) / 2) : (centerX = center.x ?? (sourceGapped.x + targetGapped.x) / 2, centerY = center.y ?? sourceGapped.y + (targetGapped.y - sourceGapped.y) * stepPosition);
|
|
11919
12105
|
const verticalSplit = [
|
|
11920
12106
|
{ x: centerX, y: sourceGapped.y },
|
|
11921
12107
|
{ x: centerX, y: targetGapped.y }
|
|
@@ -11959,14 +12145,15 @@ function getBend(a, b, c, size2) {
|
|
|
11959
12145
|
const xDir = a.x < c.x ? 1 : -1, yDir = a.y < c.y ? -1 : 1;
|
|
11960
12146
|
return `L ${x},${y2 + bendSize * yDir}Q ${x},${y2} ${x + bendSize * xDir},${y2}`;
|
|
11961
12147
|
}
|
|
11962
|
-
function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius: borderRadius2 = 5, centerX, centerY, offset: offset2 = 20 }) {
|
|
12148
|
+
function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius: borderRadius2 = 5, centerX, centerY, offset: offset2 = 20, stepPosition = 0.5 }) {
|
|
11963
12149
|
const [points, labelX, labelY, offsetX, offsetY] = getPoints({
|
|
11964
12150
|
source: { x: sourceX, y: sourceY },
|
|
11965
12151
|
sourcePosition,
|
|
11966
12152
|
target: { x: targetX, y: targetY },
|
|
11967
12153
|
targetPosition,
|
|
11968
12154
|
center: { x: centerX, y: centerY },
|
|
11969
|
-
offset: offset2
|
|
12155
|
+
offset: offset2,
|
|
12156
|
+
stepPosition
|
|
11970
12157
|
});
|
|
11971
12158
|
return [points.reduce((res, p, i2) => {
|
|
11972
12159
|
let segment = "";
|
|
@@ -12158,7 +12345,7 @@ function calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, select
|
|
|
12158
12345
|
return {
|
|
12159
12346
|
x: absolutePosition.x,
|
|
12160
12347
|
y: absolutePosition.y,
|
|
12161
|
-
z: parentZ
|
|
12348
|
+
z: parentZ >= childZ ? parentZ + 1 : childZ
|
|
12162
12349
|
};
|
|
12163
12350
|
}
|
|
12164
12351
|
function handleExpandParent(children2, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {
|
|
@@ -12350,28 +12537,43 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = !0 })
|
|
|
12350
12537
|
nodesFromDragItems
|
|
12351
12538
|
];
|
|
12352
12539
|
}
|
|
12540
|
+
function calculateSnapOffset({ dragItems, snapGrid, x, y: y2 }) {
|
|
12541
|
+
const refDragItem = dragItems.values().next().value;
|
|
12542
|
+
if (!refDragItem)
|
|
12543
|
+
return null;
|
|
12544
|
+
const refPos = {
|
|
12545
|
+
x: x - refDragItem.distance.x,
|
|
12546
|
+
y: y2 - refDragItem.distance.y
|
|
12547
|
+
}, refPosSnapped = snapPosition(refPos, snapGrid);
|
|
12548
|
+
return {
|
|
12549
|
+
x: refPosSnapped.x - refPos.x,
|
|
12550
|
+
y: refPosSnapped.y - refPos.y
|
|
12551
|
+
};
|
|
12552
|
+
}
|
|
12353
12553
|
function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop }) {
|
|
12354
|
-
let lastPos = { x: null, y: null }, autoPanId = 0, dragItems = /* @__PURE__ */ new Map(), autoPanStarted = !1, mousePosition = { x: 0, y: 0 }, containerBounds = null, dragStarted = !1, d3Selection = null, abortDrag = !1;
|
|
12554
|
+
let lastPos = { x: null, y: null }, autoPanId = 0, dragItems = /* @__PURE__ */ new Map(), autoPanStarted = !1, mousePosition = { x: 0, y: 0 }, containerBounds = null, dragStarted = !1, d3Selection = null, abortDrag = !1, nodePositionsChanged = !1, dragEvent = null;
|
|
12355
12555
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0 }) {
|
|
12356
12556
|
d3Selection = select(domNode);
|
|
12357
|
-
function updateNodes({ x, y: y2 }
|
|
12557
|
+
function updateNodes({ x, y: y2 }) {
|
|
12358
12558
|
const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions } = getStoreItems();
|
|
12359
12559
|
lastPos = { x, y: y2 };
|
|
12360
|
-
let hasChange = !1
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12560
|
+
let hasChange = !1;
|
|
12561
|
+
const isMultiDrag = dragItems.size > 1, nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null, multiDragSnapOffset = isMultiDrag && snapToGrid ? calculateSnapOffset({
|
|
12562
|
+
dragItems,
|
|
12563
|
+
snapGrid,
|
|
12564
|
+
x,
|
|
12565
|
+
y: y2
|
|
12566
|
+
}) : null;
|
|
12365
12567
|
for (const [id2, dragItem] of dragItems) {
|
|
12366
12568
|
if (!nodeLookup.has(id2))
|
|
12367
12569
|
continue;
|
|
12368
12570
|
let nextPosition = { x: x - dragItem.distance.x, y: y2 - dragItem.distance.y };
|
|
12369
|
-
snapToGrid && (nextPosition =
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
if (
|
|
12571
|
+
snapToGrid && (nextPosition = multiDragSnapOffset ? {
|
|
12572
|
+
x: nextPosition.x + multiDragSnapOffset.x,
|
|
12573
|
+
y: nextPosition.y + multiDragSnapOffset.y
|
|
12574
|
+
} : snapPosition(nextPosition, snapGrid));
|
|
12575
|
+
let adjustedNodeExtent = null;
|
|
12576
|
+
if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {
|
|
12375
12577
|
const { positionAbsolute: positionAbsolute2 } = dragItem.internals, x1 = positionAbsolute2.x - nodesBox.x + nodeExtent[0][0], x2 = positionAbsolute2.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0], y1 = positionAbsolute2.y - nodesBox.y + nodeExtent[0][1], y22 = positionAbsolute2.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];
|
|
12376
12578
|
adjustedNodeExtent = [
|
|
12377
12579
|
[x1, y1],
|
|
@@ -12382,13 +12584,13 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12382
12584
|
nodeId: id2,
|
|
12383
12585
|
nextPosition,
|
|
12384
12586
|
nodeLookup,
|
|
12385
|
-
nodeExtent: adjustedNodeExtent,
|
|
12587
|
+
nodeExtent: adjustedNodeExtent || nodeExtent,
|
|
12386
12588
|
nodeOrigin,
|
|
12387
12589
|
onError
|
|
12388
12590
|
});
|
|
12389
12591
|
hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y, dragItem.position = position, dragItem.internals.positionAbsolute = positionAbsolute;
|
|
12390
12592
|
}
|
|
12391
|
-
if (hasChange && (updateNodePositions(dragItems, !0), dragEvent && (onDrag || onNodeDrag || !nodeId && onSelectionDrag))) {
|
|
12593
|
+
if (nodePositionsChanged = nodePositionsChanged || hasChange, !!hasChange && (updateNodePositions(dragItems, !0), dragEvent && (onDrag || onNodeDrag || !nodeId && onSelectionDrag))) {
|
|
12392
12594
|
const [currentNode, currentNodes] = getEventHandlerParams({
|
|
12393
12595
|
nodeId,
|
|
12394
12596
|
dragItems,
|
|
@@ -12406,7 +12608,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12406
12608
|
return;
|
|
12407
12609
|
}
|
|
12408
12610
|
const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);
|
|
12409
|
-
(xMovement !== 0 || yMovement !== 0) && (lastPos.x = (lastPos.x ?? 0) - xMovement / transform2[2], lastPos.y = (lastPos.y ?? 0) - yMovement / transform2[2], await panBy2({ x: xMovement, y: yMovement }) && updateNodes(lastPos
|
|
12611
|
+
(xMovement !== 0 || yMovement !== 0) && (lastPos.x = (lastPos.x ?? 0) - xMovement / transform2[2], lastPos.y = (lastPos.y ?? 0) - yMovement / transform2[2], await panBy2({ x: xMovement, y: yMovement }) && updateNodes(lastPos)), autoPanId = requestAnimationFrame(autoPan);
|
|
12410
12612
|
}
|
|
12411
12613
|
function startDrag(event) {
|
|
12412
12614
|
const { nodeLookup, multiSelectionActive, nodesDraggable, transform: transform2, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges } = getStoreItems();
|
|
@@ -12423,21 +12625,21 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
12423
12625
|
}
|
|
12424
12626
|
const d3DragInstance = drag().clickDistance(nodeClickDistance).on("start", (event) => {
|
|
12425
12627
|
const { domNode: domNode2, nodeDragThreshold, transform: transform2, snapGrid, snapToGrid } = getStoreItems();
|
|
12426
|
-
containerBounds = domNode2?.getBoundingClientRect() || null, abortDrag = !1, nodeDragThreshold === 0 && startDrag(event), lastPos = getPointerPosition(event.sourceEvent, { transform: transform2, snapGrid, snapToGrid, containerBounds }), mousePosition = getEventPosition(event.sourceEvent, containerBounds);
|
|
12628
|
+
containerBounds = domNode2?.getBoundingClientRect() || null, abortDrag = !1, nodePositionsChanged = !1, dragEvent = event.sourceEvent, nodeDragThreshold === 0 && startDrag(event), lastPos = getPointerPosition(event.sourceEvent, { transform: transform2, snapGrid, snapToGrid, containerBounds }), mousePosition = getEventPosition(event.sourceEvent, containerBounds);
|
|
12427
12629
|
}).on("drag", (event) => {
|
|
12428
12630
|
const { autoPanOnNodeDrag, transform: transform2, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems(), pointerPos = getPointerPosition(event.sourceEvent, { transform: transform2, snapGrid, snapToGrid, containerBounds });
|
|
12429
|
-
if ((event.sourceEvent.type === "touchmove" && event.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
12631
|
+
if (dragEvent = event.sourceEvent, (event.sourceEvent.type === "touchmove" && event.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
12430
12632
|
nodeId && !nodeLookup.has(nodeId)) && (abortDrag = !0), !abortDrag) {
|
|
12431
12633
|
if (!autoPanStarted && autoPanOnNodeDrag && dragStarted && (autoPanStarted = !0, autoPan()), !dragStarted) {
|
|
12432
12634
|
const x = pointerPos.xSnapped - (lastPos.x ?? 0), y2 = pointerPos.ySnapped - (lastPos.y ?? 0);
|
|
12433
12635
|
Math.sqrt(x * x + y2 * y2) > nodeDragThreshold && startDrag(event);
|
|
12434
12636
|
}
|
|
12435
|
-
(lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted && (mousePosition = getEventPosition(event.sourceEvent, containerBounds), updateNodes(pointerPos
|
|
12637
|
+
(lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted && (mousePosition = getEventPosition(event.sourceEvent, containerBounds), updateNodes(pointerPos));
|
|
12436
12638
|
}
|
|
12437
12639
|
}).on("end", (event) => {
|
|
12438
12640
|
if (!(!dragStarted || abortDrag) && (autoPanStarted = !1, dragStarted = !1, cancelAnimationFrame(autoPanId), dragItems.size > 0)) {
|
|
12439
12641
|
const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();
|
|
12440
|
-
if (updateNodePositions(dragItems, !1), onDragStop || onNodeDragStop || !nodeId && onSelectionDragStop) {
|
|
12642
|
+
if (nodePositionsChanged && (updateNodePositions(dragItems, !1), nodePositionsChanged = !1), onDragStop || onNodeDragStop || !nodeId && onSelectionDragStop) {
|
|
12441
12643
|
const [currentNode, currentNodes] = getEventHandlerParams({
|
|
12442
12644
|
nodeId,
|
|
12443
12645
|
dragItems,
|
|
@@ -12508,16 +12710,17 @@ function isConnectionValid(isInsideConnectionRadius, isHandleValid) {
|
|
|
12508
12710
|
return isHandleValid ? isValid = !0 : isInsideConnectionRadius && !isHandleValid && (isValid = !1), isValid;
|
|
12509
12711
|
}
|
|
12510
12712
|
const alwaysValid = () => !0;
|
|
12511
|
-
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy: panBy2, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed }) {
|
|
12713
|
+
function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy: panBy2, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode }) {
|
|
12512
12714
|
const doc = getHostForElement(event.target);
|
|
12513
12715
|
let autoPanId = 0, closestHandle;
|
|
12514
|
-
const { x, y: y2 } = getEventPosition(event),
|
|
12716
|
+
const { x, y: y2 } = getEventPosition(event), handleType = getHandleType(edgeUpdaterType, handleDomNode), containerBounds = domNode?.getBoundingClientRect();
|
|
12717
|
+
let connectionStarted = !1;
|
|
12515
12718
|
if (!containerBounds || !handleType)
|
|
12516
12719
|
return;
|
|
12517
12720
|
const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);
|
|
12518
12721
|
if (!fromHandleInternal)
|
|
12519
12722
|
return;
|
|
12520
|
-
let position = getEventPosition(event, containerBounds), autoPanStarted = !1, connection = null, isValid = !1,
|
|
12723
|
+
let position = getEventPosition(event, containerBounds), autoPanStarted = !1, connection = null, isValid = !1, resultHandleDomNode = null;
|
|
12521
12724
|
function autoPan() {
|
|
12522
12725
|
if (!autoPanOnConnect || !containerBounds)
|
|
12523
12726
|
return;
|
|
@@ -12529,7 +12732,8 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12529
12732
|
nodeId,
|
|
12530
12733
|
type: handleType,
|
|
12531
12734
|
position: fromHandleInternal.position
|
|
12532
|
-
}, fromNodeInternal = nodeLookup.get(nodeId)
|
|
12735
|
+
}, fromNodeInternal = nodeLookup.get(nodeId);
|
|
12736
|
+
let previousConnection = {
|
|
12533
12737
|
inProgress: !0,
|
|
12534
12738
|
isValid: null,
|
|
12535
12739
|
from: getHandlePosition(fromNodeInternal, fromHandle, Position.Left, !0),
|
|
@@ -12541,10 +12745,17 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12541
12745
|
toPosition: oppositePosition[fromHandle.position],
|
|
12542
12746
|
toNode: null
|
|
12543
12747
|
};
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12748
|
+
function startConnection() {
|
|
12749
|
+
connectionStarted = !0, updateConnection(previousConnection), onConnectStart?.(event, { nodeId, handleId, handleType });
|
|
12750
|
+
}
|
|
12751
|
+
dragThreshold === 0 && startConnection();
|
|
12547
12752
|
function onPointerMove(event2) {
|
|
12753
|
+
if (!connectionStarted) {
|
|
12754
|
+
const { x: evtX, y: evtY } = getEventPosition(event2), dx = evtX - x, dy = evtY - y2;
|
|
12755
|
+
if (!(dx * dx + dy * dy > dragThreshold * dragThreshold))
|
|
12756
|
+
return;
|
|
12757
|
+
startConnection();
|
|
12758
|
+
}
|
|
12548
12759
|
if (!getFromHandle() || !fromHandle) {
|
|
12549
12760
|
onPointerUp(event2);
|
|
12550
12761
|
return;
|
|
@@ -12563,8 +12774,8 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12563
12774
|
flowId,
|
|
12564
12775
|
nodeLookup
|
|
12565
12776
|
});
|
|
12566
|
-
|
|
12567
|
-
const
|
|
12777
|
+
resultHandleDomNode = result.handleDomNode, connection = result.connection, isValid = isConnectionValid(!!closestHandle, result.isValid);
|
|
12778
|
+
const newConnection = {
|
|
12568
12779
|
// from stays the same
|
|
12569
12780
|
...previousConnection,
|
|
12570
12781
|
isValid,
|
|
@@ -12573,15 +12784,18 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
12573
12784
|
toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],
|
|
12574
12785
|
toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null
|
|
12575
12786
|
};
|
|
12576
|
-
isValid && closestHandle && previousConnection.toHandle &&
|
|
12787
|
+
isValid && closestHandle && previousConnection.toHandle && newConnection.toHandle && previousConnection.toHandle.type === newConnection.toHandle.type && previousConnection.toHandle.nodeId === newConnection.toHandle.nodeId && previousConnection.toHandle.id === newConnection.toHandle.id && previousConnection.to.x === newConnection.to.x && previousConnection.to.y === newConnection.to.y || (updateConnection(newConnection), previousConnection = newConnection);
|
|
12577
12788
|
}
|
|
12578
12789
|
function onPointerUp(event2) {
|
|
12579
|
-
(
|
|
12580
|
-
|
|
12581
|
-
...connectionState,
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12790
|
+
if (connectionStarted) {
|
|
12791
|
+
(closestHandle || resultHandleDomNode) && connection && isValid && onConnect?.(connection);
|
|
12792
|
+
const { inProgress, ...connectionState } = previousConnection, finalConnectionState = {
|
|
12793
|
+
...connectionState,
|
|
12794
|
+
toPosition: previousConnection.toHandle ? previousConnection.toPosition : null
|
|
12795
|
+
};
|
|
12796
|
+
onConnectEnd?.(event2, finalConnectionState), edgeUpdaterType && onReconnectEnd?.(event2, finalConnectionState);
|
|
12797
|
+
}
|
|
12798
|
+
cancelConnection(), cancelAnimationFrame(autoPanId), autoPanStarted = !1, isValid = !1, connection = null, resultHandleDomNode = null, doc.removeEventListener("mousemove", onPointerMove), doc.removeEventListener("mouseup", onPointerUp), doc.removeEventListener("touchmove", onPointerMove), doc.removeEventListener("touchend", onPointerUp);
|
|
12585
12799
|
}
|
|
12586
12800
|
doc.addEventListener("mousemove", onPointerMove), doc.addEventListener("mouseup", onPointerUp), doc.addEventListener("touchmove", onPointerMove), doc.addEventListener("touchend", onPointerUp);
|
|
12587
12801
|
}
|
|
@@ -12614,12 +12828,11 @@ const XYHandle = {
|
|
|
12614
12828
|
};
|
|
12615
12829
|
function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {
|
|
12616
12830
|
const selection2 = select(domNode);
|
|
12617
|
-
function update({ translateExtent, width, height, zoomStep =
|
|
12831
|
+
function update({ translateExtent, width, height, zoomStep = 1, pannable = !0, zoomable = !0, inversePan = !1 }) {
|
|
12618
12832
|
const zoomHandler = (event) => {
|
|
12619
|
-
const transform2 = getTransform();
|
|
12620
12833
|
if (event.sourceEvent.type !== "wheel" || !panZoom)
|
|
12621
12834
|
return;
|
|
12622
|
-
const pinchDelta = -event.sourceEvent.deltaY * (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 2e-3) * zoomStep, nextZoom = transform2[2] * Math.pow(2, pinchDelta);
|
|
12835
|
+
const transform2 = getTransform(), factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1, pinchDelta = -event.sourceEvent.deltaY * (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 2e-3) * zoomStep, nextZoom = transform2[2] * Math.pow(2, pinchDelta * factor);
|
|
12623
12836
|
panZoom.scaleTo(nextZoom);
|
|
12624
12837
|
};
|
|
12625
12838
|
let panStart = [0, 0];
|
|
@@ -12665,10 +12878,10 @@ const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventVie
|
|
|
12665
12878
|
x: transform2.x,
|
|
12666
12879
|
y: transform2.y,
|
|
12667
12880
|
zoom: transform2.k
|
|
12668
|
-
}), viewportToTransform = ({ x, y: y2, zoom: zoom2 }) => identity$1.translate(x, y2).scale(zoom2), isWrappedWithClass = (event, className) => event.target.closest(`.${className}`), isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2), getD3Transition = (selection2, duration = 0, onEnd = () => {
|
|
12881
|
+
}), viewportToTransform = ({ x, y: y2, zoom: zoom2 }) => identity$1.translate(x, y2).scale(zoom2), isWrappedWithClass = (event, className) => event.target.closest(`.${className}`), isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2), defaultEase = (t2) => ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2, getD3Transition = (selection2, duration = 0, ease = defaultEase, onEnd = () => {
|
|
12669
12882
|
}) => {
|
|
12670
12883
|
const hasDuration = typeof duration == "number" && duration > 0;
|
|
12671
|
-
return hasDuration || onEnd(), hasDuration ? selection2.transition().duration(duration).on("end", onEnd) : selection2;
|
|
12884
|
+
return hasDuration || onEnd(), hasDuration ? selection2.transition().duration(duration).ease(ease).on("end", onEnd) : selection2;
|
|
12672
12885
|
}, wheelDelta = (event) => {
|
|
12673
12886
|
const factor = event.ctrlKey && isMacOs() ? 10 : 1;
|
|
12674
12887
|
return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * factor;
|
|
@@ -12771,7 +12984,7 @@ function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExte
|
|
|
12771
12984
|
d3ZoomInstance.wheelDelta(wheelDelta);
|
|
12772
12985
|
function setTransform(transform2, options) {
|
|
12773
12986
|
return d3Selection ? new Promise((resolve) => {
|
|
12774
|
-
d3ZoomInstance?.transform(getD3Transition(d3Selection, options?.duration, () => resolve(!0)), transform2);
|
|
12987
|
+
d3ZoomInstance?.interpolate(options?.interpolate === "linear" ? interpolate$1 : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(!0)), transform2);
|
|
12775
12988
|
}) : Promise.resolve(!1);
|
|
12776
12989
|
}
|
|
12777
12990
|
function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange }) {
|
|
@@ -12854,12 +13067,12 @@ function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExte
|
|
|
12854
13067
|
}
|
|
12855
13068
|
function scaleTo(zoom2, options) {
|
|
12856
13069
|
return d3Selection ? new Promise((resolve) => {
|
|
12857
|
-
d3ZoomInstance?.scaleTo(getD3Transition(d3Selection, options?.duration, () => resolve(!0)), zoom2);
|
|
13070
|
+
d3ZoomInstance?.interpolate(options?.interpolate === "linear" ? interpolate$1 : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(!0)), zoom2);
|
|
12858
13071
|
}) : Promise.resolve(!1);
|
|
12859
13072
|
}
|
|
12860
13073
|
function scaleBy(factor, options) {
|
|
12861
13074
|
return d3Selection ? new Promise((resolve) => {
|
|
12862
|
-
d3ZoomInstance?.scaleBy(getD3Transition(d3Selection, options?.duration, () => resolve(!0)), factor);
|
|
13075
|
+
d3ZoomInstance?.interpolate(options?.interpolate === "linear" ? interpolate$1 : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(!0)), factor);
|
|
12863
13076
|
}) : Promise.resolve(!1);
|
|
12864
13077
|
}
|
|
12865
13078
|
function setScaleExtent(scaleExtent) {
|
|
@@ -13145,7 +13358,7 @@ function requireWithSelector_production() {
|
|
|
13145
13358
|
function is(x, y2) {
|
|
13146
13359
|
return x === y2 && (x !== 0 || 1 / x === 1 / y2) || x !== x && y2 !== y2;
|
|
13147
13360
|
}
|
|
13148
|
-
var objectIs = typeof Object.is == "function" ? Object.is : is,
|
|
13361
|
+
var objectIs = typeof Object.is == "function" ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect2 = React2.useEffect, useMemo2 = React2.useMemo, useDebugValue2 = React2.useDebugValue;
|
|
13149
13362
|
return withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual2) {
|
|
13150
13363
|
var instRef = useRef2(null);
|
|
13151
13364
|
if (instRef.current === null) {
|
|
@@ -13179,7 +13392,7 @@ function requireWithSelector_production() {
|
|
|
13179
13392
|
},
|
|
13180
13393
|
[getSnapshot, getServerSnapshot, selector2, isEqual2]
|
|
13181
13394
|
);
|
|
13182
|
-
var value =
|
|
13395
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
13183
13396
|
return useEffect2(
|
|
13184
13397
|
function() {
|
|
13185
13398
|
inst.hasValue = !0, inst.value = value;
|
|
@@ -13250,7 +13463,7 @@ function shallow$1(objA, objB) {
|
|
|
13250
13463
|
return !0;
|
|
13251
13464
|
}
|
|
13252
13465
|
const StoreContext = createContext(null), Provider$1 = StoreContext.Provider, zustandErrorMessage = errorMessages.error001();
|
|
13253
|
-
function useStore
|
|
13466
|
+
function useStore(selector2, equalityFn) {
|
|
13254
13467
|
const store = useContext(StoreContext);
|
|
13255
13468
|
if (store === null)
|
|
13256
13469
|
throw new Error(zustandErrorMessage);
|
|
@@ -13276,17 +13489,18 @@ const style$1 = { display: "none" }, ariaLiveStyle = {
|
|
|
13276
13489
|
overflow: "hidden",
|
|
13277
13490
|
clip: "rect(0px, 0px, 0px, 0px)",
|
|
13278
13491
|
clipPath: "inset(100%)"
|
|
13279
|
-
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live",
|
|
13492
|
+
}, ARIA_NODE_DESC_KEY = "react-flow__node-desc", ARIA_EDGE_DESC_KEY = "react-flow__edge-desc", ARIA_LIVE_MESSAGE = "react-flow__aria-live", ariaLiveSelector = (s2) => s2.ariaLiveMessage, ariaLabelConfigSelector = (s2) => s2.ariaLabelConfig;
|
|
13280
13493
|
function AriaLiveMessage({ rfId }) {
|
|
13281
|
-
const ariaLiveMessage = useStore
|
|
13494
|
+
const ariaLiveMessage = useStore(ariaLiveSelector);
|
|
13282
13495
|
return jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage });
|
|
13283
13496
|
}
|
|
13284
13497
|
function A11yDescriptions({ rfId, disableKeyboardA11y }) {
|
|
13285
|
-
|
|
13498
|
+
const ariaLabelConfig = useStore(ariaLabelConfigSelector);
|
|
13499
|
+
return jsxs(Fragment$1, { children: [jsx("div", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style$1, children: disableKeyboardA11y ? ariaLabelConfig["node.a11yDescription.default"] : ariaLabelConfig["node.a11yDescription.keyboardDisabled"] }), jsx("div", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style$1, children: ariaLabelConfig["edge.a11yDescription.default"] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId })] });
|
|
13286
13500
|
}
|
|
13287
|
-
const
|
|
13288
|
-
const
|
|
13289
|
-
return jsx("div", { className: cc(["react-flow__panel", className, ...positionClasses]), style:
|
|
13501
|
+
const Panel = forwardRef(({ position = "top-left", children: children2, className, style: style2, ...rest }, ref) => {
|
|
13502
|
+
const positionClasses = `${position}`.split("-");
|
|
13503
|
+
return jsx("div", { className: cc(["react-flow__panel", className, ...positionClasses]), style: style2, ref, ...rest, children: children2 });
|
|
13290
13504
|
});
|
|
13291
13505
|
Panel.displayName = "Panel";
|
|
13292
13506
|
function Attribution({ proOptions, position = "bottom-right" }) {
|
|
@@ -13304,7 +13518,7 @@ function areEqual(a, b) {
|
|
|
13304
13518
|
return shallow$1(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) && shallow$1(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId));
|
|
13305
13519
|
}
|
|
13306
13520
|
function SelectionListenerInner({ onSelectionChange }) {
|
|
13307
|
-
const store = useStoreApi(), { selectedNodes, selectedEdges } = useStore
|
|
13521
|
+
const store = useStoreApi(), { selectedNodes, selectedEdges } = useStore(selector$m, areEqual);
|
|
13308
13522
|
return useEffect(() => {
|
|
13309
13523
|
const params = { nodes: selectedNodes, edges: selectedEdges };
|
|
13310
13524
|
onSelectionChange?.(params), store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));
|
|
@@ -13312,7 +13526,7 @@ function SelectionListenerInner({ onSelectionChange }) {
|
|
|
13312
13526
|
}
|
|
13313
13527
|
const changeSelector = (s2) => !!s2.onSelectionChangeHandlers;
|
|
13314
13528
|
function SelectionListener({ onSelectionChange }) {
|
|
13315
|
-
const storeHasSelectionChangeHandlers = useStore
|
|
13529
|
+
const storeHasSelectionChangeHandlers = useStore(changeSelector);
|
|
13316
13530
|
return onSelectionChange || storeHasSelectionChangeHandlers ? jsx(SelectionListenerInner, { onSelectionChange }) : null;
|
|
13317
13531
|
}
|
|
13318
13532
|
const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, reactFlowFieldsToTrack = [
|
|
@@ -13326,6 +13540,7 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
|
|
|
13326
13540
|
"onClickConnectStart",
|
|
13327
13541
|
"onClickConnectEnd",
|
|
13328
13542
|
"nodesDraggable",
|
|
13543
|
+
"autoPanOnNodeFocus",
|
|
13329
13544
|
"nodesConnectable",
|
|
13330
13545
|
"nodesFocusable",
|
|
13331
13546
|
"edgesFocusable",
|
|
@@ -13367,10 +13582,12 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
|
|
|
13367
13582
|
"isValidConnection",
|
|
13368
13583
|
"selectNodesOnDrag",
|
|
13369
13584
|
"nodeDragThreshold",
|
|
13585
|
+
"connectionDragThreshold",
|
|
13370
13586
|
"onBeforeDelete",
|
|
13371
13587
|
"debug",
|
|
13372
13588
|
"autoPanSpeed",
|
|
13373
|
-
"paneClickDistance"
|
|
13589
|
+
"paneClickDistance",
|
|
13590
|
+
"ariaLabelConfig"
|
|
13374
13591
|
], fieldsToTrack = [...reactFlowFieldsToTrack, "rfId"], selector$l = (s2) => ({
|
|
13375
13592
|
setNodes: s2.setNodes,
|
|
13376
13593
|
setEdges: s2.setEdges,
|
|
@@ -13397,7 +13614,7 @@ const defaultNodeOrigin = [0, 0], defaultViewport = { x: 0, y: 0, zoom: 1 }, rea
|
|
|
13397
13614
|
paneClickDistance: 0
|
|
13398
13615
|
};
|
|
13399
13616
|
function StoreUpdater(props) {
|
|
13400
|
-
const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance } = useStore
|
|
13617
|
+
const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance } = useStore(selector$l, shallow$1), store = useStoreApi();
|
|
13401
13618
|
useEffect(() => (setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges), () => {
|
|
13402
13619
|
previousFields.current = initPrevValues, reset();
|
|
13403
13620
|
}), []);
|
|
@@ -13406,7 +13623,7 @@ function StoreUpdater(props) {
|
|
|
13406
13623
|
() => {
|
|
13407
13624
|
for (const fieldName of fieldsToTrack) {
|
|
13408
13625
|
const fieldValue = props[fieldName], previousFieldValue = previousFields.current[fieldName];
|
|
13409
|
-
fieldValue !== previousFieldValue && (typeof props[fieldName] > "u" || (fieldName === "nodes" ? setNodes(fieldValue) : fieldName === "edges" ? setEdges(fieldValue) : fieldName === "minZoom" ? setMinZoom(fieldValue) : fieldName === "maxZoom" ? setMaxZoom(fieldValue) : fieldName === "translateExtent" ? setTranslateExtent(fieldValue) : fieldName === "nodeExtent" ? setNodeExtent(fieldValue) : fieldName === "paneClickDistance" ? setPaneClickDistance(fieldValue) : fieldName === "fitView" ? store.setState({ fitViewQueued: fieldValue }) : fieldName === "fitViewOptions" ? store.setState({ fitViewOptions: fieldValue }) : store.setState({ [fieldName]: fieldValue })));
|
|
13626
|
+
fieldValue !== previousFieldValue && (typeof props[fieldName] > "u" || (fieldName === "nodes" ? setNodes(fieldValue) : fieldName === "edges" ? setEdges(fieldValue) : fieldName === "minZoom" ? setMinZoom(fieldValue) : fieldName === "maxZoom" ? setMaxZoom(fieldValue) : fieldName === "translateExtent" ? setTranslateExtent(fieldValue) : fieldName === "nodeExtent" ? setNodeExtent(fieldValue) : fieldName === "paneClickDistance" ? setPaneClickDistance(fieldValue) : fieldName === "ariaLabelConfig" ? store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) }) : fieldName === "fitView" ? store.setState({ fitViewQueued: fieldValue }) : fieldName === "fitViewOptions" ? store.setState({ fitViewOptions: fieldValue }) : store.setState({ [fieldName]: fieldValue })));
|
|
13410
13627
|
}
|
|
13411
13628
|
previousFields.current = props;
|
|
13412
13629
|
},
|
|
@@ -13495,23 +13712,20 @@ const useViewportHelper = () => {
|
|
|
13495
13712
|
x: viewport.x ?? tX,
|
|
13496
13713
|
y: viewport.y ?? tY,
|
|
13497
13714
|
zoom: viewport.zoom ?? tZoom
|
|
13498
|
-
},
|
|
13715
|
+
}, options), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
13499
13716
|
},
|
|
13500
13717
|
getViewport: () => {
|
|
13501
13718
|
const [x, y2, zoom2] = store.getState().transform;
|
|
13502
13719
|
return { x, y: y2, zoom: zoom2 };
|
|
13503
13720
|
},
|
|
13504
|
-
setCenter: async (x, y2, options) =>
|
|
13505
|
-
const { width, height, maxZoom, panZoom } = store.getState(), nextZoom = typeof options?.zoom < "u" ? options.zoom : maxZoom, centerX = width / 2 - x * nextZoom, centerY = height / 2 - y2 * nextZoom;
|
|
13506
|
-
return panZoom ? (await panZoom.setViewport({
|
|
13507
|
-
x: centerX,
|
|
13508
|
-
y: centerY,
|
|
13509
|
-
zoom: nextZoom
|
|
13510
|
-
}, { duration: options?.duration }), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
13511
|
-
},
|
|
13721
|
+
setCenter: async (x, y2, options) => store.getState().setCenter(x, y2, options),
|
|
13512
13722
|
fitBounds: async (bounds, options) => {
|
|
13513
13723
|
const { width, height, minZoom, maxZoom, panZoom } = store.getState(), viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);
|
|
13514
|
-
return panZoom ? (await panZoom.setViewport(viewport, {
|
|
13724
|
+
return panZoom ? (await panZoom.setViewport(viewport, {
|
|
13725
|
+
duration: options?.duration,
|
|
13726
|
+
ease: options?.ease,
|
|
13727
|
+
interpolate: options?.interpolate
|
|
13728
|
+
}), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
13515
13729
|
},
|
|
13516
13730
|
screenToFlowPosition: (clientPosition, options = {}) => {
|
|
13517
13731
|
const { transform: transform2, snapGrid, snapToGrid, domNode } = store.getState();
|
|
@@ -13680,7 +13894,7 @@ function useBatchContext() {
|
|
|
13680
13894
|
}
|
|
13681
13895
|
const selector$k = (s2) => !!s2.panZoom;
|
|
13682
13896
|
function useReactFlow() {
|
|
13683
|
-
const viewportHelper = useViewportHelper(), store = useStoreApi(), batchContext = useBatchContext(), viewportInitialized = useStore
|
|
13897
|
+
const viewportHelper = useViewportHelper(), store = useStoreApi(), batchContext = useBatchContext(), viewportInitialized = useStore(selector$k), generalHelper = useMemo(() => {
|
|
13684
13898
|
const getInternalNode = (id2) => store.getState().nodeLookup.get(id2), setNodes = (payload) => {
|
|
13685
13899
|
batchContext.nodeQueue.push(payload);
|
|
13686
13900
|
}, setEdges = (payload) => {
|
|
@@ -13766,7 +13980,7 @@ function useReactFlow() {
|
|
|
13766
13980
|
if (internalNode && !isRect && (n2.id === nodeOrRect.id || !internalNode.internals.positionAbsolute))
|
|
13767
13981
|
return !1;
|
|
13768
13982
|
const currNodeRect = nodeToRect(hasNodesOption ? n2 : internalNode), overlappingArea = getOverlappingArea(currNodeRect, nodeRect);
|
|
13769
|
-
return partially && overlappingArea > 0 || overlappingArea >= nodeRect.width * nodeRect.height;
|
|
13983
|
+
return partially && overlappingArea > 0 || overlappingArea >= currNodeRect.width * currNodeRect.height || overlappingArea >= nodeRect.width * nodeRect.height;
|
|
13770
13984
|
}) : [];
|
|
13771
13985
|
},
|
|
13772
13986
|
isNodeIntersecting: (nodeOrRect, area, partially = !0) => {
|
|
@@ -13849,7 +14063,7 @@ const containerStyle = {
|
|
|
13849
14063
|
lib: s2.lib
|
|
13850
14064
|
});
|
|
13851
14065
|
function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = !0, children: children2, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance }) {
|
|
13852
|
-
const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib } = useStore
|
|
14066
|
+
const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib } = useStore(selector$j, shallow$1), zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode), panZoom = useRef();
|
|
13853
14067
|
useResizeHandler(zoomPane);
|
|
13854
14068
|
const onTransformChange = useCallback((transform2) => {
|
|
13855
14069
|
onViewportChange?.({ x: transform2[0], y: transform2[1], zoom: transform2[2] }), isControlledViewport || store.setState({ transform: transform2 });
|
|
@@ -13927,7 +14141,7 @@ const selector$i = (s2) => ({
|
|
|
13927
14141
|
userSelectionRect: s2.userSelectionRect
|
|
13928
14142
|
});
|
|
13929
14143
|
function UserSelection() {
|
|
13930
|
-
const { userSelectionActive, userSelectionRect } = useStore
|
|
14144
|
+
const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow$1);
|
|
13931
14145
|
return userSelectionActive && userSelectionRect ? jsx("div", { className: "react-flow__selection react-flow__container", style: {
|
|
13932
14146
|
width: userSelectionRect.width,
|
|
13933
14147
|
height: userSelectionRect.height,
|
|
@@ -13943,7 +14157,7 @@ const wrapHandler = (handler, containerRef) => (event) => {
|
|
|
13943
14157
|
dragging: s2.paneDragging
|
|
13944
14158
|
});
|
|
13945
14159
|
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children: children2 }) {
|
|
13946
|
-
const store = useStoreApi(), { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore
|
|
14160
|
+
const store = useStoreApi(), { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow$1), hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive), container2 = useRef(null), containerBounds = useRef(), selectedNodeIds = useRef(/* @__PURE__ */ new Set()), selectedEdgeIds = useRef(/* @__PURE__ */ new Set()), selectionInProgress = useRef(!1), selectionStarted = useRef(!1), onClick = (event) => {
|
|
13947
14161
|
if (selectionInProgress.current || connectionInProgress) {
|
|
13948
14162
|
selectionInProgress.current = !1;
|
|
13949
14163
|
return;
|
|
@@ -14108,7 +14322,7 @@ const useNodeId = () => useContext(NodeIdContext), selector$g = (s2) => ({
|
|
|
14108
14322
|
};
|
|
14109
14323
|
};
|
|
14110
14324
|
function HandleComponent({ type = "source", position = Position.Top, isValidConnection, isConnectable = !0, isConnectableStart = !0, isConnectableEnd = !0, id: id2, onConnect, children: children2, className, onMouseDown, onTouchStart, ...rest }, ref) {
|
|
14111
|
-
const handleId = id2 || null, isTarget = type === "target", store = useStoreApi(), nodeId = useNodeId(), { connectOnClick, noPanClassName, rfId } = useStore
|
|
14325
|
+
const handleId = id2 || null, isTarget = type === "target", store = useStoreApi(), nodeId = useNodeId(), { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow$1), { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid } = useStore(connectingSelector(nodeId, handleId, type), shallow$1);
|
|
14112
14326
|
nodeId || store.getState().onError?.("010", errorMessages.error010());
|
|
14113
14327
|
const onConnectExtended = (params) => {
|
|
14114
14328
|
const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState(), edgeParams = {
|
|
@@ -14127,6 +14341,7 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14127
14341
|
if (isConnectableStart && (isMouseTriggered && event.button === 0 || !isMouseTriggered)) {
|
|
14128
14342
|
const currentStore = store.getState();
|
|
14129
14343
|
XYHandle.onPointerDown(event.nativeEvent, {
|
|
14344
|
+
handleDomNode: event.currentTarget,
|
|
14130
14345
|
autoPanOnConnect: currentStore.autoPanOnConnect,
|
|
14131
14346
|
connectionMode: currentStore.connectionMode,
|
|
14132
14347
|
connectionRadius: currentStore.connectionRadius,
|
|
@@ -14146,7 +14361,8 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14146
14361
|
isValidConnection: isValidConnection || currentStore.isValidConnection,
|
|
14147
14362
|
getTransform: () => store.getState().transform,
|
|
14148
14363
|
getFromHandle: () => store.getState().connection.fromHandle,
|
|
14149
|
-
autoPanSpeed: currentStore.autoPanSpeed
|
|
14364
|
+
autoPanSpeed: currentStore.autoPanSpeed,
|
|
14365
|
+
dragThreshold: currentStore.connectionDragThreshold
|
|
14150
14366
|
});
|
|
14151
14367
|
}
|
|
14152
14368
|
isMouseTriggered ? onMouseDown?.(event) : onTouchStart?.(event);
|
|
@@ -14247,7 +14463,7 @@ const selector$f = (s2) => {
|
|
|
14247
14463
|
};
|
|
14248
14464
|
};
|
|
14249
14465
|
function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y }) {
|
|
14250
|
-
const store = useStoreApi(), { width, height, transformString, userSelectionActive } = useStore
|
|
14466
|
+
const store = useStoreApi(), { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow$1), moveSelectedNodes = useMoveSelectedNodes(), nodeRef = useRef(null);
|
|
14251
14467
|
if (useEffect(() => {
|
|
14252
14468
|
disableKeyboardA11y || nodeRef.current?.focus({
|
|
14253
14469
|
preventScroll: !0
|
|
@@ -14274,17 +14490,17 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
14274
14490
|
}
|
|
14275
14491
|
const win = typeof window < "u" ? window : void 0, selector$e = (s2) => ({ nodesSelectionActive: s2.nodesSelectionActive, userSelectionActive: s2.userSelectionActive });
|
|
14276
14492
|
function FlowRendererComponent({ children: children2, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport }) {
|
|
14277
|
-
const { nodesSelectionActive, userSelectionActive } = useStore
|
|
14493
|
+
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e), selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win }), panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win }), panOnDrag = panActivationKeyPressed || _panOnDrag, panOnScroll = panActivationKeyPressed || _panOnScroll, _selectionOnDrag = selectionOnDrag && panOnDrag !== !0, isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;
|
|
14278
14494
|
return useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode }), jsx(ZoomPane, { onPaneContextMenu, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, children: jsxs(Pane, { onSelectionStart, onSelectionEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, panOnDrag, isSelecting: !!isSelecting, selectionMode, selectionKeyPressed, selectionOnDrag: _selectionOnDrag, children: [children2, nodesSelectionActive && jsx(NodesSelection, { onSelectionContextMenu, noPanClassName, disableKeyboardA11y })] }) });
|
|
14279
14495
|
}
|
|
14280
14496
|
FlowRendererComponent.displayName = "FlowRenderer";
|
|
14281
14497
|
const FlowRenderer = memo$1(FlowRendererComponent), selector$d = (onlyRenderVisible) => (s2) => onlyRenderVisible ? getNodesInside(s2.nodeLookup, { x: 0, y: 0, width: s2.width, height: s2.height }, s2.transform, !0).map((node) => node.id) : Array.from(s2.nodeLookup.keys());
|
|
14282
14498
|
function useVisibleNodeIds(onlyRenderVisible) {
|
|
14283
|
-
return useStore
|
|
14499
|
+
return useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow$1);
|
|
14284
14500
|
}
|
|
14285
14501
|
const selector$c = (s2) => s2.updateNodeInternals;
|
|
14286
14502
|
function useResizeObserver() {
|
|
14287
|
-
const updateNodeInternals2 = useStore
|
|
14503
|
+
const updateNodeInternals2 = useStore(selector$c), [resizeObserver] = useState(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((entries) => {
|
|
14288
14504
|
const updates = /* @__PURE__ */ new Map();
|
|
14289
14505
|
entries.forEach((entry) => {
|
|
14290
14506
|
const id2 = entry.target.getAttribute("data-id");
|
|
@@ -14313,7 +14529,7 @@ function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }) {
|
|
|
14313
14529
|
}, [node.id, nodeType, node.sourcePosition, node.targetPosition]), nodeRef;
|
|
14314
14530
|
}
|
|
14315
14531
|
function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError }) {
|
|
14316
|
-
const { node, internals, isParent: isParent2 } = useStore
|
|
14532
|
+
const { node, internals, isParent: isParent2 } = useStore((s2) => {
|
|
14317
14533
|
const node2 = s2.nodeLookup.get(id2), isParent22 = s2.parentLookup.has(id2);
|
|
14318
14534
|
return {
|
|
14319
14535
|
node: node2,
|
|
@@ -14322,7 +14538,7 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14322
14538
|
};
|
|
14323
14539
|
}, shallow$1);
|
|
14324
14540
|
let nodeType = node.type || "default", NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType];
|
|
14325
|
-
NodeComponent === void 0 && (onError?.("003", errorMessages.error003(nodeType)), nodeType = "default", NodeComponent = builtinNodeTypes.default);
|
|
14541
|
+
NodeComponent === void 0 && (onError?.("003", errorMessages.error003(nodeType)), nodeType = "default", NodeComponent = nodeTypes?.default || builtinNodeTypes.default);
|
|
14326
14542
|
const isDraggable = !!(node.draggable || nodesDraggable && typeof node.draggable > "u"), isSelectable = !!(node.selectable || elementsSelectable && typeof node.selectable > "u"), isConnectable = !!(node.connectable || nodesConnectable && typeof node.connectable > "u"), isFocusable = !!(node.focusable || nodesFocusable && typeof node.focusable > "u"), store = useStoreApi(), hasDimensions = nodeHasDimensions(node), nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }), dragging = useDrag({
|
|
14327
14543
|
nodeRef,
|
|
14328
14544
|
disabled: node.hidden || !isDraggable,
|
|
@@ -14342,7 +14558,7 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14342
14558
|
nodeRef
|
|
14343
14559
|
}), onClick && onClick(event, { ...internals.userNode });
|
|
14344
14560
|
}, onKeyDown = (event) => {
|
|
14345
|
-
if (!(isInputDOMNode(event.nativeEvent) || disableKeyboardA11y))
|
|
14561
|
+
if (!(isInputDOMNode(event.nativeEvent) || disableKeyboardA11y)) {
|
|
14346
14562
|
if (elementSelectionKeys.includes(event.key) && isSelectable) {
|
|
14347
14563
|
const unselect = event.key === "Escape";
|
|
14348
14564
|
handleNodeClick({
|
|
@@ -14351,12 +14567,30 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14351
14567
|
unselect,
|
|
14352
14568
|
nodeRef
|
|
14353
14569
|
});
|
|
14354
|
-
} else isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14570
|
+
} else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
|
|
14571
|
+
event.preventDefault();
|
|
14572
|
+
const { ariaLabelConfig } = store.getState();
|
|
14573
|
+
store.setState({
|
|
14574
|
+
ariaLiveMessage: ariaLabelConfig["node.a11yDescription.ariaLiveMessage"]({
|
|
14575
|
+
direction: event.key.replace("Arrow", "").toLowerCase(),
|
|
14576
|
+
x: ~~internals.positionAbsolute.x,
|
|
14577
|
+
y: ~~internals.positionAbsolute.y
|
|
14578
|
+
})
|
|
14579
|
+
}), moveSelectedNodes({
|
|
14580
|
+
direction: arrowKeyDiffs[event.key],
|
|
14581
|
+
factor: event.shiftKey ? 4 : 1
|
|
14582
|
+
});
|
|
14583
|
+
}
|
|
14584
|
+
}
|
|
14585
|
+
}, onFocus = () => {
|
|
14586
|
+
if (disableKeyboardA11y || !nodeRef.current?.matches(":focus-visible"))
|
|
14587
|
+
return;
|
|
14588
|
+
const { transform: transform2, width, height, autoPanOnNodeFocus, setCenter } = store.getState();
|
|
14589
|
+
if (!autoPanOnNodeFocus)
|
|
14590
|
+
return;
|
|
14591
|
+
getNodesInside(/* @__PURE__ */ new Map([[id2, node]]), { x: 0, y: 0, width, height }, transform2, !0).length > 0 || setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, {
|
|
14592
|
+
zoom: transform2[2]
|
|
14593
|
+
});
|
|
14360
14594
|
};
|
|
14361
14595
|
return jsx("div", { className: cc([
|
|
14362
14596
|
"react-flow__node",
|
|
@@ -14380,7 +14614,7 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14380
14614
|
visibility: hasDimensions ? "visible" : "hidden",
|
|
14381
14615
|
...node.style,
|
|
14382
14616
|
...inlineDimensions
|
|
14383
|
-
}, "data-id": id2, "data-testid": `rf__node-${id2}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: isFocusable ? "
|
|
14617
|
+
}, "data-id": id2, "data-testid": `rf__node-${id2}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, onFocus: isFocusable ? onFocus : void 0, role: node.ariaRole ?? (isFocusable ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? void 0 : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id2, children: jsx(NodeComponent, { id: id2, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? !1, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? !0, isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) });
|
|
14384
14618
|
}
|
|
14385
14619
|
const selector$b = (s2) => ({
|
|
14386
14620
|
nodesDraggable: s2.nodesDraggable,
|
|
@@ -14390,7 +14624,7 @@ const selector$b = (s2) => ({
|
|
|
14390
14624
|
onError: s2.onError
|
|
14391
14625
|
});
|
|
14392
14626
|
function NodeRendererComponent(props) {
|
|
14393
|
-
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore
|
|
14627
|
+
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow$1), nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements), resizeObserver = useResizeObserver();
|
|
14394
14628
|
return jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => (
|
|
14395
14629
|
/*
|
|
14396
14630
|
* The split of responsibilities between NodeRenderer and
|
|
@@ -14423,7 +14657,7 @@ function NodeRendererComponent(props) {
|
|
|
14423
14657
|
NodeRendererComponent.displayName = "NodeRenderer";
|
|
14424
14658
|
const NodeRenderer = memo$1(NodeRendererComponent);
|
|
14425
14659
|
function useVisibleEdgeIds(onlyRenderVisible) {
|
|
14426
|
-
return useStore
|
|
14660
|
+
return useStore(useCallback((s2) => {
|
|
14427
14661
|
if (!onlyRenderVisible)
|
|
14428
14662
|
return s2.edges.map((edge) => edge.id);
|
|
14429
14663
|
const visibleEdgeIds = [];
|
|
@@ -14441,14 +14675,19 @@ function useVisibleEdgeIds(onlyRenderVisible) {
|
|
|
14441
14675
|
return visibleEdgeIds;
|
|
14442
14676
|
}, [onlyRenderVisible]), shallow$1);
|
|
14443
14677
|
}
|
|
14444
|
-
const ArrowSymbol = ({ color: color2 = "none", strokeWidth = 1 }) =>
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
fill:
|
|
14450
|
-
|
|
14451
|
-
|
|
14678
|
+
const ArrowSymbol = ({ color: color2 = "none", strokeWidth = 1 }) => {
|
|
14679
|
+
const style2 = {
|
|
14680
|
+
strokeWidth,
|
|
14681
|
+
...color2 && { stroke: color2 }
|
|
14682
|
+
};
|
|
14683
|
+
return jsx("polyline", { style: style2, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" });
|
|
14684
|
+
}, ArrowClosedSymbol = ({ color: color2 = "none", strokeWidth = 1 }) => {
|
|
14685
|
+
const style2 = {
|
|
14686
|
+
strokeWidth,
|
|
14687
|
+
...color2 && { stroke: color2, fill: color2 }
|
|
14688
|
+
};
|
|
14689
|
+
return jsx("polyline", { style: style2, strokeLinecap: "round", strokeLinejoin: "round", points: "-5,-4 0,0 -5,4 -5,-4" });
|
|
14690
|
+
}, MarkerSymbols = {
|
|
14452
14691
|
[MarkerType.Arrow]: ArrowSymbol,
|
|
14453
14692
|
[MarkerType.ArrowClosed]: ArrowClosedSymbol
|
|
14454
14693
|
};
|
|
@@ -14460,7 +14699,7 @@ const Marker = ({ id: id2, type, color: color2, width = 12.5, height = 12.5, mar
|
|
|
14460
14699
|
const Symbol2 = useMarkerSymbol(type);
|
|
14461
14700
|
return Symbol2 ? jsx("marker", { className: "react-flow__arrowhead", id: id2, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: "-10 -10 20 20", markerUnits, orient, refX: "0", refY: "0", children: jsx(Symbol2, { color: color2, strokeWidth }) }) : null;
|
|
14462
14701
|
}, MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
14463
|
-
const edges = useStore
|
|
14702
|
+
const edges = useStore((s2) => s2.edges), defaultEdgeOptions = useStore((s2) => s2.defaultEdgeOptions), markers = useMemo(() => createMarkerIds(edges, {
|
|
14464
14703
|
id: rfId,
|
|
14465
14704
|
defaultColor,
|
|
14466
14705
|
defaultMarkerStart: defaultEdgeOptions?.markerStart,
|
|
@@ -14487,7 +14726,7 @@ function EdgeTextComponent({ x, y: y2, label, labelStyle, labelShowBg = !0, labe
|
|
|
14487
14726
|
EdgeTextComponent.displayName = "EdgeText";
|
|
14488
14727
|
const EdgeText = memo$1(EdgeTextComponent);
|
|
14489
14728
|
function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {
|
|
14490
|
-
return jsxs(Fragment$1, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(["react-flow__edge-path", props.className]) }), interactionWidth
|
|
14729
|
+
return jsxs(Fragment$1, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(["react-flow__edge-path", props.className]) }), interactionWidth ? jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" }) : null, label && isNumeric(labelX) && isNumeric(labelY) ? jsx(EdgeText, { x: labelX, y: labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius }) : null] });
|
|
14491
14730
|
}
|
|
14492
14731
|
function getControl({ pos, x1, y1, x2, y2 }) {
|
|
14493
14732
|
return pos === Position.Left || pos === Position.Right ? [0.5 * (x1 + x2), y1] : [x1, 0.5 * (y1 + y2)];
|
|
@@ -14549,7 +14788,8 @@ function createSmoothStepEdge(params) {
|
|
|
14549
14788
|
targetY,
|
|
14550
14789
|
targetPosition,
|
|
14551
14790
|
borderRadius: pathOptions?.borderRadius,
|
|
14552
|
-
offset: pathOptions?.offset
|
|
14791
|
+
offset: pathOptions?.offset,
|
|
14792
|
+
stepPosition: pathOptions?.stepPosition
|
|
14553
14793
|
}), _id = params.isInternal ? void 0 : id2;
|
|
14554
14794
|
return jsx(BaseEdge, { id: _id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style: style2, markerEnd, markerStart, interactionWidth });
|
|
14555
14795
|
});
|
|
@@ -14613,11 +14853,11 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14613
14853
|
const store = useStoreApi(), handleEdgeUpdater = (event, oppositeHandle) => {
|
|
14614
14854
|
if (event.button !== 0)
|
|
14615
14855
|
return;
|
|
14616
|
-
const { autoPanOnConnect, domNode, isValidConnection, connectionMode, connectionRadius, lib, onConnectStart, onConnectEnd, cancelConnection, nodeLookup, rfId: flowId, panBy: panBy2, updateConnection } = store.getState(), isTarget = oppositeHandle.type === "target"
|
|
14617
|
-
setReconnecting(!0), onReconnectStart?.(event, edge, oppositeHandle.type);
|
|
14618
|
-
const _onReconnectEnd = (evt, connectionState) => {
|
|
14856
|
+
const { autoPanOnConnect, domNode, isValidConnection, connectionMode, connectionRadius, lib, onConnectStart, onConnectEnd, cancelConnection, nodeLookup, rfId: flowId, panBy: panBy2, updateConnection } = store.getState(), isTarget = oppositeHandle.type === "target", _onReconnectEnd = (evt, connectionState) => {
|
|
14619
14857
|
setReconnecting(!1), onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState);
|
|
14620
|
-
}, onConnectEdge = (connection) => onReconnect?.(edge, connection)
|
|
14858
|
+
}, onConnectEdge = (connection) => onReconnect?.(edge, connection), _onConnectStart = (_event, params) => {
|
|
14859
|
+
setReconnecting(!0), onReconnectStart?.(event, edge, oppositeHandle.type), onConnectStart?.(_event, params);
|
|
14860
|
+
};
|
|
14621
14861
|
XYHandle.onPointerDown(event.nativeEvent, {
|
|
14622
14862
|
autoPanOnConnect,
|
|
14623
14863
|
connectionMode,
|
|
@@ -14634,23 +14874,25 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14634
14874
|
panBy: panBy2,
|
|
14635
14875
|
isValidConnection,
|
|
14636
14876
|
onConnect: onConnectEdge,
|
|
14637
|
-
onConnectStart,
|
|
14877
|
+
onConnectStart: _onConnectStart,
|
|
14638
14878
|
onConnectEnd,
|
|
14639
14879
|
onReconnectEnd: _onReconnectEnd,
|
|
14640
14880
|
updateConnection,
|
|
14641
14881
|
getTransform: () => store.getState().transform,
|
|
14642
|
-
getFromHandle: () => store.getState().connection.fromHandle
|
|
14882
|
+
getFromHandle: () => store.getState().connection.fromHandle,
|
|
14883
|
+
dragThreshold: store.getState().connectionDragThreshold,
|
|
14884
|
+
handleDomNode: event.currentTarget
|
|
14643
14885
|
});
|
|
14644
14886
|
}, onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: "target" }), onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: "source" }), onReconnectMouseEnter = () => setUpdateHover(!0), onReconnectMouseOut = () => setUpdateHover(!1);
|
|
14645
14887
|
return jsxs(Fragment$1, { children: [(isReconnectable === !0 || isReconnectable === "source") && jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "source" }), (isReconnectable === !0 || isReconnectable === "target") && jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "target" })] });
|
|
14646
14888
|
}
|
|
14647
14889
|
function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y }) {
|
|
14648
|
-
let edge = useStore
|
|
14649
|
-
const defaultEdgeOptions = useStore
|
|
14890
|
+
let edge = useStore((s2) => s2.edgeLookup.get(id2));
|
|
14891
|
+
const defaultEdgeOptions = useStore((s2) => s2.defaultEdgeOptions);
|
|
14650
14892
|
edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;
|
|
14651
14893
|
let edgeType = edge.type || "default", EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];
|
|
14652
|
-
EdgeComponent === void 0 && (onError?.("011", errorMessages.error011(edgeType)), edgeType = "default", EdgeComponent = builtinEdgeTypes.default);
|
|
14653
|
-
const isFocusable = !!(edge.focusable || edgesFocusable && typeof edge.focusable > "u"), isReconnectable = typeof onReconnect < "u" && (edge.reconnectable || edgesReconnectable && typeof edge.reconnectable > "u"), isSelectable = !!(edge.selectable || elementsSelectable && typeof edge.selectable > "u"), edgeRef = useRef(null), [updateHover, setUpdateHover] = useState(!1), [reconnecting, setReconnecting] = useState(!1), store = useStoreApi(), { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore
|
|
14894
|
+
EdgeComponent === void 0 && (onError?.("011", errorMessages.error011(edgeType)), edgeType = "default", EdgeComponent = edgeTypes?.default || builtinEdgeTypes.default);
|
|
14895
|
+
const isFocusable = !!(edge.focusable || edgesFocusable && typeof edge.focusable > "u"), isReconnectable = typeof onReconnect < "u" && (edge.reconnectable || edgesReconnectable && typeof edge.reconnectable > "u"), isSelectable = !!(edge.selectable || elementsSelectable && typeof edge.selectable > "u"), edgeRef = useRef(null), [updateHover, setUpdateHover] = useState(!1), [reconnecting, setReconnecting] = useState(!1), store = useStoreApi(), { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore(useCallback((store2) => {
|
|
14654
14896
|
const sourceNode = store2.nodeLookup.get(edge.source), targetNode = store2.nodeLookup.get(edge.target);
|
|
14655
14897
|
if (!sourceNode || !targetNode)
|
|
14656
14898
|
return {
|
|
@@ -14710,7 +14952,7 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
14710
14952
|
updating: updateHover,
|
|
14711
14953
|
selectable: isSelectable
|
|
14712
14954
|
}
|
|
14713
|
-
]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: isFocusable ? "
|
|
14955
|
+
]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: edge.ariaRole ?? (isFocusable ? "group" : "img"), "aria-roledescription": "edge", "data-id": id2, "data-testid": `rf__edge-${id2}`, "aria-label": edge.ariaLabel === null ? void 0 : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : void 0, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && jsx(EdgeComponent, { id: id2, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? !0, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: "pathOptions" in edge ? edge.pathOptions : void 0, interactionWidth: edge.interactionWidth }), isReconnectable && jsx(EdgeUpdateAnchors, { edge, isReconnectable, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, setUpdateHover, setReconnecting })] }) });
|
|
14714
14956
|
}
|
|
14715
14957
|
const selector$a = (s2) => ({
|
|
14716
14958
|
edgesFocusable: s2.edgesFocusable,
|
|
@@ -14720,13 +14962,13 @@ const selector$a = (s2) => ({
|
|
|
14720
14962
|
onError: s2.onError
|
|
14721
14963
|
});
|
|
14722
14964
|
function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y }) {
|
|
14723
|
-
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore
|
|
14965
|
+
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow$1), edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
|
|
14724
14966
|
return jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId }), edgeIds.map((id2) => jsx(EdgeWrapper, { id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, noPanClassName, onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart, onReconnectEnd, rfId, onError, edgeTypes, disableKeyboardA11y }, id2))] });
|
|
14725
14967
|
}
|
|
14726
14968
|
EdgeRendererComponent.displayName = "EdgeRenderer";
|
|
14727
14969
|
const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (s2) => `translate(${s2.transform[0]}px,${s2.transform[1]}px) scale(${s2.transform[2]})`;
|
|
14728
14970
|
function Viewport({ children: children2 }) {
|
|
14729
|
-
const transform2 = useStore
|
|
14971
|
+
const transform2 = useStore(selector$9);
|
|
14730
14972
|
return jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform: transform2 }, children: children2 });
|
|
14731
14973
|
}
|
|
14732
14974
|
function useOnInitHandler(onInit) {
|
|
@@ -14737,7 +14979,7 @@ function useOnInitHandler(onInit) {
|
|
|
14737
14979
|
}
|
|
14738
14980
|
const selector$8 = (state) => state.panZoom?.syncViewport;
|
|
14739
14981
|
function useViewportSync(viewport) {
|
|
14740
|
-
const syncViewport = useStore
|
|
14982
|
+
const syncViewport = useStore(selector$8), store = useStoreApi();
|
|
14741
14983
|
return useEffect(() => {
|
|
14742
14984
|
viewport && (syncViewport?.(viewport), store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] }));
|
|
14743
14985
|
}, [viewport, syncViewport]), null;
|
|
@@ -14750,7 +14992,7 @@ function getSelector(connectionSelector) {
|
|
|
14750
14992
|
}
|
|
14751
14993
|
function useConnection(connectionSelector) {
|
|
14752
14994
|
const combinedSelector = getSelector();
|
|
14753
|
-
return useStore
|
|
14995
|
+
return useStore(combinedSelector, shallow$1);
|
|
14754
14996
|
}
|
|
14755
14997
|
const selector$7 = (s2) => ({
|
|
14756
14998
|
nodesConnectable: s2.nodesConnectable,
|
|
@@ -14760,7 +15002,7 @@ const selector$7 = (s2) => ({
|
|
|
14760
15002
|
height: s2.height
|
|
14761
15003
|
});
|
|
14762
15004
|
function ConnectionLineWrapper({ containerStyle: containerStyle2, style: style2, type, component }) {
|
|
14763
|
-
const { nodesConnectable, width, height, isValid, inProgress } = useStore
|
|
15005
|
+
const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow$1);
|
|
14764
15006
|
return !(width && nodesConnectable && inProgress) ? null : jsx("svg", { style: containerStyle2, width, height, className: "react-flow__connectionline react-flow__container", children: jsx("g", { className: cc(["react-flow__connection", getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style2, type, CustomComponent: component, isValid }) }) });
|
|
14765
15007
|
}
|
|
14766
15008
|
const ConnectionLine = ({ style: style2, type = ConnectionLineType.Bezier, CustomComponent, isValid }) => {
|
|
@@ -14858,6 +15100,7 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
14858
15100
|
noPanClassName: "nopan",
|
|
14859
15101
|
nodeOrigin: storeNodeOrigin,
|
|
14860
15102
|
nodeDragThreshold: 1,
|
|
15103
|
+
connectionDragThreshold: 1,
|
|
14861
15104
|
snapGrid: [15, 15],
|
|
14862
15105
|
snapToGrid: !1,
|
|
14863
15106
|
nodesDraggable: !0,
|
|
@@ -14879,13 +15122,15 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
14879
15122
|
ariaLiveMessage: "",
|
|
14880
15123
|
autoPanOnConnect: !0,
|
|
14881
15124
|
autoPanOnNodeDrag: !0,
|
|
15125
|
+
autoPanOnNodeFocus: !0,
|
|
14882
15126
|
autoPanSpeed: 15,
|
|
14883
15127
|
connectionRadius: 20,
|
|
14884
15128
|
onError: devWarn,
|
|
14885
15129
|
isValidConnection: void 0,
|
|
14886
15130
|
onSelectionChangeHandlers: [],
|
|
14887
15131
|
lib: "react",
|
|
14888
|
-
debug: !1
|
|
15132
|
+
debug: !1,
|
|
15133
|
+
ariaLabelConfig: defaultAriaLabelConfig
|
|
14889
15134
|
};
|
|
14890
15135
|
}, createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent }) => createWithEqualityFn((set2, get2) => {
|
|
14891
15136
|
async function resolveFitView() {
|
|
@@ -15053,6 +15298,17 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
|
|
|
15053
15298
|
const { transform: transform2, width: width2, height: height2, panZoom, translateExtent } = get2();
|
|
15054
15299
|
return panBy({ delta, panZoom, transform: transform2, translateExtent, width: width2, height: height2 });
|
|
15055
15300
|
},
|
|
15301
|
+
setCenter: async (x, y2, options) => {
|
|
15302
|
+
const { width: width2, height: height2, maxZoom: maxZoom2, panZoom } = get2();
|
|
15303
|
+
if (!panZoom)
|
|
15304
|
+
return Promise.resolve(!1);
|
|
15305
|
+
const nextZoom = typeof options?.zoom < "u" ? options.zoom : maxZoom2;
|
|
15306
|
+
return await panZoom.setViewport({
|
|
15307
|
+
x: width2 / 2 - x * nextZoom,
|
|
15308
|
+
y: height2 / 2 - y2 * nextZoom,
|
|
15309
|
+
zoom: nextZoom
|
|
15310
|
+
}, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }), Promise.resolve(!0);
|
|
15311
|
+
},
|
|
15056
15312
|
cancelConnection: () => {
|
|
15057
15313
|
set2({
|
|
15058
15314
|
connection: { ...initialConnection }
|
|
@@ -15091,20 +15347,20 @@ const wrapperStyle = {
|
|
|
15091
15347
|
position: "relative",
|
|
15092
15348
|
zIndex: 0
|
|
15093
15349
|
};
|
|
15094
|
-
function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = "Backspace", selectionKeyCode = "Shift", selectionOnDrag = !1, selectionMode = SelectionMode.Full, panActivationKeyCode = "Space", multiSelectionKeyCode = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode = isMacOs() ? "Meta" : "Control", snapToGrid, snapGrid, onlyRenderVisibleElements = !1, selectNodesOnDrag, nodesDraggable, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = !0, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = !0, nodeExtent, defaultMarkerColor = "#b1b1b7", zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children: children2, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = "nodrag", noWheelClassName = "nowheel", noPanClassName = "nopan", fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = !1, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style: style2, id: id2, nodeDragThreshold, viewport, onViewportChange, width, height, colorMode = "light", debug, onScroll, ...rest }, ref) {
|
|
15350
|
+
function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = "Backspace", selectionKeyCode = "Shift", selectionOnDrag = !1, selectionMode = SelectionMode.Full, panActivationKeyCode = "Space", multiSelectionKeyCode = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode = isMacOs() ? "Meta" : "Control", snapToGrid, snapGrid, onlyRenderVisibleElements = !1, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = !0, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = !0, nodeExtent, defaultMarkerColor = "#b1b1b7", zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children: children2, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = "nodrag", noWheelClassName = "nowheel", noPanClassName = "nopan", fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = !1, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style: style2, id: id2, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = "light", debug, onScroll, ariaLabelConfig, ...rest }, ref) {
|
|
15095
15351
|
const rfId = id2 || "1", colorModeClassName = useColorModeClass(colorMode), wrapperOnScroll = useCallback((e2) => {
|
|
15096
15352
|
e2.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" }), onScroll?.(e2);
|
|
15097
15353
|
}, [onScroll]);
|
|
15098
|
-
return jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, children: jsxs(Wrapper, { nodes, edges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes, edgeTypes, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, onBeforeDelete, paneClickDistance, debug }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
15354
|
+
return jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, role: "application", children: jsxs(Wrapper, { nodes, edges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, children: [jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes, edgeTypes, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange }), jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, connectionDragThreshold, onBeforeDelete, paneClickDistance, debug, ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange }), children2, jsx(Attribution, { proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
15099
15355
|
}
|
|
15100
15356
|
var index = fixedForwardRef(ReactFlow);
|
|
15101
15357
|
const selector$6 = (s2) => s2.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
15102
15358
|
function EdgeLabelRenderer({ children: children2 }) {
|
|
15103
|
-
const edgeLabelRenderer = useStore
|
|
15359
|
+
const edgeLabelRenderer = useStore(selector$6);
|
|
15104
15360
|
return edgeLabelRenderer ? createPortal(children2, edgeLabelRenderer) : null;
|
|
15105
15361
|
}
|
|
15106
15362
|
function useInternalNode(id2) {
|
|
15107
|
-
return useStore
|
|
15363
|
+
return useStore(useCallback((s2) => s2.nodeLookup.get(id2), [id2]), shallow$1);
|
|
15108
15364
|
}
|
|
15109
15365
|
function LinePattern({ dimensions, lineWidth, variant, className }) {
|
|
15110
15366
|
return jsx("path", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(["react-flow__background-pattern", variant, className]) });
|
|
@@ -15136,7 +15392,7 @@ function BackgroundComponent({
|
|
|
15136
15392
|
className,
|
|
15137
15393
|
patternClassName
|
|
15138
15394
|
}) {
|
|
15139
|
-
const ref = useRef(null), { transform: transform2, patternId } = useStore
|
|
15395
|
+
const ref = useRef(null), { transform: transform2, patternId } = useStore(selector$3, shallow$1), patternSize = size2 || defaultSize[variant], isDots = variant === BackgroundVariant.Dots, isCross = variant === BackgroundVariant.Cross, gapXY = Array.isArray(gap) ? gap : [gap, gap], scaledGap = [gapXY[0] * transform2[2] || 1, gapXY[1] * transform2[2] || 1], scaledSize = patternSize * transform2[2], offsetXY = Array.isArray(offset2) ? offset2 : [offset2, offset2], patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap, scaledOffset = [
|
|
15140
15396
|
offsetXY[0] * transform2[2] || 1 + patternDimensions[0] / 2,
|
|
15141
15397
|
offsetXY[1] * transform2[2] || 1 + patternDimensions[1] / 2
|
|
15142
15398
|
], _patternId = `${patternId}${id2 || ""}`;
|
|
@@ -15170,10 +15426,11 @@ function ControlButton({ children: children2, className, ...rest }) {
|
|
|
15170
15426
|
const selector$2 = (s2) => ({
|
|
15171
15427
|
isInteractive: s2.nodesDraggable || s2.nodesConnectable || s2.elementsSelectable,
|
|
15172
15428
|
minZoomReached: s2.transform[2] <= s2.minZoom,
|
|
15173
|
-
maxZoomReached: s2.transform[2] >= s2.maxZoom
|
|
15429
|
+
maxZoomReached: s2.transform[2] >= s2.maxZoom,
|
|
15430
|
+
ariaLabelConfig: s2.ariaLabelConfig
|
|
15174
15431
|
});
|
|
15175
|
-
function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, showInteractive = !0, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children: children2, position = "bottom-left", orientation = "vertical", "aria-label": ariaLabel
|
|
15176
|
-
const store = useStoreApi(), { isInteractive, minZoomReached, maxZoomReached } = useStore
|
|
15432
|
+
function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, showInteractive = !0, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children: children2, position = "bottom-left", orientation = "vertical", "aria-label": ariaLabel }) {
|
|
15433
|
+
const store = useStoreApi(), { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow$1), { zoomIn, zoomOut, fitView } = useReactFlow(), onZoomInHandler = () => {
|
|
15177
15434
|
zoomIn(), onZoomIn?.();
|
|
15178
15435
|
}, onZoomOutHandler = () => {
|
|
15179
15436
|
zoomOut(), onZoomOut?.();
|
|
@@ -15186,7 +15443,7 @@ function ControlsComponent({ style: style2, showZoom = !0, showFitView = !0, sho
|
|
|
15186
15443
|
elementsSelectable: !isInteractive
|
|
15187
15444
|
}), onInteractiveChange?.(!isInteractive);
|
|
15188
15445
|
};
|
|
15189
|
-
return jsxs(Panel, { className: cc(["react-flow__controls", orientation === "horizontal" ? "horizontal" : "vertical", className]), position, style: style2, "data-testid": "rf__controls", "aria-label": ariaLabel, children: [showZoom && jsxs(Fragment$1, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: "react-flow__controls-zoomin", title: "
|
|
15446
|
+
return jsxs(Panel, { className: cc(["react-flow__controls", orientation === "horizontal" ? "horizontal" : "vertical", className]), position, style: style2, "data-testid": "rf__controls", "aria-label": ariaLabel ?? ariaLabelConfig["controls.ariaLabel"], children: [showZoom && jsxs(Fragment$1, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: "react-flow__controls-zoomin", title: ariaLabelConfig["controls.zoomIn.ariaLabel"], "aria-label": ariaLabelConfig["controls.zoomIn.ariaLabel"], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: "react-flow__controls-zoomout", title: ariaLabelConfig["controls.zoomOut.ariaLabel"], "aria-label": ariaLabelConfig["controls.zoomOut.ariaLabel"], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] }), showFitView && jsx(ControlButton, { className: "react-flow__controls-fitview", onClick: onFitViewHandler, title: ariaLabelConfig["controls.fitView.ariaLabel"], "aria-label": ariaLabelConfig["controls.fitView.ariaLabel"], children: jsx(FitViewIcon, {}) }), showInteractive && jsx(ControlButton, { className: "react-flow__controls-interactive", onClick: onToggleInteractivity, title: ariaLabelConfig["controls.interactive.ariaLabel"], "aria-label": ariaLabelConfig["controls.interactive.ariaLabel"], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) }), children2] });
|
|
15190
15447
|
}
|
|
15191
15448
|
ControlsComponent.displayName = "Controls";
|
|
15192
15449
|
memo$1(ControlsComponent);
|
|
@@ -15212,7 +15469,7 @@ function MiniMapNodes({
|
|
|
15212
15469
|
nodeComponent: NodeComponent = MiniMapNode,
|
|
15213
15470
|
onClick
|
|
15214
15471
|
}) {
|
|
15215
|
-
const nodeIds = useStore
|
|
15472
|
+
const nodeIds = useStore(selectorNodeIds, shallow$1), nodeColorFunc = getAttrFunction(nodeColor), nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor), nodeClassNameFunc = getAttrFunction(nodeClassName), shapeRendering = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
15216
15473
|
return jsx(Fragment$1, { children: nodeIds.map((nodeId) => (
|
|
15217
15474
|
/*
|
|
15218
15475
|
* The split of responsibilities between MiniMapNodes and
|
|
@@ -15225,7 +15482,7 @@ function MiniMapNodes({
|
|
|
15225
15482
|
)) });
|
|
15226
15483
|
}
|
|
15227
15484
|
function NodeComponentWrapperInner({ id: id2, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick }) {
|
|
15228
|
-
const { node, x, y: y2, width, height } = useStore
|
|
15485
|
+
const { node, x, y: y2, width, height } = useStore((s2) => {
|
|
15229
15486
|
const { internals } = s2.nodeLookup.get(id2), node2 = internals.userNode, { x: x2, y: y22 } = internals.positionAbsolute, { width: width2, height: height2 } = getNodeDimensions(node2);
|
|
15230
15487
|
return {
|
|
15231
15488
|
node: node2,
|
|
@@ -15253,7 +15510,8 @@ const defaultWidth = 200, defaultHeight = 150, filterHidden = (node) => !node.hi
|
|
|
15253
15510
|
panZoom: s2.panZoom,
|
|
15254
15511
|
translateExtent: s2.translateExtent,
|
|
15255
15512
|
flowWidth: s2.width,
|
|
15256
|
-
flowHeight: s2.height
|
|
15513
|
+
flowHeight: s2.height,
|
|
15514
|
+
ariaLabelConfig: s2.ariaLabelConfig
|
|
15257
15515
|
};
|
|
15258
15516
|
}, ARIA_LABEL_KEY = "react-flow__minimap-desc";
|
|
15259
15517
|
function MiniMapComponent({
|
|
@@ -15278,12 +15536,12 @@ function MiniMapComponent({
|
|
|
15278
15536
|
onNodeClick,
|
|
15279
15537
|
pannable = !1,
|
|
15280
15538
|
zoomable = !1,
|
|
15281
|
-
ariaLabel
|
|
15539
|
+
ariaLabel,
|
|
15282
15540
|
inversePan,
|
|
15283
|
-
zoomStep =
|
|
15541
|
+
zoomStep = 1,
|
|
15284
15542
|
offsetScale = 5
|
|
15285
15543
|
}) {
|
|
15286
|
-
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight } = useStore
|
|
15544
|
+
const store = useStoreApi(), svg = useRef(null), { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow$1), elementWidth = style2?.width ?? defaultWidth, elementHeight = style2?.height ?? defaultHeight, scaledWidth = boundingRect.width / elementWidth, scaledHeight = boundingRect.height / elementHeight, viewScale = Math.max(scaledWidth, scaledHeight), viewWidth = viewScale * elementWidth, viewHeight = viewScale * elementHeight, offset2 = offsetScale * viewScale, x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset2, y2 = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset2, width = viewWidth + offset2 * 2, height = viewHeight + offset2 * 2, labelledBy = `${ARIA_LABEL_KEY}-${rfId}`, viewScaleRef = useRef(0), minimapInstance = useRef();
|
|
15287
15545
|
viewScaleRef.current = viewScale, useEffect(() => {
|
|
15288
15546
|
if (svg.current && panZoom)
|
|
15289
15547
|
return minimapInstance.current = XYMinimap({
|
|
@@ -15311,7 +15569,7 @@ function MiniMapComponent({
|
|
|
15311
15569
|
} : void 0, onSvgNodeClick = onNodeClick ? useCallback((event, nodeId) => {
|
|
15312
15570
|
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
15313
15571
|
onNodeClick(event, node);
|
|
15314
|
-
}, []) : void 0;
|
|
15572
|
+
}, []) : void 0, _ariaLabel = ariaLabel ?? ariaLabelConfig["minimap.ariaLabel"];
|
|
15315
15573
|
return jsx(Panel, { position, style: {
|
|
15316
15574
|
...style2,
|
|
15317
15575
|
"--xy-minimap-background-color-props": typeof bgColor == "string" ? bgColor : void 0,
|
|
@@ -15321,13 +15579,17 @@ function MiniMapComponent({
|
|
|
15321
15579
|
"--xy-minimap-node-background-color-props": typeof nodeColor == "string" ? nodeColor : void 0,
|
|
15322
15580
|
"--xy-minimap-node-stroke-color-props": typeof nodeStrokeColor == "string" ? nodeStrokeColor : void 0,
|
|
15323
15581
|
"--xy-minimap-node-stroke-width-props": typeof nodeStrokeWidth == "number" ? nodeStrokeWidth : void 0
|
|
15324
|
-
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y2} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [
|
|
15582
|
+
}, className: cc(["react-flow__minimap", className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y2} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx("title", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor, nodeStrokeColor, nodeBorderRadius, nodeClassName, nodeStrokeWidth, nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset2},${y2 - offset2}h${width + offset2 * 2}v${height + offset2 * 2}h${-width - offset2 * 2}z
|
|
15325
15583
|
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
15326
15584
|
}
|
|
15327
15585
|
MiniMapComponent.displayName = "MiniMap";
|
|
15328
15586
|
memo$1(MiniMapComponent);
|
|
15329
|
-
|
|
15330
|
-
|
|
15587
|
+
const scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : void 0, defaultPositions = {
|
|
15588
|
+
[ResizeControlVariant.Line]: "right",
|
|
15589
|
+
[ResizeControlVariant.Handle]: "bottom-right"
|
|
15590
|
+
};
|
|
15591
|
+
function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style: style2 = void 0, children: children2, color: color2, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = !1, resizeDirection, autoScale = !0, shouldResize, onResizeStart, onResize, onResizeEnd }) {
|
|
15592
|
+
const contextNodeId = useNodeId(), id2 = typeof nodeId == "string" ? nodeId : contextNodeId, store = useStoreApi(), resizeControlRef = useRef(null), isHandleControl = variant === ResizeControlVariant.Handle, scale2 = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow$1), resizer = useRef(null), controlPosition = position ?? defaultPositions[variant];
|
|
15331
15593
|
useEffect(() => {
|
|
15332
15594
|
if (!(!resizeControlRef.current || !id2))
|
|
15333
15595
|
return resizer.current || (resizer.current = XYResizer({
|
|
@@ -15432,13 +15694,17 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
15432
15694
|
onResizeEnd,
|
|
15433
15695
|
shouldResize
|
|
15434
15696
|
]);
|
|
15435
|
-
const positionClassNames = controlPosition.split("-")
|
|
15436
|
-
return jsx("div", { className: cc(["react-flow__resize-control", "nodrag", ...positionClassNames, variant, className]), ref: resizeControlRef, style:
|
|
15697
|
+
const positionClassNames = controlPosition.split("-");
|
|
15698
|
+
return jsx("div", { className: cc(["react-flow__resize-control", "nodrag", ...positionClassNames, variant, className]), ref: resizeControlRef, style: {
|
|
15699
|
+
...style2,
|
|
15700
|
+
scale: scale2,
|
|
15701
|
+
...color2 && { [isHandleControl ? "backgroundColor" : "borderColor"]: color2 }
|
|
15702
|
+
}, children: children2 });
|
|
15437
15703
|
}
|
|
15438
15704
|
memo$1(ResizeControl);
|
|
15439
15705
|
const selector = (state) => state.domNode?.querySelector(".react-flow__renderer");
|
|
15440
15706
|
function NodeToolbarPortal({ children: children2 }) {
|
|
15441
|
-
const wrapperRef = useStore
|
|
15707
|
+
const wrapperRef = useStore(selector);
|
|
15442
15708
|
return wrapperRef ? createPortal(children2, wrapperRef) : null;
|
|
15443
15709
|
}
|
|
15444
15710
|
const nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x || a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y || a?.measured.width !== b?.measured.width || a?.measured.height !== b?.measured.height || a?.selected !== b?.selected || a?.internals.z !== b?.internals.z, nodesEqualityFn = (a, b) => {
|
|
@@ -15458,7 +15724,7 @@ function NodeToolbar({ nodeId, children: children2, className, style: style2, is
|
|
|
15458
15724
|
const contextNodeId = useNodeId(), nodesSelector2 = useCallback((state) => (Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ""]).reduce((res, id2) => {
|
|
15459
15725
|
const node = state.nodeLookup.get(id2);
|
|
15460
15726
|
return node && res.set(node.id, node), res;
|
|
15461
|
-
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore
|
|
15727
|
+
}, /* @__PURE__ */ new Map()), [nodeId, contextNodeId]), nodes = useStore(nodesSelector2, nodesEqualityFn), { x, y: y2, zoom: zoom2, selectedNodesCount } = useStore(storeSelector, shallow$1);
|
|
15462
15728
|
if (!(typeof isVisible == "boolean" ? isVisible : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1) || !nodes.size)
|
|
15463
15729
|
return null;
|
|
15464
15730
|
const nodeRect = getInternalNodesBounds(nodes), nodesArray = Array.from(nodes.values()), zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1)), wrapperStyle2 = {
|
|
@@ -15662,11 +15928,11 @@ function createIsCircular(areItemsEqual) {
|
|
|
15662
15928
|
return cache.delete(a), cache.delete(b), result;
|
|
15663
15929
|
};
|
|
15664
15930
|
}
|
|
15665
|
-
function getStrictProperties(
|
|
15666
|
-
return getOwnPropertyNames(
|
|
15931
|
+
function getStrictProperties(object2) {
|
|
15932
|
+
return getOwnPropertyNames(object2).concat(getOwnPropertySymbols(object2));
|
|
15667
15933
|
}
|
|
15668
|
-
var hasOwn = Object.hasOwn || function(
|
|
15669
|
-
return hasOwnProperty.call(
|
|
15934
|
+
var hasOwn = Object.hasOwn || function(object2, property) {
|
|
15935
|
+
return hasOwnProperty.call(object2, property);
|
|
15670
15936
|
};
|
|
15671
15937
|
function sameValueZeroEqual(a, b) {
|
|
15672
15938
|
return a === b || !a && !b && a !== a && b !== b;
|
|
@@ -16169,21 +16435,6 @@ let atom = (initialValue) => {
|
|
|
16169
16435
|
};
|
|
16170
16436
|
return $atom;
|
|
16171
16437
|
};
|
|
16172
|
-
function listenKeys($store, keys2, listener) {
|
|
16173
|
-
let keysSet = new Set(keys2).add(void 0);
|
|
16174
|
-
return $store.listen((value, oldValue, changed) => {
|
|
16175
|
-
keysSet.has(changed) && listener(value, oldValue, changed);
|
|
16176
|
-
});
|
|
16177
|
-
}
|
|
16178
|
-
let emit = (snapshotRef, onChange) => (value) => {
|
|
16179
|
-
snapshotRef.current !== value && (snapshotRef.current = value, onChange());
|
|
16180
|
-
};
|
|
16181
|
-
function useStore(store, { keys: keys2, deps = [store, keys2] } = {}) {
|
|
16182
|
-
let snapshotRef = useRef();
|
|
16183
|
-
snapshotRef.current = store.get();
|
|
16184
|
-
let subscribe = useCallback((onChange) => (emit(snapshotRef, onChange)(store.value), keys2?.length > 0 ? listenKeys(store, keys2, emit(snapshotRef, onChange)) : store.listen(emit(snapshotRef, onChange))), deps), get2 = () => snapshotRef.current;
|
|
16185
|
-
return useSyncExternalStore(subscribe, get2, get2);
|
|
16186
|
-
}
|
|
16187
16438
|
const ReduceGraphicsModeCtx = createContext(null);
|
|
16188
16439
|
function useIsReducedGraphics() {
|
|
16189
16440
|
const isReduced = useContext(ReduceGraphicsModeCtx);
|
|
@@ -16196,9 +16447,6 @@ function ReduceGraphicsContext({ reduceGraphics, children: children2 }) {
|
|
|
16196
16447
|
const $isPanningRef = useRef(null);
|
|
16197
16448
|
return $isPanningRef.current || ($isPanningRef.current = atom(reduceGraphics)), /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanningRef.current, children: /* @__PURE__ */ jsx(ReduceGraphicsModeCtx.Provider, { value: reduceGraphics, children: children2 }) });
|
|
16198
16449
|
}
|
|
16199
|
-
function useIsPanning() {
|
|
16200
|
-
return useStore(usePanningAtom());
|
|
16201
|
-
}
|
|
16202
16450
|
const LikeC4ModelContext = createContext(null), CurrentViewModelContext = createContext(null);
|
|
16203
16451
|
function EnsureCurrentViewModel({ children: children2 }) {
|
|
16204
16452
|
return useContext(CurrentViewModelContext) ? /* @__PURE__ */ jsx(Fragment$1, { children: children2 }) : null;
|
|
@@ -16288,7 +16536,7 @@ function RootContainer({
|
|
|
16288
16536
|
}) {
|
|
16289
16537
|
const id2 = useId$1(), ref = useRef(null), $isPanning = usePanningAtom();
|
|
16290
16538
|
return useEffect(() => $isPanning.listen((isPanning) => {
|
|
16291
|
-
|
|
16539
|
+
ref.current?.setAttribute("data-likec4-diagram-panning", isPanning ? "true" : "false");
|
|
16292
16540
|
}), [$isPanning]), /* @__PURE__ */ jsx(
|
|
16293
16541
|
Box,
|
|
16294
16542
|
{
|
|
@@ -16327,18 +16575,29 @@ function useUpdateEffect(callback, deps, equalityFn, effectHook) {
|
|
|
16327
16575
|
}
|
|
16328
16576
|
const useXYFlow = useReactFlow;
|
|
16329
16577
|
function useXYStore(selector2, equalityFn) {
|
|
16330
|
-
return useStore
|
|
16578
|
+
return useStore(
|
|
16331
16579
|
useCallbackRef(selector2),
|
|
16332
16580
|
equalityFn ?? shallowEqual
|
|
16333
16581
|
);
|
|
16334
16582
|
}
|
|
16335
16583
|
const useXYStoreApi = useStoreApi, useXYInternalNode = useInternalNode, selectCurrentZoom = (state) => Math.round(state.transform[2] * 100) / 100;
|
|
16336
16584
|
function useCurrentZoom() {
|
|
16337
|
-
return useStore
|
|
16585
|
+
return useStore(selectCurrentZoom);
|
|
16338
16586
|
}
|
|
16339
16587
|
const selectZoom = (state) => state.transform[2] < 0.2;
|
|
16340
16588
|
function useIsZoomTooSmall() {
|
|
16341
|
-
return useStore
|
|
16589
|
+
return useStore(selectZoom);
|
|
16590
|
+
}
|
|
16591
|
+
function getDevicePixelRatio() {
|
|
16592
|
+
const dpr = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : 1;
|
|
16593
|
+
return u(Math.floor(dpr), {
|
|
16594
|
+
min: 1,
|
|
16595
|
+
max: 4
|
|
16596
|
+
});
|
|
16597
|
+
}
|
|
16598
|
+
let knownDpr;
|
|
16599
|
+
function roundDpr(v) {
|
|
16600
|
+
return knownDpr ??= getDevicePixelRatio(), knownDpr < 2 ? Math.round(v) : Math.round(v * knownDpr) / knownDpr;
|
|
16342
16601
|
}
|
|
16343
16602
|
const { abs: abs$1, cos: cos$1, sin: sin$1, acos: acos$1, atan2, sqrt: sqrt$1, pow } = Math;
|
|
16344
16603
|
function crt(v) {
|
|
@@ -17273,9 +17532,6 @@ class Bezier {
|
|
|
17273
17532
|
return circles;
|
|
17274
17533
|
}
|
|
17275
17534
|
}
|
|
17276
|
-
function toDomPrecision(v) {
|
|
17277
|
-
return v === null ? 0.01 : Math.round(v * 100) / 100;
|
|
17278
|
-
}
|
|
17279
17535
|
function bezierControlPoints(diagramEdge) {
|
|
17280
17536
|
let [start2, ...bezierPoints] = diagramEdge.points;
|
|
17281
17537
|
invariant(start2, "start should be defined");
|
|
@@ -17684,7 +17940,11 @@ class Actor {
|
|
|
17684
17940
|
return;
|
|
17685
17941
|
const allListeners = [...listeners ? listeners.values() : [], ...wildcardListener ? wildcardListener.values() : []];
|
|
17686
17942
|
for (const handler of allListeners)
|
|
17687
|
-
|
|
17943
|
+
try {
|
|
17944
|
+
handler(emittedEvent);
|
|
17945
|
+
} catch (err) {
|
|
17946
|
+
reportUnhandledError(err);
|
|
17947
|
+
}
|
|
17688
17948
|
},
|
|
17689
17949
|
actionExecutor: (action) => {
|
|
17690
17950
|
const exec = () => {
|
|
@@ -19199,6 +19459,7 @@ function useDiagram() {
|
|
|
19199
19459
|
* @warning Do not use in render phase
|
|
19200
19460
|
*/
|
|
19201
19461
|
findDiagramNode: (xynodeId) => findDiagramNode(actor.getSnapshot().context, xynodeId),
|
|
19462
|
+
findEdge: (xyedgeId) => actor.getSnapshot().context.xyedges.find((e2) => e2.data.id === xyedgeId) ?? null,
|
|
19202
19463
|
/**
|
|
19203
19464
|
* @warning Do not use in render phase
|
|
19204
19465
|
*/
|
|
@@ -19234,6 +19495,17 @@ function useDiagramContext(selector2, compare = shallowEqual, deps) {
|
|
|
19234
19495
|
const actorRef = useDiagramActorRef(), select2 = useCallback((s2) => selector2(s2.context), deps ?? []);
|
|
19235
19496
|
return useSelector(actorRef, select2, compare);
|
|
19236
19497
|
}
|
|
19498
|
+
function useOnDiagramEvent(event, callback) {
|
|
19499
|
+
const actorRef = useDiagramActorRef(), callbackRef = useRef(callback);
|
|
19500
|
+
callbackRef.current = callback, useEffect(() => {
|
|
19501
|
+
const subscription = actorRef.on(event, (event2) => {
|
|
19502
|
+
callbackRef.current(event2);
|
|
19503
|
+
});
|
|
19504
|
+
return () => {
|
|
19505
|
+
subscription.unsubscribe();
|
|
19506
|
+
};
|
|
19507
|
+
}, [actorRef]);
|
|
19508
|
+
}
|
|
19237
19509
|
const createRecipe = (name, defaultVariants, compoundVariants) => {
|
|
19238
19510
|
const getVariantProps2 = (variants) => ({
|
|
19239
19511
|
[name]: "__ignore__",
|
|
@@ -19307,6 +19579,35 @@ const createRecipe = (name, defaultVariants, compoundVariants) => {
|
|
|
19307
19579
|
return splitProps(props, actionBtnVariantKeys);
|
|
19308
19580
|
},
|
|
19309
19581
|
getVariantProps: actionBtnFn.getVariantProps
|
|
19582
|
+
}), compoundNodeFn = /* @__PURE__ */ createRecipe("likec4-compound-node", {}, []), compoundNodeVariantMap = {
|
|
19583
|
+
isTransparent: [
|
|
19584
|
+
"false",
|
|
19585
|
+
"true"
|
|
19586
|
+
],
|
|
19587
|
+
inverseColor: [
|
|
19588
|
+
"true",
|
|
19589
|
+
"false"
|
|
19590
|
+
],
|
|
19591
|
+
borderStyle: [
|
|
19592
|
+
"solid",
|
|
19593
|
+
"dashed",
|
|
19594
|
+
"dotted",
|
|
19595
|
+
"none"
|
|
19596
|
+
]
|
|
19597
|
+
}, compoundNodeVariantKeys = Object.keys(compoundNodeVariantMap), compoundNode = /* @__PURE__ */ Object.assign(memo(compoundNodeFn.recipeFn), {
|
|
19598
|
+
__recipe__: !0,
|
|
19599
|
+
__name__: "compoundNode",
|
|
19600
|
+
__getCompoundVariantCss__: compoundNodeFn.__getCompoundVariantCss__,
|
|
19601
|
+
raw: (props) => props,
|
|
19602
|
+
variantKeys: compoundNodeVariantKeys,
|
|
19603
|
+
variantMap: compoundNodeVariantMap,
|
|
19604
|
+
merge(recipe) {
|
|
19605
|
+
return mergeRecipes(this, recipe);
|
|
19606
|
+
},
|
|
19607
|
+
splitVariantProps(props) {
|
|
19608
|
+
return splitProps(props, compoundNodeVariantKeys);
|
|
19609
|
+
},
|
|
19610
|
+
getVariantProps: compoundNodeFn.getVariantProps
|
|
19310
19611
|
}), elementNodeIconFn = /* @__PURE__ */ createRecipe("likec4-element-node-icon", {}, []), elementNodeIconVariantMap = {}, elementNodeIconVariantKeys = Object.keys(elementNodeIconVariantMap), elementNodeIcon = /* @__PURE__ */ Object.assign(memo(elementNodeIconFn.recipeFn), {
|
|
19311
19612
|
__recipe__: !0,
|
|
19312
19613
|
__name__: "elementNodeIcon",
|
|
@@ -19321,6 +19622,25 @@ const createRecipe = (name, defaultVariants, compoundVariants) => {
|
|
|
19321
19622
|
return splitProps(props, elementNodeIconVariantKeys);
|
|
19322
19623
|
},
|
|
19323
19624
|
getVariantProps: elementNodeIconFn.getVariantProps
|
|
19625
|
+
}), elementShapeRecipeFn = /* @__PURE__ */ createRecipe("likec4-element-shape", {}, []), elementShapeRecipeVariantMap = {
|
|
19626
|
+
shapetype: [
|
|
19627
|
+
"html",
|
|
19628
|
+
"svg"
|
|
19629
|
+
]
|
|
19630
|
+
}, elementShapeRecipeVariantKeys = Object.keys(elementShapeRecipeVariantMap), elementShapeRecipe = /* @__PURE__ */ Object.assign(memo(elementShapeRecipeFn.recipeFn), {
|
|
19631
|
+
__recipe__: !0,
|
|
19632
|
+
__name__: "elementShapeRecipe",
|
|
19633
|
+
__getCompoundVariantCss__: elementShapeRecipeFn.__getCompoundVariantCss__,
|
|
19634
|
+
raw: (props) => props,
|
|
19635
|
+
variantKeys: elementShapeRecipeVariantKeys,
|
|
19636
|
+
variantMap: elementShapeRecipeVariantMap,
|
|
19637
|
+
merge(recipe) {
|
|
19638
|
+
return mergeRecipes(this, recipe);
|
|
19639
|
+
},
|
|
19640
|
+
splitVariantProps(props) {
|
|
19641
|
+
return splitProps(props, elementShapeRecipeVariantKeys);
|
|
19642
|
+
},
|
|
19643
|
+
getVariantProps: elementShapeRecipeFn.getVariantProps
|
|
19324
19644
|
}), likec4tagFn = /* @__PURE__ */ createRecipe("likec4-tag", {
|
|
19325
19645
|
autoTextColor: !1
|
|
19326
19646
|
}, []), likec4tagVariantMap = {
|
|
@@ -19433,19 +19753,7 @@ function createMinimalMotionComponent(Component, options) {
|
|
|
19433
19753
|
}
|
|
19434
19754
|
const MotionButton = /* @__PURE__ */ createMinimalMotionComponent("button"), MotionDiv = /* @__PURE__ */ createMinimalMotionComponent("div"), MotionSpan = /* @__PURE__ */ createMinimalMotionComponent("span"), compoundActionBtn = cva({
|
|
19435
19755
|
base: {
|
|
19436
|
-
transitionDuration: "normal"
|
|
19437
|
-
"[data-compound-title-inverse] &": {
|
|
19438
|
-
_dark: {
|
|
19439
|
-
"--actionbtn-color": "color-mix(in srgb, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))"
|
|
19440
|
-
},
|
|
19441
|
-
_light: {
|
|
19442
|
-
"--actionbtn-color": "var(--likec4-palette-stroke)",
|
|
19443
|
-
"--actionbtn-color-hovered": "var(--likec4-palette-stroke)",
|
|
19444
|
-
"--actionbtn-color-hovered-btn": "var(--likec4-palette-hiContrast)",
|
|
19445
|
-
"--actionbtn-bg-hovered": "var(--likec4-palette-fill)/50",
|
|
19446
|
-
"--actionbtn-bg-hovered-btn": "var(--likec4-palette-fill)"
|
|
19447
|
-
}
|
|
19448
|
-
}
|
|
19756
|
+
transitionDuration: "normal"
|
|
19449
19757
|
},
|
|
19450
19758
|
variants: {
|
|
19451
19759
|
delay: {
|
|
@@ -19468,49 +19776,35 @@ function CompoundActionButton({
|
|
|
19468
19776
|
}) {
|
|
19469
19777
|
const isHoverDebounced = useDebouncedValue(isHovered, isHovered ? 130 : 0)[0] && isHovered;
|
|
19470
19778
|
return /* @__PURE__ */ jsx(
|
|
19471
|
-
|
|
19779
|
+
MotionDiv,
|
|
19472
19780
|
{
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
19479
|
-
|
|
19480
|
-
|
|
19481
|
-
|
|
19482
|
-
|
|
19483
|
-
|
|
19781
|
+
initial: !1,
|
|
19782
|
+
animate: {
|
|
19783
|
+
scale: isHoverDebounced ? 1.2 : 1,
|
|
19784
|
+
x: isHoverDebounced ? -1 : 0,
|
|
19785
|
+
y: isHoverDebounced ? -1 : 0
|
|
19786
|
+
},
|
|
19787
|
+
whileHover: {
|
|
19788
|
+
scale: 1.4,
|
|
19789
|
+
x: -3,
|
|
19790
|
+
y: -1
|
|
19791
|
+
},
|
|
19792
|
+
className: "likec4-compound-navigation compound-action",
|
|
19793
|
+
whileTap: { scale: 1 },
|
|
19794
|
+
onClick: stopPropagation,
|
|
19484
19795
|
children: /* @__PURE__ */ jsx(
|
|
19485
|
-
|
|
19796
|
+
ActionIcon,
|
|
19486
19797
|
{
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
},
|
|
19498
|
-
whileTap: { scale: 1 },
|
|
19499
|
-
children: /* @__PURE__ */ jsx(
|
|
19500
|
-
ActionIcon,
|
|
19501
|
-
{
|
|
19502
|
-
className: cx(
|
|
19503
|
-
"nodrag nopan",
|
|
19504
|
-
compoundActionBtn({
|
|
19505
|
-
delay: isHovered && !isHoverDebounced
|
|
19506
|
-
}),
|
|
19507
|
-
actionBtn()
|
|
19508
|
-
),
|
|
19509
|
-
onClick,
|
|
19510
|
-
onDoubleClick: stopPropagation,
|
|
19511
|
-
children: icon ?? /* @__PURE__ */ jsx(IconZoomScan, { stroke: 2 })
|
|
19512
|
-
}
|
|
19513
|
-
)
|
|
19798
|
+
className: cx(
|
|
19799
|
+
"nodrag nopan",
|
|
19800
|
+
compoundActionBtn({
|
|
19801
|
+
delay: isHovered && !isHoverDebounced
|
|
19802
|
+
}),
|
|
19803
|
+
actionBtn({ variant: "transparent" })
|
|
19804
|
+
),
|
|
19805
|
+
onClick,
|
|
19806
|
+
onDoubleClick: stopPropagation,
|
|
19807
|
+
children: icon ?? /* @__PURE__ */ jsx(IconZoomScan, { stroke: 2 })
|
|
19514
19808
|
}
|
|
19515
19809
|
)
|
|
19516
19810
|
}
|
|
@@ -19525,180 +19819,36 @@ function CompoundDetailsButton({
|
|
|
19525
19819
|
}) {
|
|
19526
19820
|
const isHoverDebounced = useDebouncedValue(isHovered, isHovered ? 130 : 0)[0] && isHovered;
|
|
19527
19821
|
return /* @__PURE__ */ jsx(
|
|
19528
|
-
|
|
19822
|
+
MotionDiv,
|
|
19529
19823
|
{
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
),
|
|
19541
|
-
onClick: stopPropagation,
|
|
19824
|
+
initial: !1,
|
|
19825
|
+
animate: {
|
|
19826
|
+
scale: isHoverDebounced ? 1.2 : 1
|
|
19827
|
+
// opacity: isHoverDebounced ? 1 : 0.6,
|
|
19828
|
+
},
|
|
19829
|
+
whileHover: {
|
|
19830
|
+
scale: 1.4
|
|
19831
|
+
},
|
|
19832
|
+
whileTap: { scale: 1 },
|
|
19833
|
+
className: "likec4-compound-details details-button",
|
|
19542
19834
|
children: /* @__PURE__ */ jsx(
|
|
19543
|
-
|
|
19835
|
+
ActionIcon,
|
|
19544
19836
|
{
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
children: /* @__PURE__ */ jsx(
|
|
19555
|
-
ActionIcon,
|
|
19556
|
-
{
|
|
19557
|
-
className: cx(
|
|
19558
|
-
"nodrag nopan",
|
|
19559
|
-
compoundActionBtn({
|
|
19560
|
-
delay: isHovered && !isHoverDebounced
|
|
19561
|
-
}),
|
|
19562
|
-
css({
|
|
19563
|
-
_whenHovered: {
|
|
19564
|
-
opacity: 0.75
|
|
19565
|
-
},
|
|
19566
|
-
_hover: {
|
|
19567
|
-
opacity: 1
|
|
19568
|
-
}
|
|
19569
|
-
}),
|
|
19570
|
-
actionBtn({ variant: "transparent" })
|
|
19571
|
-
),
|
|
19572
|
-
onClick,
|
|
19573
|
-
onDoubleClick: stopPropagation,
|
|
19574
|
-
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
19575
|
-
}
|
|
19576
|
-
)
|
|
19837
|
+
className: cx(
|
|
19838
|
+
"nodrag nopan",
|
|
19839
|
+
compoundActionBtn({
|
|
19840
|
+
delay: isHovered && !isHoverDebounced
|
|
19841
|
+
}),
|
|
19842
|
+
actionBtn({ variant: "transparent" })
|
|
19843
|
+
),
|
|
19844
|
+
onClick,
|
|
19845
|
+
onDoubleClick: stopPropagation,
|
|
19846
|
+
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
19577
19847
|
}
|
|
19578
19848
|
)
|
|
19579
19849
|
}
|
|
19580
19850
|
);
|
|
19581
19851
|
}
|
|
19582
|
-
const borderWidth = {
|
|
19583
|
-
var: "--_border-width",
|
|
19584
|
-
ref: "var(--_border-width, 2px)"
|
|
19585
|
-
}, borderRadius$1 = {
|
|
19586
|
-
var: "--_border-radius",
|
|
19587
|
-
ref: "var(--_border-radius, 4px)"
|
|
19588
|
-
}, compoundOpacity = {
|
|
19589
|
-
var: "--_compound-opacity",
|
|
19590
|
-
ref: "var(--_compound-opacity, 1)"
|
|
19591
|
-
}, borderOpacityPercent = {
|
|
19592
|
-
var: "--_border-opacity-percent",
|
|
19593
|
-
ref: "var(--_border-opacity-percent, 100%)"
|
|
19594
|
-
}, root = css.raw({
|
|
19595
|
-
position: "relative",
|
|
19596
|
-
width: "100%",
|
|
19597
|
-
height: "100%",
|
|
19598
|
-
padding: "0",
|
|
19599
|
-
margin: "0",
|
|
19600
|
-
border: "transparent",
|
|
19601
|
-
pointerEvents: "none",
|
|
19602
|
-
_before: {
|
|
19603
|
-
borderRadius: borderRadius$1.ref,
|
|
19604
|
-
content: '" "',
|
|
19605
|
-
position: "absolute",
|
|
19606
|
-
top: "0",
|
|
19607
|
-
left: "0",
|
|
19608
|
-
width: "100%",
|
|
19609
|
-
height: "100%",
|
|
19610
|
-
border: "transparent",
|
|
19611
|
-
background: "var(--likec4-palette-fill)",
|
|
19612
|
-
backgroundClip: "padding-box",
|
|
19613
|
-
transitionDelay: ".075ms"
|
|
19614
|
-
},
|
|
19615
|
-
_noReduceGraphics: {
|
|
19616
|
-
_before: {
|
|
19617
|
-
transition: "all {durations.slow} {easings.inOut}"
|
|
19618
|
-
},
|
|
19619
|
-
"&[data-likec4-hovered='true']": {
|
|
19620
|
-
_before: {
|
|
19621
|
-
transitionDelay: ".2s",
|
|
19622
|
-
transitionTimingFunction: "in"
|
|
19623
|
-
}
|
|
19624
|
-
}
|
|
19625
|
-
},
|
|
19626
|
-
"&:is([data-compound-transparent])": {
|
|
19627
|
-
_before: {
|
|
19628
|
-
opacity: compoundOpacity.ref,
|
|
19629
|
-
borderWidth: `calc(${borderWidth.ref} - 1px)`
|
|
19630
|
-
}
|
|
19631
|
-
}
|
|
19632
|
-
}), compoundBorder = css.raw({
|
|
19633
|
-
borderRadius: borderRadius$1.ref,
|
|
19634
|
-
padding: "0",
|
|
19635
|
-
margin: "0",
|
|
19636
|
-
transition: "all 250ms {easings.inOut}",
|
|
19637
|
-
cursor: "default",
|
|
19638
|
-
position: "absolute",
|
|
19639
|
-
top: "0",
|
|
19640
|
-
left: "0",
|
|
19641
|
-
width: "100%",
|
|
19642
|
-
height: "100%",
|
|
19643
|
-
pointerEvents: "none",
|
|
19644
|
-
background: "transparent",
|
|
19645
|
-
borderStyle: "dashed",
|
|
19646
|
-
borderWidth: `[${borderWidth.ref}]`,
|
|
19647
|
-
borderColor: `[color-mix(in srgb, var(--likec4-palette-stroke) ${borderOpacityPercent.ref}, transparent)]`
|
|
19648
|
-
}), indicatorSvg = css.raw({
|
|
19649
|
-
position: "absolute",
|
|
19650
|
-
top: "0",
|
|
19651
|
-
left: "0",
|
|
19652
|
-
width: "100%",
|
|
19653
|
-
height: "100%",
|
|
19654
|
-
pointerEvents: "none",
|
|
19655
|
-
overflow: "visible",
|
|
19656
|
-
visibility: "hidden",
|
|
19657
|
-
_whenFocused: {
|
|
19658
|
-
visibility: "visible"
|
|
19659
|
-
},
|
|
19660
|
-
_whenSelected: {
|
|
19661
|
-
visibility: "visible"
|
|
19662
|
-
},
|
|
19663
|
-
_whenPanning: {
|
|
19664
|
-
display: "none"
|
|
19665
|
-
}
|
|
19666
|
-
}), indicatorRect = css.raw({
|
|
19667
|
-
stroke: "[color-mix(in srgb, var(--likec4-palette-stroke) 60%, var(--likec4-palette-hiContrast))]",
|
|
19668
|
-
strokeWidth: "4",
|
|
19669
|
-
fill: "[none]",
|
|
19670
|
-
animationStyle: "indicator",
|
|
19671
|
-
_light: {
|
|
19672
|
-
stroke: "[color-mix(in srgb, var(--likec4-palette-stroke) 80%, var(--likec4-palette-hiContrast))]"
|
|
19673
|
-
}
|
|
19674
|
-
}), compound = sva({
|
|
19675
|
-
slots: ["root", "compoundBorder", "indicatorSvg", "indicatorRect"],
|
|
19676
|
-
className: "compound-container",
|
|
19677
|
-
base: {
|
|
19678
|
-
root,
|
|
19679
|
-
compoundBorder,
|
|
19680
|
-
indicatorSvg,
|
|
19681
|
-
indicatorRect
|
|
19682
|
-
},
|
|
19683
|
-
variants: {
|
|
19684
|
-
isTransparent: {
|
|
19685
|
-
false: {
|
|
19686
|
-
root: {
|
|
19687
|
-
_before: {
|
|
19688
|
-
boxShadow: {
|
|
19689
|
-
_noReduceGraphics: "0 4px 10px 0.5px rgba(0,0,0,0.1) , 0 2px 2px -1px rgba(0,0,0,0.4)",
|
|
19690
|
-
_whenSelected: "none",
|
|
19691
|
-
_whenPanning: "none !important"
|
|
19692
|
-
}
|
|
19693
|
-
}
|
|
19694
|
-
}
|
|
19695
|
-
},
|
|
19696
|
-
true: {
|
|
19697
|
-
root: {}
|
|
19698
|
-
}
|
|
19699
|
-
}
|
|
19700
|
-
}
|
|
19701
|
-
});
|
|
19702
19852
|
function CompoundNodeContainer({
|
|
19703
19853
|
nodeProps: {
|
|
19704
19854
|
selected: isSelected = !1,
|
|
@@ -19713,136 +19863,46 @@ function CompoundNodeContainer({
|
|
|
19713
19863
|
style: style2,
|
|
19714
19864
|
...rest
|
|
19715
19865
|
}) {
|
|
19716
|
-
|
|
19717
|
-
let opacity = u((data.style.opacity ?? 100) / 100, {
|
|
19866
|
+
let opacity = u(data.style.opacity ?? 100, {
|
|
19718
19867
|
min: 0,
|
|
19719
|
-
max:
|
|
19868
|
+
max: 100
|
|
19720
19869
|
});
|
|
19721
|
-
isTransparent
|
|
19722
|
-
const MIN_OPACITY = 65, borderOpacity = MIN_OPACITY + u((100 - MIN_OPACITY) * opacity, {
|
|
19870
|
+
const isTransparent = opacity < 99, MIN_OPACITY = 65, borderOpacity = MIN_OPACITY + u((100 - MIN_OPACITY) * (opacity / 100), {
|
|
19723
19871
|
min: 0,
|
|
19724
19872
|
max: 100 - MIN_OPACITY
|
|
19725
|
-
}),
|
|
19726
|
-
isTransparent
|
|
19873
|
+
}), compoundClass = compoundNode({
|
|
19874
|
+
isTransparent,
|
|
19875
|
+
inverseColor: opacity < 60,
|
|
19876
|
+
borderStyle: data.style.border ?? (isTransparent ? "dashed" : "none")
|
|
19727
19877
|
}), depth = u(data.depth ?? 1, {
|
|
19728
19878
|
min: 1,
|
|
19729
19879
|
max: 5
|
|
19730
19880
|
});
|
|
19731
|
-
return /* @__PURE__ */
|
|
19881
|
+
return /* @__PURE__ */ jsx(
|
|
19732
19882
|
m.div,
|
|
19733
19883
|
{
|
|
19734
19884
|
className: cx(
|
|
19735
|
-
|
|
19736
|
-
"likec4-compound-node",
|
|
19885
|
+
compoundClass,
|
|
19737
19886
|
className
|
|
19738
19887
|
),
|
|
19739
19888
|
initial: !1,
|
|
19740
19889
|
"data-likec4-hovered": isHovered,
|
|
19741
19890
|
"data-likec4-color": data.color,
|
|
19742
19891
|
"data-compound-depth": depth,
|
|
19743
|
-
...isTransparent && {
|
|
19744
|
-
"data-compound-transparent": !0,
|
|
19745
|
-
"data-compound-title-inverse": opacity < 0.5
|
|
19746
|
-
},
|
|
19747
19892
|
...isDimmed !== !1 && {
|
|
19748
19893
|
"data-likec4-dimmed": isDimmed
|
|
19749
19894
|
},
|
|
19750
19895
|
style: {
|
|
19751
19896
|
...style2,
|
|
19752
19897
|
// @ts-expect-error
|
|
19753
|
-
|
|
19754
|
-
|
|
19755
|
-
[borderRadius$1.var]: "6px",
|
|
19756
|
-
[borderOpacityPercent.var]: `${borderOpacity}%`
|
|
19898
|
+
"--_border-transparency": `${borderOpacity}%`,
|
|
19899
|
+
"--_compound-transparency": `${opacity}%`
|
|
19757
19900
|
},
|
|
19758
19901
|
...rest,
|
|
19759
|
-
children:
|
|
19760
|
-
isTransparent && data.style.border !== "none" && /* @__PURE__ */ jsx(
|
|
19761
|
-
"div",
|
|
19762
|
-
{
|
|
19763
|
-
className: classes2.compoundBorder,
|
|
19764
|
-
style: {
|
|
19765
|
-
borderStyle: data.style.border ?? "dashed"
|
|
19766
|
-
}
|
|
19767
|
-
}
|
|
19768
|
-
),
|
|
19769
|
-
/* @__PURE__ */ jsx("svg", { className: classes2.indicatorSvg, children: /* @__PURE__ */ jsx(
|
|
19770
|
-
"rect",
|
|
19771
|
-
{
|
|
19772
|
-
className: classes2.indicatorRect,
|
|
19773
|
-
x: 0,
|
|
19774
|
-
y: 0,
|
|
19775
|
-
width: "100%",
|
|
19776
|
-
height: "100%",
|
|
19777
|
-
rx: 6
|
|
19778
|
-
}
|
|
19779
|
-
) }),
|
|
19780
|
-
children2
|
|
19781
|
-
]
|
|
19902
|
+
children: children2
|
|
19782
19903
|
}
|
|
19783
19904
|
);
|
|
19784
19905
|
}
|
|
19785
|
-
const titleContainer = css({
|
|
19786
|
-
position: "absolute",
|
|
19787
|
-
display: "flex",
|
|
19788
|
-
alignItems: "center",
|
|
19789
|
-
gap: "1.5",
|
|
19790
|
-
// 6px
|
|
19791
|
-
left: "[14px]",
|
|
19792
|
-
top: "[4px]",
|
|
19793
|
-
right: "[30px]",
|
|
19794
|
-
width: "auto",
|
|
19795
|
-
minHeight: "30px",
|
|
19796
|
-
":where(.react-flow__node.draggable) &": {
|
|
19797
|
-
pointerEvents: "all",
|
|
19798
|
-
cursor: "grab"
|
|
19799
|
-
},
|
|
19800
|
-
".likec4-compound-node:has(.compound-action) &": {
|
|
19801
|
-
paddingLeft: "[22px]"
|
|
19802
|
-
}
|
|
19803
|
-
}), titleText = css({
|
|
19804
|
-
flex: "1",
|
|
19805
|
-
fontFamily: "likec4.compound",
|
|
19806
|
-
fontWeight: 600,
|
|
19807
|
-
fontSize: "15px",
|
|
19808
|
-
textTransform: "uppercase",
|
|
19809
|
-
letterSpacing: "0.2px",
|
|
19810
|
-
color: "var(--likec4-palette-loContrast)",
|
|
19811
|
-
"[data-compound-title-inverse] &": {
|
|
19812
|
-
color: {
|
|
19813
|
-
base: "[color-mix(in srgb, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))]",
|
|
19814
|
-
_light: "var(--likec4-palette-stroke)"
|
|
19815
|
-
}
|
|
19816
|
-
}
|
|
19817
|
-
}), iconSize = "20px", cssIcon = css({
|
|
19818
|
-
flex: `0 0 ${iconSize}`,
|
|
19819
|
-
height: `${iconSize}`,
|
|
19820
|
-
width: `${iconSize}`,
|
|
19821
|
-
display: "flex",
|
|
19822
|
-
alignItems: "center",
|
|
19823
|
-
justifyContent: "center",
|
|
19824
|
-
mixBlendMode: {
|
|
19825
|
-
base: "hard-light",
|
|
19826
|
-
_reduceGraphicsOnPan: "normal"
|
|
19827
|
-
},
|
|
19828
|
-
"& svg, & img": {
|
|
19829
|
-
width: "100%",
|
|
19830
|
-
height: "auto",
|
|
19831
|
-
maxHeight: "100%",
|
|
19832
|
-
pointerEvents: "none",
|
|
19833
|
-
filter: {
|
|
19834
|
-
base: [
|
|
19835
|
-
"drop-shadow(0 0 3px rgb(0 0 0 / 12%))",
|
|
19836
|
-
"drop-shadow(0 1px 8px rgb(0 0 0 / 8%))",
|
|
19837
|
-
"drop-shadow(1px 1px 16px rgb(0 0 0 / 3%))"
|
|
19838
|
-
],
|
|
19839
|
-
_reduceGraphicsOnPan: "none"
|
|
19840
|
-
}
|
|
19841
|
-
},
|
|
19842
|
-
"& img": {
|
|
19843
|
-
objectFit: "contain"
|
|
19844
|
-
}
|
|
19845
|
-
});
|
|
19846
19906
|
function CompoundTitle({ id: id2, data }) {
|
|
19847
19907
|
const elementIcon = IconRenderer({
|
|
19848
19908
|
element: {
|
|
@@ -19850,35 +19910,21 @@ function CompoundTitle({ id: id2, data }) {
|
|
|
19850
19910
|
title: data.title,
|
|
19851
19911
|
icon: data.icon
|
|
19852
19912
|
},
|
|
19853
|
-
className:
|
|
19913
|
+
className: "likec4-compound-icon"
|
|
19854
19914
|
});
|
|
19855
|
-
return /* @__PURE__ */ jsxs(
|
|
19856
|
-
|
|
19857
|
-
{
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
children: [
|
|
19863
|
-
elementIcon,
|
|
19864
|
-
/* @__PURE__ */ jsx(Text, { className: titleText, truncate: "end", children: data.title })
|
|
19865
|
-
]
|
|
19866
|
-
}
|
|
19867
|
-
);
|
|
19915
|
+
return /* @__PURE__ */ jsxs("div", { className: "likec4-compound-title-container", children: [
|
|
19916
|
+
elementIcon,
|
|
19917
|
+
/* @__PURE__ */ jsx(Text, { component: "h3", className: "likec4-compound-title", truncate: "end", children: data.title })
|
|
19918
|
+
] });
|
|
19919
|
+
}
|
|
19920
|
+
function nodePropsEqual(prev, next) {
|
|
19921
|
+
return prev.id === next.id && deepEqual(prev.selected ?? !1, next.selected ?? !1) && deepEqual(prev.dragging ?? !1, next.dragging ?? !1) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
19868
19922
|
}
|
|
19869
|
-
const style = {
|
|
19870
|
-
top: "50%",
|
|
19871
|
-
left: "50%",
|
|
19872
|
-
visibility: "hidden"
|
|
19873
|
-
}, DefaultHandles = () => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
19874
|
-
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style }),
|
|
19875
|
-
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, style })
|
|
19876
|
-
] }), nodePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? !1, next.selected ?? !1) && deepEqual(prev.dragging ?? !1, next.dragging ?? !1) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
19877
19923
|
function customNode(Node2) {
|
|
19878
|
-
const NodeComponent = memo$1(
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19924
|
+
const NodeComponent = memo$1(
|
|
19925
|
+
Node2,
|
|
19926
|
+
(prev, next) => nodePropsEqual(prev, next)
|
|
19927
|
+
);
|
|
19882
19928
|
return NodeComponent.displayName = "Node", NodeComponent;
|
|
19883
19929
|
}
|
|
19884
19930
|
const container$2 = css({
|
|
@@ -20127,107 +20173,8 @@ const ElementNodeContainer = forwardRef(({
|
|
|
20127
20173
|
);
|
|
20128
20174
|
});
|
|
20129
20175
|
ElementNodeContainer.displayName = "ElementNodeContainer";
|
|
20130
|
-
const indicator = css({
|
|
20131
|
-
_smallZoom: {
|
|
20132
|
-
visibility: "hidden"
|
|
20133
|
-
},
|
|
20134
|
-
stroke: "var(--likec4-palette-loContrast)",
|
|
20135
|
-
fill: "[none]",
|
|
20136
|
-
strokeWidth: 8,
|
|
20137
|
-
strokeOpacity: 0.8,
|
|
20138
|
-
visibility: "hidden",
|
|
20139
|
-
pointerEvents: "none",
|
|
20140
|
-
_light: {
|
|
20141
|
-
stroke: "[color-mix(in srgb, var(--likec4-palette-fill) 50%,rgb(121, 121, 121))]"
|
|
20142
|
-
},
|
|
20143
|
-
_whenFocused: {
|
|
20144
|
-
visibility: "visible"
|
|
20145
|
-
},
|
|
20146
|
-
_groupFocusVisible: {
|
|
20147
|
-
visibility: "visible"
|
|
20148
|
-
},
|
|
20149
|
-
_whenSelected: {
|
|
20150
|
-
animationStyle: "indicator",
|
|
20151
|
-
visibility: "visible"
|
|
20152
|
-
}
|
|
20153
|
-
}), fillElementFill = css({
|
|
20154
|
-
fill: "var(--likec4-palette-fill)"
|
|
20155
|
-
});
|
|
20156
|
-
css({
|
|
20157
|
-
fill: "var(--likec4-palette-stroke)"
|
|
20158
|
-
});
|
|
20159
|
-
const fillMixStroke = css({
|
|
20160
|
-
fill: "[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]",
|
|
20161
|
-
".shape-svg-multiple &": {
|
|
20162
|
-
fill: "var(--likec4-palette-fill)"
|
|
20163
|
-
}
|
|
20164
|
-
}), shapeBase = css.raw({
|
|
20165
|
-
top: "0",
|
|
20166
|
-
left: "0",
|
|
20167
|
-
position: "absolute",
|
|
20168
|
-
width: "100%",
|
|
20169
|
-
height: "100%",
|
|
20170
|
-
pointerEvents: "none",
|
|
20171
|
-
fill: "var(--likec4-palette-fill)",
|
|
20172
|
-
stroke: "var(--likec4-palette-stroke)",
|
|
20173
|
-
overflow: "visible"
|
|
20174
|
-
// zIndex is removed to improve rendering performance
|
|
20175
|
-
// this forces to keep shape in the same layer as the node
|
|
20176
|
-
// zIndex: -1,
|
|
20177
|
-
}), shapeSvgMultiple = cx(
|
|
20178
|
-
"shape-svg-multiple",
|
|
20179
|
-
css(shapeBase, {
|
|
20180
|
-
transformOrigin: {
|
|
20181
|
-
base: "50% 50%",
|
|
20182
|
-
_shapeQueue: "75% 25%",
|
|
20183
|
-
_shapeCylinder: "50% 100%",
|
|
20184
|
-
_shapeStorage: "50% 100%"
|
|
20185
|
-
},
|
|
20186
|
-
transform: "translate(14px, 14px) perspective(300px) translateZ(-8px)",
|
|
20187
|
-
filter: "brightness(0.65) saturate(0.8)",
|
|
20188
|
-
stroke: "[none]",
|
|
20189
|
-
display: {
|
|
20190
|
-
_smallZoom: "none",
|
|
20191
|
-
_reduceGraphicsOnPan: "none",
|
|
20192
|
-
_whenSelected: "none",
|
|
20193
|
-
_whenFocused: "none"
|
|
20194
|
-
}
|
|
20195
|
-
})
|
|
20196
|
-
), shapeSvg = css(shapeBase, {
|
|
20197
|
-
transition: "fill 120ms linear, filter 130ms {easings.inOut}",
|
|
20198
|
-
transitionDelay: "0ms",
|
|
20199
|
-
filter: `
|
|
20200
|
-
drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
|
|
20201
|
-
drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))
|
|
20202
|
-
drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
|
|
20203
|
-
`,
|
|
20204
|
-
_whenHovered: {
|
|
20205
|
-
filter: `
|
|
20206
|
-
drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25))
|
|
20207
|
-
drop-shadow(0 8px 3px rgba(0, 0, 0, 0.1))
|
|
20208
|
-
drop-shadow(0 10px 10px rgba(0, 0, 0, 0.05))
|
|
20209
|
-
`
|
|
20210
|
-
},
|
|
20211
|
-
":where([data-likec4-level='true']) &": {
|
|
20212
|
-
filter: `
|
|
20213
|
-
drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25))
|
|
20214
|
-
drop-shadow(0 8px 3px rgba(0, 0, 0, 0.1))
|
|
20215
|
-
drop-shadow(0 10px 10px rgba(0, 0, 0, 0.05))
|
|
20216
|
-
`
|
|
20217
|
-
},
|
|
20218
|
-
_whenSelected: {
|
|
20219
|
-
filter: "none"
|
|
20220
|
-
},
|
|
20221
|
-
_smallZoom: {
|
|
20222
|
-
filter: "none"
|
|
20223
|
-
},
|
|
20224
|
-
_whenPanning: {
|
|
20225
|
-
transition: "none",
|
|
20226
|
-
filter: "none"
|
|
20227
|
-
}
|
|
20228
|
-
});
|
|
20229
20176
|
function cylinderSVGPath(diameter, height, tilt = 0.065) {
|
|
20230
|
-
const radius = Math.round(diameter / 2), rx = radius, ry =
|
|
20177
|
+
const radius = Math.round(diameter / 2), rx = radius, ry = roundDpr(tilt * radius), tiltAdjustedHeight = height - 2 * ry;
|
|
20231
20178
|
return {
|
|
20232
20179
|
path: ` M ${diameter},${ry}
|
|
20233
20180
|
a ${rx},${ry} 0,0,0 ${-diameter} 0
|
|
@@ -20241,7 +20188,7 @@ function cylinderSVGPath(diameter, height, tilt = 0.065) {
|
|
|
20241
20188
|
};
|
|
20242
20189
|
}
|
|
20243
20190
|
function queueSVGPath(width, height, tilt = 0.185) {
|
|
20244
|
-
const diameter = height, ry = Math.round(diameter / 2), rx =
|
|
20191
|
+
const diameter = height, ry = Math.round(diameter / 2), rx = roundDpr(diameter / 2 * tilt), tiltAdjustedWidth = width - 2 * rx;
|
|
20245
20192
|
return {
|
|
20246
20193
|
path: `
|
|
20247
20194
|
M ${rx},0
|
|
@@ -20258,7 +20205,7 @@ const PersonIcon = {
|
|
|
20258
20205
|
height: 120,
|
|
20259
20206
|
path: "M57.9197 0C10.9124 0 33.5766 54.75 33.5766 54.75C38.6131 62.25 45.3285 60.75 45.3285 66C45.3285 70.5 39.4526 72 33.5766 72.75C24.3431 72.75 15.9489 71.25 7.55474 84.75C2.51825 93 0 120 0 120H115C115 120 112.482 93 108.285 84.75C99.8905 70.5 91.4963 72.75 82.2628 72C76.3869 71.25 70.5109 69.75 70.5109 65.25C70.5109 60.75 77.2263 62.25 82.2628 54C82.2628 54.75 104.927 0 57.9197 0V0Z"
|
|
20260
20207
|
};
|
|
20261
|
-
function
|
|
20208
|
+
function ShapeSvg({ shape, w, h }) {
|
|
20262
20209
|
switch (shape) {
|
|
20263
20210
|
case "mobile":
|
|
20264
20211
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
@@ -20268,11 +20215,11 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20268
20215
|
width: w,
|
|
20269
20216
|
height: h,
|
|
20270
20217
|
rx: 6,
|
|
20271
|
-
|
|
20218
|
+
"data-likec4-fill": "mix-stroke",
|
|
20272
20219
|
strokeWidth: 0
|
|
20273
20220
|
}
|
|
20274
20221
|
),
|
|
20275
|
-
/* @__PURE__ */ jsxs("g", {
|
|
20222
|
+
/* @__PURE__ */ jsxs("g", { "data-likec4-fill": "fill", strokeWidth: 0, children: [
|
|
20276
20223
|
/* @__PURE__ */ jsx("circle", { cx: 17, cy: h / 2, r: 12 }),
|
|
20277
20224
|
/* @__PURE__ */ jsx("rect", { x: 33, y: 12, width: w - 44, height: h - 24, rx: 5 })
|
|
20278
20225
|
] })
|
|
@@ -20285,11 +20232,11 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20285
20232
|
width: w,
|
|
20286
20233
|
height: h,
|
|
20287
20234
|
rx: 6,
|
|
20288
|
-
|
|
20235
|
+
"data-likec4-fill": "mix-stroke",
|
|
20289
20236
|
strokeWidth: 0
|
|
20290
20237
|
}
|
|
20291
20238
|
),
|
|
20292
|
-
/* @__PURE__ */ jsxs("g", {
|
|
20239
|
+
/* @__PURE__ */ jsxs("g", { "data-likec4-fill": "fill", strokeWidth: 0, children: [
|
|
20293
20240
|
/* @__PURE__ */ jsx("circle", { cx: 16, cy: 17, r: 7 }),
|
|
20294
20241
|
/* @__PURE__ */ jsx("circle", { cx: 36, cy: 17, r: 7 }),
|
|
20295
20242
|
/* @__PURE__ */ jsx("circle", { cx: 56, cy: 17, r: 7 }),
|
|
@@ -20316,7 +20263,7 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20316
20263
|
width: PersonIcon.width,
|
|
20317
20264
|
height: PersonIcon.height,
|
|
20318
20265
|
viewBox: `0 0 ${PersonIcon.width} ${PersonIcon.height}`,
|
|
20319
|
-
|
|
20266
|
+
"data-likec4-fill": "mix-stroke",
|
|
20320
20267
|
children: /* @__PURE__ */ jsx(
|
|
20321
20268
|
"path",
|
|
20322
20269
|
{
|
|
@@ -20331,7 +20278,7 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20331
20278
|
const { path, rx, ry } = queueSVGPath(w, h);
|
|
20332
20279
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
20333
20280
|
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
20334
|
-
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry: ry - 0.75, rx,
|
|
20281
|
+
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry: ry - 0.75, rx, "data-likec4-fill": "mix-stroke", strokeWidth: 2 })
|
|
20335
20282
|
] });
|
|
20336
20283
|
}
|
|
20337
20284
|
case "storage":
|
|
@@ -20339,7 +20286,7 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20339
20286
|
const { path, rx, ry } = cylinderSVGPath(w, h);
|
|
20340
20287
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
20341
20288
|
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
20342
|
-
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry, rx: rx - 0.75,
|
|
20289
|
+
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry, rx: rx - 0.75, "data-likec4-fill": "mix-stroke", strokeWidth: 2 })
|
|
20343
20290
|
] });
|
|
20344
20291
|
}
|
|
20345
20292
|
case "rectangle":
|
|
@@ -20356,14 +20303,33 @@ function ElementShapeSvg({ shape, w, h }) {
|
|
|
20356
20303
|
return nonexhaustive(shape);
|
|
20357
20304
|
}
|
|
20358
20305
|
}
|
|
20306
|
+
function ShapeHtml({ multiple, withOutLine }) {
|
|
20307
|
+
return /* @__PURE__ */ jsxs(
|
|
20308
|
+
Box,
|
|
20309
|
+
{
|
|
20310
|
+
className: elementShapeRecipe({
|
|
20311
|
+
shapetype: "html"
|
|
20312
|
+
}),
|
|
20313
|
+
children: [
|
|
20314
|
+
multiple && /* @__PURE__ */ jsx("div", { className: "likec4-shape-multiple" }),
|
|
20315
|
+
withOutLine && /* @__PURE__ */ jsx("div", { className: "likec4-shape-outline" })
|
|
20316
|
+
]
|
|
20317
|
+
}
|
|
20318
|
+
);
|
|
20319
|
+
}
|
|
20359
20320
|
function ElementShape({ data, width, height, withSelectedIndicator = !0 }) {
|
|
20360
20321
|
let w = width && width > 10 ? width : data.width, h = height && height > 10 ? height : data.height;
|
|
20361
20322
|
const isMultiple = data.style?.multiple ?? !1;
|
|
20323
|
+
if (data.shape === "rectangle")
|
|
20324
|
+
return /* @__PURE__ */ jsx(ShapeHtml, { multiple: isMultiple, withOutLine: withSelectedIndicator });
|
|
20325
|
+
const className = elementShapeRecipe({
|
|
20326
|
+
shapetype: "svg"
|
|
20327
|
+
});
|
|
20362
20328
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
20363
|
-
isMultiple && /* @__PURE__ */ jsx("svg", { className:
|
|
20364
|
-
/* @__PURE__ */ jsxs("svg", { className
|
|
20329
|
+
isMultiple && /* @__PURE__ */ jsx("svg", { className, "data-likec4-shape-multiple": "true", viewBox: `0 0 ${w} ${h}`, children: /* @__PURE__ */ jsx(ShapeSvg, { shape: data.shape, w, h }) }),
|
|
20330
|
+
/* @__PURE__ */ jsxs("svg", { className, viewBox: `0 0 ${w} ${h}`, children: [
|
|
20365
20331
|
withSelectedIndicator && /* @__PURE__ */ jsx(SelectedIndicator, { shape: data.shape, w, h }),
|
|
20366
|
-
/* @__PURE__ */ jsx(
|
|
20332
|
+
/* @__PURE__ */ jsx(ShapeSvg, { shape: data.shape, w, h })
|
|
20367
20333
|
] })
|
|
20368
20334
|
] });
|
|
20369
20335
|
}
|
|
@@ -20392,10 +20358,10 @@ function SelectedIndicator({ shape, w, h }) {
|
|
|
20392
20358
|
break;
|
|
20393
20359
|
}
|
|
20394
20360
|
}
|
|
20395
|
-
return /* @__PURE__ */ jsx("g", { className:
|
|
20361
|
+
return /* @__PURE__ */ jsx("g", { className: "likec4-shape-outline", children: svg });
|
|
20396
20362
|
}
|
|
20397
20363
|
const ElementTag = forwardRef(
|
|
20398
|
-
({ tag, cursor
|
|
20364
|
+
({ tag, cursor, className, style: style2, ...props }, ref) => {
|
|
20399
20365
|
const spec = useTagSpecification(tag);
|
|
20400
20366
|
return /* @__PURE__ */ jsxs(
|
|
20401
20367
|
Box,
|
|
@@ -20409,7 +20375,10 @@ const ElementTag = forwardRef(
|
|
|
20409
20375
|
className
|
|
20410
20376
|
),
|
|
20411
20377
|
...props,
|
|
20412
|
-
style: {
|
|
20378
|
+
style: {
|
|
20379
|
+
cursor,
|
|
20380
|
+
...style2
|
|
20381
|
+
},
|
|
20413
20382
|
children: [
|
|
20414
20383
|
/* @__PURE__ */ jsx("span", { children: "#" }),
|
|
20415
20384
|
/* @__PURE__ */ jsx("span", { children: tag })
|
|
@@ -20472,7 +20441,7 @@ const ElementTag = forwardRef(
|
|
|
20472
20441
|
"data-likec4-tag": tag,
|
|
20473
20442
|
className: css({
|
|
20474
20443
|
layerStyle: "likec4.tag",
|
|
20475
|
-
flex: 1,
|
|
20444
|
+
flex: "1",
|
|
20476
20445
|
display: "flex",
|
|
20477
20446
|
alignItems: "center",
|
|
20478
20447
|
justifyContent: "center",
|
|
@@ -20507,9 +20476,9 @@ const ElementTag = forwardRef(
|
|
|
20507
20476
|
ElementTag,
|
|
20508
20477
|
{
|
|
20509
20478
|
tag,
|
|
20479
|
+
cursor: "pointer",
|
|
20510
20480
|
className: css({
|
|
20511
20481
|
userSelect: "none",
|
|
20512
|
-
cursor: "pointer",
|
|
20513
20482
|
...zoomIsLargeEnough && {
|
|
20514
20483
|
fontSize: "lg",
|
|
20515
20484
|
borderRadius: "[4px]",
|
|
@@ -20541,7 +20510,7 @@ const MarkdownBlock = forwardRef(({
|
|
|
20541
20510
|
}, ref) => {
|
|
20542
20511
|
if (value.isEmpty && hideIfEmpty)
|
|
20543
20512
|
return null;
|
|
20544
|
-
const content = value.nonEmpty ? { dangerouslySetInnerHTML: { __html: value.html } } : { children: /* @__PURE__ */ jsx(Text, { component: "span", fz: "xs", c: "dimmed", style: { userSelect: "none" }, children: emptyText }) };
|
|
20513
|
+
const content = value.nonEmpty ? value.isMarkdown ? { dangerouslySetInnerHTML: { __html: value.html } } : { children: /* @__PURE__ */ jsx("p", { children: value.text }) } : { children: /* @__PURE__ */ jsx(Text, { component: "span", fz: "xs", c: "dimmed", style: { userSelect: "none" }, children: emptyText }) };
|
|
20545
20514
|
return /* @__PURE__ */ jsx(
|
|
20546
20515
|
Box,
|
|
20547
20516
|
{
|
|
@@ -20554,6 +20523,9 @@ const MarkdownBlock = forwardRef(({
|
|
|
20554
20523
|
className
|
|
20555
20524
|
),
|
|
20556
20525
|
style: {
|
|
20526
|
+
...props.fontSize && {
|
|
20527
|
+
"--text-fz": `var(--font-sizes-${props.fontSize}, var(--font-sizes-md))`
|
|
20528
|
+
},
|
|
20557
20529
|
// @ts-expect-error
|
|
20558
20530
|
"--mantine-scale": textScale
|
|
20559
20531
|
},
|
|
@@ -20562,7 +20534,7 @@ const MarkdownBlock = forwardRef(({
|
|
|
20562
20534
|
);
|
|
20563
20535
|
});
|
|
20564
20536
|
MarkdownBlock.displayName = "MarkdownBlock";
|
|
20565
|
-
function ElementTitle({ id: id2, data, iconSize
|
|
20537
|
+
function ElementTitle({ id: id2, data, iconSize }) {
|
|
20566
20538
|
const elementIcon = IconRenderer({
|
|
20567
20539
|
element: {
|
|
20568
20540
|
id: id2,
|
|
@@ -20582,9 +20554,9 @@ function ElementTitle({ id: id2, data, iconSize: iconSize2 }) {
|
|
|
20582
20554
|
classes2.root,
|
|
20583
20555
|
"likec4-element"
|
|
20584
20556
|
),
|
|
20585
|
-
style: e(
|
|
20557
|
+
style: e(iconSize) ? {
|
|
20586
20558
|
// @ts-ignore
|
|
20587
|
-
"--likec4-icon-size": `${
|
|
20559
|
+
"--likec4-icon-size": `${iconSize}px`
|
|
20588
20560
|
} : void 0,
|
|
20589
20561
|
children: [
|
|
20590
20562
|
elementIcon,
|
|
@@ -20606,7 +20578,7 @@ function ElementTitle({ id: id2, data, iconSize: iconSize2 }) {
|
|
|
20606
20578
|
children: data.technology
|
|
20607
20579
|
}
|
|
20608
20580
|
),
|
|
20609
|
-
data.description && /* @__PURE__ */ jsx(
|
|
20581
|
+
data.description?.nonEmpty && (data.description.isMarkdown ? /* @__PURE__ */ jsx(
|
|
20610
20582
|
MarkdownBlock,
|
|
20611
20583
|
{
|
|
20612
20584
|
className: cx(classes2.description, "likec4-element-description"),
|
|
@@ -20616,22 +20588,28 @@ function ElementTitle({ id: id2, data, iconSize: iconSize2 }) {
|
|
|
20616
20588
|
maxHeight: data.description.isMarkdown ? "8rem" : void 0,
|
|
20617
20589
|
lineClamp: isSmOrXs ? 3 : 5
|
|
20618
20590
|
}
|
|
20619
|
-
)
|
|
20591
|
+
) : /* @__PURE__ */ jsx(
|
|
20592
|
+
Text,
|
|
20593
|
+
{
|
|
20594
|
+
component: "div",
|
|
20595
|
+
className: cx(classes2.description, "likec4-element-description"),
|
|
20596
|
+
lineClamp: isSmOrXs ? 3 : 5,
|
|
20597
|
+
children: data.description.text
|
|
20598
|
+
}
|
|
20599
|
+
))
|
|
20620
20600
|
] })
|
|
20621
20601
|
]
|
|
20622
20602
|
}
|
|
20623
20603
|
);
|
|
20624
20604
|
}
|
|
20625
|
-
|
|
20626
|
-
|
|
20627
|
-
|
|
20628
|
-
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
}
|
|
20634
|
-
const CompoundActions = (props) => {
|
|
20605
|
+
const style = {
|
|
20606
|
+
top: "50%",
|
|
20607
|
+
left: "50%",
|
|
20608
|
+
visibility: "hidden"
|
|
20609
|
+
}, DefaultHandles = () => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
20610
|
+
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style }),
|
|
20611
|
+
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, style })
|
|
20612
|
+
] }), CompoundActions = (props) => {
|
|
20635
20613
|
const { enableNavigateTo } = useEnabledFeatures(), diagram = useDiagram(), { navigateTo } = props.data;
|
|
20636
20614
|
return navigateTo && enableNavigateTo ? /* @__PURE__ */ jsx(
|
|
20637
20615
|
CompoundActionButton,
|
|
@@ -20981,7 +20959,7 @@ function CompoundElementToolbar(props) {
|
|
|
20981
20959
|
style: style2,
|
|
20982
20960
|
modelFqn
|
|
20983
20961
|
}
|
|
20984
|
-
} = props, { elementColor, onColorPreview, onChange } = useHandlers(modelFqn, props);
|
|
20962
|
+
} = props, { elementColor, onColorPreview, onChange } = useHandlers(modelFqn, props), opacity = style2?.opacity ?? 100;
|
|
20985
20963
|
return /* @__PURE__ */ jsxs(
|
|
20986
20964
|
Toolbar,
|
|
20987
20965
|
{
|
|
@@ -20995,7 +20973,7 @@ function CompoundElementToolbar(props) {
|
|
|
20995
20973
|
elementColor,
|
|
20996
20974
|
onColorPreview,
|
|
20997
20975
|
isOpacityEditable: !0,
|
|
20998
|
-
elementOpacity:
|
|
20976
|
+
elementOpacity: opacity,
|
|
20999
20977
|
onChange,
|
|
21000
20978
|
position: "left-start"
|
|
21001
20979
|
}
|
|
@@ -21003,7 +20981,7 @@ function CompoundElementToolbar(props) {
|
|
|
21003
20981
|
/* @__PURE__ */ jsx(
|
|
21004
20982
|
BorderStyleOption,
|
|
21005
20983
|
{
|
|
21006
|
-
elementBorderStyle: style2?.border,
|
|
20984
|
+
elementBorderStyle: style2?.border ?? (opacity < 99 ? "dashed" : "none"),
|
|
21007
20985
|
onChange
|
|
21008
20986
|
}
|
|
21009
20987
|
),
|
|
@@ -21240,7 +21218,7 @@ function CompoundDetailsButtonWithHandler(props) {
|
|
|
21240
21218
|
}
|
|
21241
21219
|
);
|
|
21242
21220
|
}
|
|
21243
|
-
const ElementNode =
|
|
21221
|
+
const ElementNode = (props) => {
|
|
21244
21222
|
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
21245
21223
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
21246
21224
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
@@ -21251,9 +21229,9 @@ const ElementNode = customNode((props) => {
|
|
|
21251
21229
|
!enableReadOnly && /* @__PURE__ */ jsx(ElementToolbar, { ...props }),
|
|
21252
21230
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
21253
21231
|
] });
|
|
21254
|
-
}
|
|
21232
|
+
};
|
|
21255
21233
|
ElementNode.displayName = "ElementNode";
|
|
21256
|
-
const DeploymentNode =
|
|
21234
|
+
const DeploymentNode = (props) => {
|
|
21257
21235
|
const { enableElementTags, enableReadOnly } = useEnabledFeatures();
|
|
21258
21236
|
return /* @__PURE__ */ jsxs(ElementNodeContainer, { nodeProps: props, children: [
|
|
21259
21237
|
/* @__PURE__ */ jsx(ElementShape, { ...props }),
|
|
@@ -21264,9 +21242,9 @@ const DeploymentNode = customNode((props) => {
|
|
|
21264
21242
|
!enableReadOnly && /* @__PURE__ */ jsx(DeploymentElementToolbar, { ...props }),
|
|
21265
21243
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
21266
21244
|
] });
|
|
21267
|
-
}
|
|
21245
|
+
};
|
|
21268
21246
|
DeploymentNode.displayName = "DeploymentNode";
|
|
21269
|
-
const CompoundElementNode =
|
|
21247
|
+
const CompoundElementNode = (props) => {
|
|
21270
21248
|
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
21271
21249
|
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
21272
21250
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
@@ -21275,9 +21253,9 @@ const CompoundElementNode = customNode((props) => {
|
|
|
21275
21253
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundElementToolbar, { ...props }),
|
|
21276
21254
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
21277
21255
|
] });
|
|
21278
|
-
}
|
|
21256
|
+
};
|
|
21279
21257
|
CompoundElementNode.displayName = "CompoundElementNode";
|
|
21280
|
-
const CompoundDeploymentNode =
|
|
21258
|
+
const CompoundDeploymentNode = (props) => {
|
|
21281
21259
|
const { enableElementDetails, enableReadOnly } = useEnabledFeatures();
|
|
21282
21260
|
return /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
21283
21261
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
@@ -21286,18 +21264,50 @@ const CompoundDeploymentNode = customNode((props) => {
|
|
|
21286
21264
|
!enableReadOnly && /* @__PURE__ */ jsx(CompoundDeploymentToolbar, { ...props }),
|
|
21287
21265
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
21288
21266
|
] });
|
|
21289
|
-
}
|
|
21267
|
+
};
|
|
21290
21268
|
CompoundDeploymentNode.displayName = "CompoundDeploymentNode";
|
|
21291
|
-
const ViewGroupNode =
|
|
21269
|
+
const ViewGroupNode = (props) => /* @__PURE__ */ jsxs(CompoundNodeContainer, { nodeProps: props, children: [
|
|
21292
21270
|
/* @__PURE__ */ jsx(CompoundTitle, { ...props }),
|
|
21293
21271
|
/* @__PURE__ */ jsx(DefaultHandles, {})
|
|
21294
|
-
] })
|
|
21272
|
+
] });
|
|
21295
21273
|
ViewGroupNode.displayName = "ViewGroupNode";
|
|
21274
|
+
function useOptionalCurrentViewModel() {
|
|
21275
|
+
return useContext(CurrentViewModelContext);
|
|
21276
|
+
}
|
|
21277
|
+
function useCurrentViewModel() {
|
|
21278
|
+
const vm = useContext(CurrentViewModelContext);
|
|
21279
|
+
if (!vm)
|
|
21280
|
+
throw new Error("No LikeC4ViewModel in context found");
|
|
21281
|
+
return vm;
|
|
21282
|
+
}
|
|
21296
21283
|
const selectViewId = (s2) => s2.context.view.id;
|
|
21297
21284
|
function useCurrentViewId() {
|
|
21298
21285
|
const actorRef = useDiagramActorRef();
|
|
21299
21286
|
return useSelector(actorRef, selectViewId);
|
|
21300
21287
|
}
|
|
21288
|
+
const LikeC4ProjectsContext = createContext(null), emptyProjects = [];
|
|
21289
|
+
function useLikeC4Projects() {
|
|
21290
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21291
|
+
return ctx ? ctx.projects : emptyProjects;
|
|
21292
|
+
}
|
|
21293
|
+
const emptyOnProjectChange = () => {
|
|
21294
|
+
}, emptyContext = {
|
|
21295
|
+
projects: emptyProjects,
|
|
21296
|
+
onProjectChange: emptyOnProjectChange
|
|
21297
|
+
};
|
|
21298
|
+
function useLikeC4ProjectsContext() {
|
|
21299
|
+
return useContext(LikeC4ProjectsContext) ?? emptyContext;
|
|
21300
|
+
}
|
|
21301
|
+
function useHasProjects() {
|
|
21302
|
+
const ctx = useContext(LikeC4ProjectsContext);
|
|
21303
|
+
return ctx ? ctx.projects.length > 1 : !1;
|
|
21304
|
+
}
|
|
21305
|
+
function useLikeC4ProjectId() {
|
|
21306
|
+
const ctx = useContext(LikeC4ModelContext);
|
|
21307
|
+
if (!ctx)
|
|
21308
|
+
throw new Error("No LikeC4ModelContext found");
|
|
21309
|
+
return ctx.projectId;
|
|
21310
|
+
}
|
|
21301
21311
|
const backdropBlur = "--_blur", backdropOpacity = "--_opacity", level = "--_level", offset = "--_offset", inset = "--_inset", borderRadius = "--_border-radius", dialog = css.raw({
|
|
21302
21312
|
boxSizing: "border-box",
|
|
21303
21313
|
margin: "0",
|
|
@@ -21538,7 +21548,7 @@ export {
|
|
|
21538
21548
|
clsx as L,
|
|
21539
21549
|
MantineContext as M,
|
|
21540
21550
|
getThemeColor as N,
|
|
21541
|
-
isElement$
|
|
21551
|
+
isElement$2 as O,
|
|
21542
21552
|
Popover as P,
|
|
21543
21553
|
getRefProp as Q,
|
|
21544
21554
|
useUncontrolled as R,
|
|
@@ -21617,7 +21627,7 @@ export {
|
|
|
21617
21627
|
loadExternalIsValidProp as ay,
|
|
21618
21628
|
isMotionValue as az,
|
|
21619
21629
|
useMantineTheme as b,
|
|
21620
|
-
|
|
21630
|
+
Box as b$,
|
|
21621
21631
|
css as b0,
|
|
21622
21632
|
getPatternStyles as b1,
|
|
21623
21633
|
patternFns as b2,
|
|
@@ -21654,11 +21664,11 @@ export {
|
|
|
21654
21664
|
deepEqual as bX,
|
|
21655
21665
|
ActionIcon as bY,
|
|
21656
21666
|
IconZoomScan as bZ,
|
|
21657
|
-
|
|
21667
|
+
MotionDiv as b_,
|
|
21658
21668
|
stopPropagation as ba,
|
|
21659
21669
|
cx as bb,
|
|
21660
|
-
|
|
21661
|
-
useStore
|
|
21670
|
+
roundDpr as bc,
|
|
21671
|
+
useStore as bd,
|
|
21662
21672
|
useUpdateEffect as be,
|
|
21663
21673
|
XSTATE_STOP as bf,
|
|
21664
21674
|
cloneMachineSnapshot as bg,
|
|
@@ -21682,161 +21692,171 @@ export {
|
|
|
21682
21692
|
getPersistedSnapshot as by,
|
|
21683
21693
|
$$ACTOR_TYPE as bz,
|
|
21684
21694
|
useMantineStyleNonce as c,
|
|
21685
|
-
|
|
21686
|
-
|
|
21687
|
-
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
|
|
21731
|
-
|
|
21732
|
-
|
|
21733
|
-
|
|
21734
|
-
|
|
21735
|
-
|
|
21736
|
-
|
|
21737
|
-
|
|
21738
|
-
|
|
21739
|
-
|
|
21740
|
-
|
|
21741
|
-
|
|
21742
|
-
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
|
|
21695
|
+
CompoundNodeContainer as c$,
|
|
21696
|
+
n$1 as c0,
|
|
21697
|
+
EdgeLabelRenderer as c1,
|
|
21698
|
+
e as c2,
|
|
21699
|
+
getNodeDimensions as c3,
|
|
21700
|
+
useXYFlow as c4,
|
|
21701
|
+
useDiagram as c5,
|
|
21702
|
+
useEnabledFeatures as c6,
|
|
21703
|
+
useXYInternalNode as c7,
|
|
21704
|
+
isSamePoint as c8,
|
|
21705
|
+
bezierControlPoints as c9,
|
|
21706
|
+
isMacOs as cA,
|
|
21707
|
+
IconCheck as cB,
|
|
21708
|
+
IconId as cC,
|
|
21709
|
+
HStack as cD,
|
|
21710
|
+
ElementTag as cE,
|
|
21711
|
+
MarkdownBlock as cF,
|
|
21712
|
+
cva as cG,
|
|
21713
|
+
Button as cH,
|
|
21714
|
+
MotionSpan as cI,
|
|
21715
|
+
Portal as cJ,
|
|
21716
|
+
useLikeC4ProjectsContext as cK,
|
|
21717
|
+
useLikeC4ProjectId as cL,
|
|
21718
|
+
Menu as cM,
|
|
21719
|
+
MenuTarget as cN,
|
|
21720
|
+
MenuDropdown as cO,
|
|
21721
|
+
MenuItem as cP,
|
|
21722
|
+
useLikeC4Model as cQ,
|
|
21723
|
+
Divider as cR,
|
|
21724
|
+
o$1 as cS,
|
|
21725
|
+
useDiagramActorRef as cT,
|
|
21726
|
+
useCurrentViewModel as cU,
|
|
21727
|
+
useActorRef as cV,
|
|
21728
|
+
useUpdateEffect$1 as cW,
|
|
21729
|
+
Group as cX,
|
|
21730
|
+
getBezierPath as cY,
|
|
21731
|
+
ElementActionButtons as cZ,
|
|
21732
|
+
IconTransform as c_,
|
|
21733
|
+
bezierPath as ca,
|
|
21734
|
+
ViewGroupNode as cb,
|
|
21735
|
+
CompoundDeploymentNode as cc,
|
|
21736
|
+
CompoundElementNode as cd,
|
|
21737
|
+
DeploymentNode as ce,
|
|
21738
|
+
ElementNode as cf,
|
|
21739
|
+
useDiagramActorSnapshot as cg,
|
|
21740
|
+
n as ch,
|
|
21741
|
+
MotionButton as ci,
|
|
21742
|
+
Tooltip$1 as cj,
|
|
21743
|
+
useDiagramEventHandlers as ck,
|
|
21744
|
+
useDiagramContext as cl,
|
|
21745
|
+
useHover$1 as cm,
|
|
21746
|
+
PopoverTarget as cn,
|
|
21747
|
+
PopoverDropdown as co,
|
|
21748
|
+
FloatingIndicator as cp,
|
|
21749
|
+
Flex as cq,
|
|
21750
|
+
clampUseMovePosition as cr,
|
|
21751
|
+
useMove as cs,
|
|
21752
|
+
useMantinePortalProps as ct,
|
|
21753
|
+
hstack as cu,
|
|
21754
|
+
TooltipGroup as cv,
|
|
21755
|
+
shallowEqual as cw,
|
|
21756
|
+
useSelector as cx,
|
|
21757
|
+
useCurrentViewId as cy,
|
|
21758
|
+
IconFileSymlink as cz,
|
|
21749
21759
|
alpha$1 as d,
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21784
|
-
|
|
21785
|
-
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21790
|
-
|
|
21791
|
-
|
|
21792
|
-
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21806
|
-
|
|
21807
|
-
|
|
21808
|
-
|
|
21809
|
-
|
|
21810
|
-
|
|
21811
|
-
|
|
21812
|
-
|
|
21760
|
+
getBoundsOfRects as d$,
|
|
21761
|
+
CompoundTitle as d0,
|
|
21762
|
+
CompoundDetailsButton as d1,
|
|
21763
|
+
ElementNodeContainer as d2,
|
|
21764
|
+
ElementShape as d3,
|
|
21765
|
+
ElementTitle as d4,
|
|
21766
|
+
ElementTags as d5,
|
|
21767
|
+
Handle as d6,
|
|
21768
|
+
Position as d7,
|
|
21769
|
+
ElementDetailsButton as d8,
|
|
21770
|
+
getDefaultExportFromCjs as d9,
|
|
21771
|
+
IconOrShapeRenderer as dA,
|
|
21772
|
+
FocusTrap as dB,
|
|
21773
|
+
t$3 as dC,
|
|
21774
|
+
useOnDiagramEvent as dD,
|
|
21775
|
+
findDiagramEdge as dE,
|
|
21776
|
+
findDiagramNode as dF,
|
|
21777
|
+
autoUpdate as dG,
|
|
21778
|
+
Space as dH,
|
|
21779
|
+
computePosition as dI,
|
|
21780
|
+
offset$2 as dJ,
|
|
21781
|
+
autoPlacement as dK,
|
|
21782
|
+
size$1 as dL,
|
|
21783
|
+
hide$1 as dM,
|
|
21784
|
+
useOptionalCurrentViewModel as dN,
|
|
21785
|
+
ButtonGroup as dO,
|
|
21786
|
+
EnsureCurrentViewModel as dP,
|
|
21787
|
+
useIsReducedGraphics as dQ,
|
|
21788
|
+
usePanningAtom as dR,
|
|
21789
|
+
useTimeout as dS,
|
|
21790
|
+
useCustomCompareMemo as dT,
|
|
21791
|
+
useLikeC4Specification as dU,
|
|
21792
|
+
r as dV,
|
|
21793
|
+
applyEdgeChanges as dW,
|
|
21794
|
+
applyNodeChanges as dX,
|
|
21795
|
+
getViewportForBounds as dY,
|
|
21796
|
+
typedSystem as dZ,
|
|
21797
|
+
centerXYInternalNode as d_,
|
|
21798
|
+
l$1 as da,
|
|
21799
|
+
IconSelector as db,
|
|
21800
|
+
SegmentedControl as dc,
|
|
21801
|
+
ReactFlowProvider as dd,
|
|
21802
|
+
useStoreApi as de,
|
|
21803
|
+
useReactFlow as df,
|
|
21804
|
+
Panel as dg,
|
|
21805
|
+
m as dh,
|
|
21806
|
+
Stack as di,
|
|
21807
|
+
u as dj,
|
|
21808
|
+
useSyncedRef as dk,
|
|
21809
|
+
IconRenderer as dl,
|
|
21810
|
+
useTimeoutEffect as dm,
|
|
21811
|
+
ReactRemoveScroll as dn,
|
|
21812
|
+
ActionIconGroup as dp,
|
|
21813
|
+
IfEnabled as dq,
|
|
21814
|
+
DiagramFeatures as dr,
|
|
21815
|
+
t$1 as ds,
|
|
21816
|
+
customNode as dt,
|
|
21817
|
+
useXYStore as du,
|
|
21818
|
+
useReducedMotionConfig as dv,
|
|
21819
|
+
Overlay as dw,
|
|
21820
|
+
sva as dx,
|
|
21821
|
+
t$2 as dy,
|
|
21822
|
+
VisuallyHidden as dz,
|
|
21813
21823
|
em as e,
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21824
|
+
boxToRect as e0,
|
|
21825
|
+
and as e1,
|
|
21826
|
+
AllDisabled as e2,
|
|
21827
|
+
focusedBounds as e3,
|
|
21828
|
+
or as e4,
|
|
21829
|
+
nodeToRect as e5,
|
|
21830
|
+
useCustomCompareEffect as e6,
|
|
21831
|
+
DiagramActorContextProvider as e7,
|
|
21832
|
+
CurrentViewModelContext as e8,
|
|
21833
|
+
IconRendererProvider as e9,
|
|
21834
|
+
DiagramEventHandlers as ea,
|
|
21835
|
+
ReduceGraphicsContext as eb,
|
|
21836
|
+
RootContainer as ec,
|
|
21837
|
+
useMutationObserver as ed,
|
|
21838
|
+
shallowEqual$1 as ee,
|
|
21839
|
+
LikeC4ProjectsContext as ef,
|
|
21840
|
+
LikeC4ModelContext as eg,
|
|
21841
|
+
useLikeC4ViewModel as eh,
|
|
21842
|
+
useHasProjects as ei,
|
|
21843
|
+
useLikeC4Projects as ej,
|
|
21844
|
+
useSetState as ek,
|
|
21845
|
+
CompoundActionButton as el,
|
|
21846
|
+
DefaultHandles as em,
|
|
21847
|
+
CompoundActions as en,
|
|
21848
|
+
CompoundDeploymentToolbar as eo,
|
|
21849
|
+
CompoundDetailsButtonWithHandler as ep,
|
|
21850
|
+
CompoundElementToolbar as eq,
|
|
21851
|
+
DeploymentElementActions as er,
|
|
21852
|
+
DeploymentElementToolbar as es,
|
|
21853
|
+
ElementActions as et,
|
|
21854
|
+
ElementDetailsButtonWithHandler as eu,
|
|
21855
|
+
ElementToolbar as ev,
|
|
21856
|
+
Toolbar as ew,
|
|
21857
|
+
IfNotEnabled as ex,
|
|
21858
|
+
IfNotReadOnly as ey,
|
|
21859
|
+
IfReadOnly as ez,
|
|
21840
21860
|
getPrimaryContrastColor as f,
|
|
21841
21861
|
getPrimaryShade as g,
|
|
21842
21862
|
deepMerge as h,
|