merge next

This commit is contained in:
peterkogo
2024-01-30 12:36:04 +01:00
54 changed files with 718 additions and 167 deletions
@@ -34,7 +34,7 @@
// See of connection landed inside the flow pane
const targetIsPane = (event.target as HTMLDivElement)?.classList.contains('svelte-flow__pane');
if (targetIsPane) {
if (targetIsPane && 'clientX' in event && 'clientY' in event) {
const id = getId();
const position = {
x: event.clientX,
@@ -22,6 +22,7 @@
import CustomEdge from './CustomEdge.svelte';
import '@xyflow/svelte/dist/style.css';
import InitTracker from './InitTracker.svelte';
const nodeTypes: NodeTypes = {
custom: CustomNode,
@@ -148,6 +149,7 @@
selectionMode={SelectionMode.Full}
initialViewport={{ x: 100, y: 100, zoom: 2 }}
snapGrid={[25, 25]}
oninit={() => console.log('on init')}
on:nodeclick={(event) => console.log('on node click', event)}
on:nodemouseenter={(event) => console.log('on node enter', event)}
on:nodemouseleave={(event) => console.log('on node leave', event)}
@@ -207,6 +209,8 @@
}}>hide/unhide</button
>
</Panel>
<InitTracker />
</SvelteFlow>
<style>
@@ -0,0 +1,18 @@
<script lang="ts">
import { useNodesInitialized, useInitialized } from '@xyflow/svelte';
const nodesInitialized = useNodesInitialized();
const initialized = useInitialized();
$: {
if (nodesInitialized) {
console.log('nodes initialized');
}
}
$: {
if (initialized) {
console.log('initialized');
}
}
</script>