fix linting, formatting
This commit is contained in:
@@ -110,6 +110,7 @@
|
||||
let prevConnections: Map<string, HandleConnection> | null = null;
|
||||
$effect.pre(() => {
|
||||
// connectionLookup is not reactive, so we use edges to get notified about updates
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
$edges;
|
||||
if (onconnect || ondisconnect) {
|
||||
let connections = $connectionLookup.get(`${nodeId}-${type}-${handleId}`);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
let bounds: Rect | null = $derived.by(() => {
|
||||
if ($selectionRectMode === 'nodes') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
$nodes;
|
||||
return getInternalNodesBounds($nodeLookup, { filter: (node) => !!node.selected });
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { setContext, onDestroy } from 'svelte';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { get } from 'svelte/store';
|
||||
import cc from 'classcat';
|
||||
import { errorMessages, Position } from '@xyflow/system';
|
||||
|
||||
@@ -132,12 +132,13 @@
|
||||
|
||||
// TODO: extract this part!
|
||||
$effect(() => {
|
||||
// TODO: HOLY MOLY! changing the order of the initialized breaks effect subscriptions
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
||||
if (resizeObserver && (!initialized || nodeRef !== prevNodeRef)) {
|
||||
prevNodeRef && resizeObserver.unobserve(prevNodeRef);
|
||||
nodeRef && resizeObserver.observe(nodeRef);
|
||||
prevNodeRef = nodeRef;
|
||||
}
|
||||
/* eslint-enable @typescript-eslint/no-unused-expressions */
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
initialWidth,
|
||||
initialHeight,
|
||||
nodeOrigin,
|
||||
fitView
|
||||
fitView,
|
||||
children
|
||||
}: SvelteFlowProviderProps = $props();
|
||||
|
||||
const store = createStore({
|
||||
@@ -31,4 +32,4 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
{@render children?.()}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { Edge, Node } from '$lib/types';
|
||||
import type { Snippet } from 'svelte';
|
||||
import type { NodeOrigin } from '@xyflow/system';
|
||||
import type { Edge, Node } from '$lib/types';
|
||||
|
||||
export type SvelteFlowProviderProps = {
|
||||
initialNodes?: Node[];
|
||||
@@ -8,4 +9,5 @@ export type SvelteFlowProviderProps = {
|
||||
initialHeight?: number;
|
||||
fitView?: boolean;
|
||||
nodeOrigin?: NodeOrigin;
|
||||
children?: Snippet;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { NodeProps } from '$lib/types';
|
||||
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
let {}: NodeProps = $props();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user