refactor(node-wrapper): add separate folder

This commit is contained in:
moklick
2023-12-16 09:55:30 +01:00
parent b861b47783
commit 20c779f57d
4 changed files with 12 additions and 11 deletions
@@ -8,7 +8,6 @@ import {
internalsSymbol,
isInputDOMNode,
NodeProps,
type XYPosition,
} from '@xyflow/system';
import { useStore, useStoreApi } from '../../hooks/useStore';
@@ -16,15 +15,9 @@ import { Provider } from '../../contexts/NodeIdContext';
import { ARIA_NODE_DESC_KEY } from '../A11yDescriptions';
import useDrag from '../../hooks/useDrag';
import useUpdateNodePositions from '../../hooks/useUpdateNodePositions';
import { handleNodeClick } from './utils';
import { handleNodeClick } from '../Nodes/utils';
import type { NodeWrapperProps } from '../../types';
export const arrowKeyDiffs: Record<string, XYPosition> = {
ArrowUp: { x: 0, y: -1 },
ArrowDown: { x: 0, y: 1 },
ArrowLeft: { x: -1, y: 0 },
ArrowRight: { x: 1, y: 0 },
};
import { arrowKeyDiffs } from './utils';
const NodeWrapper = ({
id,
@@ -0,0 +1,8 @@
import { XYPosition } from '@xyflow/system';
export const arrowKeyDiffs: Record<string, XYPosition> = {
ArrowUp: { x: 0, y: -1 },
ArrowDown: { x: 0, y: 1 },
ArrowLeft: { x: -1, y: 0 },
ArrowRight: { x: 1, y: 0 },
};
@@ -10,9 +10,9 @@ import { getNodesBounds } from '@xyflow/system';
import { useStore, useStoreApi } from '../../hooks/useStore';
import useDrag from '../../hooks/useDrag';
import { arrowKeyDiffs } from '../Nodes/wrapNode';
import useUpdateNodePositions from '../../hooks/useUpdateNodePositions';
import type { Node, ReactFlowState } from '../../types';
import { arrowKeyDiffs } from '../NodeWrapper/utils';
export type NodesSelectionProps = {
onSelectionContextMenu?: (event: MouseEvent, nodes: Node[]) => void;