removed defaultNodeOptions again

This commit is contained in:
peterkogo
2025-01-07 10:41:21 +01:00
parent 56ef230428
commit e62c496a77
7 changed files with 9 additions and 54 deletions
@@ -122,12 +122,12 @@
if (!isSelecting || !containerBounds || !store.selectionRect) {
return;
}
const start = performance.now();
selectionInProgress = true;
const mousePos = getEventPosition(event, containerBounds);
const startX = store.selectionRect.startX ?? 0;
const startY = store.selectionRect.startY ?? 0;
const { startX = 0, startY = 0 } = store.selectionRect;
const nextUserSelectRect = {
...store.selectionRect,
x: mousePos.x < startX ? mousePos.x : startX,
@@ -145,8 +145,7 @@
nextUserSelectRect,
[store.viewport.x, store.viewport.y, store.viewport.zoom],
store.selectionMode === SelectionMode.Partial,
true,
store.defaultNodeOptions.selectable
true
).map((n) => n.id)
);
@@ -174,9 +173,6 @@
store.selectionRectMode = 'user';
store.selectionRect = nextUserSelectRect;
const end = performance.now();
// console.log('onPointerMove', end - start);
}
function onPointerUp(event: PointerEvent) {
@@ -32,8 +32,7 @@ import type {
OnDelete,
OnEdgeCreate,
OnBeforeDelete,
IsValidConnection,
DefaultNodeOptions
IsValidConnection
} from '$lib/types';
import type { Snippet } from 'svelte';
@@ -303,22 +302,6 @@ export type SvelteFlowProps = NodeEvents &
* }
*/
defaultEdgeOptions?: DefaultEdgeOptions;
/** Defaults to be applied to all new nodes that are added to the flow.
*
* Properties on a new nodes will override these defaults if they exist.
* @example
* const defaultNodeOptions = {
* type: 'customNodeType',
* position: {x: 0, y: 0}
* data: { label: 'custom label' },
* hidden: false,
* deletable: true,
* selected: false,
* focusable: true,
* zIndex: 12,
* }
*/
defaultNodeOptions?: DefaultNodeOptions;
/** Sets a fixed width for the flow */
width?: number;
/** Sets a fixed height for the flow */