refactor(svelte): cleanup node options and props

This commit is contained in:
moklick
2023-03-02 15:31:37 +01:00
parent df6c3381b1
commit 33b9a801fe
15 changed files with 141 additions and 59 deletions
@@ -37,7 +37,10 @@ export function hasSelector(target: Element, selector: string, domNode: Element)
export function getDragItems(nodes: Node[], mousePos: XYPosition, nodeId?: string): NodeDragItem[] {
return nodes
.filter(
(n) => (n.selected || n.id === nodeId) && (!n.parentNode || !isParentSelected(n, nodes))
(n) =>
(n.selected || n.id === nodeId) &&
(n.draggable || n.draggable === undefined) &&
(!n.parentNode || !isParentSelected(n, nodes))
)
.map((n) => ({
id: n.id,