chore(system): rename BaseNode/BaseEdge types to NodeBase/EdgeBase

This commit is contained in:
moklick
2023-06-13 16:54:26 +02:00
parent 65d1c3bbd4
commit 9dfec49ed5
25 changed files with 499 additions and 550 deletions
+6 -2
View File
@@ -13,7 +13,9 @@ import {
type Connection,
type XYPosition,
type CoordinateExtent,
type UpdateConnection
type UpdateConnection,
type NodeBase,
type NodeDragItem
} from '@xyflow/system';
import { addEdge as addEdgeUtil } from '$lib/utils';
@@ -57,7 +59,9 @@ export function createStore(): SvelteFlowStore {
const updateNodePositions: UpdateNodePositions = (nodeDragItems, dragging = false) => {
store.nodes.update((nds) => {
return nds.map((n) => {
const nodeDragItem = nodeDragItems.find((ndi) => ndi.id === n.id);
const nodeDragItem = (nodeDragItems as Array<NodeBase | NodeDragItem>).find(
(ndi) => ndi.id === n.id
);
if (nodeDragItem) {
return {