chore(svelte): cleanup examples

This commit is contained in:
moklick
2023-06-15 15:16:33 +02:00
parent 019dab3be1
commit f35ddc485c
9 changed files with 14 additions and 291 deletions
@@ -5,13 +5,9 @@
interface $$Props extends NodeProps<{ label: string }> {}
export let id: $$Props['id'];
export let data: $$Props['data'] = { label: 'Node' };
export let targetPosition: $$Props['targetPosition'] = Position.Top;
export let sourcePosition: $$Props['sourcePosition'] = Position.Bottom;
export let xPos: $$Props['xPos'];
export let yPos: $$Props['yPos'];
export let selected: $$Props['selected'] = false;
</script>
<Handle type="target" position={targetPosition} on:connect:start on:connect on:connect:end />
@@ -5,13 +5,8 @@
interface $$Props extends NodeProps<{ label: string }> {}
export let id: $$Props['id'];
export let data: $$Props['data'] = { label: 'Node' };
export let targetPosition: $$Props['targetPosition'] = Position.Top;
export let sourcePosition: $$Props['sourcePosition'] = Position.Bottom;
export let xPos: $$Props['xPos'];
export let yPos: $$Props['yPos'];
export let selected: $$Props['selected'] = false;
</script>
{data?.label}
@@ -5,13 +5,8 @@
interface $$Props extends NodeProps<{ label: string }> {}
export let id: $$Props['id'];
export let data: $$Props['data'] = { label: 'Node' };
export let targetPosition: $$Props['targetPosition'] = Position.Top;
export let sourcePosition: $$Props['sourcePosition'] = Position.Bottom;
export let xPos: $$Props['xPos'];
export let yPos: $$Props['yPos'];
export let selected: $$Props['selected'] = false;
</script>
{data?.label}
+1
View File
@@ -53,6 +53,7 @@ export {
SelectionMode,
type SelectionRect,
type OnError,
type NodeProps,
type NodeOrigin,
type OnNodeDrag,
type OnSelectionDrag,
@@ -1,10 +1,9 @@
<script lang="ts">
import { Position } from '@xyflow/system';
import { Handle } from '../../../lib/index';
import { Handle, Position, type NodeProps } from '../../../lib/index';
type $$Props = NodeProps;
export let data: { color: string; onChange: () => void } = { color: '#111', onChange: () => {} };
export let xPos: number = 0;
export let yPos: number = 0;
</script>
<Handle type="target" position={Position.Left} />
@@ -1,5 +1,7 @@
<script lang="ts">
import { Handle, Position } from '../../../lib/index';
import { Handle, Position, type NodeProps } from '../../../lib/index';
type $$Props = NodeProps;
export let data: { label: string } = { label: 'Node' };
export let xPos: number = 0;
@@ -1,5 +1,7 @@
<script lang="ts">
import { Handle, Position } from '../../../lib/index';
import { Handle, Position, type NodeProps } from '../../../lib/index';
type $$Props = NodeProps;
export let id: string;
export let xPos: number = 0;
@@ -14,7 +16,6 @@
</div>
<Handle type="source" position={Position.Bottom} />
<style>
.custom {
background: #ffcc00;