@odigos/ui-kit 0.0.21 → 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 +7 -0
- package/lib/components.js +2 -9
- package/lib/containers.js +344 -99
- package/lib/{index-Dboulcny.js → index-3mlRUlHD.js} +652 -1392
- package/lib/theme/index.d.ts +3 -3
- package/lib/theme.js +0 -6
- package/package.json +18 -18
package/lib/containers.js
CHANGED
|
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
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-
|
|
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
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';
|
|
@@ -15,17 +15,9 @@ import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as us
|
|
|
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
16
|
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-BfUUVS8N.js';
|
|
17
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';
|
|
18
|
-
import require$$1 from 'use-sync-external-store/shim';
|
|
19
18
|
import { createPortal } from 'react-dom';
|
|
20
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.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";
|
|
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: {}};
|
|
@@ -5158,7 +5150,7 @@ function getConnectionStatus(isValid) {
|
|
|
5158
5150
|
|
|
5159
5151
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5160
5152
|
/**
|
|
5161
|
-
* Test whether an object is
|
|
5153
|
+
* Test whether an object is usable as an Edge
|
|
5162
5154
|
* @public
|
|
5163
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
|
|
5164
5156
|
* @param element - The element to test
|
|
@@ -5166,7 +5158,7 @@ function getConnectionStatus(isValid) {
|
|
|
5166
5158
|
*/
|
|
5167
5159
|
const isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;
|
|
5168
5160
|
/**
|
|
5169
|
-
* Test whether an object is
|
|
5161
|
+
* Test whether an object is usable as a Node
|
|
5170
5162
|
* @public
|
|
5171
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
|
|
5172
5164
|
* @param element - The element to test
|
|
@@ -5190,9 +5182,8 @@ const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
|
|
|
5190
5182
|
* to calculate the correct transform to fit the given nodes in a viewport.
|
|
5191
5183
|
* @public
|
|
5192
5184
|
* @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.
|
|
5193
|
-
* @param nodes - Nodes to calculate the bounds for
|
|
5194
|
-
* @
|
|
5195
|
-
* @returns Bounding box enclosing all nodes
|
|
5185
|
+
* @param nodes - Nodes to calculate the bounds for.
|
|
5186
|
+
* @returns Bounding box enclosing all nodes.
|
|
5196
5187
|
*
|
|
5197
5188
|
* @remarks This function was previously called `getRectOfNodes`
|
|
5198
5189
|
*
|
|
@@ -5220,7 +5211,7 @@ const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
|
|
|
5220
5211
|
*const bounds = getNodesBounds(nodes);
|
|
5221
5212
|
*```
|
|
5222
5213
|
*/
|
|
5223
|
-
const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0]
|
|
5214
|
+
const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {
|
|
5224
5215
|
if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {
|
|
5225
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.');
|
|
5226
5217
|
}
|
|
@@ -5290,9 +5281,9 @@ excludeNonSelectableNodes = false) => {
|
|
|
5290
5281
|
* This utility filters an array of edges, keeping only those where either the source or target
|
|
5291
5282
|
* node is present in the given array of nodes.
|
|
5292
5283
|
* @public
|
|
5293
|
-
* @param nodes - Nodes you want to get the connected edges for
|
|
5294
|
-
* @param edges - All edges
|
|
5295
|
-
* @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.
|
|
5296
5287
|
*
|
|
5297
5288
|
* @example
|
|
5298
5289
|
* ```js
|
|
@@ -5626,16 +5617,16 @@ function calculateAppliedPaddings(bounds, x, y, zoom, width, height) {
|
|
|
5626
5617
|
};
|
|
5627
5618
|
}
|
|
5628
5619
|
/**
|
|
5629
|
-
* Returns a viewport that encloses the given bounds with
|
|
5620
|
+
* Returns a viewport that encloses the given bounds with padding.
|
|
5630
5621
|
* @public
|
|
5631
5622
|
* @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}
|
|
5632
|
-
* @param bounds - Bounds to fit inside viewport
|
|
5633
|
-
* @param width - Width of the viewport
|
|
5634
|
-
* @param height - Height of the viewport
|
|
5635
|
-
* @param minZoom - Minimum zoom level of the resulting viewport
|
|
5636
|
-
* @param maxZoom - Maximum zoom level of the resulting viewport
|
|
5637
|
-
* @param padding -
|
|
5638
|
-
* @returns A
|
|
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}.
|
|
5639
5630
|
* @example
|
|
5640
5631
|
* const { x, y, zoom } = getViewportForBounds(
|
|
5641
5632
|
* { x: 0, y: 0, width: 100, height: 100},
|
|
@@ -5807,14 +5798,15 @@ function getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {
|
|
|
5807
5798
|
* The `getBezierPath` util returns everything you need to render a bezier edge
|
|
5808
5799
|
*between two nodes.
|
|
5809
5800
|
* @public
|
|
5810
|
-
* @
|
|
5811
|
-
*
|
|
5812
|
-
*
|
|
5813
|
-
*
|
|
5814
|
-
*
|
|
5815
|
-
*
|
|
5816
|
-
*
|
|
5817
|
-
*
|
|
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.
|
|
5818
5810
|
* @example
|
|
5819
5811
|
* ```js
|
|
5820
5812
|
* const source = { x: 0, y: 20 };
|
|
@@ -5911,9 +5903,9 @@ const connectionExists = (edge, edges) => {
|
|
|
5911
5903
|
/**
|
|
5912
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.
|
|
5913
5905
|
* @public
|
|
5914
|
-
* @param edgeParams - Either an Edge or a Connection you want to add
|
|
5915
|
-
* @param edges -
|
|
5916
|
-
* @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.
|
|
5917
5909
|
*
|
|
5918
5910
|
* @remarks If an edge with the same `target` and `source` already exists (and the same
|
|
5919
5911
|
*`targetHandle` and `sourceHandle` if those are set), then this util won't add
|
|
@@ -5950,11 +5942,16 @@ const addEdge = (edgeParams, edges) => {
|
|
|
5950
5942
|
/**
|
|
5951
5943
|
* Calculates the straight line path between two points.
|
|
5952
5944
|
* @public
|
|
5953
|
-
* @
|
|
5954
|
-
*
|
|
5955
|
-
*
|
|
5956
|
-
*
|
|
5957
|
-
*
|
|
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.
|
|
5958
5955
|
* @example
|
|
5959
5956
|
* ```js
|
|
5960
5957
|
* const source = { x: 0, y: 20 };
|
|
@@ -5995,8 +5992,8 @@ const getDirection = ({ source, sourcePosition = Position.Bottom, target, }) =>
|
|
|
5995
5992
|
};
|
|
5996
5993
|
const distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));
|
|
5997
5994
|
/*
|
|
5998
|
-
*
|
|
5999
|
-
* 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
|
|
6000
5997
|
*/
|
|
6001
5998
|
function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, }) {
|
|
6002
5999
|
const sourceDir = handleDirections[sourcePosition];
|
|
@@ -6127,16 +6124,19 @@ function getBend(a, b, c, size) {
|
|
|
6127
6124
|
}
|
|
6128
6125
|
/**
|
|
6129
6126
|
* The `getSmoothStepPath` util returns everything you need to render a stepped path
|
|
6130
|
-
*between two nodes. The `borderRadius` property can be used to choose how rounded
|
|
6131
|
-
*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.
|
|
6132
6129
|
* @public
|
|
6133
|
-
* @
|
|
6134
|
-
*
|
|
6135
|
-
*
|
|
6136
|
-
*
|
|
6137
|
-
*
|
|
6138
|
-
*
|
|
6139
|
-
*
|
|
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.
|
|
6140
6140
|
* @example
|
|
6141
6141
|
* ```js
|
|
6142
6142
|
* const source = { x: 0, y: 20 };
|
|
@@ -7386,9 +7386,15 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
|
|
|
7386
7386
|
}
|
|
7387
7387
|
function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
|
|
7388
7388
|
return function (event, d) {
|
|
7389
|
+
const isWheel = event.type === 'wheel';
|
|
7389
7390
|
// we still want to enable pinch zooming even if preventScrolling is set to false
|
|
7390
|
-
const preventZoom = !preventScrolling &&
|
|
7391
|
-
|
|
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) {
|
|
7392
7398
|
return null;
|
|
7393
7399
|
}
|
|
7394
7400
|
event.preventDefault();
|
|
@@ -8099,7 +8105,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
8099
8105
|
})
|
|
8100
8106
|
.on('end', (event) => {
|
|
8101
8107
|
onResizeEnd?.(event, { ...prevValues });
|
|
8102
|
-
onEnd?.();
|
|
8108
|
+
onEnd?.({ ...prevValues });
|
|
8103
8109
|
});
|
|
8104
8110
|
selection.call(dragHandler);
|
|
8105
8111
|
}
|
|
@@ -8116,6 +8122,201 @@ var withSelector = {exports: {}};
|
|
|
8116
8122
|
|
|
8117
8123
|
var withSelector_production = {};
|
|
8118
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
|
+
|
|
8119
8320
|
/**
|
|
8120
8321
|
* @license React
|
|
8121
8322
|
* use-sync-external-store-shim/with-selector.production.js
|
|
@@ -8132,7 +8333,7 @@ function requireWithSelector_production () {
|
|
|
8132
8333
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
8133
8334
|
hasRequiredWithSelector_production = 1;
|
|
8134
8335
|
var React$1 = React,
|
|
8135
|
-
shim =
|
|
8336
|
+
shim = requireShim();
|
|
8136
8337
|
function is(x, y) {
|
|
8137
8338
|
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
8138
8339
|
}
|
|
@@ -8235,7 +8436,7 @@ function requireWithSelector_development () {
|
|
|
8235
8436
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
8236
8437
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
8237
8438
|
var React$1 = React,
|
|
8238
|
-
shim =
|
|
8439
|
+
shim = requireShim(),
|
|
8239
8440
|
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
8240
8441
|
useSyncExternalStore = shim.useSyncExternalStore,
|
|
8241
8442
|
useRef = React$1.useRef,
|
|
@@ -8431,9 +8632,13 @@ const zustandErrorMessage = errorMessages['error001']();
|
|
|
8431
8632
|
* state management library, so you should check out their docs for more details.
|
|
8432
8633
|
*
|
|
8433
8634
|
* @public
|
|
8434
|
-
* @param selector
|
|
8435
|
-
*
|
|
8436
|
-
*
|
|
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.
|
|
8437
8642
|
*
|
|
8438
8643
|
* @example
|
|
8439
8644
|
* ```ts
|
|
@@ -8454,8 +8659,7 @@ function useStore(selector, equalityFn) {
|
|
|
8454
8659
|
/**
|
|
8455
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.
|
|
8456
8661
|
*
|
|
8457
|
-
* @returns The store object
|
|
8458
|
-
*
|
|
8662
|
+
* @returns The store object.
|
|
8459
8663
|
* @example
|
|
8460
8664
|
* ```ts
|
|
8461
8665
|
* const store = useStoreApi();
|
|
@@ -8588,7 +8792,7 @@ const defaultViewport = { x: 0, y: 0, zoom: 1 };
|
|
|
8588
8792
|
* We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)
|
|
8589
8793
|
* and values that have a dedicated setter function in the store (like `setNodes`).
|
|
8590
8794
|
*/
|
|
8591
|
-
//
|
|
8795
|
+
// These fields exist in the global store, and we need to keep them up to date
|
|
8592
8796
|
const reactFlowFieldsToTrack = [
|
|
8593
8797
|
'nodes',
|
|
8594
8798
|
'edges',
|
|
@@ -8761,9 +8965,7 @@ const defaultDoc = typeof document !== 'undefined' ? document : null;
|
|
|
8761
8965
|
* currently pressed or not.
|
|
8762
8966
|
*
|
|
8763
8967
|
* @public
|
|
8764
|
-
* @param
|
|
8765
|
-
* @param param.options - Options
|
|
8766
|
-
* @returns boolean
|
|
8968
|
+
* @param options - Options
|
|
8767
8969
|
*
|
|
8768
8970
|
* @example
|
|
8769
8971
|
* ```tsx
|
|
@@ -8783,11 +8985,17 @@ const defaultDoc = typeof document !== 'undefined' ? document : null;
|
|
|
8783
8985
|
*```
|
|
8784
8986
|
*/
|
|
8785
8987
|
function useKeyPress(
|
|
8786
|
-
|
|
8787
|
-
*
|
|
8788
|
-
*
|
|
8789
|
-
*
|
|
8790
|
-
*
|
|
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
|
|
8791
8999
|
*/
|
|
8792
9000
|
keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) {
|
|
8793
9001
|
const [keyPressed, setKeyPressed] = useState(false);
|
|
@@ -9105,9 +9313,9 @@ function applyChange(change, element) {
|
|
|
9105
9313
|
/**
|
|
9106
9314
|
* Drop in function that applies node changes to an array of nodes.
|
|
9107
9315
|
* @public
|
|
9108
|
-
* @param changes - Array of changes to apply
|
|
9109
|
-
* @param nodes - Array of nodes to apply the changes to
|
|
9110
|
-
* @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.
|
|
9111
9319
|
* @example
|
|
9112
9320
|
*```tsx
|
|
9113
9321
|
*import { useState, useCallback } from 'react';
|
|
@@ -9139,9 +9347,9 @@ function applyNodeChanges(changes, nodes) {
|
|
|
9139
9347
|
/**
|
|
9140
9348
|
* Drop in function that applies edge changes to an array of edges.
|
|
9141
9349
|
* @public
|
|
9142
|
-
* @param changes - Array of changes to apply
|
|
9143
|
-
* @param edges - Array of edge to apply the changes to
|
|
9144
|
-
* @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.
|
|
9145
9353
|
* @example
|
|
9146
9354
|
* ```tsx
|
|
9147
9355
|
*import { useState, useCallback } from 'react';
|
|
@@ -9225,41 +9433,45 @@ function elementToRemoveChange(item) {
|
|
|
9225
9433
|
}
|
|
9226
9434
|
|
|
9227
9435
|
/**
|
|
9228
|
-
* Test whether an object is
|
|
9436
|
+
* Test whether an object is usable as an [`Node`](/api-reference/types/node).
|
|
9229
9437
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
9230
9438
|
* [`Node`](/api-reference/types/node) if it returns `true`.
|
|
9231
9439
|
*
|
|
9232
9440
|
* @public
|
|
9233
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
|
|
9234
|
-
* @param element - The element to test
|
|
9235
|
-
* @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`.
|
|
9236
9446
|
*
|
|
9237
9447
|
* @example
|
|
9238
9448
|
* ```js
|
|
9239
9449
|
*import { isNode } from '@xyflow/react';
|
|
9240
9450
|
*
|
|
9241
9451
|
*if (isNode(node)) {
|
|
9242
|
-
* //
|
|
9452
|
+
* // ...
|
|
9243
9453
|
*}
|
|
9244
9454
|
*```
|
|
9245
9455
|
*/
|
|
9246
9456
|
const isNode = (element) => isNodeBase(element);
|
|
9247
9457
|
/**
|
|
9248
|
-
* Test whether an object is
|
|
9458
|
+
* Test whether an object is usable as an [`Edge`](/api-reference/types/edge).
|
|
9249
9459
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
9250
9460
|
* [`Edge`](/api-reference/types/edge) if it returns `true`.
|
|
9251
9461
|
*
|
|
9252
9462
|
* @public
|
|
9253
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
|
|
9254
9464
|
* @param element - The element to test
|
|
9255
|
-
* @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`.
|
|
9256
9468
|
*
|
|
9257
9469
|
* @example
|
|
9258
9470
|
* ```js
|
|
9259
9471
|
*import { isEdge } from '@xyflow/react';
|
|
9260
9472
|
*
|
|
9261
9473
|
*if (isEdge(edge)) {
|
|
9262
|
-
* //
|
|
9474
|
+
* // ...
|
|
9263
9475
|
*}
|
|
9264
9476
|
*```
|
|
9265
9477
|
*/
|
|
@@ -9403,8 +9615,6 @@ const selector$k = (s) => !!s.panZoom;
|
|
|
9403
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.
|
|
9404
9616
|
*
|
|
9405
9617
|
* @public
|
|
9406
|
-
* @returns ReactFlowInstance
|
|
9407
|
-
*
|
|
9408
9618
|
* @example
|
|
9409
9619
|
* ```jsx
|
|
9410
9620
|
*import { useCallback, useState } from 'react';
|
|
@@ -10059,7 +10269,7 @@ NodeIdContext.Consumer;
|
|
|
10059
10269
|
* drill down the id as a prop.
|
|
10060
10270
|
*
|
|
10061
10271
|
* @public
|
|
10062
|
-
* @returns id
|
|
10272
|
+
* @returns The id for a node in the flow.
|
|
10063
10273
|
*
|
|
10064
10274
|
* @example
|
|
10065
10275
|
*```jsx
|
|
@@ -10822,6 +11032,14 @@ function getControl({ pos, x1, y1, x2, y2 }) {
|
|
|
10822
11032
|
* The `getSimpleBezierPath` util returns everything you need to render a simple
|
|
10823
11033
|
* bezier edge between two nodes.
|
|
10824
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.
|
|
10825
11043
|
*/
|
|
10826
11044
|
function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) {
|
|
10827
11045
|
const [sourceControlX, sourceControlY] = getControl({
|
|
@@ -10858,7 +11076,7 @@ function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Botto
|
|
|
10858
11076
|
}
|
|
10859
11077
|
function createSimpleBezierEdge(params) {
|
|
10860
11078
|
// eslint-disable-next-line react/display-name
|
|
10861
|
-
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, }) => {
|
|
10862
11080
|
const [path, labelX, labelY] = getSimpleBezierPath({
|
|
10863
11081
|
sourceX,
|
|
10864
11082
|
sourceY,
|
|
@@ -11327,6 +11545,10 @@ function getSelector(connectionSelector) {
|
|
|
11327
11545
|
* based on a certain condition (e.g. if the connection is valid or not).
|
|
11328
11546
|
*
|
|
11329
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.
|
|
11330
11552
|
* @example
|
|
11331
11553
|
*
|
|
11332
11554
|
* ```tsx
|
|
@@ -11941,8 +12163,16 @@ function EdgeLabelRenderer({ children }) {
|
|
|
11941
12163
|
* like React's `useState` hook with an additional helper callback.
|
|
11942
12164
|
*
|
|
11943
12165
|
* @public
|
|
11944
|
-
* @
|
|
11945
|
-
*
|
|
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.
|
|
11946
12176
|
* @example
|
|
11947
12177
|
*
|
|
11948
12178
|
*```tsx
|
|
@@ -11983,8 +12213,18 @@ function useNodesState(initialNodes) {
|
|
|
11983
12213
|
* like React's `useState` hook with an additional helper callback.
|
|
11984
12214
|
*
|
|
11985
12215
|
* @public
|
|
11986
|
-
* @
|
|
11987
|
-
*
|
|
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.
|
|
11988
12228
|
* @example
|
|
11989
12229
|
*
|
|
11990
12230
|
*```tsx
|
|
@@ -12268,8 +12508,9 @@ nodeComponent: NodeComponent = MiniMapNode, onClick, }) {
|
|
|
12268
12508
|
}
|
|
12269
12509
|
function NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) {
|
|
12270
12510
|
const { node, x, y, width, height } = useStore((s) => {
|
|
12271
|
-
const
|
|
12272
|
-
const
|
|
12511
|
+
const { internals } = s.nodeLookup.get(id);
|
|
12512
|
+
const node = internals.userNode;
|
|
12513
|
+
const { x, y } = internals.positionAbsolute;
|
|
12273
12514
|
const { width, height } = getNodeDimensions(node);
|
|
12274
12515
|
return {
|
|
12275
12516
|
node,
|
|
@@ -12367,7 +12608,7 @@ nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position =
|
|
|
12367
12608
|
: undefined;
|
|
12368
12609
|
const onSvgNodeClick = onNodeClick
|
|
12369
12610
|
? useCallback((event, nodeId) => {
|
|
12370
|
-
const node = store.getState().nodeLookup.get(nodeId);
|
|
12611
|
+
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
12371
12612
|
onNodeClick(event, node);
|
|
12372
12613
|
}, [])
|
|
12373
12614
|
: undefined;
|
|
@@ -12379,7 +12620,7 @@ nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position =
|
|
|
12379
12620
|
'--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,
|
|
12380
12621
|
'--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,
|
|
12381
12622
|
'--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,
|
|
12382
|
-
'--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === '
|
|
12623
|
+
'--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined,
|
|
12383
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
|
|
12384
12625
|
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) }));
|
|
12385
12626
|
}
|
|
@@ -12493,11 +12734,15 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
12493
12734
|
}
|
|
12494
12735
|
triggerNodeChanges(changes);
|
|
12495
12736
|
},
|
|
12496
|
-
onEnd: () => {
|
|
12737
|
+
onEnd: ({ width, height }) => {
|
|
12497
12738
|
const dimensionChange = {
|
|
12498
12739
|
id: id,
|
|
12499
12740
|
type: 'dimensions',
|
|
12500
12741
|
resizing: false,
|
|
12742
|
+
dimensions: {
|
|
12743
|
+
width,
|
|
12744
|
+
height,
|
|
12745
|
+
},
|
|
12501
12746
|
};
|
|
12502
12747
|
store.getState().triggerNodeChanges([dimensionChange]);
|
|
12503
12748
|
},
|