refactor(react/svelte): cleanup types
This commit is contained in:
@@ -3,18 +3,9 @@ import { zoomIdentity } from 'd3-zoom';
|
||||
import { clampPosition, getDimensions, fitView } from '@reactflow/utils';
|
||||
import {
|
||||
internalsSymbol,
|
||||
type ReactFlowState,
|
||||
type Node,
|
||||
type Edge,
|
||||
type NodeDimensionUpdate,
|
||||
type CoordinateExtent,
|
||||
type NodeDimensionChange,
|
||||
type EdgeSelectionChange,
|
||||
type NodeSelectionChange,
|
||||
type NodePositionChange,
|
||||
type NodeDragItem,
|
||||
type UnselectNodesAndEdgesParams,
|
||||
type NodeChange,
|
||||
type XYPosition,
|
||||
} from '@reactflow/system';
|
||||
|
||||
@@ -22,6 +13,17 @@ import { applyNodeChanges, createSelectionChange, getSelectionChanges } from '..
|
||||
import { getHandleBounds } from '../components/Nodes/utils';
|
||||
import { createNodeInternals, updateAbsoluteNodePositions, updateNodesAndEdgesSelections } from './utils';
|
||||
import initialState from './initialState';
|
||||
import type {
|
||||
ReactFlowState,
|
||||
Node,
|
||||
Edge,
|
||||
NodeDimensionChange,
|
||||
EdgeSelectionChange,
|
||||
NodeSelectionChange,
|
||||
NodePositionChange,
|
||||
UnselectNodesAndEdgesParams,
|
||||
NodeChange,
|
||||
} from '../types';
|
||||
|
||||
const createRFStore = () =>
|
||||
createStore<ReactFlowState>((set, get) => ({
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { devWarn } from '@reactflow/utils';
|
||||
import { ConnectionMode, type CoordinateExtent, type ReactFlowStore } from '@reactflow/system';
|
||||
import { devWarn, infiniteExtent } from '@reactflow/utils';
|
||||
import { ConnectionMode } from '@reactflow/system';
|
||||
|
||||
export const infiniteExtent: CoordinateExtent = [
|
||||
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
||||
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
|
||||
];
|
||||
import type { ReactFlowStore } from '../types';
|
||||
|
||||
const initialState: ReactFlowStore = {
|
||||
rfId: '1',
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
import type { StoreApi } from 'zustand';
|
||||
import {
|
||||
internalsSymbol,
|
||||
type Edge,
|
||||
type EdgeSelectionChange,
|
||||
type Node,
|
||||
type NodeInternals,
|
||||
type NodeSelectionChange,
|
||||
type ReactFlowState,
|
||||
type XYZPosition,
|
||||
type NodeOrigin,
|
||||
} from '@reactflow/system';
|
||||
import { internalsSymbol, type XYZPosition, type NodeOrigin } from '@reactflow/system';
|
||||
import { isNumeric, getNodePositionWithOrigin } from '@reactflow/utils';
|
||||
|
||||
import type { Edge, EdgeSelectionChange, Node, NodeInternals, NodeSelectionChange, ReactFlowState } from '../types';
|
||||
|
||||
type ParentNodes = Record<string, boolean>;
|
||||
|
||||
function calculateXYZPosition(
|
||||
|
||||
Reference in New Issue
Block a user