@hitachivantara/uikit-react-lab 5.41.13 → 5.41.15

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.
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const uikitStyles = require("@hitachivantara/uikit-styles");
6
6
  const HvFlowBackground = ({
7
7
  color = "secondary",
8
8
  ...others
9
9
  }) => {
10
10
  return /* @__PURE__ */ jsxRuntime.jsx(
11
- ReactFlow.Background,
11
+ reactflow.Background,
12
12
  {
13
13
  color: uikitStyles.getColor(color, uikitStyles.theme.colors.secondary_80),
14
14
  gap: 16,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const shallow = require("zustand/shallow");
6
6
  const uikitReactCore = require("@hitachivantara/uikit-react-core");
7
7
  const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
@@ -32,11 +32,11 @@ const HvFlowControls = ({
32
32
  children,
33
33
  ...others
34
34
  }) => {
35
- const { isInteractive, minZoomReached, maxZoomReached } = ReactFlow.useStore(
35
+ const { isInteractive, minZoomReached, maxZoomReached } = reactflow.useStore(
36
36
  selector,
37
37
  shallow.shallow
38
38
  );
39
- const store = ReactFlow.useStoreApi();
39
+ const store = reactflow.useStoreApi();
40
40
  const { zoomIn, zoomOut, fitView } = useFlowInstance.useFlowInstance();
41
41
  const labels = uikitReactCore.useLabels(DEFAULT_LABELS, labelsProps);
42
42
  const handleZoomIn = () => {
@@ -59,7 +59,7 @@ const HvFlowControls = ({
59
59
  });
60
60
  onInteractiveChange?.(!isInteractive);
61
61
  };
62
- return /* @__PURE__ */ jsxRuntime.jsx(ReactFlow.Panel, { position, ...others, children: /* @__PURE__ */ jsxRuntime.jsxs(uikitReactCore.HvMultiButton, { vertical: orientation === "vertical", children: [
62
+ return /* @__PURE__ */ jsxRuntime.jsx(reactflow.Panel, { position, ...others, children: /* @__PURE__ */ jsxRuntime.jsxs(uikitReactCore.HvMultiButton, { vertical: orientation === "vertical", children: [
63
63
  !hideZoom && /* @__PURE__ */ jsxRuntime.jsx(
64
64
  uikitReactCore.HvButton,
65
65
  {
@@ -4,15 +4,13 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const core = require("@dnd-kit/core");
6
6
  const react$1 = require("@emotion/react");
7
- const ReactFlow = require("reactflow");
7
+ const reactflow = require("reactflow");
8
8
  const uid = require("uid");
9
9
  const uikitReactCore = require("@hitachivantara/uikit-react-core");
10
10
  const base = require("./base.cjs");
11
11
  const Flow_styles = require("./Flow.styles.cjs");
12
12
  const NodeMetaContext = require("./FlowContext/NodeMetaContext.cjs");
13
13
  const useFlowInstance = require("./hooks/useFlowInstance.cjs");
14
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
15
- const ReactFlow__default = /* @__PURE__ */ _interopDefault(ReactFlow);
16
14
  const getNode = (nodes, nodeId) => {
17
15
  return nodes.find((n) => n.id === nodeId);
18
16
  };
@@ -131,7 +129,7 @@ const HvDroppableFlow = ({
131
129
  );
132
130
  const handleConnect = react.useCallback(
133
131
  (connection) => {
134
- const eds = ReactFlow.addEdge(connection, edgesRef.current);
132
+ const eds = reactflow.addEdge(connection, edgesRef.current);
135
133
  updateEdges(eds);
136
134
  handleFlowChange(nodesRef.current, eds);
137
135
  onConnectProp?.(connection);
@@ -140,7 +138,7 @@ const HvDroppableFlow = ({
140
138
  );
141
139
  const handleNodesChange = react.useCallback(
142
140
  (changes) => {
143
- const nds = ReactFlow.applyNodeChanges(changes, nodesRef.current);
141
+ const nds = reactflow.applyNodeChanges(changes, nodesRef.current);
144
142
  updateNodes(nds);
145
143
  handleFlowChange(nds, edgesRef.current);
146
144
  onNodesChangeProp?.(changes);
@@ -149,7 +147,7 @@ const HvDroppableFlow = ({
149
147
  );
150
148
  const handleEdgesChange = react.useCallback(
151
149
  (changes) => {
152
- const eds = ReactFlow.applyEdgeChanges(changes, edgesRef.current);
150
+ const eds = reactflow.applyEdgeChanges(changes, edgesRef.current);
153
151
  updateEdges(eds);
154
152
  handleFlowChange(nodesRef.current, eds);
155
153
  onEdgesChangeProp?.(changes);
@@ -160,7 +158,7 @@ const HvDroppableFlow = ({
160
158
  const isValidConnection = (connection) => validateEdge(nodes, edges, connection, registry);
161
159
  const defaultEdgeOptions = {
162
160
  markerEnd: {
163
- type: ReactFlow.MarkerType.ArrowClosed,
161
+ type: reactflow.MarkerType.ArrowClosed,
164
162
  height: 20,
165
163
  width: 20
166
164
  },
@@ -179,7 +177,7 @@ const HvDroppableFlow = ({
179
177
  ref: setNodeRef,
180
178
  className: cx(classes.root, className),
181
179
  children: /* @__PURE__ */ jsxRuntime.jsx(
182
- ReactFlow__default.default,
180
+ reactflow.ReactFlow,
183
181
  {
184
182
  nodes,
185
183
  edges,
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
6
  const Empty_styles = require("./Empty.styles.cjs");
7
7
  const HvFlowEmpty = ({ className, ...others }) => {
8
8
  const { classes, cx } = Empty_styles.useClasses();
9
- const nodes = ReactFlow.useNodes();
9
+ const nodes = reactflow.useNodes();
10
10
  return !nodes || (nodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvEmptyState, { className: cx(classes.root, className), ...others }) : null);
11
11
  };
12
12
  exports.HvFlowEmpty = HvFlowEmpty;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const core = require("@dnd-kit/core");
5
5
  const modifiers = require("@dnd-kit/modifiers");
6
- const ReactFlow = require("reactflow");
6
+ const reactflow = require("reactflow");
7
7
  const DroppableFlow = require("./DroppableFlow.cjs");
8
8
  const FlowContext = require("./FlowContext/FlowContext.cjs");
9
9
  const HvFlow = ({
@@ -17,7 +17,7 @@ const HvFlow = ({
17
17
  core.useSensor(core.PointerSensor),
18
18
  core.useSensor(core.KeyboardSensor)
19
19
  );
20
- return /* @__PURE__ */ jsxRuntime.jsx(ReactFlow.ReactFlowProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(FlowContext.HvFlowProvider, { nodeGroups, defaultActions, children: /* @__PURE__ */ jsxRuntime.jsxs(
20
+ return /* @__PURE__ */ jsxRuntime.jsx(reactflow.ReactFlowProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(FlowContext.HvFlowProvider, { nodeGroups, defaultActions, children: /* @__PURE__ */ jsxRuntime.jsxs(
21
21
  core.DndContext,
22
22
  {
23
23
  sensors,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const uikitStyles = require("@hitachivantara/uikit-styles");
6
6
  const Minimap_styles = require("./Minimap.styles.cjs");
7
7
  const HvFlowMinimap = ({
@@ -15,7 +15,7 @@ const HvFlowMinimap = ({
15
15
  }) => {
16
16
  const { classes, cx } = Minimap_styles.useClasses(classesProp);
17
17
  return /* @__PURE__ */ jsxRuntime.jsx(
18
- ReactFlow.MiniMap,
18
+ reactflow.MiniMap,
19
19
  {
20
20
  className: cx(classes.root, className),
21
21
  nodeColor: typeof nodeColor === "string" ? uikitStyles.getColor(nodeColor, "atmo4") : nodeColor,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
6
  const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
7
7
  const BaseNode_styles = require("./BaseNode.styles.cjs");
@@ -58,12 +58,12 @@ const HvFlowBaseNode = ({
58
58
  const edgeConnected = utils.isConnected(id, "source", output.id, outputEdges);
59
59
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.outputContainer, children: [
60
60
  /* @__PURE__ */ jsxRuntime.jsx(
61
- ReactFlow.Handle,
61
+ reactflow.Handle,
62
62
  {
63
63
  type: "source",
64
64
  isConnectableEnd: false,
65
65
  id: output.id,
66
- position: ReactFlow.Position.Right,
66
+ position: reactflow.Position.Right,
67
67
  className: cx(classes.handle, {
68
68
  [classes.handleConnected]: edgeConnected
69
69
  })
@@ -77,12 +77,12 @@ const HvFlowBaseNode = ({
77
77
  const edgeConnected = utils.isConnected(id, "target", input.id, inputEdges);
78
78
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.inputContainer, children: [
79
79
  /* @__PURE__ */ jsxRuntime.jsx(
80
- ReactFlow.Handle,
80
+ reactflow.Handle,
81
81
  {
82
82
  type: "target",
83
83
  isConnectableStart: false,
84
84
  id: input.id,
85
- position: ReactFlow.Position.Left,
85
+ position: reactflow.Position.Left,
86
86
  className: cx(classes.handle, {
87
87
  [classes.handleConnected]: edgeConnected
88
88
  })
@@ -111,7 +111,7 @@ const HvFlowBaseNode = ({
111
111
  onMouseEnter: toggleShowActions,
112
112
  onMouseLeave: toggleShowActions,
113
113
  children: [
114
- /* @__PURE__ */ jsxRuntime.jsx(ReactFlow.NodeToolbar, { ...getNodeToolbarProps(), children: nodeActions?.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
114
+ /* @__PURE__ */ jsxRuntime.jsx(reactflow.NodeToolbar, { ...getNodeToolbarProps(), children: nodeActions?.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
115
115
  uikitReactCore.HvIconButton,
116
116
  {
117
117
  title: action.label,
@@ -5,7 +5,7 @@ const react = require("react");
5
5
  const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
6
  const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
7
7
  const SidebarGroupItem_styles = require("./SidebarGroupItem.styles.cjs");
8
- const HvFlowSidebarGroupItem = react.forwardRef((props, ref) => {
8
+ const HvFlowSidebarGroupItem = react.forwardRef(function HvFlowSidebarGroupItem2(props, ref) {
9
9
  const {
10
10
  label,
11
11
  isDragging,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const ReactFlow = require("reactflow");
3
+ const reactflow = require("reactflow");
4
4
  function useFlowInstance() {
5
- return ReactFlow.useReactFlow();
5
+ return reactflow.useReactFlow();
6
6
  }
7
7
  exports.useFlowInstance = useFlowInstance;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const react = require("react");
4
- const ReactFlow = require("reactflow");
4
+ const reactflow = require("reactflow");
5
5
  const shallow = require("zustand/shallow");
6
6
  const useFlowInstance = require("./useFlowInstance.cjs");
7
7
  const useNodeId = require("./useNodeId.cjs");
@@ -19,7 +19,7 @@ function useFlowNode(id) {
19
19
  (state) => state.getNodes().find((n) => n.id === nodeId),
20
20
  [nodeId]
21
21
  );
22
- return ReactFlow.useStore(nodeSelector, shallow.shallow);
22
+ return reactflow.useStore(nodeSelector, shallow.shallow);
23
23
  }
24
24
  function useFlowNodeInputEdges(id) {
25
25
  const nodeId = useNodeId.useNodeId(id);
@@ -27,7 +27,7 @@ function useFlowNodeInputEdges(id) {
27
27
  (state) => state.edges.filter((e) => e.target === nodeId),
28
28
  [nodeId]
29
29
  );
30
- return ReactFlow.useStore(inputEdgesSelector, shallow.shallow);
30
+ return reactflow.useStore(inputEdgesSelector, shallow.shallow);
31
31
  }
32
32
  function useFlowNodeOutputEdges(id) {
33
33
  const nodeId = useNodeId.useNodeId(id);
@@ -35,7 +35,7 @@ function useFlowNodeOutputEdges(id) {
35
35
  (state) => state.edges.filter((e) => e.source === nodeId),
36
36
  [nodeId]
37
37
  );
38
- return ReactFlow.useStore(outputEdgesSelector, shallow.shallow);
38
+ return reactflow.useStore(outputEdgesSelector, shallow.shallow);
39
39
  }
40
40
  function useFlowNodeEdges(id) {
41
41
  const nodeId = useNodeId.useNodeId(id);
@@ -45,7 +45,7 @@ function useFlowNodeEdges(id) {
45
45
  ),
46
46
  [nodeId]
47
47
  );
48
- return ReactFlow.useStore(edgesSelector, shallow.shallow);
48
+ return reactflow.useStore(edgesSelector, shallow.shallow);
49
49
  }
50
50
  function useFlowNodeParents(id) {
51
51
  const inputEdges = useFlowNodeInputEdges(id);
@@ -55,20 +55,20 @@ function useFlowNodeParents(id) {
55
55
  },
56
56
  [inputEdges]
57
57
  );
58
- return ReactFlow.useStore(parentNodesSelector, shallow.shallow);
58
+ return reactflow.useStore(parentNodesSelector, shallow.shallow);
59
59
  }
60
60
  function useFlowInputNodes(id) {
61
61
  const nodeId = useNodeId.useNodeId(id);
62
- const nodes = ReactFlow.useNodes();
63
- const edges = ReactFlow.useEdges();
62
+ const nodes = reactflow.useNodes();
63
+ const edges = reactflow.useEdges();
64
64
  return react.useMemo(() => {
65
65
  return edges.filter((e) => e.target === nodeId).map((e) => nodes.find((n) => n.id === e.source)).filter((n) => n !== null);
66
66
  }, [edges, nodeId, nodes]);
67
67
  }
68
68
  function useFlowOutputNodes(id) {
69
69
  const nodeId = useNodeId.useNodeId(id);
70
- const nodes = ReactFlow.useNodes();
71
- const edges = ReactFlow.useEdges();
70
+ const nodes = reactflow.useNodes();
71
+ const edges = reactflow.useEdges();
72
72
  return react.useMemo(() => {
73
73
  return edges.filter((e) => e.source === nodeId).map((e) => nodes.find((n) => n.id === e.target)).filter((n) => n !== null);
74
74
  }, [edges, nodeId, nodes]);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const ReactFlow = require("reactflow");
3
+ const reactflow = require("reactflow");
4
4
  function useNodeId(id) {
5
- const currentNodeId = ReactFlow.useNodeId();
5
+ const currentNodeId = reactflow.useNodeId();
6
6
  return id ?? currentNodeId;
7
7
  }
8
8
  exports.useNodeId = useNodeId;
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useState, useRef, useCallback } from "react";
3
3
  import { useDroppable, useDndMonitor } from "@dnd-kit/core";
4
4
  import { Global } from "@emotion/react";
5
- import ReactFlow, { addEdge, applyNodeChanges, applyEdgeChanges, MarkerType } from "reactflow";
5
+ import { addEdge, applyNodeChanges, applyEdgeChanges, MarkerType, ReactFlow } from "reactflow";
6
6
  import { uid } from "uid";
7
7
  import { useUniqueId } from "@hitachivantara/uikit-react-core";
8
8
  import { flowStyles } from "./base.js";
@@ -1 +1 @@
1
- {"version":3,"file":"DroppableFlow.js","sources":["../../../src/Flow/DroppableFlow.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\";\nimport { DragEndEvent, useDndMonitor, useDroppable } from \"@dnd-kit/core\";\nimport { Global } from \"@emotion/react\";\nimport ReactFlow, {\n addEdge,\n applyEdgeChanges,\n applyNodeChanges,\n Connection,\n Edge,\n EdgeChange,\n MarkerType,\n Node,\n NodeChange,\n ReactFlowProps,\n} from \"reactflow\";\nimport { uid } from \"uid\";\nimport { ExtractNames, useUniqueId } from \"@hitachivantara/uikit-react-core\";\n\nimport { flowStyles } from \"./base\";\nimport { staticClasses, useClasses } from \"./Flow.styles\";\nimport { useNodeMetaRegistry } from \"./FlowContext/NodeMetaContext\";\nimport { useFlowInstance } from \"./hooks\";\nimport {\n HvFlowNodeInputGroup,\n HvFlowNodeMetaRegistry,\n HvFlowNodeOutputGroup,\n HvFlowNodeTypes,\n} from \"./types\";\n\nexport { staticClasses as flowClasses };\n\nexport type HvFlowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDroppableFlowProps<\n NodeType extends string | undefined = string | undefined,\n NodeData = any,\n> extends Omit<ReactFlowProps, \"nodes\" | \"edges\" | \"nodeTypes\"> {\n /** Flow content: background, controls, and minimap. */\n children?: React.ReactNode;\n /** Flow nodes types. */\n nodeTypes?: HvFlowNodeTypes<NodeData>;\n /** Flow nodes. */\n nodes?: Node<NodeData, NodeType>[];\n /** Flow edges. */\n edges?: Edge[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowClasses;\n /** Callback called when the flow changes. Returns the updated nodes and edges. */\n onFlowChange?: (nodes: Node<NodeData, NodeType>[], edges: Edge[]) => void;\n /**\n * Callback called when a node is dropped in the flow.\n *\n * This callback should be used to override the custom UI Kit drop event.\n * Thus, when defined, the user is responsible for adding nodes to the flow.\n *\n * This callback is called when `HvFlowSidebar` is used or a custom sidebar was created using Dnd Kit.\n * When a custom sidebar was created using the native HTML drag and drop API, refer to the `onDrop` callback.\n *\n * Returns the event and the node to be added to the flow.\n */\n onDndDrop?: (event: DragEndEvent, node: Node) => void;\n}\n\nexport const getNode = (nodes: Node[], nodeId: string) => {\n return nodes.find((n) => n.id === nodeId);\n};\n\nconst validateEdge = (\n nodes: Node[],\n edges: Edge[],\n connection: Connection,\n nodeMetaRegistry: HvFlowNodeMetaRegistry,\n) => {\n const {\n source: sourceId,\n sourceHandle,\n target: targetId,\n targetHandle,\n } = connection;\n\n if (!sourceHandle || !targetHandle || !sourceId || !targetId) return false;\n\n const sourceNode = getNode(nodes, sourceId);\n const targetNode = getNode(nodes, targetId);\n\n if (!sourceNode || !targetNode) return false;\n\n const sourceType = sourceNode.type;\n const targetType = targetNode.type;\n\n if (!sourceType || !targetType) return false;\n\n const inputs = nodeMetaRegistry[targetId]?.inputs || [];\n const outputs = nodeMetaRegistry[sourceId]?.outputs || [];\n\n const source = outputs\n .flatMap((out) => (out as HvFlowNodeOutputGroup).outputs || out)\n .find((out) => out.id === sourceHandle);\n const target = inputs\n .flatMap((inp) => (inp as HvFlowNodeInputGroup).inputs || inp)\n .find((inp) => inp.id === targetHandle);\n\n const sourceProvides = source?.provides || \"\";\n const targetAccepts = target?.accepts || [];\n const sourceMaxConnections = source?.maxConnections;\n const targetMaxConnections = target?.maxConnections;\n\n let isValid =\n targetAccepts.length === 0 || targetAccepts.includes(sourceProvides);\n\n if (isValid && targetMaxConnections != null) {\n const targetConnections = edges.filter(\n (edg) => edg.target === targetId && edg.targetHandle === targetHandle,\n ).length;\n\n isValid = targetConnections < targetMaxConnections;\n }\n\n if (isValid && sourceMaxConnections != null) {\n const sourceConnections = edges.filter(\n (edg) => edg.source === sourceId && edg.sourceHandle === sourceHandle,\n ).length;\n\n isValid = sourceConnections < sourceMaxConnections;\n }\n\n return isValid;\n};\n\nexport const HvDroppableFlow = ({\n id,\n className,\n children,\n onFlowChange,\n onDndDrop,\n classes: classesProp,\n nodes: initialNodes = [],\n edges: initialEdges = [],\n onConnect: onConnectProp,\n onNodesChange: onNodesChangeProp,\n onEdgesChange: onEdgesChangeProp,\n defaultEdgeOptions: defaultEdgeOptionsProp,\n nodeTypes,\n ...others\n}: HvDroppableFlowProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const reactFlowInstance = useFlowInstance();\n\n const [nodes, setNodes] = useState(initialNodes);\n const [edges, setEdges] = useState(initialEdges);\n // Keeping track of nodes and edges for onFlowChange since useState is async\n const nodesRef = useRef(initialNodes);\n const edgesRef = useRef(initialEdges);\n\n const updateNodes = (nds: Node[]) => {\n setNodes(nds);\n nodesRef.current = nds;\n };\n\n const updateEdges = (eds: Edge[]) => {\n setEdges(eds);\n edgesRef.current = eds;\n };\n\n const { setNodeRef } = useDroppable({\n id: elementId,\n });\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n if (event.over?.id !== elementId) return;\n\n const hvFlow = event.active.data.current?.hvFlow;\n const type = hvFlow?.type;\n\n // Only known node types can be dropped in the canvas\n if (!type || !nodeTypes?.[type]) {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(\n `Could not add node to the flow because of unknown type ${type}. Use nodeTypes to define all the node types.`,\n );\n }\n return;\n }\n\n // Position node in the flow\n const position = reactFlowInstance.screenToFlowPosition({\n x: hvFlow?.x || 0,\n y: hvFlow?.y || 0,\n });\n\n // Node data\n const data = {\n nodeLabel: hvFlow?.label,\n ...hvFlow?.data,\n };\n\n // Node to add\n const newNode: Node = {\n id: uid(),\n position,\n data,\n type,\n };\n\n // Drop override\n if (onDndDrop) {\n onDndDrop(event, newNode);\n return;\n }\n\n updateNodes(nodes.concat(newNode));\n },\n [elementId, nodeTypes, nodes, onDndDrop, reactFlowInstance],\n );\n\n useDndMonitor({\n onDragEnd: handleDragEnd,\n });\n\n const handleFlowChange = useCallback(\n (nds: Node[], eds: Edge[]) => {\n // The new flow is returned if the user is not dragging nodes\n // This avoids triggering this handler too many times\n const isDragging = nds.find((node) => node.dragging);\n if (!isDragging) {\n onFlowChange?.(nds, eds);\n }\n },\n [onFlowChange],\n );\n\n const handleConnect = useCallback(\n (connection: Connection) => {\n const eds = addEdge(connection, edgesRef.current);\n updateEdges(eds);\n\n handleFlowChange(nodesRef.current, eds);\n onConnectProp?.(connection);\n },\n [handleFlowChange, onConnectProp],\n );\n\n const handleNodesChange = useCallback(\n (changes: NodeChange[]) => {\n const nds = applyNodeChanges(changes, nodesRef.current);\n updateNodes(nds);\n\n handleFlowChange(nds, edgesRef.current);\n onNodesChangeProp?.(changes);\n },\n [handleFlowChange, onNodesChangeProp],\n );\n\n const handleEdgesChange = useCallback(\n (changes: EdgeChange[]) => {\n const eds = applyEdgeChanges(changes, edgesRef.current);\n updateEdges(eds);\n\n handleFlowChange(nodesRef.current, eds);\n onEdgesChangeProp?.(changes);\n },\n [handleFlowChange, onEdgesChangeProp],\n );\n\n const { registry } = useNodeMetaRegistry();\n\n const isValidConnection: ReactFlowProps[\"isValidConnection\"] = (connection) =>\n validateEdge(nodes, edges, connection, registry);\n\n const defaultEdgeOptions = {\n markerEnd: {\n type: MarkerType.ArrowClosed,\n height: 20,\n width: 20,\n },\n type: \"smoothstep\",\n pathOptions: {\n borderRadius: 40,\n },\n ...defaultEdgeOptionsProp,\n };\n\n return (\n <>\n <Global styles={flowStyles} />\n <div\n id={elementId}\n ref={setNodeRef}\n className={cx(classes.root, className)}\n >\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodesChange={handleNodesChange}\n onEdgesChange={handleEdgesChange}\n onConnect={handleConnect}\n isValidConnection={isValidConnection}\n defaultEdgeOptions={defaultEdgeOptions}\n snapGrid={[1, 1]}\n snapToGrid\n onError={(code, message) => {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(message);\n }\n }}\n {...others}\n >\n {children}\n </ReactFlow>\n </div>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+Da,MAAA,UAAU,CAAC,OAAe,WAAmB;AACxD,SAAO,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM;AAC1C;AAEA,MAAM,eAAe,CACnB,OACA,OACA,YACA,qBACG;AACG,QAAA;AAAA,IACJ,QAAQ;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EAAA,IACE;AAEA,MAAA,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,CAAC,SAAiB,QAAA;AAE/D,QAAA,aAAa,QAAQ,OAAO,QAAQ;AACpC,QAAA,aAAa,QAAQ,OAAO,QAAQ;AAE1C,MAAI,CAAC,cAAc,CAAC,WAAmB,QAAA;AAEvC,QAAM,aAAa,WAAW;AAC9B,QAAM,aAAa,WAAW;AAE9B,MAAI,CAAC,cAAc,CAAC,WAAmB,QAAA;AAEvC,QAAM,SAAS,iBAAiB,QAAQ,GAAG,UAAU,CAAC;AACtD,QAAM,UAAU,iBAAiB,QA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ACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe;AAAA,YACf,eAAe;AAAA,YACf,WAAW;AAAA,YACX;AAAA,YACA;AAAA,YACA,UAAU,CAAC,GAAG,CAAC;AAAA,YACf,YAAU;AAAA,YACV,SAAS,CAAC,MAAM,YAAY;AAAA,YAK5B;AAAA,YACC,GAAG;AAAA,YAEH;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"DroppableFlow.js","sources":["../../../src/Flow/DroppableFlow.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\";\nimport { DragEndEvent, useDndMonitor, useDroppable } from \"@dnd-kit/core\";\nimport { Global } from \"@emotion/react\";\nimport {\n addEdge,\n applyEdgeChanges,\n applyNodeChanges,\n Connection,\n Edge,\n EdgeChange,\n MarkerType,\n Node,\n NodeChange,\n ReactFlow,\n ReactFlowProps,\n} from \"reactflow\";\nimport { uid } from \"uid\";\nimport { ExtractNames, useUniqueId } from \"@hitachivantara/uikit-react-core\";\n\nimport { flowStyles } from \"./base\";\nimport { staticClasses, useClasses } from \"./Flow.styles\";\nimport { useNodeMetaRegistry } from \"./FlowContext/NodeMetaContext\";\nimport { useFlowInstance } from \"./hooks\";\nimport {\n HvFlowNodeInputGroup,\n HvFlowNodeMetaRegistry,\n HvFlowNodeOutputGroup,\n HvFlowNodeTypes,\n} from \"./types\";\n\nexport { staticClasses as flowClasses };\n\nexport type HvFlowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDroppableFlowProps<\n NodeType extends string | undefined = string | undefined,\n NodeData = any,\n> extends Omit<ReactFlowProps, \"nodes\" | \"edges\" | \"nodeTypes\"> {\n /** Flow content: background, controls, and minimap. */\n children?: React.ReactNode;\n /** Flow nodes types. */\n nodeTypes?: HvFlowNodeTypes<NodeData>;\n /** Flow nodes. */\n nodes?: Node<NodeData, NodeType>[];\n /** Flow edges. */\n edges?: Edge[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowClasses;\n /** Callback called when the flow changes. Returns the updated nodes and edges. */\n onFlowChange?: (nodes: Node<NodeData, NodeType>[], edges: Edge[]) => void;\n /**\n * Callback called when a node is dropped in the flow.\n *\n * This callback should be used to override the custom UI Kit drop event.\n * Thus, when defined, the user is responsible for adding nodes to the flow.\n *\n * This callback is called when `HvFlowSidebar` is used or a custom sidebar was created using Dnd Kit.\n * When a custom sidebar was created using the native HTML drag and drop API, refer to the `onDrop` callback.\n *\n * Returns the event and the node to be added to the flow.\n */\n onDndDrop?: (event: DragEndEvent, node: Node) => void;\n}\n\nexport const getNode = (nodes: Node[], nodeId: string) => {\n return nodes.find((n) => n.id === nodeId);\n};\n\nconst validateEdge = (\n nodes: Node[],\n edges: Edge[],\n connection: Connection,\n nodeMetaRegistry: HvFlowNodeMetaRegistry,\n) => {\n const {\n source: sourceId,\n sourceHandle,\n target: targetId,\n targetHandle,\n } = connection;\n\n if (!sourceHandle || !targetHandle || !sourceId || !targetId) return false;\n\n const sourceNode = getNode(nodes, sourceId);\n const targetNode = getNode(nodes, targetId);\n\n if (!sourceNode || !targetNode) return false;\n\n const sourceType = sourceNode.type;\n const targetType = targetNode.type;\n\n if (!sourceType || !targetType) return false;\n\n const inputs = nodeMetaRegistry[targetId]?.inputs || [];\n const outputs = nodeMetaRegistry[sourceId]?.outputs || [];\n\n const source = outputs\n .flatMap((out) => (out as HvFlowNodeOutputGroup).outputs || out)\n .find((out) => out.id === sourceHandle);\n const target = inputs\n .flatMap((inp) => (inp as HvFlowNodeInputGroup).inputs || inp)\n .find((inp) => inp.id === targetHandle);\n\n const sourceProvides = source?.provides || \"\";\n const targetAccepts = target?.accepts || [];\n const sourceMaxConnections = source?.maxConnections;\n const targetMaxConnections = target?.maxConnections;\n\n let isValid =\n targetAccepts.length === 0 || targetAccepts.includes(sourceProvides);\n\n if (isValid && targetMaxConnections != null) {\n const targetConnections = edges.filter(\n (edg) => edg.target === targetId && edg.targetHandle === targetHandle,\n ).length;\n\n isValid = targetConnections < targetMaxConnections;\n }\n\n if (isValid && sourceMaxConnections != null) {\n const sourceConnections = edges.filter(\n (edg) => edg.source === sourceId && edg.sourceHandle === sourceHandle,\n ).length;\n\n isValid = sourceConnections < sourceMaxConnections;\n }\n\n return isValid;\n};\n\nexport const HvDroppableFlow = ({\n id,\n className,\n children,\n onFlowChange,\n onDndDrop,\n classes: classesProp,\n nodes: initialNodes = [],\n edges: initialEdges = [],\n onConnect: onConnectProp,\n onNodesChange: onNodesChangeProp,\n onEdgesChange: onEdgesChangeProp,\n defaultEdgeOptions: defaultEdgeOptionsProp,\n nodeTypes,\n ...others\n}: HvDroppableFlowProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const reactFlowInstance = useFlowInstance();\n\n const [nodes, setNodes] = useState(initialNodes);\n const [edges, setEdges] = useState(initialEdges);\n // Keeping track of nodes and edges for onFlowChange since useState is async\n const nodesRef = useRef(initialNodes);\n const edgesRef = useRef(initialEdges);\n\n const updateNodes = (nds: Node[]) => {\n setNodes(nds);\n nodesRef.current = nds;\n };\n\n const updateEdges = (eds: Edge[]) => {\n setEdges(eds);\n edgesRef.current = eds;\n };\n\n const { setNodeRef } = useDroppable({\n id: elementId,\n });\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n if (event.over?.id !== elementId) return;\n\n const hvFlow = event.active.data.current?.hvFlow;\n const type = hvFlow?.type;\n\n // Only known node types can be dropped in the canvas\n if (!type || !nodeTypes?.[type]) {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(\n `Could not add node to the flow because of unknown type ${type}. Use nodeTypes to define all the node types.`,\n );\n }\n return;\n }\n\n // Position node in the flow\n const position = reactFlowInstance.screenToFlowPosition({\n x: hvFlow?.x || 0,\n y: hvFlow?.y || 0,\n });\n\n // Node data\n const data = {\n nodeLabel: hvFlow?.label,\n ...hvFlow?.data,\n };\n\n // Node to add\n const newNode: Node = {\n id: uid(),\n position,\n data,\n type,\n };\n\n // Drop override\n if (onDndDrop) {\n onDndDrop(event, newNode);\n return;\n }\n\n updateNodes(nodes.concat(newNode));\n },\n [elementId, nodeTypes, nodes, onDndDrop, reactFlowInstance],\n );\n\n useDndMonitor({\n onDragEnd: handleDragEnd,\n });\n\n const handleFlowChange = useCallback(\n (nds: Node[], eds: Edge[]) => {\n // The new flow is returned if the user is not dragging nodes\n // This avoids triggering this handler too many times\n const isDragging = nds.find((node) => node.dragging);\n if (!isDragging) {\n onFlowChange?.(nds, eds);\n }\n },\n [onFlowChange],\n );\n\n const handleConnect = useCallback(\n (connection: Connection) => {\n const eds = addEdge(connection, edgesRef.current);\n updateEdges(eds);\n\n handleFlowChange(nodesRef.current, eds);\n onConnectProp?.(connection);\n },\n [handleFlowChange, onConnectProp],\n );\n\n const handleNodesChange = useCallback(\n (changes: NodeChange[]) => {\n const nds = applyNodeChanges(changes, nodesRef.current);\n updateNodes(nds);\n\n handleFlowChange(nds, edgesRef.current);\n onNodesChangeProp?.(changes);\n },\n [handleFlowChange, onNodesChangeProp],\n );\n\n const handleEdgesChange = useCallback(\n (changes: EdgeChange[]) => {\n const eds = applyEdgeChanges(changes, edgesRef.current);\n updateEdges(eds);\n\n handleFlowChange(nodesRef.current, eds);\n onEdgesChangeProp?.(changes);\n },\n [handleFlowChange, onEdgesChangeProp],\n );\n\n const { registry } = useNodeMetaRegistry();\n\n const isValidConnection: ReactFlowProps[\"isValidConnection\"] = (connection) =>\n validateEdge(nodes, edges, connection, registry);\n\n const defaultEdgeOptions = {\n markerEnd: {\n type: MarkerType.ArrowClosed,\n height: 20,\n width: 20,\n },\n type: \"smoothstep\",\n pathOptions: {\n borderRadius: 40,\n },\n ...defaultEdgeOptionsProp,\n };\n\n return (\n <>\n <Global styles={flowStyles} />\n <div\n id={elementId}\n ref={setNodeRef}\n className={cx(classes.root, className)}\n >\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodesChange={handleNodesChange}\n onEdgesChange={handleEdgesChange}\n onConnect={handleConnect}\n isValidConnection={isValidConnection}\n defaultEdgeOptions={defaultEdgeOptions}\n snapGrid={[1, 1]}\n snapToGrid\n onError={(code, message) => {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(message);\n }\n }}\n {...others}\n >\n {children}\n </ReactFlow>\n </div>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAgEa,MAAA,UAAU,CAAC,OAAe,WAAmB;AACxD,SAAO,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM;AAC1C;AAEA,MAAM,eAAe,CACnB,OACA,OACA,YACA,qBACG;AACG,QAAA;AAAA,IACJ,QAAQ;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EAAA,IACE;AAEA,MAAA,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,CAAC,SAAiB,QAAA;AAE/D,QAAA,aAAa,QAAQ,OAAO,QAAQ;AACpC,QAAA,aAAa,QAAQ,OAAO,QAAQ;AAE1C,MAAI,CAAC,cAAc,CAAC,WAAmB,QAAA;AAEvC,QAAM,aAAa,WAAW;AAC9B,QAAM,aAAa,WAAW;AAE9B,MAAI,CAAC,cAAc,CAAC,WAAmB,QAAA;AAEvC,QAAM,SAAS,iBAAiB,QAAQ,GAAG,UAAU,CAAC;AACtD,QAAM,UAAU,iBAAiB,QAAQ,GAAG,WAAW,CAAC;AAExD,QAAM,SAAS,QACZ,QAAQ,CAAC,QAAS,IAA8B,WAAW,GAAG,EAC9D,KAAK,CAAC,QAAQ,IAAI,OAAO,YAAY;AACxC,QAAM,SAAS,OACZ,QAAQ,CAAC,QAAS,IAA6B,UAAU,GAAG,EAC5D,KAAK,CAAC,QAAQ,IAAI,OAAO,YAAY;AAElC,QAAA,iBAAiB,QAAQ,YAAY;AACrC,QAAA,gBAAgB,QAAQ,WAAW,CAAC;AAC1C,QAAM,uBAAuB,QAAQ;AACrC,QAAM,uBAAuB,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Drag } from "@hitachivantara/uikit-react-icons";
5
5
  import { useClasses } from "./SidebarGroupItem.styles.js";
6
6
  import { staticClasses } from "./SidebarGroupItem.styles.js";
7
- const HvFlowSidebarGroupItem = forwardRef((props, ref) => {
7
+ const HvFlowSidebarGroupItem = forwardRef(function HvFlowSidebarGroupItem2(props, ref) {
8
8
  const {
9
9
  label,
10
10
  isDragging,
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarGroupItem.js","sources":["../../../../../../src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n ExtractNames,\n HvBaseProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Drag } from \"@hitachivantara/uikit-react-icons\";\n\nimport { staticClasses, useClasses } from \"./SidebarGroupItem.styles\";\n\nexport { staticClasses as flowSidebarGroupItemClasses };\n\nexport type HvFlowSidebarGroupItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowSidebarGroupItemProps extends HvBaseProps {\n /** Item label. */\n label: string;\n /** Whether the item is being dragged. */\n isDragging?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupItemClasses;\n}\n\nexport const HvFlowSidebarGroupItem = forwardRef<\n HTMLDivElement,\n HvFlowSidebarGroupItemProps\n>((props, ref) => {\n const {\n label,\n isDragging,\n classes: classesProp,\n className,\n ...others\n } = props;\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n { [classes.dragging]: isDragging },\n className,\n )}\n {...others}\n >\n <HvTypography>{label}</HvTypography>\n <Drag />\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,yBAAyB,WAGpC,CAAC,OAAO,QAAQ;AACV,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,EAAE,CAAC,QAAQ,QAAQ,GAAG,WAAW;AAAA,QACjC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,gBAAc,UAAM,MAAA,CAAA;AAAA,4BACpB,MAAK,CAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACR;AAEJ,CAAC;"}
1
+ {"version":3,"file":"SidebarGroupItem.js","sources":["../../../../../../src/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n ExtractNames,\n HvBaseProps,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Drag } from \"@hitachivantara/uikit-react-icons\";\n\nimport { staticClasses, useClasses } from \"./SidebarGroupItem.styles\";\n\nexport { staticClasses as flowSidebarGroupItemClasses };\n\nexport type HvFlowSidebarGroupItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowSidebarGroupItemProps extends HvBaseProps {\n /** Item label. */\n label: string;\n /** Whether the item is being dragged. */\n isDragging?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowSidebarGroupItemClasses;\n}\n\nexport const HvFlowSidebarGroupItem = forwardRef<\n HTMLDivElement,\n HvFlowSidebarGroupItemProps\n>(function HvFlowSidebarGroupItem(props, ref) {\n const {\n label,\n isDragging,\n classes: classesProp,\n className,\n ...others\n } = props;\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n { [classes.dragging]: isDragging },\n className,\n )}\n {...others}\n >\n <HvTypography>{label}</HvTypography>\n <Drag />\n </div>\n );\n});\n"],"names":["HvFlowSidebarGroupItem"],"mappings":";;;;;;AAuBO,MAAM,yBAAyB,WAGpC,SAASA,wBAAuB,OAAO,KAAK;AACtC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,EAAE,CAAC,QAAQ,QAAQ,GAAG,WAAW;AAAA,QACjC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,gBAAc,UAAM,MAAA,CAAA;AAAA,4BACpB,MAAK,CAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACR;AAEJ,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-lab",
3
- "version": "5.41.13",
3
+ "version": "5.41.15",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Contributed React components for the NEXT UI Kit.",
@@ -33,10 +33,10 @@
33
33
  "@dnd-kit/core": "^6.1.0",
34
34
  "@dnd-kit/modifiers": "^6.0.1",
35
35
  "@emotion/css": "^11.11.0",
36
- "@hitachivantara/uikit-react-core": "^5.82.3",
37
- "@hitachivantara/uikit-react-icons": "^5.13.0",
38
- "@hitachivantara/uikit-react-utils": "^0.2.17",
39
- "@hitachivantara/uikit-styles": "^5.40.2",
36
+ "@hitachivantara/uikit-react-core": "^5.83.0",
37
+ "@hitachivantara/uikit-react-icons": "^5.13.2",
38
+ "@hitachivantara/uikit-react-utils": "^0.2.19",
39
+ "@hitachivantara/uikit-styles": "^5.40.4",
40
40
  "@mui/base": "^5.0.0-beta.40",
41
41
  "@types/react-grid-layout": "^1.3.5",
42
42
  "react-grid-layout": "^1.4.4",
@@ -52,7 +52,7 @@
52
52
  "access": "public",
53
53
  "directory": "package"
54
54
  },
55
- "gitHead": "8c8ff8da3d880c63a34299c6d4593b1865dc60f0",
55
+ "gitHead": "75efe8d1fa16056ea5a0a3f2b895635065b7a3be",
56
56
  "exports": {
57
57
  ".": {
58
58
  "types": "./dist/types/index.d.ts",