@odigos/ui-kit 0.0.20 → 0.0.22
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/CHANGELOG.md +19 -0
- package/lib/components.js +7 -14
- package/lib/constants.js +3 -3
- package/lib/containers.js +1021 -875
- package/lib/functions.js +12 -6
- package/lib/hooks.js +5 -5
- package/lib/icons/destinations/alauda-logo/index.d.ts +2 -0
- package/lib/icons/destinations/alibaba-cloud-logo/index.d.ts +2 -0
- package/lib/icons/destinations/bonree-logo/index.d.ts +2 -0
- package/lib/icons/destinations/checkly-logo/index.d.ts +2 -0
- package/lib/icons/destinations/greptime-logo/index.d.ts +2 -0
- package/lib/icons/destinations/index.d.ts +12 -0
- package/lib/icons/destinations/observe-logo/index.d.ts +2 -0
- package/lib/icons/destinations/one-uptime-logo/index.d.ts +2 -0
- package/lib/icons/destinations/open-observe-logo/index.d.ts +2 -0
- package/lib/icons/destinations/oracle-logo/index.d.ts +2 -0
- package/lib/icons/destinations/seq-logo/index.d.ts +2 -0
- package/lib/icons/destinations/telemetry-hub-logo/index.d.ts +2 -0
- package/lib/icons/destinations/tingyun-logo/index.d.ts +2 -0
- package/lib/icons.js +2 -2
- package/lib/{index-BoH4B5XC.js → index-3mlRUlHD.js} +656 -1396
- package/lib/{index-WSle42rz.js → index-BfUUVS8N.js} +1 -1
- package/lib/{index-DSzybApb.js → index-C48Fe7Pl.js} +15 -3
- package/lib/{index-CD_BQJCD.js → index-C7Y1tYdc.js} +1 -1
- package/lib/{index-DB8Djrsy.js → index-CksKgOxY.js} +161 -1
- package/lib/{index-BFRz3l_w.js → index-D3sp5Hx7.js} +2 -2
- package/lib/{index-BazfJyRh.js → index-DiTtXTRm.js} +6 -10
- package/lib/store.js +1 -1
- package/lib/theme/index.d.ts +3 -3
- package/lib/theme.js +1 -7
- package/lib/types/destinations/index.d.ts +12 -0
- package/lib/types.js +12 -0
- package/lib/{useSourceSelectionFormData-_2PggiXn.js → useSourceSelectionFormData-CrKof314.js} +3 -3
- package/lib/{useTransition-bXMKBfST.js → useTransition-D0ykOLrk.js} +2 -2
- package/package.json +26 -26
package/lib/containers.js
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, memo, useContext, createContext, useCallback, useLayoutEffect, Fragment } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-
|
|
3
|
+
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-D3sp5Hx7.js';
|
|
4
4
|
import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-C_0J5P9M.js';
|
|
5
5
|
import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } from './types.js';
|
|
6
|
-
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, V as Text, P as Segment, O as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, W as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a3 as ModalBody, A as AutocompleteInput, i as Divider, R as Status, $ as FlexRow, Y as Tooltip, s as IconWrapped, G as MonitorsIcons, a4 as TableContainer, a5 as TableTitleWrap, r as IconTitleBadge, a6 as TableWrap, y as InteractiveTable, a1 as CenterThis, J as NoDataFound, a0 as FlexColumn, Z as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a7 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, L as NotificationNote, U as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-
|
|
7
|
-
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore,
|
|
6
|
+
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, V as Text, P as Segment, O as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, W as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a3 as ModalBody, A as AutocompleteInput, i as Divider, R as Status, $ as FlexRow, Y as Tooltip, s as IconWrapped, G as MonitorsIcons, a4 as TableContainer, a5 as TableTitleWrap, r as IconTitleBadge, a6 as TableWrap, y as InteractiveTable, a1 as CenterThis, J as NoDataFound, a0 as FlexColumn, Z as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a7 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, L as NotificationNote, U as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-3mlRUlHD.js';
|
|
7
|
+
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-DiTtXTRm.js';
|
|
8
8
|
import Theme from './theme.js';
|
|
9
9
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
10
10
|
import { i as CheckCircledIcon, O as OdigosLogo } from './index-BsH_egEe.js';
|
|
11
11
|
import { C as CrossCircledIcon, E as EditIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, N as NotificationIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon } from './index-KOMAv-TS.js';
|
|
12
|
-
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-
|
|
13
|
-
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-
|
|
14
|
-
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-
|
|
12
|
+
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-C7Y1tYdc.js';
|
|
13
|
+
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-CrKof314.js';
|
|
14
|
+
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-D0ykOLrk.js';
|
|
15
15
|
import { T as TrashIcon, S as SearchIcon, P as PlusIcon$1, A as ArrowIcon, a as CopyIcon, f as CheckIcon, g as CrossIcon } from './index-BJxaoI0G.js';
|
|
16
|
-
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-
|
|
17
|
-
import { f as filterActions, g as getConditionsBooleans, k as getEntityLabel, j as getEntityIcon, s as sleep$1, m as getPlatformIcon, n as getPlatformLabel, d as formatBytes, h as getContainersIcons, o as getValueForRange, i as getDestinationIcon, b as filterSources, a as filterDestinations, c as compareCondition, l as getMetricForEntity, p as getWorkloadId, e as getContainersInstrumentedCount, q as isOverTime } from './index-
|
|
18
|
-
import require$$1 from 'use-sync-external-store/shim';
|
|
16
|
+
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-BfUUVS8N.js';
|
|
17
|
+
import { f as filterActions, g as getConditionsBooleans, k as getEntityLabel, j as getEntityIcon, s as sleep$1, m as getPlatformIcon, n as getPlatformLabel, d as formatBytes, h as getContainersIcons, o as getValueForRange, i as getDestinationIcon, b as filterSources, a as filterDestinations, c as compareCondition, l as getMetricForEntity, p as getWorkloadId, e as getContainersInstrumentedCount, q as isOverTime } from './index-C48Fe7Pl.js';
|
|
19
18
|
import { createPortal } from 'react-dom';
|
|
20
|
-
import {
|
|
19
|
+
import { a5 as RulesIcon, a6 as SourcesIcon, a2 as ActionsIcon, a3 as DestinationsIcon } from './index-CksKgOxY.js';
|
|
21
20
|
import './index-DGel4E-Z.js';
|
|
22
|
-
import 'babel-runtime/helpers/extends';
|
|
23
|
-
import 'babel-runtime/core-js/object/get-prototype-of';
|
|
24
|
-
import 'babel-runtime/helpers/classCallCheck';
|
|
25
|
-
import 'babel-runtime/helpers/createClass';
|
|
26
|
-
import 'babel-runtime/helpers/possibleConstructorReturn';
|
|
27
|
-
import 'babel-runtime/helpers/inherits';
|
|
28
|
-
import 'object-assign';
|
|
29
21
|
import './index-7-KCQK-x.js';
|
|
30
22
|
|
|
31
23
|
const buildCard$3 = (action) => {
|
|
@@ -1092,7 +1084,7 @@ const ComputePlatformsActionsMenu = ({ connections }) => {
|
|
|
1092
1084
|
React.createElement(ConnectionStatusDropdown, { connections: connections, value: statuses, onSelect: (val) => setStatuses([...(statuses || []), val]), onDeselect: (val) => setStatuses((statuses || []).filter((opt) => opt.id !== val.id)), showSearch: true, required: true, isMulti: true })))));
|
|
1093
1085
|
};
|
|
1094
1086
|
|
|
1095
|
-
var css_248z = "/* this gets exported as style.css and can be used for the default theming */\n/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */\n.react-flow {\n direction: ltr;\n\n --xy-edge-stroke-default: #b1b1b7;\n --xy-edge-stroke-width-default: 1;\n --xy-edge-stroke-selected-default: #555;\n\n --xy-connectionline-stroke-default: #b1b1b7;\n --xy-connectionline-stroke-width-default: 1;\n\n --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);\n\n --xy-minimap-background-color-default: #fff;\n --xy-minimap-mask-background-color-default: rgb(240, 240, 240, 0.6);\n --xy-minimap-mask-stroke-color-default: transparent;\n --xy-minimap-mask-stroke-width-default: 1;\n --xy-minimap-node-background-color-default: #e2e2e2;\n --xy-minimap-node-stroke-color-default: transparent;\n --xy-minimap-node-stroke-width-default: 2;\n\n --xy-background-color-default: transparent;\n --xy-background-pattern-dots-color-default: #91919a;\n --xy-background-pattern-lines-color-default: #eee;\n --xy-background-pattern-cross-color-default: #e2e2e2;\n background-color: var(--xy-background-color, var(--xy-background-color-default));\n --xy-node-color-default: inherit;\n --xy-node-border-default: 1px solid #1a192b;\n --xy-node-background-color-default: #fff;\n --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);\n --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;\n --xy-node-border-radius-default: 3px;\n\n --xy-handle-background-color-default: #1a192b;\n --xy-handle-border-color-default: #fff;\n\n --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);\n --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);\n\n --xy-controls-button-background-color-default: #fefefe;\n --xy-controls-button-background-color-hover-default: #f4f4f4;\n --xy-controls-button-color-default: inherit;\n --xy-controls-button-color-hover-default: inherit;\n --xy-controls-button-border-color-default: #eee;\n --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n --xy-edge-label-background-color-default: #ffffff;\n --xy-edge-label-color-default: inherit;\n --xy-resize-background-color-default: #3367d9;\n}\n.react-flow.dark {\n --xy-edge-stroke-default: #3e3e3e;\n --xy-edge-stroke-width-default: 1;\n --xy-edge-stroke-selected-default: #727272;\n\n --xy-connectionline-stroke-default: #b1b1b7;\n --xy-connectionline-stroke-width-default: 1;\n\n --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);\n\n --xy-minimap-background-color-default: #141414;\n --xy-minimap-mask-background-color-default: rgb(60, 60, 60, 0.6);\n --xy-minimap-mask-stroke-color-default: transparent;\n --xy-minimap-mask-stroke-width-default: 1;\n --xy-minimap-node-background-color-default: #2b2b2b;\n --xy-minimap-node-stroke-color-default: transparent;\n --xy-minimap-node-stroke-width-default: 2;\n\n --xy-background-color-default: #141414;\n --xy-background-pattern-dots-color-default: #777;\n --xy-background-pattern-lines-color-default: #777;\n --xy-background-pattern-cross-color-default: #777;\n --xy-node-color-default: #f8f8f8;\n --xy-node-border-default: 1px solid #3c3c3c;\n --xy-node-background-color-default: #1e1e1e;\n --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);\n --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;\n\n --xy-handle-background-color-default: #bebebe;\n --xy-handle-border-color-default: #1e1e1e;\n\n --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);\n --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);\n\n --xy-controls-button-background-color-default: #2b2b2b;\n --xy-controls-button-background-color-hover-default: #3e3e3e;\n --xy-controls-button-color-default: #f8f8f8;\n --xy-controls-button-color-hover-default: #fff;\n --xy-controls-button-border-color-default: #5b5b5b;\n --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n --xy-edge-label-background-color-default: #141414;\n --xy-edge-label-color-default: #f8f8f8;\n}\n.react-flow__background {\n background-color: var(--xy-background-color, var(--xy-background-color-props, var(--xy-background-color-default)));\n pointer-events: none;\n z-index: -1;\n}\n.react-flow__container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n}\n.react-flow__pane {\n z-index: 1;\n}\n.react-flow__pane.draggable {\n cursor: grab;\n }\n.react-flow__pane.dragging {\n cursor: grabbing;\n }\n.react-flow__pane.selection {\n cursor: pointer;\n }\n.react-flow__viewport {\n transform-origin: 0 0;\n z-index: 2;\n pointer-events: none;\n}\n.react-flow__renderer {\n z-index: 4;\n}\n.react-flow__selection {\n z-index: 6;\n}\n.react-flow__nodesselection-rect:focus,\n.react-flow__nodesselection-rect:focus-visible {\n outline: none;\n}\n.react-flow__edge-path {\n stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));\n stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));\n fill: none;\n}\n.react-flow__connection-path {\n stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));\n stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));\n fill: none;\n}\n.react-flow .react-flow__edges {\n position: absolute;\n}\n.react-flow .react-flow__edges svg {\n overflow: visible;\n position: absolute;\n pointer-events: none;\n }\n.react-flow__edge {\n pointer-events: visibleStroke;\n}\n.react-flow__edge.selectable {\n cursor: pointer;\n }\n.react-flow__edge.animated path {\n stroke-dasharray: 5;\n animation: dashdraw 0.5s linear infinite;\n }\n.react-flow__edge.animated path.react-flow__edge-interaction {\n stroke-dasharray: none;\n animation: none;\n }\n.react-flow__edge.inactive {\n pointer-events: none;\n }\n.react-flow__edge.selected,\n .react-flow__edge:focus,\n .react-flow__edge:focus-visible {\n outline: none;\n }\n.react-flow__edge.selected .react-flow__edge-path,\n .react-flow__edge.selectable:focus .react-flow__edge-path,\n .react-flow__edge.selectable:focus-visible .react-flow__edge-path {\n stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));\n }\n.react-flow__edge-textwrapper {\n pointer-events: all;\n }\n.react-flow__edge .react-flow__edge-text {\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n.react-flow__connection {\n pointer-events: none;\n}\n.react-flow__connection .animated {\n stroke-dasharray: 5;\n animation: dashdraw 0.5s linear infinite;\n }\nsvg.react-flow__connectionline {\n z-index: 1001;\n overflow: visible;\n position: absolute;\n}\n.react-flow__nodes {\n pointer-events: none;\n transform-origin: 0 0;\n}\n.react-flow__node {\n position: absolute;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n pointer-events: all;\n transform-origin: 0 0;\n box-sizing: border-box;\n cursor: default;\n}\n.react-flow__node.selectable {\n cursor: pointer;\n }\n.react-flow__node.draggable {\n cursor: grab;\n pointer-events: all;\n }\n.react-flow__node.draggable.dragging {\n cursor: grabbing;\n }\n.react-flow__nodesselection {\n z-index: 3;\n transform-origin: left top;\n pointer-events: none;\n}\n.react-flow__nodesselection-rect {\n position: absolute;\n pointer-events: all;\n cursor: grab;\n }\n.react-flow__handle {\n position: absolute;\n pointer-events: none;\n min-width: 5px;\n min-height: 5px;\n width: 6px;\n height: 6px;\n background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));\n border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));\n border-radius: 100%;\n}\n.react-flow__handle.connectingfrom {\n pointer-events: all;\n }\n.react-flow__handle.connectionindicator {\n pointer-events: all;\n cursor: crosshair;\n }\n.react-flow__handle-bottom {\n top: auto;\n left: 50%;\n bottom: 0;\n transform: translate(-50%, 50%);\n }\n.react-flow__handle-top {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n.react-flow__handle-left {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n }\n.react-flow__handle-right {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n }\n.react-flow__edgeupdater {\n cursor: move;\n pointer-events: all;\n}\n.react-flow__panel {\n position: absolute;\n z-index: 5;\n margin: 15px;\n}\n.react-flow__panel.top {\n top: 0;\n }\n.react-flow__panel.bottom {\n bottom: 0;\n }\n.react-flow__panel.left {\n left: 0;\n }\n.react-flow__panel.right {\n right: 0;\n }\n.react-flow__panel.center {\n left: 50%;\n transform: translateX(-50%);\n }\n.react-flow__attribution {\n font-size: 10px;\n background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));\n padding: 2px 3px;\n margin: 0;\n}\n.react-flow__attribution a {\n text-decoration: none;\n color: #999;\n }\n@keyframes dashdraw {\n from {\n stroke-dashoffset: 10;\n }\n}\n.react-flow__edgelabel-renderer {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n left: 0;\n top: 0;\n}\n.react-flow__viewport-portal {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.react-flow__minimap {\n background: var(\n --xy-minimap-background-color-props,\n var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))\n );\n}\n.react-flow__minimap-svg {\n display: block;\n }\n.react-flow__minimap-mask {\n fill: var(\n --xy-minimap-mask-background-color-props,\n var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))\n );\n stroke: var(\n --xy-minimap-mask-stroke-color-props,\n var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))\n );\n stroke-width: var(\n --xy-minimap-mask-stroke-width-props,\n var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))\n );\n }\n.react-flow__minimap-node {\n fill: var(\n --xy-minimap-node-background-color-props,\n var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))\n );\n stroke: var(\n --xy-minimap-node-stroke-color-props,\n var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))\n );\n stroke-width: var(\n --xy-minimap-node-stroke-width-props,\n var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))\n );\n }\n.react-flow__background-pattern.dots {\n fill: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))\n );\n }\n.react-flow__background-pattern.lines {\n stroke: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))\n );\n }\n.react-flow__background-pattern.cross {\n stroke: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))\n );\n }\n.react-flow__controls {\n display: flex;\n flex-direction: column;\n box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));\n}\n.react-flow__controls.horizontal {\n flex-direction: row;\n }\n.react-flow__controls-button {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 26px;\n width: 26px;\n padding: 4px;\n border: none;\n background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));\n border-bottom: 1px solid\n var(\n --xy-controls-button-border-color-props,\n var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))\n );\n color: var(\n --xy-controls-button-color-props,\n var(--xy-controls-button-color, var(--xy-controls-button-color-default))\n );\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n.react-flow__controls-button svg {\n width: 100%;\n max-width: 12px;\n max-height: 12px;\n fill: currentColor;\n }\n.react-flow__edge.updating .react-flow__edge-path {\n stroke: #777;\n }\n.react-flow__edge-text {\n font-size: 10px;\n }\n.react-flow__node.selectable:focus,\n .react-flow__node.selectable:focus-visible {\n outline: none;\n }\n.react-flow__node-input,\n.react-flow__node-default,\n.react-flow__node-output,\n.react-flow__node-group {\n padding: 10px;\n border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));\n width: 150px;\n font-size: 12px;\n color: var(--xy-node-color, var(--xy-node-color-default));\n text-align: center;\n border: var(--xy-node-border, var(--xy-node-border-default));\n background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));\n}\n.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {\n box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));\n }\n.react-flow__node-input.selectable.selected,\n .react-flow__node-input.selectable:focus,\n .react-flow__node-input.selectable:focus-visible,\n .react-flow__node-default.selectable.selected,\n .react-flow__node-default.selectable:focus,\n .react-flow__node-default.selectable:focus-visible,\n .react-flow__node-output.selectable.selected,\n .react-flow__node-output.selectable:focus,\n .react-flow__node-output.selectable:focus-visible,\n .react-flow__node-group.selectable.selected,\n .react-flow__node-group.selectable:focus,\n .react-flow__node-group.selectable:focus-visible {\n box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));\n }\n.react-flow__node-group {\n background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));\n}\n.react-flow__nodesselection-rect,\n.react-flow__selection {\n background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));\n border: var(--xy-selection-border, var(--xy-selection-border-default));\n}\n.react-flow__nodesselection-rect:focus,\n .react-flow__nodesselection-rect:focus-visible,\n .react-flow__selection:focus,\n .react-flow__selection:focus-visible {\n outline: none;\n }\n.react-flow__controls-button:hover {\n background: var(\n --xy-controls-button-background-color-hover-props,\n var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))\n );\n color: var(\n --xy-controls-button-color-hover-props,\n var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))\n );\n }\n.react-flow__controls-button:disabled {\n pointer-events: none;\n }\n.react-flow__controls-button:disabled svg {\n fill-opacity: 0.4;\n }\n.react-flow__controls-button:last-child {\n border-bottom: none;\n }\n.react-flow__resize-control {\n position: absolute;\n}\n.react-flow__resize-control.left,\n.react-flow__resize-control.right {\n cursor: ew-resize;\n}\n.react-flow__resize-control.top,\n.react-flow__resize-control.bottom {\n cursor: ns-resize;\n}\n.react-flow__resize-control.top.left,\n.react-flow__resize-control.bottom.right {\n cursor: nwse-resize;\n}\n.react-flow__resize-control.bottom.left,\n.react-flow__resize-control.top.right {\n cursor: nesw-resize;\n}\n/* handle styles */\n.react-flow__resize-control.handle {\n width: 4px;\n height: 4px;\n border: 1px solid #fff;\n border-radius: 1px;\n background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n transform: translate(-50%, -50%);\n}\n.react-flow__resize-control.handle.left {\n left: 0;\n top: 50%;\n}\n.react-flow__resize-control.handle.right {\n left: 100%;\n top: 50%;\n}\n.react-flow__resize-control.handle.top {\n left: 50%;\n top: 0;\n}\n.react-flow__resize-control.handle.bottom {\n left: 50%;\n top: 100%;\n}\n.react-flow__resize-control.handle.top.left {\n left: 0;\n}\n.react-flow__resize-control.handle.bottom.left {\n left: 0;\n}\n.react-flow__resize-control.handle.top.right {\n left: 100%;\n}\n.react-flow__resize-control.handle.bottom.right {\n left: 100%;\n}\n/* line styles */\n.react-flow__resize-control.line {\n border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n border-width: 0;\n border-style: solid;\n}\n.react-flow__resize-control.line.left,\n.react-flow__resize-control.line.right {\n width: 1px;\n transform: translate(-50%, 0);\n top: 0;\n height: 100%;\n}\n.react-flow__resize-control.line.left {\n left: 0;\n border-left-width: 1px;\n}\n.react-flow__resize-control.line.right {\n left: 100%;\n border-right-width: 1px;\n}\n.react-flow__resize-control.line.top,\n.react-flow__resize-control.line.bottom {\n height: 1px;\n transform: translate(0, -50%);\n left: 0;\n width: 100%;\n}\n.react-flow__resize-control.line.top {\n top: 0;\n border-top-width: 1px;\n}\n.react-flow__resize-control.line.bottom {\n border-bottom-width: 1px;\n top: 100%;\n}\n.react-flow__edge-textbg {\n fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));\n}\n.react-flow__edge-text {\n fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));\n}\n";
|
|
1087
|
+
var css_248z = "/* this gets exported as style.css and can be used for the default theming */\n/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */\n.react-flow {\n direction: ltr;\n\n --xy-edge-stroke-default: #b1b1b7;\n --xy-edge-stroke-width-default: 1;\n --xy-edge-stroke-selected-default: #555;\n\n --xy-connectionline-stroke-default: #b1b1b7;\n --xy-connectionline-stroke-width-default: 1;\n\n --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);\n\n --xy-minimap-background-color-default: #fff;\n --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);\n --xy-minimap-mask-stroke-color-default: transparent;\n --xy-minimap-mask-stroke-width-default: 1;\n --xy-minimap-node-background-color-default: #e2e2e2;\n --xy-minimap-node-stroke-color-default: transparent;\n --xy-minimap-node-stroke-width-default: 2;\n\n --xy-background-color-default: transparent;\n --xy-background-pattern-dots-color-default: #91919a;\n --xy-background-pattern-lines-color-default: #eee;\n --xy-background-pattern-cross-color-default: #e2e2e2;\n background-color: var(--xy-background-color, var(--xy-background-color-default));\n --xy-node-color-default: inherit;\n --xy-node-border-default: 1px solid #1a192b;\n --xy-node-background-color-default: #fff;\n --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);\n --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;\n --xy-node-border-radius-default: 3px;\n\n --xy-handle-background-color-default: #1a192b;\n --xy-handle-border-color-default: #fff;\n\n --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);\n --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);\n\n --xy-controls-button-background-color-default: #fefefe;\n --xy-controls-button-background-color-hover-default: #f4f4f4;\n --xy-controls-button-color-default: inherit;\n --xy-controls-button-color-hover-default: inherit;\n --xy-controls-button-border-color-default: #eee;\n --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n --xy-edge-label-background-color-default: #ffffff;\n --xy-edge-label-color-default: inherit;\n --xy-resize-background-color-default: #3367d9;\n}\n.react-flow.dark {\n --xy-edge-stroke-default: #3e3e3e;\n --xy-edge-stroke-width-default: 1;\n --xy-edge-stroke-selected-default: #727272;\n\n --xy-connectionline-stroke-default: #b1b1b7;\n --xy-connectionline-stroke-width-default: 1;\n\n --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);\n\n --xy-minimap-background-color-default: #141414;\n --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);\n --xy-minimap-mask-stroke-color-default: transparent;\n --xy-minimap-mask-stroke-width-default: 1;\n --xy-minimap-node-background-color-default: #2b2b2b;\n --xy-minimap-node-stroke-color-default: transparent;\n --xy-minimap-node-stroke-width-default: 2;\n\n --xy-background-color-default: #141414;\n --xy-background-pattern-dots-color-default: #777;\n --xy-background-pattern-lines-color-default: #777;\n --xy-background-pattern-cross-color-default: #777;\n --xy-node-color-default: #f8f8f8;\n --xy-node-border-default: 1px solid #3c3c3c;\n --xy-node-background-color-default: #1e1e1e;\n --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);\n --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;\n\n --xy-handle-background-color-default: #bebebe;\n --xy-handle-border-color-default: #1e1e1e;\n\n --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);\n --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);\n\n --xy-controls-button-background-color-default: #2b2b2b;\n --xy-controls-button-background-color-hover-default: #3e3e3e;\n --xy-controls-button-color-default: #f8f8f8;\n --xy-controls-button-color-hover-default: #fff;\n --xy-controls-button-border-color-default: #5b5b5b;\n --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n --xy-edge-label-background-color-default: #141414;\n --xy-edge-label-color-default: #f8f8f8;\n}\n.react-flow__background {\n background-color: var(--xy-background-color, var(--xy-background-color-props, var(--xy-background-color-default)));\n pointer-events: none;\n z-index: -1;\n}\n.react-flow__container {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n}\n.react-flow__pane {\n z-index: 1;\n}\n.react-flow__pane.draggable {\n cursor: grab;\n }\n.react-flow__pane.dragging {\n cursor: grabbing;\n }\n.react-flow__pane.selection {\n cursor: pointer;\n }\n.react-flow__viewport {\n transform-origin: 0 0;\n z-index: 2;\n pointer-events: none;\n}\n.react-flow__renderer {\n z-index: 4;\n}\n.react-flow__selection {\n z-index: 6;\n}\n.react-flow__nodesselection-rect:focus,\n.react-flow__nodesselection-rect:focus-visible {\n outline: none;\n}\n.react-flow__edge-path {\n stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));\n stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));\n fill: none;\n}\n.react-flow__connection-path {\n stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));\n stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));\n fill: none;\n}\n.react-flow .react-flow__edges {\n position: absolute;\n}\n.react-flow .react-flow__edges svg {\n overflow: visible;\n position: absolute;\n pointer-events: none;\n }\n.react-flow__edge {\n pointer-events: visibleStroke;\n}\n.react-flow__edge.selectable {\n cursor: pointer;\n }\n.react-flow__edge.animated path {\n stroke-dasharray: 5;\n animation: dashdraw 0.5s linear infinite;\n }\n.react-flow__edge.animated path.react-flow__edge-interaction {\n stroke-dasharray: none;\n animation: none;\n }\n.react-flow__edge.inactive {\n pointer-events: none;\n }\n.react-flow__edge.selected,\n .react-flow__edge:focus,\n .react-flow__edge:focus-visible {\n outline: none;\n }\n.react-flow__edge.selected .react-flow__edge-path,\n .react-flow__edge.selectable:focus .react-flow__edge-path,\n .react-flow__edge.selectable:focus-visible .react-flow__edge-path {\n stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));\n }\n.react-flow__edge-textwrapper {\n pointer-events: all;\n }\n.react-flow__edge .react-flow__edge-text {\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n.react-flow__connection {\n pointer-events: none;\n}\n.react-flow__connection .animated {\n stroke-dasharray: 5;\n animation: dashdraw 0.5s linear infinite;\n }\nsvg.react-flow__connectionline {\n z-index: 1001;\n overflow: visible;\n position: absolute;\n}\n.react-flow__nodes {\n pointer-events: none;\n transform-origin: 0 0;\n}\n.react-flow__node {\n position: absolute;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n pointer-events: all;\n transform-origin: 0 0;\n box-sizing: border-box;\n cursor: default;\n}\n.react-flow__node.selectable {\n cursor: pointer;\n }\n.react-flow__node.draggable {\n cursor: grab;\n pointer-events: all;\n }\n.react-flow__node.draggable.dragging {\n cursor: grabbing;\n }\n.react-flow__nodesselection {\n z-index: 3;\n transform-origin: left top;\n pointer-events: none;\n}\n.react-flow__nodesselection-rect {\n position: absolute;\n pointer-events: all;\n cursor: grab;\n }\n.react-flow__handle {\n position: absolute;\n pointer-events: none;\n min-width: 5px;\n min-height: 5px;\n width: 6px;\n height: 6px;\n background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));\n border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));\n border-radius: 100%;\n}\n.react-flow__handle.connectingfrom {\n pointer-events: all;\n }\n.react-flow__handle.connectionindicator {\n pointer-events: all;\n cursor: crosshair;\n }\n.react-flow__handle-bottom {\n top: auto;\n left: 50%;\n bottom: 0;\n transform: translate(-50%, 50%);\n }\n.react-flow__handle-top {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n.react-flow__handle-left {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n }\n.react-flow__handle-right {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n }\n.react-flow__edgeupdater {\n cursor: move;\n pointer-events: all;\n}\n.react-flow__panel {\n position: absolute;\n z-index: 5;\n margin: 15px;\n}\n.react-flow__panel.top {\n top: 0;\n }\n.react-flow__panel.bottom {\n bottom: 0;\n }\n.react-flow__panel.top.center, .react-flow__panel.bottom.center {\n left: 50%;\n transform: translateX(-50%);\n }\n.react-flow__panel.left {\n left: 0;\n }\n.react-flow__panel.right {\n right: 0;\n }\n.react-flow__panel.left.center, .react-flow__panel.right.center {\n top: 50%;\n transform: translateY(-50%);\n }\n.react-flow__attribution {\n font-size: 10px;\n background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));\n padding: 2px 3px;\n margin: 0;\n}\n.react-flow__attribution a {\n text-decoration: none;\n color: #999;\n }\n@keyframes dashdraw {\n from {\n stroke-dashoffset: 10;\n }\n}\n.react-flow__edgelabel-renderer {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n left: 0;\n top: 0;\n}\n.react-flow__viewport-portal {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.react-flow__minimap {\n background: var(\n --xy-minimap-background-color-props,\n var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))\n );\n}\n.react-flow__minimap-svg {\n display: block;\n }\n.react-flow__minimap-mask {\n fill: var(\n --xy-minimap-mask-background-color-props,\n var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))\n );\n stroke: var(\n --xy-minimap-mask-stroke-color-props,\n var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))\n );\n stroke-width: var(\n --xy-minimap-mask-stroke-width-props,\n var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))\n );\n }\n.react-flow__minimap-node {\n fill: var(\n --xy-minimap-node-background-color-props,\n var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))\n );\n stroke: var(\n --xy-minimap-node-stroke-color-props,\n var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))\n );\n stroke-width: var(\n --xy-minimap-node-stroke-width-props,\n var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))\n );\n }\n.react-flow__background-pattern.dots {\n fill: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))\n );\n }\n.react-flow__background-pattern.lines {\n stroke: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))\n );\n }\n.react-flow__background-pattern.cross {\n stroke: var(\n --xy-background-pattern-color-props,\n var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))\n );\n }\n.react-flow__controls {\n display: flex;\n flex-direction: column;\n box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));\n}\n.react-flow__controls.horizontal {\n flex-direction: row;\n }\n.react-flow__controls-button {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 26px;\n width: 26px;\n padding: 4px;\n border: none;\n background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));\n border-bottom: 1px solid\n var(\n --xy-controls-button-border-color-props,\n var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))\n );\n color: var(\n --xy-controls-button-color-props,\n var(--xy-controls-button-color, var(--xy-controls-button-color-default))\n );\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n.react-flow__controls-button svg {\n width: 100%;\n max-width: 12px;\n max-height: 12px;\n fill: currentColor;\n }\n.react-flow__edge.updating .react-flow__edge-path {\n stroke: #777;\n }\n.react-flow__edge-text {\n font-size: 10px;\n }\n.react-flow__node.selectable:focus,\n .react-flow__node.selectable:focus-visible {\n outline: none;\n }\n.react-flow__node-input,\n.react-flow__node-default,\n.react-flow__node-output,\n.react-flow__node-group {\n padding: 10px;\n border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));\n width: 150px;\n font-size: 12px;\n color: var(--xy-node-color, var(--xy-node-color-default));\n text-align: center;\n border: var(--xy-node-border, var(--xy-node-border-default));\n background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));\n}\n.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {\n box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));\n }\n.react-flow__node-input.selectable.selected,\n .react-flow__node-input.selectable:focus,\n .react-flow__node-input.selectable:focus-visible,\n .react-flow__node-default.selectable.selected,\n .react-flow__node-default.selectable:focus,\n .react-flow__node-default.selectable:focus-visible,\n .react-flow__node-output.selectable.selected,\n .react-flow__node-output.selectable:focus,\n .react-flow__node-output.selectable:focus-visible,\n .react-flow__node-group.selectable.selected,\n .react-flow__node-group.selectable:focus,\n .react-flow__node-group.selectable:focus-visible {\n box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));\n }\n.react-flow__node-group {\n background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));\n}\n.react-flow__nodesselection-rect,\n.react-flow__selection {\n background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));\n border: var(--xy-selection-border, var(--xy-selection-border-default));\n}\n.react-flow__nodesselection-rect:focus,\n .react-flow__nodesselection-rect:focus-visible,\n .react-flow__selection:focus,\n .react-flow__selection:focus-visible {\n outline: none;\n }\n.react-flow__controls-button:hover {\n background: var(\n --xy-controls-button-background-color-hover-props,\n var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))\n );\n color: var(\n --xy-controls-button-color-hover-props,\n var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))\n );\n }\n.react-flow__controls-button:disabled {\n pointer-events: none;\n }\n.react-flow__controls-button:disabled svg {\n fill-opacity: 0.4;\n }\n.react-flow__controls-button:last-child {\n border-bottom: none;\n }\n.react-flow__resize-control {\n position: absolute;\n}\n.react-flow__resize-control.left,\n.react-flow__resize-control.right {\n cursor: ew-resize;\n}\n.react-flow__resize-control.top,\n.react-flow__resize-control.bottom {\n cursor: ns-resize;\n}\n.react-flow__resize-control.top.left,\n.react-flow__resize-control.bottom.right {\n cursor: nwse-resize;\n}\n.react-flow__resize-control.bottom.left,\n.react-flow__resize-control.top.right {\n cursor: nesw-resize;\n}\n/* handle styles */\n.react-flow__resize-control.handle {\n width: 4px;\n height: 4px;\n border: 1px solid #fff;\n border-radius: 1px;\n background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n transform: translate(-50%, -50%);\n}\n.react-flow__resize-control.handle.left {\n left: 0;\n top: 50%;\n}\n.react-flow__resize-control.handle.right {\n left: 100%;\n top: 50%;\n}\n.react-flow__resize-control.handle.top {\n left: 50%;\n top: 0;\n}\n.react-flow__resize-control.handle.bottom {\n left: 50%;\n top: 100%;\n}\n.react-flow__resize-control.handle.top.left {\n left: 0;\n}\n.react-flow__resize-control.handle.bottom.left {\n left: 0;\n}\n.react-flow__resize-control.handle.top.right {\n left: 100%;\n}\n.react-flow__resize-control.handle.bottom.right {\n left: 100%;\n}\n/* line styles */\n.react-flow__resize-control.line {\n border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n border-width: 0;\n border-style: solid;\n}\n.react-flow__resize-control.line.left,\n.react-flow__resize-control.line.right {\n width: 1px;\n transform: translate(-50%, 0);\n top: 0;\n height: 100%;\n}\n.react-flow__resize-control.line.left {\n left: 0;\n border-left-width: 1px;\n}\n.react-flow__resize-control.line.right {\n left: 100%;\n border-right-width: 1px;\n}\n.react-flow__resize-control.line.top,\n.react-flow__resize-control.line.bottom {\n height: 1px;\n transform: translate(0, -50%);\n left: 0;\n width: 100%;\n}\n.react-flow__resize-control.line.top {\n top: 0;\n border-top-width: 1px;\n}\n.react-flow__resize-control.line.bottom {\n border-bottom-width: 1px;\n top: 100%;\n}\n.react-flow__edge-textbg {\n fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));\n}\n.react-flow__edge-text {\n fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));\n}\n";
|
|
1096
1088
|
styleInject(css_248z);
|
|
1097
1089
|
|
|
1098
1090
|
var jsxRuntime = {exports: {}};
|
|
@@ -1162,15 +1154,13 @@ function requireReactJsxRuntime_development () {
|
|
|
1162
1154
|
function getComponentNameFromType(type) {
|
|
1163
1155
|
if (null == type) return null;
|
|
1164
1156
|
if ("function" === typeof type)
|
|
1165
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
1157
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
1166
1158
|
? null
|
|
1167
1159
|
: type.displayName || type.name || null;
|
|
1168
1160
|
if ("string" === typeof type) return type;
|
|
1169
1161
|
switch (type) {
|
|
1170
1162
|
case REACT_FRAGMENT_TYPE:
|
|
1171
1163
|
return "Fragment";
|
|
1172
|
-
case REACT_PORTAL_TYPE:
|
|
1173
|
-
return "Portal";
|
|
1174
1164
|
case REACT_PROFILER_TYPE:
|
|
1175
1165
|
return "Profiler";
|
|
1176
1166
|
case REACT_STRICT_MODE_TYPE:
|
|
@@ -1179,6 +1169,8 @@ function requireReactJsxRuntime_development () {
|
|
|
1179
1169
|
return "Suspense";
|
|
1180
1170
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
1181
1171
|
return "SuspenseList";
|
|
1172
|
+
case REACT_ACTIVITY_TYPE:
|
|
1173
|
+
return "Activity";
|
|
1182
1174
|
}
|
|
1183
1175
|
if ("object" === typeof type)
|
|
1184
1176
|
switch (
|
|
@@ -1188,6 +1180,8 @@ function requireReactJsxRuntime_development () {
|
|
|
1188
1180
|
),
|
|
1189
1181
|
type.$$typeof)
|
|
1190
1182
|
) {
|
|
1183
|
+
case REACT_PORTAL_TYPE:
|
|
1184
|
+
return "Portal";
|
|
1191
1185
|
case REACT_CONTEXT_TYPE:
|
|
1192
1186
|
return (type.displayName || "Context") + ".Provider";
|
|
1193
1187
|
case REACT_CONSUMER_TYPE:
|
|
@@ -1242,260 +1236,28 @@ function requireReactJsxRuntime_development () {
|
|
|
1242
1236
|
return testStringCoercion(value);
|
|
1243
1237
|
}
|
|
1244
1238
|
}
|
|
1245
|
-
function
|
|
1246
|
-
|
|
1247
|
-
if (
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1254
|
-
prevGroupEnd = console.groupEnd;
|
|
1255
|
-
var props = {
|
|
1256
|
-
configurable: true,
|
|
1257
|
-
enumerable: true,
|
|
1258
|
-
value: disabledLog,
|
|
1259
|
-
writable: true
|
|
1260
|
-
};
|
|
1261
|
-
Object.defineProperties(console, {
|
|
1262
|
-
info: props,
|
|
1263
|
-
log: props,
|
|
1264
|
-
warn: props,
|
|
1265
|
-
error: props,
|
|
1266
|
-
group: props,
|
|
1267
|
-
groupCollapsed: props,
|
|
1268
|
-
groupEnd: props
|
|
1269
|
-
});
|
|
1270
|
-
}
|
|
1271
|
-
disabledDepth++;
|
|
1272
|
-
}
|
|
1273
|
-
function reenableLogs() {
|
|
1274
|
-
disabledDepth--;
|
|
1275
|
-
if (0 === disabledDepth) {
|
|
1276
|
-
var props = { configurable: true, enumerable: true, writable: true };
|
|
1277
|
-
Object.defineProperties(console, {
|
|
1278
|
-
log: assign({}, props, { value: prevLog }),
|
|
1279
|
-
info: assign({}, props, { value: prevInfo }),
|
|
1280
|
-
warn: assign({}, props, { value: prevWarn }),
|
|
1281
|
-
error: assign({}, props, { value: prevError }),
|
|
1282
|
-
group: assign({}, props, { value: prevGroup }),
|
|
1283
|
-
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
|
1284
|
-
groupEnd: assign({}, props, { value: prevGroupEnd })
|
|
1285
|
-
});
|
|
1286
|
-
}
|
|
1287
|
-
0 > disabledDepth &&
|
|
1288
|
-
console.error(
|
|
1289
|
-
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
1290
|
-
);
|
|
1291
|
-
}
|
|
1292
|
-
function describeBuiltInComponentFrame(name) {
|
|
1293
|
-
if (void 0 === prefix)
|
|
1294
|
-
try {
|
|
1295
|
-
throw Error();
|
|
1296
|
-
} catch (x) {
|
|
1297
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1298
|
-
prefix = (match && match[1]) || "";
|
|
1299
|
-
suffix =
|
|
1300
|
-
-1 < x.stack.indexOf("\n at")
|
|
1301
|
-
? " (<anonymous>)"
|
|
1302
|
-
: -1 < x.stack.indexOf("@")
|
|
1303
|
-
? "@unknown:0:0"
|
|
1304
|
-
: "";
|
|
1305
|
-
}
|
|
1306
|
-
return "\n" + prefix + name + suffix;
|
|
1307
|
-
}
|
|
1308
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1309
|
-
if (!fn || reentry) return "";
|
|
1310
|
-
var frame = componentFrameCache.get(fn);
|
|
1311
|
-
if (void 0 !== frame) return frame;
|
|
1312
|
-
reentry = true;
|
|
1313
|
-
frame = Error.prepareStackTrace;
|
|
1314
|
-
Error.prepareStackTrace = void 0;
|
|
1315
|
-
var previousDispatcher = null;
|
|
1316
|
-
previousDispatcher = ReactSharedInternals.H;
|
|
1317
|
-
ReactSharedInternals.H = null;
|
|
1318
|
-
disableLogs();
|
|
1239
|
+
function getTaskName(type) {
|
|
1240
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
1241
|
+
if (
|
|
1242
|
+
"object" === typeof type &&
|
|
1243
|
+
null !== type &&
|
|
1244
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
1245
|
+
)
|
|
1246
|
+
return "<...>";
|
|
1319
1247
|
try {
|
|
1320
|
-
var
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
var Fake = function () {
|
|
1325
|
-
throw Error();
|
|
1326
|
-
};
|
|
1327
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
1328
|
-
set: function () {
|
|
1329
|
-
throw Error();
|
|
1330
|
-
}
|
|
1331
|
-
});
|
|
1332
|
-
if ("object" === typeof Reflect && Reflect.construct) {
|
|
1333
|
-
try {
|
|
1334
|
-
Reflect.construct(Fake, []);
|
|
1335
|
-
} catch (x) {
|
|
1336
|
-
var control = x;
|
|
1337
|
-
}
|
|
1338
|
-
Reflect.construct(fn, [], Fake);
|
|
1339
|
-
} else {
|
|
1340
|
-
try {
|
|
1341
|
-
Fake.call();
|
|
1342
|
-
} catch (x$0) {
|
|
1343
|
-
control = x$0;
|
|
1344
|
-
}
|
|
1345
|
-
fn.call(Fake.prototype);
|
|
1346
|
-
}
|
|
1347
|
-
} else {
|
|
1348
|
-
try {
|
|
1349
|
-
throw Error();
|
|
1350
|
-
} catch (x$1) {
|
|
1351
|
-
control = x$1;
|
|
1352
|
-
}
|
|
1353
|
-
(Fake = fn()) &&
|
|
1354
|
-
"function" === typeof Fake.catch &&
|
|
1355
|
-
Fake.catch(function () {});
|
|
1356
|
-
}
|
|
1357
|
-
} catch (sample) {
|
|
1358
|
-
if (sample && control && "string" === typeof sample.stack)
|
|
1359
|
-
return [sample.stack, control.stack];
|
|
1360
|
-
}
|
|
1361
|
-
return [null, null];
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
|
1365
|
-
"DetermineComponentFrameRoot";
|
|
1366
|
-
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
1367
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
1368
|
-
"name"
|
|
1369
|
-
);
|
|
1370
|
-
namePropDescriptor &&
|
|
1371
|
-
namePropDescriptor.configurable &&
|
|
1372
|
-
Object.defineProperty(
|
|
1373
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
1374
|
-
"name",
|
|
1375
|
-
{ value: "DetermineComponentFrameRoot" }
|
|
1376
|
-
);
|
|
1377
|
-
var _RunInRootFrame$Deter =
|
|
1378
|
-
RunInRootFrame.DetermineComponentFrameRoot(),
|
|
1379
|
-
sampleStack = _RunInRootFrame$Deter[0],
|
|
1380
|
-
controlStack = _RunInRootFrame$Deter[1];
|
|
1381
|
-
if (sampleStack && controlStack) {
|
|
1382
|
-
var sampleLines = sampleStack.split("\n"),
|
|
1383
|
-
controlLines = controlStack.split("\n");
|
|
1384
|
-
for (
|
|
1385
|
-
_RunInRootFrame$Deter = namePropDescriptor = 0;
|
|
1386
|
-
namePropDescriptor < sampleLines.length &&
|
|
1387
|
-
!sampleLines[namePropDescriptor].includes(
|
|
1388
|
-
"DetermineComponentFrameRoot"
|
|
1389
|
-
);
|
|
1390
|
-
|
|
1391
|
-
)
|
|
1392
|
-
namePropDescriptor++;
|
|
1393
|
-
for (
|
|
1394
|
-
;
|
|
1395
|
-
_RunInRootFrame$Deter < controlLines.length &&
|
|
1396
|
-
!controlLines[_RunInRootFrame$Deter].includes(
|
|
1397
|
-
"DetermineComponentFrameRoot"
|
|
1398
|
-
);
|
|
1399
|
-
|
|
1400
|
-
)
|
|
1401
|
-
_RunInRootFrame$Deter++;
|
|
1402
|
-
if (
|
|
1403
|
-
namePropDescriptor === sampleLines.length ||
|
|
1404
|
-
_RunInRootFrame$Deter === controlLines.length
|
|
1405
|
-
)
|
|
1406
|
-
for (
|
|
1407
|
-
namePropDescriptor = sampleLines.length - 1,
|
|
1408
|
-
_RunInRootFrame$Deter = controlLines.length - 1;
|
|
1409
|
-
1 <= namePropDescriptor &&
|
|
1410
|
-
0 <= _RunInRootFrame$Deter &&
|
|
1411
|
-
sampleLines[namePropDescriptor] !==
|
|
1412
|
-
controlLines[_RunInRootFrame$Deter];
|
|
1413
|
-
|
|
1414
|
-
)
|
|
1415
|
-
_RunInRootFrame$Deter--;
|
|
1416
|
-
for (
|
|
1417
|
-
;
|
|
1418
|
-
1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
|
|
1419
|
-
namePropDescriptor--, _RunInRootFrame$Deter--
|
|
1420
|
-
)
|
|
1421
|
-
if (
|
|
1422
|
-
sampleLines[namePropDescriptor] !==
|
|
1423
|
-
controlLines[_RunInRootFrame$Deter]
|
|
1424
|
-
) {
|
|
1425
|
-
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
|
|
1426
|
-
do
|
|
1427
|
-
if (
|
|
1428
|
-
(namePropDescriptor--,
|
|
1429
|
-
_RunInRootFrame$Deter--,
|
|
1430
|
-
0 > _RunInRootFrame$Deter ||
|
|
1431
|
-
sampleLines[namePropDescriptor] !==
|
|
1432
|
-
controlLines[_RunInRootFrame$Deter])
|
|
1433
|
-
) {
|
|
1434
|
-
var _frame =
|
|
1435
|
-
"\n" +
|
|
1436
|
-
sampleLines[namePropDescriptor].replace(
|
|
1437
|
-
" at new ",
|
|
1438
|
-
" at "
|
|
1439
|
-
);
|
|
1440
|
-
fn.displayName &&
|
|
1441
|
-
_frame.includes("<anonymous>") &&
|
|
1442
|
-
(_frame = _frame.replace("<anonymous>", fn.displayName));
|
|
1443
|
-
"function" === typeof fn &&
|
|
1444
|
-
componentFrameCache.set(fn, _frame);
|
|
1445
|
-
return _frame;
|
|
1446
|
-
}
|
|
1447
|
-
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
|
|
1448
|
-
}
|
|
1449
|
-
break;
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
} finally {
|
|
1453
|
-
(reentry = false),
|
|
1454
|
-
(ReactSharedInternals.H = previousDispatcher),
|
|
1455
|
-
reenableLogs(),
|
|
1456
|
-
(Error.prepareStackTrace = frame);
|
|
1248
|
+
var name = getComponentNameFromType(type);
|
|
1249
|
+
return name ? "<" + name + ">" : "<...>";
|
|
1250
|
+
} catch (x) {
|
|
1251
|
+
return "<...>";
|
|
1457
1252
|
}
|
|
1458
|
-
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
|
|
1459
|
-
? describeBuiltInComponentFrame(sampleLines)
|
|
1460
|
-
: "";
|
|
1461
|
-
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
|
1462
|
-
return sampleLines;
|
|
1463
|
-
}
|
|
1464
|
-
function describeUnknownElementTypeFrameInDEV(type) {
|
|
1465
|
-
if (null == type) return "";
|
|
1466
|
-
if ("function" === typeof type) {
|
|
1467
|
-
var prototype = type.prototype;
|
|
1468
|
-
return describeNativeComponentFrame(
|
|
1469
|
-
type,
|
|
1470
|
-
!(!prototype || !prototype.isReactComponent)
|
|
1471
|
-
);
|
|
1472
|
-
}
|
|
1473
|
-
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
|
1474
|
-
switch (type) {
|
|
1475
|
-
case REACT_SUSPENSE_TYPE:
|
|
1476
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
1477
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1478
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
1479
|
-
}
|
|
1480
|
-
if ("object" === typeof type)
|
|
1481
|
-
switch (type.$$typeof) {
|
|
1482
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1483
|
-
return (type = describeNativeComponentFrame(type.render, false)), type;
|
|
1484
|
-
case REACT_MEMO_TYPE:
|
|
1485
|
-
return describeUnknownElementTypeFrameInDEV(type.type);
|
|
1486
|
-
case REACT_LAZY_TYPE:
|
|
1487
|
-
prototype = type._payload;
|
|
1488
|
-
type = type._init;
|
|
1489
|
-
try {
|
|
1490
|
-
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
|
1491
|
-
} catch (x) {}
|
|
1492
|
-
}
|
|
1493
|
-
return "";
|
|
1494
1253
|
}
|
|
1495
1254
|
function getOwner() {
|
|
1496
1255
|
var dispatcher = ReactSharedInternals.A;
|
|
1497
1256
|
return null === dispatcher ? null : dispatcher.getOwner();
|
|
1498
1257
|
}
|
|
1258
|
+
function UnknownOwner() {
|
|
1259
|
+
return Error("react-stack-top-frame");
|
|
1260
|
+
}
|
|
1499
1261
|
function hasValidKey(config) {
|
|
1500
1262
|
if (hasOwnProperty.call(config, "key")) {
|
|
1501
1263
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
@@ -1528,7 +1290,16 @@ function requireReactJsxRuntime_development () {
|
|
|
1528
1290
|
componentName = this.props.ref;
|
|
1529
1291
|
return void 0 !== componentName ? componentName : null;
|
|
1530
1292
|
}
|
|
1531
|
-
function ReactElement(
|
|
1293
|
+
function ReactElement(
|
|
1294
|
+
type,
|
|
1295
|
+
key,
|
|
1296
|
+
self,
|
|
1297
|
+
source,
|
|
1298
|
+
owner,
|
|
1299
|
+
props,
|
|
1300
|
+
debugStack,
|
|
1301
|
+
debugTask
|
|
1302
|
+
) {
|
|
1532
1303
|
self = props.ref;
|
|
1533
1304
|
type = {
|
|
1534
1305
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
@@ -1556,6 +1327,18 @@ function requireReactJsxRuntime_development () {
|
|
|
1556
1327
|
writable: true,
|
|
1557
1328
|
value: null
|
|
1558
1329
|
});
|
|
1330
|
+
Object.defineProperty(type, "_debugStack", {
|
|
1331
|
+
configurable: false,
|
|
1332
|
+
enumerable: false,
|
|
1333
|
+
writable: true,
|
|
1334
|
+
value: debugStack
|
|
1335
|
+
});
|
|
1336
|
+
Object.defineProperty(type, "_debugTask", {
|
|
1337
|
+
configurable: false,
|
|
1338
|
+
enumerable: false,
|
|
1339
|
+
writable: true,
|
|
1340
|
+
value: debugTask
|
|
1341
|
+
});
|
|
1559
1342
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
1560
1343
|
return type;
|
|
1561
1344
|
}
|
|
@@ -1565,71 +1348,26 @@ function requireReactJsxRuntime_development () {
|
|
|
1565
1348
|
maybeKey,
|
|
1566
1349
|
isStaticChildren,
|
|
1567
1350
|
source,
|
|
1568
|
-
self
|
|
1351
|
+
self,
|
|
1352
|
+
debugStack,
|
|
1353
|
+
debugTask
|
|
1569
1354
|
) {
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
|
|
1587
|
-
void 0 !== type.getModuleId))
|
|
1588
|
-
) {
|
|
1589
|
-
var children = config.children;
|
|
1590
|
-
if (void 0 !== children)
|
|
1591
|
-
if (isStaticChildren)
|
|
1592
|
-
if (isArrayImpl(children)) {
|
|
1593
|
-
for (
|
|
1594
|
-
isStaticChildren = 0;
|
|
1595
|
-
isStaticChildren < children.length;
|
|
1596
|
-
isStaticChildren++
|
|
1597
|
-
)
|
|
1598
|
-
validateChildKeys(children[isStaticChildren], type);
|
|
1599
|
-
Object.freeze && Object.freeze(children);
|
|
1600
|
-
} else
|
|
1601
|
-
console.error(
|
|
1602
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
1603
|
-
);
|
|
1604
|
-
else validateChildKeys(children, type);
|
|
1605
|
-
} else {
|
|
1606
|
-
children = "";
|
|
1607
|
-
if (
|
|
1608
|
-
void 0 === type ||
|
|
1609
|
-
("object" === typeof type &&
|
|
1610
|
-
null !== type &&
|
|
1611
|
-
0 === Object.keys(type).length)
|
|
1612
|
-
)
|
|
1613
|
-
children +=
|
|
1614
|
-
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1615
|
-
null === type
|
|
1616
|
-
? (isStaticChildren = "null")
|
|
1617
|
-
: isArrayImpl(type)
|
|
1618
|
-
? (isStaticChildren = "array")
|
|
1619
|
-
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
|
|
1620
|
-
? ((isStaticChildren =
|
|
1621
|
-
"<" +
|
|
1622
|
-
(getComponentNameFromType(type.type) || "Unknown") +
|
|
1623
|
-
" />"),
|
|
1624
|
-
(children =
|
|
1625
|
-
" Did you accidentally export a JSX literal instead of a component?"))
|
|
1626
|
-
: (isStaticChildren = typeof type);
|
|
1627
|
-
console.error(
|
|
1628
|
-
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
1629
|
-
isStaticChildren,
|
|
1630
|
-
children
|
|
1631
|
-
);
|
|
1632
|
-
}
|
|
1355
|
+
var children = config.children;
|
|
1356
|
+
if (void 0 !== children)
|
|
1357
|
+
if (isStaticChildren)
|
|
1358
|
+
if (isArrayImpl(children)) {
|
|
1359
|
+
for (
|
|
1360
|
+
isStaticChildren = 0;
|
|
1361
|
+
isStaticChildren < children.length;
|
|
1362
|
+
isStaticChildren++
|
|
1363
|
+
)
|
|
1364
|
+
validateChildKeys(children[isStaticChildren]);
|
|
1365
|
+
Object.freeze && Object.freeze(children);
|
|
1366
|
+
} else
|
|
1367
|
+
console.error(
|
|
1368
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
1369
|
+
);
|
|
1370
|
+
else validateChildKeys(children);
|
|
1633
1371
|
if (hasOwnProperty.call(config, "key")) {
|
|
1634
1372
|
children = getComponentNameFromType(type);
|
|
1635
1373
|
var keys = Object.keys(config).filter(function (k) {
|
|
@@ -1668,88 +1406,23 @@ function requireReactJsxRuntime_development () {
|
|
|
1668
1406
|
? type.displayName || type.name || "Unknown"
|
|
1669
1407
|
: type
|
|
1670
1408
|
);
|
|
1671
|
-
return ReactElement(
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
for (var i = 0; i < node.length; i++) {
|
|
1681
|
-
var child = node[i];
|
|
1682
|
-
isValidElement(child) && validateExplicitKey(child, parentType);
|
|
1683
|
-
}
|
|
1684
|
-
else if (isValidElement(node))
|
|
1685
|
-
node._store && (node._store.validated = 1);
|
|
1686
|
-
else if (
|
|
1687
|
-
(null === node || "object" !== typeof node
|
|
1688
|
-
? (i = null)
|
|
1689
|
-
: ((i =
|
|
1690
|
-
(MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
|
|
1691
|
-
node["@@iterator"]),
|
|
1692
|
-
(i = "function" === typeof i ? i : null)),
|
|
1693
|
-
"function" === typeof i &&
|
|
1694
|
-
i !== node.entries &&
|
|
1695
|
-
((i = i.call(node)), i !== node))
|
|
1696
|
-
)
|
|
1697
|
-
for (; !(node = i.next()).done; )
|
|
1698
|
-
isValidElement(node.value) &&
|
|
1699
|
-
validateExplicitKey(node.value, parentType);
|
|
1700
|
-
}
|
|
1701
|
-
function isValidElement(object) {
|
|
1702
|
-
return (
|
|
1703
|
-
"object" === typeof object &&
|
|
1704
|
-
null !== object &&
|
|
1705
|
-
object.$$typeof === REACT_ELEMENT_TYPE
|
|
1409
|
+
return ReactElement(
|
|
1410
|
+
type,
|
|
1411
|
+
children,
|
|
1412
|
+
self,
|
|
1413
|
+
source,
|
|
1414
|
+
getOwner(),
|
|
1415
|
+
maybeKey,
|
|
1416
|
+
debugStack,
|
|
1417
|
+
debugTask
|
|
1706
1418
|
);
|
|
1707
1419
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
(
|
|
1714
|
-
(parentType = getCurrentComponentErrorInfo(parentType)),
|
|
1715
|
-
!ownerHasKeyUseWarning[parentType])
|
|
1716
|
-
) {
|
|
1717
|
-
ownerHasKeyUseWarning[parentType] = true;
|
|
1718
|
-
var childOwner = "";
|
|
1719
|
-
element &&
|
|
1720
|
-
null != element._owner &&
|
|
1721
|
-
element._owner !== getOwner() &&
|
|
1722
|
-
((childOwner = null),
|
|
1723
|
-
"number" === typeof element._owner.tag
|
|
1724
|
-
? (childOwner = getComponentNameFromType(element._owner.type))
|
|
1725
|
-
: "string" === typeof element._owner.name &&
|
|
1726
|
-
(childOwner = element._owner.name),
|
|
1727
|
-
(childOwner = " It was passed a child from " + childOwner + "."));
|
|
1728
|
-
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1729
|
-
ReactSharedInternals.getCurrentStack = function () {
|
|
1730
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
|
1731
|
-
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
|
1732
|
-
return stack;
|
|
1733
|
-
};
|
|
1734
|
-
console.error(
|
|
1735
|
-
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
1736
|
-
parentType,
|
|
1737
|
-
childOwner
|
|
1738
|
-
);
|
|
1739
|
-
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1743
|
-
var info = "",
|
|
1744
|
-
owner = getOwner();
|
|
1745
|
-
owner &&
|
|
1746
|
-
(owner = getComponentNameFromType(owner.type)) &&
|
|
1747
|
-
(info = "\n\nCheck the render method of `" + owner + "`.");
|
|
1748
|
-
info ||
|
|
1749
|
-
((parentType = getComponentNameFromType(parentType)) &&
|
|
1750
|
-
(info =
|
|
1751
|
-
"\n\nCheck the top-level render call using <" + parentType + ">."));
|
|
1752
|
-
return info;
|
|
1420
|
+
function validateChildKeys(node) {
|
|
1421
|
+
"object" === typeof node &&
|
|
1422
|
+
null !== node &&
|
|
1423
|
+
node.$$typeof === REACT_ELEMENT_TYPE &&
|
|
1424
|
+
node._store &&
|
|
1425
|
+
(node._store.validated = 1);
|
|
1753
1426
|
}
|
|
1754
1427
|
var React$1 = React,
|
|
1755
1428
|
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
@@ -1764,41 +1437,62 @@ function requireReactJsxRuntime_development () {
|
|
|
1764
1437
|
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
1765
1438
|
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
1766
1439
|
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
|
|
1440
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
1441
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
1770
1442
|
ReactSharedInternals =
|
|
1771
1443
|
React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
1772
1444
|
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
1773
|
-
assign = Object.assign,
|
|
1774
|
-
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
|
1775
1445
|
isArrayImpl = Array.isArray,
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
reentry = false;
|
|
1788
|
-
var componentFrameCache = new (
|
|
1789
|
-
"function" === typeof WeakMap ? WeakMap : Map
|
|
1790
|
-
)();
|
|
1791
|
-
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
1792
|
-
specialPropKeyWarningShown;
|
|
1446
|
+
createTask = console.createTask
|
|
1447
|
+
? console.createTask
|
|
1448
|
+
: function () {
|
|
1449
|
+
return null;
|
|
1450
|
+
};
|
|
1451
|
+
React$1 = {
|
|
1452
|
+
"react-stack-bottom-frame": function (callStackForError) {
|
|
1453
|
+
return callStackForError();
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
var specialPropKeyWarningShown;
|
|
1793
1457
|
var didWarnAboutElementRef = {};
|
|
1794
|
-
var
|
|
1795
|
-
|
|
1458
|
+
var unknownOwnerDebugStack = React$1["react-stack-bottom-frame"].bind(
|
|
1459
|
+
React$1,
|
|
1460
|
+
UnknownOwner
|
|
1461
|
+
)();
|
|
1462
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1463
|
+
var didWarnAboutKeySpread = {};
|
|
1796
1464
|
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1797
1465
|
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
1798
|
-
|
|
1466
|
+
var trackActualOwner =
|
|
1467
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1468
|
+
return jsxDEVImpl(
|
|
1469
|
+
type,
|
|
1470
|
+
config,
|
|
1471
|
+
maybeKey,
|
|
1472
|
+
false,
|
|
1473
|
+
source,
|
|
1474
|
+
self,
|
|
1475
|
+
trackActualOwner
|
|
1476
|
+
? Error("react-stack-top-frame")
|
|
1477
|
+
: unknownOwnerDebugStack,
|
|
1478
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1479
|
+
);
|
|
1799
1480
|
};
|
|
1800
1481
|
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
1801
|
-
|
|
1482
|
+
var trackActualOwner =
|
|
1483
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1484
|
+
return jsxDEVImpl(
|
|
1485
|
+
type,
|
|
1486
|
+
config,
|
|
1487
|
+
maybeKey,
|
|
1488
|
+
true,
|
|
1489
|
+
source,
|
|
1490
|
+
self,
|
|
1491
|
+
trackActualOwner
|
|
1492
|
+
? Error("react-stack-top-frame")
|
|
1493
|
+
: unknownOwnerDebugStack,
|
|
1494
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1495
|
+
);
|
|
1802
1496
|
};
|
|
1803
1497
|
})();
|
|
1804
1498
|
return reactJsxRuntime_development;
|
|
@@ -5456,7 +5150,7 @@ function getConnectionStatus(isValid) {
|
|
|
5456
5150
|
|
|
5457
5151
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5458
5152
|
/**
|
|
5459
|
-
* Test whether an object is
|
|
5153
|
+
* Test whether an object is usable as an Edge
|
|
5460
5154
|
* @public
|
|
5461
5155
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
|
|
5462
5156
|
* @param element - The element to test
|
|
@@ -5464,7 +5158,7 @@ function getConnectionStatus(isValid) {
|
|
|
5464
5158
|
*/
|
|
5465
5159
|
const isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;
|
|
5466
5160
|
/**
|
|
5467
|
-
* Test whether an object is
|
|
5161
|
+
* Test whether an object is usable as a Node
|
|
5468
5162
|
* @public
|
|
5469
5163
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
|
|
5470
5164
|
* @param element - The element to test
|
|
@@ -5488,9 +5182,8 @@ const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
|
|
|
5488
5182
|
* to calculate the correct transform to fit the given nodes in a viewport.
|
|
5489
5183
|
* @public
|
|
5490
5184
|
* @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.
|
|
5491
|
-
* @param nodes - Nodes to calculate the bounds for
|
|
5492
|
-
* @
|
|
5493
|
-
* @returns Bounding box enclosing all nodes
|
|
5185
|
+
* @param nodes - Nodes to calculate the bounds for.
|
|
5186
|
+
* @returns Bounding box enclosing all nodes.
|
|
5494
5187
|
*
|
|
5495
5188
|
* @remarks This function was previously called `getRectOfNodes`
|
|
5496
5189
|
*
|
|
@@ -5518,7 +5211,7 @@ const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
|
|
|
5518
5211
|
*const bounds = getNodesBounds(nodes);
|
|
5519
5212
|
*```
|
|
5520
5213
|
*/
|
|
5521
|
-
const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0]
|
|
5214
|
+
const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {
|
|
5522
5215
|
if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {
|
|
5523
5216
|
console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');
|
|
5524
5217
|
}
|
|
@@ -5588,9 +5281,9 @@ excludeNonSelectableNodes = false) => {
|
|
|
5588
5281
|
* This utility filters an array of edges, keeping only those where either the source or target
|
|
5589
5282
|
* node is present in the given array of nodes.
|
|
5590
5283
|
* @public
|
|
5591
|
-
* @param nodes - Nodes you want to get the connected edges for
|
|
5592
|
-
* @param edges - All edges
|
|
5593
|
-
* @returns Array of edges that connect any of the given nodes with each other
|
|
5284
|
+
* @param nodes - Nodes you want to get the connected edges for.
|
|
5285
|
+
* @param edges - All edges.
|
|
5286
|
+
* @returns Array of edges that connect any of the given nodes with each other.
|
|
5594
5287
|
*
|
|
5595
5288
|
* @example
|
|
5596
5289
|
* ```js
|
|
@@ -5628,11 +5321,12 @@ function getFitViewNodes(nodeLookup, options) {
|
|
|
5628
5321
|
});
|
|
5629
5322
|
return fitViewNodes;
|
|
5630
5323
|
}
|
|
5631
|
-
async function
|
|
5324
|
+
async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {
|
|
5632
5325
|
if (nodes.size === 0) {
|
|
5633
|
-
return Promise.resolve(
|
|
5326
|
+
return Promise.resolve(true);
|
|
5634
5327
|
}
|
|
5635
|
-
const
|
|
5328
|
+
const nodesToFit = getFitViewNodes(nodes, options);
|
|
5329
|
+
const bounds = getInternalNodesBounds(nodesToFit);
|
|
5636
5330
|
const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);
|
|
5637
5331
|
await panZoom.setViewport(viewport, { duration: options?.duration });
|
|
5638
5332
|
return Promise.resolve(true);
|
|
@@ -5844,31 +5538,126 @@ const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
|
5844
5538
|
};
|
|
5845
5539
|
};
|
|
5846
5540
|
/**
|
|
5847
|
-
*
|
|
5848
|
-
* @
|
|
5849
|
-
* @
|
|
5541
|
+
* Parses a single padding value to a number
|
|
5542
|
+
* @internal
|
|
5543
|
+
* @param padding - Padding to parse
|
|
5544
|
+
* @param viewport - Width or height of the viewport
|
|
5545
|
+
* @returns The padding in pixels
|
|
5546
|
+
*/
|
|
5547
|
+
function parsePadding(padding, viewport) {
|
|
5548
|
+
if (typeof padding === 'number') {
|
|
5549
|
+
return Math.floor(viewport - viewport / (1 + padding));
|
|
5550
|
+
}
|
|
5551
|
+
if (typeof padding === 'string' && padding.endsWith('px')) {
|
|
5552
|
+
const paddingValue = parseFloat(padding);
|
|
5553
|
+
if (!Number.isNaN(paddingValue)) {
|
|
5554
|
+
return Math.floor(paddingValue);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
if (typeof padding === 'string' && padding.endsWith('%')) {
|
|
5558
|
+
const paddingValue = parseFloat(padding);
|
|
5559
|
+
if (!Number.isNaN(paddingValue)) {
|
|
5560
|
+
return Math.floor(viewport * paddingValue * 0.01);
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
5563
|
+
console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`);
|
|
5564
|
+
return 0;
|
|
5565
|
+
}
|
|
5566
|
+
/**
|
|
5567
|
+
* Parses the paddings to an object with top, right, bottom, left, x and y paddings
|
|
5568
|
+
* @internal
|
|
5569
|
+
* @param padding - Padding to parse
|
|
5570
|
+
* @param width - Width of the viewport
|
|
5571
|
+
* @param height - Height of the viewport
|
|
5572
|
+
* @returns An object with the paddings in pixels
|
|
5573
|
+
*/
|
|
5574
|
+
function parsePaddings(padding, width, height) {
|
|
5575
|
+
if (typeof padding === 'string' || typeof padding === 'number') {
|
|
5576
|
+
const paddingY = parsePadding(padding, height);
|
|
5577
|
+
const paddingX = parsePadding(padding, width);
|
|
5578
|
+
return {
|
|
5579
|
+
top: paddingY,
|
|
5580
|
+
right: paddingX,
|
|
5581
|
+
bottom: paddingY,
|
|
5582
|
+
left: paddingX,
|
|
5583
|
+
x: paddingX * 2,
|
|
5584
|
+
y: paddingY * 2,
|
|
5585
|
+
};
|
|
5586
|
+
}
|
|
5587
|
+
if (typeof padding === 'object') {
|
|
5588
|
+
const top = parsePadding(padding.top ?? padding.y ?? 0, height);
|
|
5589
|
+
const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);
|
|
5590
|
+
const left = parsePadding(padding.left ?? padding.x ?? 0, width);
|
|
5591
|
+
const right = parsePadding(padding.right ?? padding.x ?? 0, width);
|
|
5592
|
+
return { top, right, bottom, left, x: left + right, y: top + bottom };
|
|
5593
|
+
}
|
|
5594
|
+
return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };
|
|
5595
|
+
}
|
|
5596
|
+
/**
|
|
5597
|
+
* Calculates the resulting paddings if the new viewport is applied
|
|
5598
|
+
* @internal
|
|
5850
5599
|
* @param bounds - Bounds to fit inside viewport
|
|
5600
|
+
* @param x - X position of the viewport
|
|
5601
|
+
* @param y - Y position of the viewport
|
|
5602
|
+
* @param zoom - Zoom level of the viewport
|
|
5851
5603
|
* @param width - Width of the viewport
|
|
5852
|
-
* @param height
|
|
5853
|
-
* @
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5604
|
+
* @param height - Height of the viewport
|
|
5605
|
+
* @returns An object with the minimum padding required to fit the bounds inside the viewport
|
|
5606
|
+
*/
|
|
5607
|
+
function calculateAppliedPaddings(bounds, x, y, zoom, width, height) {
|
|
5608
|
+
const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);
|
|
5609
|
+
const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);
|
|
5610
|
+
const right = width - boundRight;
|
|
5611
|
+
const bottom = height - boundBottom;
|
|
5612
|
+
return {
|
|
5613
|
+
left: Math.floor(left),
|
|
5614
|
+
top: Math.floor(top),
|
|
5615
|
+
right: Math.floor(right),
|
|
5616
|
+
bottom: Math.floor(bottom),
|
|
5617
|
+
};
|
|
5618
|
+
}
|
|
5619
|
+
/**
|
|
5620
|
+
* Returns a viewport that encloses the given bounds with padding.
|
|
5621
|
+
* @public
|
|
5622
|
+
* @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}
|
|
5623
|
+
* @param bounds - Bounds to fit inside viewport.
|
|
5624
|
+
* @param width - Width of the viewport.
|
|
5625
|
+
* @param height - Height of the viewport.
|
|
5626
|
+
* @param minZoom - Minimum zoom level of the resulting viewport.
|
|
5627
|
+
* @param maxZoom - Maximum zoom level of the resulting viewport.
|
|
5628
|
+
* @param padding - Padding around the bounds.
|
|
5629
|
+
* @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.
|
|
5857
5630
|
* @example
|
|
5858
5631
|
* const { x, y, zoom } = getViewportForBounds(
|
|
5859
|
-
*{ x: 0, y: 0, width: 100, height: 100},
|
|
5860
|
-
*1200, 800, 0.5, 2);
|
|
5632
|
+
* { x: 0, y: 0, width: 100, height: 100},
|
|
5633
|
+
* 1200, 800, 0.5, 2);
|
|
5861
5634
|
*/
|
|
5862
5635
|
const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {
|
|
5863
|
-
|
|
5864
|
-
const
|
|
5636
|
+
// First we resolve all the paddings to actual pixel values
|
|
5637
|
+
const p = parsePaddings(padding, width, height);
|
|
5638
|
+
const xZoom = (width - p.x) / bounds.width;
|
|
5639
|
+
const yZoom = (height - p.y) / bounds.height;
|
|
5640
|
+
// We calculate the new x, y, zoom for a centered view
|
|
5865
5641
|
const zoom = Math.min(xZoom, yZoom);
|
|
5866
5642
|
const clampedZoom = clamp(zoom, minZoom, maxZoom);
|
|
5867
5643
|
const boundsCenterX = bounds.x + bounds.width / 2;
|
|
5868
5644
|
const boundsCenterY = bounds.y + bounds.height / 2;
|
|
5869
5645
|
const x = width / 2 - boundsCenterX * clampedZoom;
|
|
5870
5646
|
const y = height / 2 - boundsCenterY * clampedZoom;
|
|
5871
|
-
|
|
5647
|
+
// Then we calculate the minimum padding, to respect asymmetric paddings
|
|
5648
|
+
const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);
|
|
5649
|
+
// We only want to have an offset if the newPadding is smaller than the required padding
|
|
5650
|
+
const offset = {
|
|
5651
|
+
left: Math.min(newPadding.left - p.left, 0),
|
|
5652
|
+
top: Math.min(newPadding.top - p.top, 0),
|
|
5653
|
+
right: Math.min(newPadding.right - p.right, 0),
|
|
5654
|
+
bottom: Math.min(newPadding.bottom - p.bottom, 0),
|
|
5655
|
+
};
|
|
5656
|
+
return {
|
|
5657
|
+
x: x - offset.left + offset.right,
|
|
5658
|
+
y: y - offset.top + offset.bottom,
|
|
5659
|
+
zoom: clampedZoom,
|
|
5660
|
+
};
|
|
5872
5661
|
};
|
|
5873
5662
|
const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;
|
|
5874
5663
|
function isCoordinateExtent(extent) {
|
|
@@ -6009,14 +5798,15 @@ function getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {
|
|
|
6009
5798
|
* The `getBezierPath` util returns everything you need to render a bezier edge
|
|
6010
5799
|
*between two nodes.
|
|
6011
5800
|
* @public
|
|
6012
|
-
* @
|
|
6013
|
-
*
|
|
6014
|
-
*
|
|
6015
|
-
*
|
|
6016
|
-
*
|
|
6017
|
-
*
|
|
6018
|
-
*
|
|
6019
|
-
*
|
|
5801
|
+
* @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
|
|
5802
|
+
* and `offsetX`, `offsetY` between source handle and label.
|
|
5803
|
+
* - `path`: the path to use in an SVG `<path>` element.
|
|
5804
|
+
* - `labelX`: the `x` position you can use to render a label for this edge.
|
|
5805
|
+
* - `labelY`: the `y` position you can use to render a label for this edge.
|
|
5806
|
+
* - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
|
|
5807
|
+
* middle of this path.
|
|
5808
|
+
* - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
|
|
5809
|
+
* middle of this path.
|
|
6020
5810
|
* @example
|
|
6021
5811
|
* ```js
|
|
6022
5812
|
* const source = { x: 0, y: 20 };
|
|
@@ -6113,9 +5903,9 @@ const connectionExists = (edge, edges) => {
|
|
|
6113
5903
|
/**
|
|
6114
5904
|
* This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.
|
|
6115
5905
|
* @public
|
|
6116
|
-
* @param edgeParams - Either an Edge or a Connection you want to add
|
|
6117
|
-
* @param edges -
|
|
6118
|
-
* @returns A new array of edges with the new edge added
|
|
5906
|
+
* @param edgeParams - Either an `Edge` or a `Connection` you want to add.
|
|
5907
|
+
* @param edges - The array of all current edges.
|
|
5908
|
+
* @returns A new array of edges with the new edge added.
|
|
6119
5909
|
*
|
|
6120
5910
|
* @remarks If an edge with the same `target` and `source` already exists (and the same
|
|
6121
5911
|
*`targetHandle` and `sourceHandle` if those are set), then this util won't add
|
|
@@ -6152,11 +5942,16 @@ const addEdge = (edgeParams, edges) => {
|
|
|
6152
5942
|
/**
|
|
6153
5943
|
* Calculates the straight line path between two points.
|
|
6154
5944
|
* @public
|
|
6155
|
-
* @
|
|
6156
|
-
*
|
|
6157
|
-
*
|
|
6158
|
-
*
|
|
6159
|
-
*
|
|
5945
|
+
* @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
|
|
5946
|
+
* and `offsetX`, `offsetY` between source handle and label.
|
|
5947
|
+
*
|
|
5948
|
+
* - `path`: the path to use in an SVG `<path>` element.
|
|
5949
|
+
* - `labelX`: the `x` position you can use to render a label for this edge.
|
|
5950
|
+
* - `labelY`: the `y` position you can use to render a label for this edge.
|
|
5951
|
+
* - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
|
|
5952
|
+
* middle of this path.
|
|
5953
|
+
* - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
|
|
5954
|
+
* middle of this path.
|
|
6160
5955
|
* @example
|
|
6161
5956
|
* ```js
|
|
6162
5957
|
* const source = { x: 0, y: 20 };
|
|
@@ -6197,8 +5992,8 @@ const getDirection = ({ source, sourcePosition = Position.Bottom, target, }) =>
|
|
|
6197
5992
|
};
|
|
6198
5993
|
const distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));
|
|
6199
5994
|
/*
|
|
6200
|
-
*
|
|
6201
|
-
* It's not as good as a real orthogonal edge routing but it's faster and good enough as a default for step and smooth step edges
|
|
5995
|
+
* With this function we try to mimic an orthogonal edge routing behaviour
|
|
5996
|
+
* It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges
|
|
6202
5997
|
*/
|
|
6203
5998
|
function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, }) {
|
|
6204
5999
|
const sourceDir = handleDirections[sourcePosition];
|
|
@@ -6329,16 +6124,19 @@ function getBend(a, b, c, size) {
|
|
|
6329
6124
|
}
|
|
6330
6125
|
/**
|
|
6331
6126
|
* The `getSmoothStepPath` util returns everything you need to render a stepped path
|
|
6332
|
-
*between two nodes. The `borderRadius` property can be used to choose how rounded
|
|
6333
|
-
*the corners of those steps are.
|
|
6127
|
+
* between two nodes. The `borderRadius` property can be used to choose how rounded
|
|
6128
|
+
* the corners of those steps are.
|
|
6334
6129
|
* @public
|
|
6335
|
-
* @
|
|
6336
|
-
*
|
|
6337
|
-
*
|
|
6338
|
-
*
|
|
6339
|
-
*
|
|
6340
|
-
*
|
|
6341
|
-
*
|
|
6130
|
+
* @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)
|
|
6131
|
+
* and `offsetX`, `offsetY` between source handle and label.
|
|
6132
|
+
*
|
|
6133
|
+
* - `path`: the path to use in an SVG `<path>` element.
|
|
6134
|
+
* - `labelX`: the `x` position you can use to render a label for this edge.
|
|
6135
|
+
* - `labelY`: the `y` position you can use to render a label for this edge.
|
|
6136
|
+
* - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
|
|
6137
|
+
* middle of this path.
|
|
6138
|
+
* - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
|
|
6139
|
+
* middle of this path.
|
|
6342
6140
|
* @example
|
|
6343
6141
|
* ```js
|
|
6344
6142
|
* const source = { x: 0, y: 20 };
|
|
@@ -6532,6 +6330,7 @@ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
|
|
|
6532
6330
|
}
|
|
6533
6331
|
function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
6534
6332
|
const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
|
|
6333
|
+
let nodesInitialized = true;
|
|
6535
6334
|
const tmpLookup = new Map(nodeLookup);
|
|
6536
6335
|
const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0;
|
|
6537
6336
|
nodeLookup.clear();
|
|
@@ -6562,10 +6361,15 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
|
|
|
6562
6361
|
};
|
|
6563
6362
|
nodeLookup.set(userNode.id, internalNode);
|
|
6564
6363
|
}
|
|
6364
|
+
if ((!internalNode.measured || !internalNode.measured.width || !internalNode.measured.height) &&
|
|
6365
|
+
!internalNode.hidden) {
|
|
6366
|
+
nodesInitialized = false;
|
|
6367
|
+
}
|
|
6565
6368
|
if (userNode.parentId) {
|
|
6566
6369
|
updateChildNode(internalNode, nodeLookup, parentLookup, options);
|
|
6567
6370
|
}
|
|
6568
6371
|
}
|
|
6372
|
+
return nodesInitialized;
|
|
6569
6373
|
}
|
|
6570
6374
|
function updateParentLookup(node, parentLookup) {
|
|
6571
6375
|
if (!node.parentId) {
|
|
@@ -7582,9 +7386,15 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
|
|
|
7582
7386
|
}
|
|
7583
7387
|
function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
|
|
7584
7388
|
return function (event, d) {
|
|
7389
|
+
const isWheel = event.type === 'wheel';
|
|
7585
7390
|
// we still want to enable pinch zooming even if preventScrolling is set to false
|
|
7586
|
-
const preventZoom = !preventScrolling &&
|
|
7587
|
-
|
|
7391
|
+
const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;
|
|
7392
|
+
const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);
|
|
7393
|
+
// if user is pinch zooming above a nowheel element, we don't want the browser to zoom
|
|
7394
|
+
if (event.ctrlKey && isWheel && hasNoWheelClass) {
|
|
7395
|
+
event.preventDefault();
|
|
7396
|
+
}
|
|
7397
|
+
if (preventZoom || hasNoWheelClass) {
|
|
7588
7398
|
return null;
|
|
7589
7399
|
}
|
|
7590
7400
|
event.preventDefault();
|
|
@@ -8295,7 +8105,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
8295
8105
|
})
|
|
8296
8106
|
.on('end', (event) => {
|
|
8297
8107
|
onResizeEnd?.(event, { ...prevValues });
|
|
8298
|
-
onEnd?.();
|
|
8108
|
+
onEnd?.({ ...prevValues });
|
|
8299
8109
|
});
|
|
8300
8110
|
selection.call(dragHandler);
|
|
8301
8111
|
}
|
|
@@ -8312,6 +8122,201 @@ var withSelector = {exports: {}};
|
|
|
8312
8122
|
|
|
8313
8123
|
var withSelector_production = {};
|
|
8314
8124
|
|
|
8125
|
+
var shim = {exports: {}};
|
|
8126
|
+
|
|
8127
|
+
var useSyncExternalStoreShim_production = {};
|
|
8128
|
+
|
|
8129
|
+
/**
|
|
8130
|
+
* @license React
|
|
8131
|
+
* use-sync-external-store-shim.production.js
|
|
8132
|
+
*
|
|
8133
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8134
|
+
*
|
|
8135
|
+
* This source code is licensed under the MIT license found in the
|
|
8136
|
+
* LICENSE file in the root directory of this source tree.
|
|
8137
|
+
*/
|
|
8138
|
+
|
|
8139
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
8140
|
+
|
|
8141
|
+
function requireUseSyncExternalStoreShim_production () {
|
|
8142
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
8143
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
8144
|
+
var React$1 = React;
|
|
8145
|
+
function is(x, y) {
|
|
8146
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
8147
|
+
}
|
|
8148
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
8149
|
+
useState = React$1.useState,
|
|
8150
|
+
useEffect = React$1.useEffect,
|
|
8151
|
+
useLayoutEffect = React$1.useLayoutEffect,
|
|
8152
|
+
useDebugValue = React$1.useDebugValue;
|
|
8153
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
8154
|
+
var value = getSnapshot(),
|
|
8155
|
+
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
8156
|
+
inst = _useState[0].inst,
|
|
8157
|
+
forceUpdate = _useState[1];
|
|
8158
|
+
useLayoutEffect(
|
|
8159
|
+
function () {
|
|
8160
|
+
inst.value = value;
|
|
8161
|
+
inst.getSnapshot = getSnapshot;
|
|
8162
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8163
|
+
},
|
|
8164
|
+
[subscribe, value, getSnapshot]
|
|
8165
|
+
);
|
|
8166
|
+
useEffect(
|
|
8167
|
+
function () {
|
|
8168
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8169
|
+
return subscribe(function () {
|
|
8170
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8171
|
+
});
|
|
8172
|
+
},
|
|
8173
|
+
[subscribe]
|
|
8174
|
+
);
|
|
8175
|
+
useDebugValue(value);
|
|
8176
|
+
return value;
|
|
8177
|
+
}
|
|
8178
|
+
function checkIfSnapshotChanged(inst) {
|
|
8179
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
8180
|
+
inst = inst.value;
|
|
8181
|
+
try {
|
|
8182
|
+
var nextValue = latestGetSnapshot();
|
|
8183
|
+
return !objectIs(inst, nextValue);
|
|
8184
|
+
} catch (error) {
|
|
8185
|
+
return true;
|
|
8186
|
+
}
|
|
8187
|
+
}
|
|
8188
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
8189
|
+
return getSnapshot();
|
|
8190
|
+
}
|
|
8191
|
+
var shim =
|
|
8192
|
+
"undefined" === typeof window ||
|
|
8193
|
+
"undefined" === typeof window.document ||
|
|
8194
|
+
"undefined" === typeof window.document.createElement
|
|
8195
|
+
? useSyncExternalStore$1
|
|
8196
|
+
: useSyncExternalStore$2;
|
|
8197
|
+
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
8198
|
+
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
8199
|
+
return useSyncExternalStoreShim_production;
|
|
8200
|
+
}
|
|
8201
|
+
|
|
8202
|
+
var useSyncExternalStoreShim_development = {};
|
|
8203
|
+
|
|
8204
|
+
/**
|
|
8205
|
+
* @license React
|
|
8206
|
+
* use-sync-external-store-shim.development.js
|
|
8207
|
+
*
|
|
8208
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8209
|
+
*
|
|
8210
|
+
* This source code is licensed under the MIT license found in the
|
|
8211
|
+
* LICENSE file in the root directory of this source tree.
|
|
8212
|
+
*/
|
|
8213
|
+
|
|
8214
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
8215
|
+
|
|
8216
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
8217
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
8218
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
8219
|
+
"production" !== process.env.NODE_ENV &&
|
|
8220
|
+
(function () {
|
|
8221
|
+
function is(x, y) {
|
|
8222
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
8223
|
+
}
|
|
8224
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
8225
|
+
didWarnOld18Alpha ||
|
|
8226
|
+
void 0 === React$1.startTransition ||
|
|
8227
|
+
((didWarnOld18Alpha = true),
|
|
8228
|
+
console.error(
|
|
8229
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
8230
|
+
));
|
|
8231
|
+
var value = getSnapshot();
|
|
8232
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
8233
|
+
var cachedValue = getSnapshot();
|
|
8234
|
+
objectIs(value, cachedValue) ||
|
|
8235
|
+
(console.error(
|
|
8236
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
8237
|
+
),
|
|
8238
|
+
(didWarnUncachedGetSnapshot = true));
|
|
8239
|
+
}
|
|
8240
|
+
cachedValue = useState({
|
|
8241
|
+
inst: { value: value, getSnapshot: getSnapshot }
|
|
8242
|
+
});
|
|
8243
|
+
var inst = cachedValue[0].inst,
|
|
8244
|
+
forceUpdate = cachedValue[1];
|
|
8245
|
+
useLayoutEffect(
|
|
8246
|
+
function () {
|
|
8247
|
+
inst.value = value;
|
|
8248
|
+
inst.getSnapshot = getSnapshot;
|
|
8249
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8250
|
+
},
|
|
8251
|
+
[subscribe, value, getSnapshot]
|
|
8252
|
+
);
|
|
8253
|
+
useEffect(
|
|
8254
|
+
function () {
|
|
8255
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8256
|
+
return subscribe(function () {
|
|
8257
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
8258
|
+
});
|
|
8259
|
+
},
|
|
8260
|
+
[subscribe]
|
|
8261
|
+
);
|
|
8262
|
+
useDebugValue(value);
|
|
8263
|
+
return value;
|
|
8264
|
+
}
|
|
8265
|
+
function checkIfSnapshotChanged(inst) {
|
|
8266
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
8267
|
+
inst = inst.value;
|
|
8268
|
+
try {
|
|
8269
|
+
var nextValue = latestGetSnapshot();
|
|
8270
|
+
return !objectIs(inst, nextValue);
|
|
8271
|
+
} catch (error) {
|
|
8272
|
+
return true;
|
|
8273
|
+
}
|
|
8274
|
+
}
|
|
8275
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
8276
|
+
return getSnapshot();
|
|
8277
|
+
}
|
|
8278
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
8279
|
+
"function" ===
|
|
8280
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
8281
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
8282
|
+
var React$1 = React,
|
|
8283
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
8284
|
+
useState = React$1.useState,
|
|
8285
|
+
useEffect = React$1.useEffect,
|
|
8286
|
+
useLayoutEffect = React$1.useLayoutEffect,
|
|
8287
|
+
useDebugValue = React$1.useDebugValue,
|
|
8288
|
+
didWarnOld18Alpha = false,
|
|
8289
|
+
didWarnUncachedGetSnapshot = false,
|
|
8290
|
+
shim =
|
|
8291
|
+
"undefined" === typeof window ||
|
|
8292
|
+
"undefined" === typeof window.document ||
|
|
8293
|
+
"undefined" === typeof window.document.createElement
|
|
8294
|
+
? useSyncExternalStore$1
|
|
8295
|
+
: useSyncExternalStore$2;
|
|
8296
|
+
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
8297
|
+
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
8298
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
8299
|
+
"function" ===
|
|
8300
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
8301
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
8302
|
+
})();
|
|
8303
|
+
return useSyncExternalStoreShim_development;
|
|
8304
|
+
}
|
|
8305
|
+
|
|
8306
|
+
var hasRequiredShim;
|
|
8307
|
+
|
|
8308
|
+
function requireShim () {
|
|
8309
|
+
if (hasRequiredShim) return shim.exports;
|
|
8310
|
+
hasRequiredShim = 1;
|
|
8311
|
+
|
|
8312
|
+
if (process.env.NODE_ENV === 'production') {
|
|
8313
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
8314
|
+
} else {
|
|
8315
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
8316
|
+
}
|
|
8317
|
+
return shim.exports;
|
|
8318
|
+
}
|
|
8319
|
+
|
|
8315
8320
|
/**
|
|
8316
8321
|
* @license React
|
|
8317
8322
|
* use-sync-external-store-shim/with-selector.production.js
|
|
@@ -8328,7 +8333,7 @@ function requireWithSelector_production () {
|
|
|
8328
8333
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
8329
8334
|
hasRequiredWithSelector_production = 1;
|
|
8330
8335
|
var React$1 = React,
|
|
8331
|
-
shim =
|
|
8336
|
+
shim = requireShim();
|
|
8332
8337
|
function is(x, y) {
|
|
8333
8338
|
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
8334
8339
|
}
|
|
@@ -8431,7 +8436,7 @@ function requireWithSelector_development () {
|
|
|
8431
8436
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
8432
8437
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
8433
8438
|
var React$1 = React,
|
|
8434
|
-
shim =
|
|
8439
|
+
shim = requireShim(),
|
|
8435
8440
|
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
8436
8441
|
useSyncExternalStore = shim.useSyncExternalStore,
|
|
8437
8442
|
useRef = React$1.useRef,
|
|
@@ -8627,9 +8632,13 @@ const zustandErrorMessage = errorMessages['error001']();
|
|
|
8627
8632
|
* state management library, so you should check out their docs for more details.
|
|
8628
8633
|
*
|
|
8629
8634
|
* @public
|
|
8630
|
-
* @param selector
|
|
8631
|
-
*
|
|
8632
|
-
*
|
|
8635
|
+
* @param selector - A selector function that returns a slice of the flow's internal state.
|
|
8636
|
+
* Extracting or transforming just the state you need is a good practice to avoid unnecessary
|
|
8637
|
+
* re-renders.
|
|
8638
|
+
* @param equalityFn - A function to compare the previous and next value. This is incredibly useful
|
|
8639
|
+
* for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing
|
|
8640
|
+
* `zustand/shallow`, but you can be as granular as you like.
|
|
8641
|
+
* @returns The selected state slice.
|
|
8633
8642
|
*
|
|
8634
8643
|
* @example
|
|
8635
8644
|
* ```ts
|
|
@@ -8650,8 +8659,7 @@ function useStore(selector, equalityFn) {
|
|
|
8650
8659
|
/**
|
|
8651
8660
|
* In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions.
|
|
8652
8661
|
*
|
|
8653
|
-
* @returns The store object
|
|
8654
|
-
*
|
|
8662
|
+
* @returns The store object.
|
|
8655
8663
|
* @example
|
|
8656
8664
|
* ```ts
|
|
8657
8665
|
* const store = useStoreApi();
|
|
@@ -8784,7 +8792,7 @@ const defaultViewport = { x: 0, y: 0, zoom: 1 };
|
|
|
8784
8792
|
* We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)
|
|
8785
8793
|
* and values that have a dedicated setter function in the store (like `setNodes`).
|
|
8786
8794
|
*/
|
|
8787
|
-
//
|
|
8795
|
+
// These fields exist in the global store, and we need to keep them up to date
|
|
8788
8796
|
const reactFlowFieldsToTrack = [
|
|
8789
8797
|
'nodes',
|
|
8790
8798
|
'edges',
|
|
@@ -8907,9 +8915,9 @@ function StoreUpdater(props) {
|
|
|
8907
8915
|
setPaneClickDistance(fieldValue);
|
|
8908
8916
|
// Renamed fields
|
|
8909
8917
|
else if (fieldName === 'fitView')
|
|
8910
|
-
store.setState({
|
|
8918
|
+
store.setState({ fitViewQueued: fieldValue });
|
|
8911
8919
|
else if (fieldName === 'fitViewOptions')
|
|
8912
|
-
store.setState({
|
|
8920
|
+
store.setState({ fitViewOptions: fieldValue });
|
|
8913
8921
|
// General case
|
|
8914
8922
|
else
|
|
8915
8923
|
store.setState({ [fieldName]: fieldValue });
|
|
@@ -8957,9 +8965,7 @@ const defaultDoc = typeof document !== 'undefined' ? document : null;
|
|
|
8957
8965
|
* currently pressed or not.
|
|
8958
8966
|
*
|
|
8959
8967
|
* @public
|
|
8960
|
-
* @param
|
|
8961
|
-
* @param param.options - Options
|
|
8962
|
-
* @returns boolean
|
|
8968
|
+
* @param options - Options
|
|
8963
8969
|
*
|
|
8964
8970
|
* @example
|
|
8965
8971
|
* ```tsx
|
|
@@ -8979,11 +8985,17 @@ const defaultDoc = typeof document !== 'undefined' ? document : null;
|
|
|
8979
8985
|
*```
|
|
8980
8986
|
*/
|
|
8981
8987
|
function useKeyPress(
|
|
8982
|
-
|
|
8983
|
-
*
|
|
8984
|
-
*
|
|
8985
|
-
*
|
|
8986
|
-
*
|
|
8988
|
+
/**
|
|
8989
|
+
* The key code (string or array of strings) specifies which key(s) should trigger
|
|
8990
|
+
* an action.
|
|
8991
|
+
*
|
|
8992
|
+
* A **string** can represent:
|
|
8993
|
+
* - A **single key**, e.g. `'a'`
|
|
8994
|
+
* - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'`
|
|
8995
|
+
*
|
|
8996
|
+
* An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']`
|
|
8997
|
+
* means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`.
|
|
8998
|
+
* @default null
|
|
8987
8999
|
*/
|
|
8988
9000
|
keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) {
|
|
8989
9001
|
const [keyPressed, setKeyPressed] = useState(false);
|
|
@@ -9019,7 +9031,7 @@ keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true
|
|
|
9019
9031
|
const target = options?.target || defaultDoc;
|
|
9020
9032
|
if (keyCode !== null) {
|
|
9021
9033
|
const downHandler = (event) => {
|
|
9022
|
-
modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey;
|
|
9034
|
+
modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;
|
|
9023
9035
|
const preventAction = (!modifierPressed.current || (modifierPressed.current && !options.actInsideInputWithModifier)) &&
|
|
9024
9036
|
isInputDOMNode(event);
|
|
9025
9037
|
if (preventAction) {
|
|
@@ -9028,16 +9040,15 @@ keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true
|
|
|
9028
9040
|
const keyOrCode = useKeyOrCode(event.code, keysToWatch);
|
|
9029
9041
|
pressedKeys.current.add(event[keyOrCode]);
|
|
9030
9042
|
if (isMatchingKey(keyCodes, pressedKeys.current, false)) {
|
|
9031
|
-
event.
|
|
9043
|
+
const target = (event.composedPath?.()?.[0] || event.target);
|
|
9044
|
+
const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';
|
|
9045
|
+
if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {
|
|
9046
|
+
event.preventDefault();
|
|
9047
|
+
}
|
|
9032
9048
|
setKeyPressed(true);
|
|
9033
9049
|
}
|
|
9034
9050
|
};
|
|
9035
9051
|
const upHandler = (event) => {
|
|
9036
|
-
const preventAction = (!modifierPressed.current || (modifierPressed.current && !options.actInsideInputWithModifier)) &&
|
|
9037
|
-
isInputDOMNode(event);
|
|
9038
|
-
if (preventAction) {
|
|
9039
|
-
return false;
|
|
9040
|
-
}
|
|
9041
9052
|
const keyOrCode = useKeyOrCode(event.code, keysToWatch);
|
|
9042
9053
|
if (isMatchingKey(keyCodes, pressedKeys.current, true)) {
|
|
9043
9054
|
setKeyPressed(false);
|
|
@@ -9128,22 +9139,6 @@ const useViewportHelper = () => {
|
|
|
9128
9139
|
const [x, y, zoom] = store.getState().transform;
|
|
9129
9140
|
return { x, y, zoom };
|
|
9130
9141
|
},
|
|
9131
|
-
fitView: (options) => {
|
|
9132
|
-
const { nodeLookup, minZoom, maxZoom, panZoom, domNode } = store.getState();
|
|
9133
|
-
if (!panZoom || !domNode) {
|
|
9134
|
-
return Promise.resolve(false);
|
|
9135
|
-
}
|
|
9136
|
-
const fitViewNodes = getFitViewNodes(nodeLookup, options);
|
|
9137
|
-
const { width, height } = getDimensions(domNode);
|
|
9138
|
-
return fitView({
|
|
9139
|
-
nodes: fitViewNodes,
|
|
9140
|
-
width,
|
|
9141
|
-
height,
|
|
9142
|
-
minZoom,
|
|
9143
|
-
maxZoom,
|
|
9144
|
-
panZoom,
|
|
9145
|
-
}, options);
|
|
9146
|
-
},
|
|
9147
9142
|
setCenter: async (x, y, options) => {
|
|
9148
9143
|
const { width, height, maxZoom, panZoom } = store.getState();
|
|
9149
9144
|
const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom;
|
|
@@ -9318,9 +9313,9 @@ function applyChange(change, element) {
|
|
|
9318
9313
|
/**
|
|
9319
9314
|
* Drop in function that applies node changes to an array of nodes.
|
|
9320
9315
|
* @public
|
|
9321
|
-
* @param changes - Array of changes to apply
|
|
9322
|
-
* @param nodes - Array of nodes to apply the changes to
|
|
9323
|
-
* @returns Array of updated nodes
|
|
9316
|
+
* @param changes - Array of changes to apply.
|
|
9317
|
+
* @param nodes - Array of nodes to apply the changes to.
|
|
9318
|
+
* @returns Array of updated nodes.
|
|
9324
9319
|
* @example
|
|
9325
9320
|
*```tsx
|
|
9326
9321
|
*import { useState, useCallback } from 'react';
|
|
@@ -9352,9 +9347,9 @@ function applyNodeChanges(changes, nodes) {
|
|
|
9352
9347
|
/**
|
|
9353
9348
|
* Drop in function that applies edge changes to an array of edges.
|
|
9354
9349
|
* @public
|
|
9355
|
-
* @param changes - Array of changes to apply
|
|
9356
|
-
* @param edges - Array of edge to apply the changes to
|
|
9357
|
-
* @returns Array of updated edges
|
|
9350
|
+
* @param changes - Array of changes to apply.
|
|
9351
|
+
* @param edges - Array of edge to apply the changes to.
|
|
9352
|
+
* @returns Array of updated edges.
|
|
9358
9353
|
* @example
|
|
9359
9354
|
* ```tsx
|
|
9360
9355
|
*import { useState, useCallback } from 'react';
|
|
@@ -9438,41 +9433,45 @@ function elementToRemoveChange(item) {
|
|
|
9438
9433
|
}
|
|
9439
9434
|
|
|
9440
9435
|
/**
|
|
9441
|
-
* Test whether an object is
|
|
9436
|
+
* Test whether an object is usable as an [`Node`](/api-reference/types/node).
|
|
9442
9437
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
9443
9438
|
* [`Node`](/api-reference/types/node) if it returns `true`.
|
|
9444
9439
|
*
|
|
9445
9440
|
* @public
|
|
9446
9441
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
|
|
9447
|
-
* @param element - The element to test
|
|
9448
|
-
* @returns
|
|
9442
|
+
* @param element - The element to test.
|
|
9443
|
+
* @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,
|
|
9444
|
+
* this function acts as a type guard and will narrow the type of the value to `Node` if it returns
|
|
9445
|
+
* `true`.
|
|
9449
9446
|
*
|
|
9450
9447
|
* @example
|
|
9451
9448
|
* ```js
|
|
9452
9449
|
*import { isNode } from '@xyflow/react';
|
|
9453
9450
|
*
|
|
9454
9451
|
*if (isNode(node)) {
|
|
9455
|
-
* //
|
|
9452
|
+
* // ...
|
|
9456
9453
|
*}
|
|
9457
9454
|
*```
|
|
9458
9455
|
*/
|
|
9459
9456
|
const isNode = (element) => isNodeBase(element);
|
|
9460
9457
|
/**
|
|
9461
|
-
* Test whether an object is
|
|
9458
|
+
* Test whether an object is usable as an [`Edge`](/api-reference/types/edge).
|
|
9462
9459
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
9463
9460
|
* [`Edge`](/api-reference/types/edge) if it returns `true`.
|
|
9464
9461
|
*
|
|
9465
9462
|
* @public
|
|
9466
9463
|
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
|
|
9467
9464
|
* @param element - The element to test
|
|
9468
|
-
* @returns
|
|
9465
|
+
* @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,
|
|
9466
|
+
* this function acts as a type guard and will narrow the type of the value to `Edge` if it returns
|
|
9467
|
+
* `true`.
|
|
9469
9468
|
*
|
|
9470
9469
|
* @example
|
|
9471
9470
|
* ```js
|
|
9472
9471
|
*import { isEdge } from '@xyflow/react';
|
|
9473
9472
|
*
|
|
9474
9473
|
*if (isEdge(edge)) {
|
|
9475
|
-
* //
|
|
9474
|
+
* // ...
|
|
9476
9475
|
*}
|
|
9477
9476
|
*```
|
|
9478
9477
|
*/
|
|
@@ -9547,7 +9546,7 @@ const BatchContext = createContext(null);
|
|
|
9547
9546
|
function BatchProvider({ children, }) {
|
|
9548
9547
|
const store = useStoreApi();
|
|
9549
9548
|
const nodeQueueHandler = useCallback((queueItems) => {
|
|
9550
|
-
const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup } = store.getState();
|
|
9549
|
+
const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued } = store.getState();
|
|
9551
9550
|
/*
|
|
9552
9551
|
* This is essentially an `Array.reduce` in imperative clothing. Processing
|
|
9553
9552
|
* this queue is a relatively hot path so we'd like to avoid the overhead of
|
|
@@ -9560,11 +9559,26 @@ function BatchProvider({ children, }) {
|
|
|
9560
9559
|
if (hasDefaultNodes) {
|
|
9561
9560
|
setNodes(next);
|
|
9562
9561
|
}
|
|
9563
|
-
else
|
|
9564
|
-
|
|
9562
|
+
else {
|
|
9563
|
+
// When a controlled flow is used we need to collect the changes
|
|
9564
|
+
const changes = getElementsDiffChanges({
|
|
9565
9565
|
items: next,
|
|
9566
9566
|
lookup: nodeLookup,
|
|
9567
|
-
})
|
|
9567
|
+
});
|
|
9568
|
+
// We only want to fire onNodesChange if there are changes to the nodes
|
|
9569
|
+
if (changes.length > 0) {
|
|
9570
|
+
onNodesChange?.(changes);
|
|
9571
|
+
}
|
|
9572
|
+
else if (fitViewQueued) {
|
|
9573
|
+
// If there are no changes to the nodes, we still need to call setNodes
|
|
9574
|
+
// to trigger a re-render and fitView.
|
|
9575
|
+
window.requestAnimationFrame(() => {
|
|
9576
|
+
const { fitViewQueued, nodes, setNodes } = store.getState();
|
|
9577
|
+
if (fitViewQueued) {
|
|
9578
|
+
setNodes(nodes);
|
|
9579
|
+
}
|
|
9580
|
+
});
|
|
9581
|
+
}
|
|
9568
9582
|
}
|
|
9569
9583
|
}, []);
|
|
9570
9584
|
const nodeQueue = useQueue(nodeQueueHandler);
|
|
@@ -9601,8 +9615,6 @@ const selector$k = (s) => !!s.panZoom;
|
|
|
9601
9615
|
* This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.
|
|
9602
9616
|
*
|
|
9603
9617
|
* @public
|
|
9604
|
-
* @returns ReactFlowInstance
|
|
9605
|
-
*
|
|
9606
9618
|
* @example
|
|
9607
9619
|
* ```jsx
|
|
9608
9620
|
*import { useCallback, useState } from 'react';
|
|
@@ -9783,6 +9795,15 @@ function useReactFlow() {
|
|
|
9783
9795
|
.getState()
|
|
9784
9796
|
.connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`)
|
|
9785
9797
|
?.values() ?? []),
|
|
9798
|
+
fitView: async (options) => {
|
|
9799
|
+
// We either create a new Promise or reuse the existing one
|
|
9800
|
+
// Even if fitView is called multiple times in a row, we only end up with a single Promise
|
|
9801
|
+
const fitViewResolver = store.getState().fitViewResolver ?? Promise.withResolvers();
|
|
9802
|
+
// We schedule a fitView by setting fitViewQueued and triggering a setNodes
|
|
9803
|
+
store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver });
|
|
9804
|
+
batchContext.nodeQueue.push((nodes) => [...nodes]);
|
|
9805
|
+
return fitViewResolver.promise;
|
|
9806
|
+
},
|
|
9786
9807
|
};
|
|
9787
9808
|
}, []);
|
|
9788
9809
|
return useMemo(() => {
|
|
@@ -9980,11 +10001,12 @@ const wrapHandler = (handler, containerRef) => {
|
|
|
9980
10001
|
const selector$h = (s) => ({
|
|
9981
10002
|
userSelectionActive: s.userSelectionActive,
|
|
9982
10003
|
elementsSelectable: s.elementsSelectable,
|
|
10004
|
+
connectionInProgress: s.connection.inProgress,
|
|
9983
10005
|
dragging: s.paneDragging,
|
|
9984
10006
|
});
|
|
9985
10007
|
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {
|
|
9986
10008
|
const store = useStoreApi();
|
|
9987
|
-
const { userSelectionActive, elementsSelectable, dragging } = useStore(selector$h, shallow$1);
|
|
10009
|
+
const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow$1);
|
|
9988
10010
|
const hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive);
|
|
9989
10011
|
const container = useRef(null);
|
|
9990
10012
|
const containerBounds = useRef();
|
|
@@ -9995,7 +10017,8 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
9995
10017
|
const selectionStarted = useRef(false);
|
|
9996
10018
|
const onClick = (event) => {
|
|
9997
10019
|
// We prevent click events when the user let go of the selectionKey during a selection
|
|
9998
|
-
|
|
10020
|
+
// We also prevent click events when a connection is in progress
|
|
10021
|
+
if (selectionInProgress.current || connectionInProgress) {
|
|
9999
10022
|
selectionInProgress.current = false;
|
|
10000
10023
|
return;
|
|
10001
10024
|
}
|
|
@@ -10246,7 +10269,7 @@ NodeIdContext.Consumer;
|
|
|
10246
10269
|
* drill down the id as a prop.
|
|
10247
10270
|
*
|
|
10248
10271
|
* @public
|
|
10249
|
-
* @returns id
|
|
10272
|
+
* @returns The id for a node in the flow.
|
|
10250
10273
|
*
|
|
10251
10274
|
* @example
|
|
10252
10275
|
*```jsx
|
|
@@ -10919,7 +10942,7 @@ const MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
|
10919
10942
|
MarkerDefinitions.displayName = 'MarkerDefinitions';
|
|
10920
10943
|
var MarkerDefinitions$1 = memo(MarkerDefinitions);
|
|
10921
10944
|
|
|
10922
|
-
function EdgeTextComponent({ x, y, label, labelStyle
|
|
10945
|
+
function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) {
|
|
10923
10946
|
const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 });
|
|
10924
10947
|
const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]);
|
|
10925
10948
|
const edgeTextRef = useRef(null);
|
|
@@ -10934,7 +10957,7 @@ function EdgeTextComponent({ x, y, label, labelStyle = {}, labelShowBg = true, l
|
|
|
10934
10957
|
});
|
|
10935
10958
|
}
|
|
10936
10959
|
}, [label]);
|
|
10937
|
-
if (
|
|
10960
|
+
if (!label) {
|
|
10938
10961
|
return null;
|
|
10939
10962
|
}
|
|
10940
10963
|
return (jsxRuntimeExports.jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsxRuntimeExports.jsx("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsxRuntimeExports.jsx("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeTextRef, style: labelStyle, children: label }), children] }));
|
|
@@ -10944,26 +10967,26 @@ EdgeTextComponent.displayName = 'EdgeText';
|
|
|
10944
10967
|
* You can use the `<EdgeText />` component as a helper component to display text
|
|
10945
10968
|
* within your custom edges.
|
|
10946
10969
|
*
|
|
10947
|
-
|
|
10970
|
+
* @public
|
|
10948
10971
|
*
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
*import { EdgeText } from '@xyflow/react';
|
|
10972
|
+
* @example
|
|
10973
|
+
* ```jsx
|
|
10974
|
+
* import { EdgeText } from '@xyflow/react';
|
|
10952
10975
|
*
|
|
10953
|
-
*export function CustomEdgeLabel({ label }) {
|
|
10954
|
-
*
|
|
10955
|
-
*
|
|
10956
|
-
*
|
|
10957
|
-
*
|
|
10958
|
-
*
|
|
10959
|
-
*
|
|
10960
|
-
*
|
|
10961
|
-
*
|
|
10962
|
-
*
|
|
10963
|
-
*
|
|
10964
|
-
*
|
|
10965
|
-
*
|
|
10966
|
-
*}
|
|
10976
|
+
* export function CustomEdgeLabel({ label }) {
|
|
10977
|
+
* return (
|
|
10978
|
+
* <EdgeText
|
|
10979
|
+
* x={100}
|
|
10980
|
+
* y={100}
|
|
10981
|
+
* label={label}
|
|
10982
|
+
* labelStyle={{ fill: 'white' }}
|
|
10983
|
+
* labelShowBg
|
|
10984
|
+
* labelBgStyle={{ fill: 'red' }}
|
|
10985
|
+
* labelBgPadding={[2, 4]}
|
|
10986
|
+
* labelBgBorderRadius={2}
|
|
10987
|
+
* />
|
|
10988
|
+
* );
|
|
10989
|
+
* }
|
|
10967
10990
|
*```
|
|
10968
10991
|
*/
|
|
10969
10992
|
const EdgeText = memo(EdgeTextComponent);
|
|
@@ -11009,6 +11032,14 @@ function getControl({ pos, x1, y1, x2, y2 }) {
|
|
|
11009
11032
|
* The `getSimpleBezierPath` util returns everything you need to render a simple
|
|
11010
11033
|
* bezier edge between two nodes.
|
|
11011
11034
|
* @public
|
|
11035
|
+
* @returns
|
|
11036
|
+
* - `path`: the path to use in an SVG `<path>` element.
|
|
11037
|
+
* - `labelX`: the `x` position you can use to render a label for this edge.
|
|
11038
|
+
* - `labelY`: the `y` position you can use to render a label for this edge.
|
|
11039
|
+
* - `offsetX`: the absolute difference between the source `x` position and the `x` position of the
|
|
11040
|
+
* middle of this path.
|
|
11041
|
+
* - `offsetY`: the absolute difference between the source `y` position and the `y` position of the
|
|
11042
|
+
* middle of this path.
|
|
11012
11043
|
*/
|
|
11013
11044
|
function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) {
|
|
11014
11045
|
const [sourceControlX, sourceControlY] = getControl({
|
|
@@ -11045,7 +11076,7 @@ function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Botto
|
|
|
11045
11076
|
}
|
|
11046
11077
|
function createSimpleBezierEdge(params) {
|
|
11047
11078
|
// eslint-disable-next-line react/display-name
|
|
11048
|
-
return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition
|
|
11079
|
+
return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {
|
|
11049
11080
|
const [path, labelX, labelY] = getSimpleBezierPath({
|
|
11050
11081
|
sourceX,
|
|
11051
11082
|
sourceY,
|
|
@@ -11080,7 +11111,33 @@ function createSmoothStepEdge(params) {
|
|
|
11080
11111
|
return (jsxRuntimeExports.jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));
|
|
11081
11112
|
});
|
|
11082
11113
|
}
|
|
11114
|
+
/**
|
|
11115
|
+
* Component that can be used inside a custom edge to render a smooth step edge.
|
|
11116
|
+
*
|
|
11117
|
+
* @public
|
|
11118
|
+
* @example
|
|
11119
|
+
*
|
|
11120
|
+
* ```tsx
|
|
11121
|
+
* import { SmoothStepEdge } from '@xyflow/react';
|
|
11122
|
+
*
|
|
11123
|
+
* function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {
|
|
11124
|
+
* return (
|
|
11125
|
+
* <SmoothStepEdge
|
|
11126
|
+
* sourceX={sourceX}
|
|
11127
|
+
* sourceY={sourceY}
|
|
11128
|
+
* targetX={targetX}
|
|
11129
|
+
* targetY={targetY}
|
|
11130
|
+
* sourcePosition={sourcePosition}
|
|
11131
|
+
* targetPosition={targetPosition}
|
|
11132
|
+
* />
|
|
11133
|
+
* );
|
|
11134
|
+
* }
|
|
11135
|
+
* ```
|
|
11136
|
+
*/
|
|
11083
11137
|
const SmoothStepEdge = createSmoothStepEdge({ isInternal: false });
|
|
11138
|
+
/**
|
|
11139
|
+
* @internal
|
|
11140
|
+
*/
|
|
11084
11141
|
const SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true });
|
|
11085
11142
|
SmoothStepEdge.displayName = 'SmoothStepEdge';
|
|
11086
11143
|
SmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal';
|
|
@@ -11092,7 +11149,33 @@ function createStepEdge(params) {
|
|
|
11092
11149
|
return (jsxRuntimeExports.jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) }));
|
|
11093
11150
|
});
|
|
11094
11151
|
}
|
|
11152
|
+
/**
|
|
11153
|
+
* Component that can be used inside a custom edge to render a step edge.
|
|
11154
|
+
*
|
|
11155
|
+
* @public
|
|
11156
|
+
* @example
|
|
11157
|
+
*
|
|
11158
|
+
* ```tsx
|
|
11159
|
+
* import { StepEdge } from '@xyflow/react';
|
|
11160
|
+
*
|
|
11161
|
+
* function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {
|
|
11162
|
+
* return (
|
|
11163
|
+
* <StepEdge
|
|
11164
|
+
* sourceX={sourceX}
|
|
11165
|
+
* sourceY={sourceY}
|
|
11166
|
+
* targetX={targetX}
|
|
11167
|
+
* targetY={targetY}
|
|
11168
|
+
* sourcePosition={sourcePosition}
|
|
11169
|
+
* targetPosition={targetPosition}
|
|
11170
|
+
* />
|
|
11171
|
+
* );
|
|
11172
|
+
* }
|
|
11173
|
+
* ```
|
|
11174
|
+
*/
|
|
11095
11175
|
const StepEdge = createStepEdge({ isInternal: false });
|
|
11176
|
+
/**
|
|
11177
|
+
* @internal
|
|
11178
|
+
*/
|
|
11096
11179
|
const StepEdgeInternal = createStepEdge({ isInternal: true });
|
|
11097
11180
|
StepEdge.displayName = 'StepEdge';
|
|
11098
11181
|
StepEdgeInternal.displayName = 'StepEdgeInternal';
|
|
@@ -11105,7 +11188,31 @@ function createStraightEdge(params) {
|
|
|
11105
11188
|
return (jsxRuntimeExports.jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));
|
|
11106
11189
|
});
|
|
11107
11190
|
}
|
|
11191
|
+
/**
|
|
11192
|
+
* Component that can be used inside a custom edge to render a straight line.
|
|
11193
|
+
*
|
|
11194
|
+
* @public
|
|
11195
|
+
* @example
|
|
11196
|
+
*
|
|
11197
|
+
* ```tsx
|
|
11198
|
+
* import { StraightEdge } from '@xyflow/react';
|
|
11199
|
+
*
|
|
11200
|
+
* function CustomEdge({ sourceX, sourceY, targetX, targetY }) {
|
|
11201
|
+
* return (
|
|
11202
|
+
* <StraightEdge
|
|
11203
|
+
* sourceX={sourceX}
|
|
11204
|
+
* sourceY={sourceY}
|
|
11205
|
+
* targetX={targetX}
|
|
11206
|
+
* targetY={targetY}
|
|
11207
|
+
* />
|
|
11208
|
+
* );
|
|
11209
|
+
* }
|
|
11210
|
+
* ```
|
|
11211
|
+
*/
|
|
11108
11212
|
const StraightEdge = createStraightEdge({ isInternal: false });
|
|
11213
|
+
/**
|
|
11214
|
+
* @internal
|
|
11215
|
+
*/
|
|
11109
11216
|
const StraightEdgeInternal = createStraightEdge({ isInternal: true });
|
|
11110
11217
|
StraightEdge.displayName = 'StraightEdge';
|
|
11111
11218
|
StraightEdgeInternal.displayName = 'StraightEdgeInternal';
|
|
@@ -11126,7 +11233,33 @@ function createBezierEdge(params) {
|
|
|
11126
11233
|
return (jsxRuntimeExports.jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));
|
|
11127
11234
|
});
|
|
11128
11235
|
}
|
|
11236
|
+
/**
|
|
11237
|
+
* Component that can be used inside a custom edge to render a bezier curve.
|
|
11238
|
+
*
|
|
11239
|
+
* @public
|
|
11240
|
+
* @example
|
|
11241
|
+
*
|
|
11242
|
+
* ```tsx
|
|
11243
|
+
* import { BezierEdge } from '@xyflow/react';
|
|
11244
|
+
*
|
|
11245
|
+
* function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {
|
|
11246
|
+
* return (
|
|
11247
|
+
* <BezierEdge
|
|
11248
|
+
* sourceX={sourceX}
|
|
11249
|
+
* sourceY={sourceY}
|
|
11250
|
+
* targetX={targetX}
|
|
11251
|
+
* targetY={targetY}
|
|
11252
|
+
* sourcePosition={sourcePosition}
|
|
11253
|
+
* targetPosition={targetPosition}
|
|
11254
|
+
* />
|
|
11255
|
+
* );
|
|
11256
|
+
* }
|
|
11257
|
+
* ```
|
|
11258
|
+
*/
|
|
11129
11259
|
const BezierEdge = createBezierEdge({ isInternal: false });
|
|
11260
|
+
/**
|
|
11261
|
+
* @internal
|
|
11262
|
+
*/
|
|
11130
11263
|
const BezierEdgeInternal = createBezierEdge({ isInternal: true });
|
|
11131
11264
|
BezierEdge.displayName = 'BezierEdge';
|
|
11132
11265
|
BezierEdgeInternal.displayName = 'BezierEdgeInternal';
|
|
@@ -11162,6 +11295,9 @@ const shiftY = (y, shift, position) => {
|
|
|
11162
11295
|
return y;
|
|
11163
11296
|
};
|
|
11164
11297
|
const EdgeUpdaterClassName = 'react-flow__edgeupdater';
|
|
11298
|
+
/**
|
|
11299
|
+
* @internal
|
|
11300
|
+
*/
|
|
11165
11301
|
function EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) {
|
|
11166
11302
|
return (jsxRuntimeExports.jsx("circle", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" }));
|
|
11167
11303
|
}
|
|
@@ -11409,6 +11545,10 @@ function getSelector(connectionSelector) {
|
|
|
11409
11545
|
* based on a certain condition (e.g. if the connection is valid or not).
|
|
11410
11546
|
*
|
|
11411
11547
|
* @public
|
|
11548
|
+
* @param connectionSelector - An optional selector function used to extract a slice of the
|
|
11549
|
+
* `ConnectionState` data. Using a selector can prevent component re-renders where data you don't
|
|
11550
|
+
* otherwise care about might change. If a selector is not provided, the entire `ConnectionState`
|
|
11551
|
+
* object is returned unchanged.
|
|
11412
11552
|
* @example
|
|
11413
11553
|
*
|
|
11414
11554
|
* ```tsx
|
|
@@ -11595,11 +11735,11 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
11595
11735
|
elementsSelectable: true,
|
|
11596
11736
|
elevateNodesOnSelect: true,
|
|
11597
11737
|
elevateEdgesOnSelect: false,
|
|
11598
|
-
fitViewOnInit: false,
|
|
11599
|
-
fitViewDone: false,
|
|
11600
|
-
fitViewOnInitOptions: undefined,
|
|
11601
11738
|
selectNodesOnDrag: true,
|
|
11602
11739
|
multiSelectionActive: false,
|
|
11740
|
+
fitViewQueued: fitView ?? false,
|
|
11741
|
+
fitViewOptions: undefined,
|
|
11742
|
+
fitViewResolver: null,
|
|
11603
11743
|
connection: { ...initialConnection },
|
|
11604
11744
|
connectionClickStartHandle: null,
|
|
11605
11745
|
connectOnClick: true,
|
|
@@ -11616,277 +11756,256 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
11616
11756
|
};
|
|
11617
11757
|
};
|
|
11618
11758
|
|
|
11619
|
-
const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
/*
|
|
11624
|
-
* setNodes() is called exclusively in response to user actions:
|
|
11625
|
-
* - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,
|
|
11626
|
-
* - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.
|
|
11627
|
-
*
|
|
11628
|
-
* When this happens, we take the note objects passed by the user and extend them with fields
|
|
11629
|
-
* relevant for internal React Flow operations.
|
|
11630
|
-
*/
|
|
11631
|
-
adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
11632
|
-
nodeOrigin,
|
|
11633
|
-
nodeExtent,
|
|
11634
|
-
elevateNodesOnSelect,
|
|
11635
|
-
checkEquality: true,
|
|
11636
|
-
});
|
|
11637
|
-
set({ nodes });
|
|
11638
|
-
},
|
|
11639
|
-
setEdges: (edges) => {
|
|
11640
|
-
const { connectionLookup, edgeLookup } = get();
|
|
11641
|
-
updateConnectionLookup(connectionLookup, edgeLookup, edges);
|
|
11642
|
-
set({ edges });
|
|
11643
|
-
},
|
|
11644
|
-
setDefaultNodesAndEdges: (nodes, edges) => {
|
|
11645
|
-
if (nodes) {
|
|
11646
|
-
const { setNodes } = get();
|
|
11647
|
-
setNodes(nodes);
|
|
11648
|
-
set({ hasDefaultNodes: true });
|
|
11649
|
-
}
|
|
11650
|
-
if (edges) {
|
|
11651
|
-
const { setEdges } = get();
|
|
11652
|
-
setEdges(edges);
|
|
11653
|
-
set({ hasDefaultEdges: true });
|
|
11654
|
-
}
|
|
11655
|
-
},
|
|
11656
|
-
/*
|
|
11657
|
-
* Every node gets registerd at a ResizeObserver. Whenever a node
|
|
11658
|
-
* changes its dimensions, this function is called to measure the
|
|
11659
|
-
* new dimensions and update the nodes.
|
|
11660
|
-
*/
|
|
11661
|
-
updateNodeInternals: (updates, params = { triggerFitView: true }) => {
|
|
11662
|
-
const { triggerNodeChanges, nodeLookup, parentLookup, fitViewOnInit, fitViewDone, fitViewOnInitOptions, domNode, nodeOrigin, nodeExtent, debug, fitViewSync, } = get();
|
|
11663
|
-
const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent);
|
|
11664
|
-
if (!updatedInternals) {
|
|
11759
|
+
const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => {
|
|
11760
|
+
async function resolveFitView() {
|
|
11761
|
+
const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();
|
|
11762
|
+
if (!panZoom) {
|
|
11665
11763
|
return;
|
|
11666
11764
|
}
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11765
|
+
await fitViewport({
|
|
11766
|
+
nodes: nodeLookup,
|
|
11767
|
+
width,
|
|
11768
|
+
height,
|
|
11769
|
+
panZoom,
|
|
11770
|
+
minZoom,
|
|
11771
|
+
maxZoom,
|
|
11772
|
+
}, fitViewOptions);
|
|
11773
|
+
fitViewResolver?.resolve(true);
|
|
11774
|
+
/**
|
|
11775
|
+
* wait for the fitViewport to resolve before deleting the resolver,
|
|
11776
|
+
* we want to reuse the old resolver if the user calls fitView again in the mean time
|
|
11777
|
+
*/
|
|
11778
|
+
set({ fitViewResolver: null });
|
|
11779
|
+
}
|
|
11780
|
+
return {
|
|
11781
|
+
...getInitialState({ nodes, edges, width, height, fitView, nodeOrigin, nodeExtent, defaultNodes, defaultEdges }),
|
|
11782
|
+
setNodes: (nodes) => {
|
|
11783
|
+
const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued } = get();
|
|
11677
11784
|
/*
|
|
11678
|
-
*
|
|
11679
|
-
*
|
|
11680
|
-
*
|
|
11681
|
-
*
|
|
11682
|
-
*
|
|
11785
|
+
* setNodes() is called exclusively in response to user actions:
|
|
11786
|
+
* - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,
|
|
11787
|
+
* - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.
|
|
11788
|
+
*
|
|
11789
|
+
* When this happens, we take the note objects passed by the user and extend them with fields
|
|
11790
|
+
* relevant for internal React Flow operations.
|
|
11683
11791
|
*/
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11792
|
+
const nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
11793
|
+
nodeOrigin,
|
|
11794
|
+
nodeExtent,
|
|
11795
|
+
elevateNodesOnSelect,
|
|
11796
|
+
checkEquality: true,
|
|
11797
|
+
});
|
|
11798
|
+
if (fitViewQueued && nodesInitialized) {
|
|
11799
|
+
resolveFitView();
|
|
11800
|
+
set({ nodes, fitViewQueued: false, fitViewOptions: undefined });
|
|
11693
11801
|
}
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11802
|
+
else {
|
|
11803
|
+
set({ nodes });
|
|
11804
|
+
}
|
|
11805
|
+
},
|
|
11806
|
+
setEdges: (edges) => {
|
|
11807
|
+
const { connectionLookup, edgeLookup } = get();
|
|
11808
|
+
updateConnectionLookup(connectionLookup, edgeLookup, edges);
|
|
11809
|
+
set({ edges });
|
|
11810
|
+
},
|
|
11811
|
+
setDefaultNodesAndEdges: (nodes, edges) => {
|
|
11812
|
+
if (nodes) {
|
|
11813
|
+
const { setNodes } = get();
|
|
11814
|
+
setNodes(nodes);
|
|
11815
|
+
set({ hasDefaultNodes: true });
|
|
11816
|
+
}
|
|
11817
|
+
if (edges) {
|
|
11818
|
+
const { setEdges } = get();
|
|
11819
|
+
setEdges(edges);
|
|
11820
|
+
set({ hasDefaultEdges: true });
|
|
11821
|
+
}
|
|
11822
|
+
},
|
|
11823
|
+
/*
|
|
11824
|
+
* Every node gets registerd at a ResizeObserver. Whenever a node
|
|
11825
|
+
* changes its dimensions, this function is called to measure the
|
|
11826
|
+
* new dimensions and update the nodes.
|
|
11827
|
+
*/
|
|
11828
|
+
updateNodeInternals: (updates) => {
|
|
11829
|
+
const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued } = get();
|
|
11830
|
+
const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent);
|
|
11831
|
+
if (!updatedInternals) {
|
|
11832
|
+
return;
|
|
11833
|
+
}
|
|
11834
|
+
updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent });
|
|
11835
|
+
if (fitViewQueued) {
|
|
11836
|
+
resolveFitView();
|
|
11837
|
+
set({ fitViewQueued: false, fitViewOptions: undefined });
|
|
11838
|
+
}
|
|
11839
|
+
else {
|
|
11840
|
+
// we always want to trigger useStore calls whenever updateNodeInternals is called
|
|
11841
|
+
set({});
|
|
11842
|
+
}
|
|
11843
|
+
if (changes?.length > 0) {
|
|
11844
|
+
if (debug) {
|
|
11845
|
+
console.log('React Flow: trigger node changes', changes);
|
|
11846
|
+
}
|
|
11847
|
+
triggerNodeChanges?.(changes);
|
|
11848
|
+
}
|
|
11849
|
+
},
|
|
11850
|
+
updateNodePositions: (nodeDragItems, dragging = false) => {
|
|
11851
|
+
const parentExpandChildren = [];
|
|
11852
|
+
const changes = [];
|
|
11853
|
+
const { nodeLookup, triggerNodeChanges } = get();
|
|
11854
|
+
for (const [id, dragItem] of nodeDragItems) {
|
|
11855
|
+
// we are using the nodelookup to be sure to use the current expandParent and parentId value
|
|
11856
|
+
const node = nodeLookup.get(id);
|
|
11857
|
+
const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);
|
|
11858
|
+
const change = {
|
|
11718
11859
|
id,
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11860
|
+
type: 'position',
|
|
11861
|
+
position: expandParent
|
|
11862
|
+
? {
|
|
11863
|
+
x: Math.max(0, dragItem.position.x),
|
|
11864
|
+
y: Math.max(0, dragItem.position.y),
|
|
11865
|
+
}
|
|
11866
|
+
: dragItem.position,
|
|
11867
|
+
dragging,
|
|
11868
|
+
};
|
|
11869
|
+
if (expandParent && node.parentId) {
|
|
11870
|
+
parentExpandChildren.push({
|
|
11871
|
+
id,
|
|
11872
|
+
parentId: node.parentId,
|
|
11873
|
+
rect: {
|
|
11874
|
+
...dragItem.internals.positionAbsolute,
|
|
11875
|
+
width: dragItem.measured.width ?? 0,
|
|
11876
|
+
height: dragItem.measured.height ?? 0,
|
|
11877
|
+
},
|
|
11878
|
+
});
|
|
11879
|
+
}
|
|
11880
|
+
changes.push(change);
|
|
11726
11881
|
}
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);
|
|
11732
|
-
changes.push(...parentExpandChanges);
|
|
11733
|
-
}
|
|
11734
|
-
triggerNodeChanges(changes);
|
|
11735
|
-
},
|
|
11736
|
-
triggerNodeChanges: (changes) => {
|
|
11737
|
-
const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get();
|
|
11738
|
-
if (changes?.length) {
|
|
11739
|
-
if (hasDefaultNodes) {
|
|
11740
|
-
const updatedNodes = applyNodeChanges(changes, nodes);
|
|
11741
|
-
setNodes(updatedNodes);
|
|
11882
|
+
if (parentExpandChildren.length > 0) {
|
|
11883
|
+
const { parentLookup, nodeOrigin } = get();
|
|
11884
|
+
const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);
|
|
11885
|
+
changes.push(...parentExpandChanges);
|
|
11742
11886
|
}
|
|
11743
|
-
|
|
11744
|
-
|
|
11887
|
+
triggerNodeChanges(changes);
|
|
11888
|
+
},
|
|
11889
|
+
triggerNodeChanges: (changes) => {
|
|
11890
|
+
const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get();
|
|
11891
|
+
if (changes?.length) {
|
|
11892
|
+
if (hasDefaultNodes) {
|
|
11893
|
+
const updatedNodes = applyNodeChanges(changes, nodes);
|
|
11894
|
+
setNodes(updatedNodes);
|
|
11895
|
+
}
|
|
11896
|
+
if (debug) {
|
|
11897
|
+
console.log('React Flow: trigger node changes', changes);
|
|
11898
|
+
}
|
|
11899
|
+
onNodesChange?.(changes);
|
|
11745
11900
|
}
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11901
|
+
},
|
|
11902
|
+
triggerEdgeChanges: (changes) => {
|
|
11903
|
+
const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get();
|
|
11904
|
+
if (changes?.length) {
|
|
11905
|
+
if (hasDefaultEdges) {
|
|
11906
|
+
const updatedEdges = applyEdgeChanges(changes, edges);
|
|
11907
|
+
setEdges(updatedEdges);
|
|
11908
|
+
}
|
|
11909
|
+
if (debug) {
|
|
11910
|
+
console.log('React Flow: trigger edge changes', changes);
|
|
11911
|
+
}
|
|
11912
|
+
onEdgesChange?.(changes);
|
|
11755
11913
|
}
|
|
11756
|
-
|
|
11757
|
-
|
|
11914
|
+
},
|
|
11915
|
+
addSelectedNodes: (selectedNodeIds) => {
|
|
11916
|
+
const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
11917
|
+
if (multiSelectionActive) {
|
|
11918
|
+
const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true));
|
|
11919
|
+
triggerNodeChanges(nodeChanges);
|
|
11920
|
+
return;
|
|
11758
11921
|
}
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11922
|
+
triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true));
|
|
11923
|
+
triggerEdgeChanges(getSelectionChanges(edgeLookup));
|
|
11924
|
+
},
|
|
11925
|
+
addSelectedEdges: (selectedEdgeIds) => {
|
|
11926
|
+
const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
11927
|
+
if (multiSelectionActive) {
|
|
11928
|
+
const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true));
|
|
11929
|
+
triggerEdgeChanges(changedEdges);
|
|
11930
|
+
return;
|
|
11931
|
+
}
|
|
11932
|
+
triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds])));
|
|
11933
|
+
triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true));
|
|
11934
|
+
},
|
|
11935
|
+
unselectNodesAndEdges: ({ nodes, edges } = {}) => {
|
|
11936
|
+
const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
11937
|
+
const nodesToUnselect = nodes ? nodes : storeNodes;
|
|
11938
|
+
const edgesToUnselect = edges ? edges : storeEdges;
|
|
11939
|
+
const nodeChanges = nodesToUnselect.map((n) => {
|
|
11940
|
+
const internalNode = nodeLookup.get(n.id);
|
|
11941
|
+
if (internalNode) {
|
|
11942
|
+
/*
|
|
11943
|
+
* we need to unselect the internal node that was selected previously before we
|
|
11944
|
+
* send the change to the user to prevent it to be selected while dragging the new node
|
|
11945
|
+
*/
|
|
11946
|
+
internalNode.selected = false;
|
|
11947
|
+
}
|
|
11948
|
+
return createSelectionChange(n.id, false);
|
|
11949
|
+
});
|
|
11950
|
+
const edgeChanges = edgesToUnselect.map((edge) => createSelectionChange(edge.id, false));
|
|
11766
11951
|
triggerNodeChanges(nodeChanges);
|
|
11767
|
-
|
|
11768
|
-
}
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
const
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
}
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
const
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11952
|
+
triggerEdgeChanges(edgeChanges);
|
|
11953
|
+
},
|
|
11954
|
+
setMinZoom: (minZoom) => {
|
|
11955
|
+
const { panZoom, maxZoom } = get();
|
|
11956
|
+
panZoom?.setScaleExtent([minZoom, maxZoom]);
|
|
11957
|
+
set({ minZoom });
|
|
11958
|
+
},
|
|
11959
|
+
setMaxZoom: (maxZoom) => {
|
|
11960
|
+
const { panZoom, minZoom } = get();
|
|
11961
|
+
panZoom?.setScaleExtent([minZoom, maxZoom]);
|
|
11962
|
+
set({ maxZoom });
|
|
11963
|
+
},
|
|
11964
|
+
setTranslateExtent: (translateExtent) => {
|
|
11965
|
+
get().panZoom?.setTranslateExtent(translateExtent);
|
|
11966
|
+
set({ translateExtent });
|
|
11967
|
+
},
|
|
11968
|
+
setPaneClickDistance: (clickDistance) => {
|
|
11969
|
+
get().panZoom?.setClickDistance(clickDistance);
|
|
11970
|
+
},
|
|
11971
|
+
resetSelectedElements: () => {
|
|
11972
|
+
const { edges, nodes, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
11973
|
+
const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);
|
|
11974
|
+
const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);
|
|
11975
|
+
triggerNodeChanges(nodeChanges);
|
|
11976
|
+
triggerEdgeChanges(edgeChanges);
|
|
11977
|
+
},
|
|
11978
|
+
setNodeExtent: (nextNodeExtent) => {
|
|
11979
|
+
const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent } = get();
|
|
11980
|
+
if (nextNodeExtent[0][0] === nodeExtent[0][0] &&
|
|
11981
|
+
nextNodeExtent[0][1] === nodeExtent[0][1] &&
|
|
11982
|
+
nextNodeExtent[1][0] === nodeExtent[1][0] &&
|
|
11983
|
+
nextNodeExtent[1][1] === nodeExtent[1][1]) {
|
|
11984
|
+
return;
|
|
11794
11985
|
}
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
resetSelectedElements: () => {
|
|
11819
|
-
const { edges, nodes, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
11820
|
-
const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);
|
|
11821
|
-
const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);
|
|
11822
|
-
triggerNodeChanges(nodeChanges);
|
|
11823
|
-
triggerEdgeChanges(edgeChanges);
|
|
11824
|
-
},
|
|
11825
|
-
setNodeExtent: (nextNodeExtent) => {
|
|
11826
|
-
const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent } = get();
|
|
11827
|
-
if (nextNodeExtent[0][0] === nodeExtent[0][0] &&
|
|
11828
|
-
nextNodeExtent[0][1] === nodeExtent[0][1] &&
|
|
11829
|
-
nextNodeExtent[1][0] === nodeExtent[1][0] &&
|
|
11830
|
-
nextNodeExtent[1][1] === nodeExtent[1][1]) {
|
|
11831
|
-
return;
|
|
11832
|
-
}
|
|
11833
|
-
adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
11834
|
-
nodeOrigin,
|
|
11835
|
-
nodeExtent: nextNodeExtent,
|
|
11836
|
-
elevateNodesOnSelect,
|
|
11837
|
-
checkEquality: false,
|
|
11838
|
-
});
|
|
11839
|
-
set({ nodeExtent: nextNodeExtent });
|
|
11840
|
-
},
|
|
11841
|
-
panBy: (delta) => {
|
|
11842
|
-
const { transform, width, height, panZoom, translateExtent } = get();
|
|
11843
|
-
return panBy({ delta, panZoom, transform, translateExtent, width, height });
|
|
11844
|
-
},
|
|
11845
|
-
fitView: (options) => {
|
|
11846
|
-
const { panZoom, width, height, minZoom, maxZoom, nodeLookup } = get();
|
|
11847
|
-
if (!panZoom) {
|
|
11848
|
-
return Promise.resolve(false);
|
|
11849
|
-
}
|
|
11850
|
-
const fitViewNodes = getFitViewNodes(nodeLookup, options);
|
|
11851
|
-
return fitView({
|
|
11852
|
-
nodes: fitViewNodes,
|
|
11853
|
-
width,
|
|
11854
|
-
height,
|
|
11855
|
-
panZoom,
|
|
11856
|
-
minZoom,
|
|
11857
|
-
maxZoom,
|
|
11858
|
-
}, options);
|
|
11859
|
-
},
|
|
11860
|
-
/*
|
|
11861
|
-
* we can't call an asnychronous function in updateNodeInternals
|
|
11862
|
-
* for that we created this sync version of fitView
|
|
11863
|
-
*/
|
|
11864
|
-
fitViewSync: (options) => {
|
|
11865
|
-
const { panZoom, width, height, minZoom, maxZoom, nodeLookup } = get();
|
|
11866
|
-
if (!panZoom) {
|
|
11867
|
-
return false;
|
|
11868
|
-
}
|
|
11869
|
-
const fitViewNodes = getFitViewNodes(nodeLookup, options);
|
|
11870
|
-
fitView({
|
|
11871
|
-
nodes: fitViewNodes,
|
|
11872
|
-
width,
|
|
11873
|
-
height,
|
|
11874
|
-
panZoom,
|
|
11875
|
-
minZoom,
|
|
11876
|
-
maxZoom,
|
|
11877
|
-
}, options);
|
|
11878
|
-
return fitViewNodes.size > 0;
|
|
11879
|
-
},
|
|
11880
|
-
cancelConnection: () => {
|
|
11881
|
-
set({
|
|
11882
|
-
connection: { ...initialConnection },
|
|
11883
|
-
});
|
|
11884
|
-
},
|
|
11885
|
-
updateConnection: (connection) => {
|
|
11886
|
-
set({ connection });
|
|
11887
|
-
},
|
|
11888
|
-
reset: () => set({ ...getInitialState() }),
|
|
11889
|
-
}), Object.is);
|
|
11986
|
+
adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
11987
|
+
nodeOrigin,
|
|
11988
|
+
nodeExtent: nextNodeExtent,
|
|
11989
|
+
elevateNodesOnSelect,
|
|
11990
|
+
checkEquality: false,
|
|
11991
|
+
});
|
|
11992
|
+
set({ nodeExtent: nextNodeExtent });
|
|
11993
|
+
},
|
|
11994
|
+
panBy: (delta) => {
|
|
11995
|
+
const { transform, width, height, panZoom, translateExtent } = get();
|
|
11996
|
+
return panBy({ delta, panZoom, transform, translateExtent, width, height });
|
|
11997
|
+
},
|
|
11998
|
+
cancelConnection: () => {
|
|
11999
|
+
set({
|
|
12000
|
+
connection: { ...initialConnection },
|
|
12001
|
+
});
|
|
12002
|
+
},
|
|
12003
|
+
updateConnection: (connection) => {
|
|
12004
|
+
set({ connection });
|
|
12005
|
+
},
|
|
12006
|
+
reset: () => set({ ...getInitialState() }),
|
|
12007
|
+
};
|
|
12008
|
+
}, Object.is);
|
|
11890
12009
|
|
|
11891
12010
|
/**
|
|
11892
12011
|
* The `<ReactFlowProvider />` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#)
|
|
@@ -11993,37 +12112,38 @@ const selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-rende
|
|
|
11993
12112
|
* Edges are SVG-based. If you want to render more complex labels you can use the
|
|
11994
12113
|
* `<EdgeLabelRenderer />` component to access a div based renderer. This component
|
|
11995
12114
|
* is a portal that renders the label in a `<div />` that is positioned on top of
|
|
11996
|
-
* the edges. You can see an example usage of the component in the
|
|
12115
|
+
* the edges. You can see an example usage of the component in the
|
|
12116
|
+
* [edge label renderer example](/examples/edges/edge-label-renderer).
|
|
11997
12117
|
* @public
|
|
11998
12118
|
*
|
|
11999
12119
|
* @example
|
|
12000
|
-
|
|
12001
|
-
*import React from 'react';
|
|
12002
|
-
*import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';
|
|
12120
|
+
* ```jsx
|
|
12121
|
+
* import React from 'react';
|
|
12122
|
+
* import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';
|
|
12003
12123
|
*
|
|
12004
|
-
*export function CustomEdge({ id, data, ...props }) {
|
|
12005
|
-
*
|
|
12124
|
+
* export function CustomEdge({ id, data, ...props }) {
|
|
12125
|
+
* const [edgePath, labelX, labelY] = getBezierPath(props);
|
|
12006
12126
|
*
|
|
12007
|
-
*
|
|
12008
|
-
*
|
|
12009
|
-
*
|
|
12010
|
-
*
|
|
12011
|
-
*
|
|
12012
|
-
*
|
|
12013
|
-
*
|
|
12014
|
-
*
|
|
12015
|
-
*
|
|
12016
|
-
*
|
|
12017
|
-
*
|
|
12018
|
-
*
|
|
12019
|
-
*
|
|
12020
|
-
*
|
|
12021
|
-
*
|
|
12022
|
-
*
|
|
12023
|
-
*
|
|
12024
|
-
*
|
|
12025
|
-
*};
|
|
12026
|
-
|
|
12127
|
+
* return (
|
|
12128
|
+
* <>
|
|
12129
|
+
* <BaseEdge id={id} path={edgePath} />
|
|
12130
|
+
* <EdgeLabelRenderer>
|
|
12131
|
+
* <div
|
|
12132
|
+
* style={{
|
|
12133
|
+
* position: 'absolute',
|
|
12134
|
+
* transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,
|
|
12135
|
+
* background: '#ffcc00',
|
|
12136
|
+
* padding: 10,
|
|
12137
|
+
* }}
|
|
12138
|
+
* className="nodrag nopan"
|
|
12139
|
+
* >
|
|
12140
|
+
* {data.label}
|
|
12141
|
+
* </div>
|
|
12142
|
+
* </EdgeLabelRenderer>
|
|
12143
|
+
* </>
|
|
12144
|
+
* );
|
|
12145
|
+
* };
|
|
12146
|
+
* ```
|
|
12027
12147
|
*
|
|
12028
12148
|
* @remarks The `<EdgeLabelRenderer />` has no pointer events by default. If you want to
|
|
12029
12149
|
* add mouse interactions you need to set the style `pointerEvents: all` and add
|
|
@@ -12043,8 +12163,16 @@ function EdgeLabelRenderer({ children }) {
|
|
|
12043
12163
|
* like React's `useState` hook with an additional helper callback.
|
|
12044
12164
|
*
|
|
12045
12165
|
* @public
|
|
12046
|
-
* @
|
|
12047
|
-
*
|
|
12166
|
+
* @returns
|
|
12167
|
+
* - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your
|
|
12168
|
+
* `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,
|
|
12169
|
+
* for example.
|
|
12170
|
+
* - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of
|
|
12171
|
+
* nodes or a callback that receives the current array of nodes and returns a new array of nodes.
|
|
12172
|
+
* This is the same as the second element of the tuple returned by React's `useState` hook.
|
|
12173
|
+
* - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes
|
|
12174
|
+
* state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your
|
|
12175
|
+
* `<ReactFlow />` component.
|
|
12048
12176
|
* @example
|
|
12049
12177
|
*
|
|
12050
12178
|
*```tsx
|
|
@@ -12085,8 +12213,18 @@ function useNodesState(initialNodes) {
|
|
|
12085
12213
|
* like React's `useState` hook with an additional helper callback.
|
|
12086
12214
|
*
|
|
12087
12215
|
* @public
|
|
12088
|
-
* @
|
|
12089
|
-
*
|
|
12216
|
+
* @returns
|
|
12217
|
+
* - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your
|
|
12218
|
+
* `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,
|
|
12219
|
+
* for example.
|
|
12220
|
+
*
|
|
12221
|
+
* - `setEdges`: A function that you can use to update the edges. You can pass it a new array of
|
|
12222
|
+
* edges or a callback that receives the current array of edges and returns a new array of edges.
|
|
12223
|
+
* This is the same as the second element of the tuple returned by React's `useState` hook.
|
|
12224
|
+
*
|
|
12225
|
+
* - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges
|
|
12226
|
+
* state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your
|
|
12227
|
+
* `<ReactFlow />` component.
|
|
12090
12228
|
* @example
|
|
12091
12229
|
*
|
|
12092
12230
|
*```tsx
|
|
@@ -12370,8 +12508,9 @@ nodeComponent: NodeComponent = MiniMapNode, onClick, }) {
|
|
|
12370
12508
|
}
|
|
12371
12509
|
function NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) {
|
|
12372
12510
|
const { node, x, y, width, height } = useStore((s) => {
|
|
12373
|
-
const
|
|
12374
|
-
const
|
|
12511
|
+
const { internals } = s.nodeLookup.get(id);
|
|
12512
|
+
const node = internals.userNode;
|
|
12513
|
+
const { x, y } = internals.positionAbsolute;
|
|
12375
12514
|
const { width, height } = getNodeDimensions(node);
|
|
12376
12515
|
return {
|
|
12377
12516
|
node,
|
|
@@ -12391,6 +12530,7 @@ var MiniMapNodes$1 = memo(MiniMapNodes);
|
|
|
12391
12530
|
|
|
12392
12531
|
const defaultWidth = 200;
|
|
12393
12532
|
const defaultHeight = 150;
|
|
12533
|
+
const filterHidden = (node) => !node.hidden;
|
|
12394
12534
|
const selector$1 = (s) => {
|
|
12395
12535
|
const viewBB = {
|
|
12396
12536
|
x: -s.transform[0] / s.transform[2],
|
|
@@ -12400,7 +12540,9 @@ const selector$1 = (s) => {
|
|
|
12400
12540
|
};
|
|
12401
12541
|
return {
|
|
12402
12542
|
viewBB,
|
|
12403
|
-
boundingRect: s.nodeLookup.size > 0
|
|
12543
|
+
boundingRect: s.nodeLookup.size > 0
|
|
12544
|
+
? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB)
|
|
12545
|
+
: viewBB,
|
|
12404
12546
|
rfId: s.rfId,
|
|
12405
12547
|
panZoom: s.panZoom,
|
|
12406
12548
|
translateExtent: s.translateExtent,
|
|
@@ -12466,7 +12608,7 @@ nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position =
|
|
|
12466
12608
|
: undefined;
|
|
12467
12609
|
const onSvgNodeClick = onNodeClick
|
|
12468
12610
|
? useCallback((event, nodeId) => {
|
|
12469
|
-
const node = store.getState().nodeLookup.get(nodeId);
|
|
12611
|
+
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
12470
12612
|
onNodeClick(event, node);
|
|
12471
12613
|
}, [])
|
|
12472
12614
|
: undefined;
|
|
@@ -12478,7 +12620,7 @@ nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position =
|
|
|
12478
12620
|
'--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,
|
|
12479
12621
|
'--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,
|
|
12480
12622
|
'--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,
|
|
12481
|
-
'--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === '
|
|
12623
|
+
'--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined,
|
|
12482
12624
|
}, className: cc(['react-flow__minimap', className]), "data-testid": "rf__minimap", children: jsxRuntimeExports.jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [ariaLabel && jsxRuntimeExports.jsx("title", { id: labelledBy, children: ariaLabel }), jsxRuntimeExports.jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsxRuntimeExports.jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z
|
|
12483
12625
|
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) }));
|
|
12484
12626
|
}
|
|
@@ -12592,11 +12734,15 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
12592
12734
|
}
|
|
12593
12735
|
triggerNodeChanges(changes);
|
|
12594
12736
|
},
|
|
12595
|
-
onEnd: () => {
|
|
12737
|
+
onEnd: ({ width, height }) => {
|
|
12596
12738
|
const dimensionChange = {
|
|
12597
12739
|
id: id,
|
|
12598
12740
|
type: 'dimensions',
|
|
12599
12741
|
resizing: false,
|
|
12742
|
+
dimensions: {
|
|
12743
|
+
width,
|
|
12744
|
+
height,
|
|
12745
|
+
},
|
|
12600
12746
|
};
|
|
12601
12747
|
store.getState().triggerNodeChanges([dimensionChange]);
|
|
12602
12748
|
},
|