refactor(types)!: Remove ElementId type

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent fe0eeaeae9
commit f00f34d84b
28 changed files with 99 additions and 150 deletions
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { ElementId, FlowElement, FlowElements, GraphEdge, KeyCode } from '../../types'
import { FlowElement, FlowElements, GraphEdge, KeyCode } from '../../types'
import { useStore, useKeyPress } from '../../composables'
import { getConnectedEdges, isGraphNode } from '../../utils'
import NodesSelection from '../../components/NodesSelection/NodesSelection.vue'
@@ -44,7 +44,7 @@ tryOnMounted(() => {
const connectedEdges = getConnectedEdges(selectedNodes, props.edges)
const elementsToRemove = [...props.selectedElements, ...connectedEdges].reduce(
(res, item) => res.set(item.id, item),
new Map<ElementId, FlowElement>(),
new Map<string, FlowElement>(),
)
store.hooks.elementsRemove.trigger(Array.from(elementsToRemove.values()))