chore(svelte): use prettier

This commit is contained in:
moklick
2023-06-06 15:46:19 +02:00
parent c4e98dd420
commit 84603bd966
34 changed files with 335 additions and 330 deletions
@@ -8,14 +8,18 @@
export let position: AttributionProps['position'] = 'bottom-right';
</script>
{#if !proOptions?.hideAttribution}
<Panel
position={position}
{position}
class="svelte-flow__attribution"
data-message="Please only hide this attribution when you are subscribed to Svelte Flow Pro: https://pro.reactflow.dev"
>
<a href="https://reactflow.dev/svelte" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">
<a
href="https://reactflow.dev/svelte"
target="_blank"
rel="noopener noreferrer"
aria-label="Svelte Flow attribution"
>
Svelte Flow
</a>
</Panel>
@@ -33,4 +37,4 @@
text-decoration: none;
color: #999;
}
</style>
</style>
@@ -18,12 +18,12 @@
<path
d={path}
id={id}
{id}
fill="none"
class="svelte-flow__edge-path"
marker-start={markerStart}
marker-end={markerEnd}
style={style}
{style}
/>
{#if interactionWidth}
@@ -29,8 +29,8 @@
export let markerEnd: $$Props['markerEnd'] = undefined;
export let sourceHandleId: $$Props['sourceHandleId'] = undefined;
export let targetHandleId: $$Props['targetHandleId'] = undefined;
// @ todo: support edge updates
// @ todo: support edge updates
const { edges, edgeTypes, flowId, addSelectedEdges } = useStore();
const dispatch = createEventDispatcher();
@@ -45,19 +45,13 @@
addSelectedEdges([id]);
}
const edge = $edges.find(e => e.id === id);
const edge = $edges.find((e) => e.id === id);
dispatch('edge:click', edge);
}
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<g
class="svelte-flow__edge"
class:animated
class:selected
data-id={id}
on:click={onClick}
>
<g class="svelte-flow__edge" class:animated class:selected data-id={id} on:click={onClick}>
<svelte:component
this={edgeComponent}
{id}
@@ -25,7 +25,7 @@
const handleId = id || null;
const dispatch = createEventDispatcher();
const store = useStore();
const {
connectionMode,
@@ -38,7 +38,7 @@
addEdge,
panBy,
cancelConnection,
updateConnection,
updateConnection
} = store;
function dispatchEvent(eventName: string, params?: Connection) {
@@ -47,7 +47,7 @@
function onConnectExtended(params: Connection) {
addEdge(params);
dispatchEvent('connect', params)
dispatchEvent('connect', params);
}
function onPointerDown(event: MouseEvent | TouchEvent) {
@@ -69,7 +69,7 @@
cancelConnection,
panBy,
onConnect: onConnectExtended,
getTransform: () => $transform,
getTransform: () => $transform
});
}
}
@@ -1,5 +1,4 @@
<script lang="ts">
import { createEventDispatcher, onMount, setContext, SvelteComponentTyped } from 'svelte';
import cc from 'classcat';
import { errorMessages, type NodeProps } from '@xyflow/system';
@@ -59,7 +58,7 @@
});
function dispatchEvent(eventName: string) {
const node = $nodes.find(n => n.id === id);
const node = $nodes.find((n) => n.id === id);
dispatch(eventName, node);
}
@@ -69,13 +68,20 @@
addSelectedNodes([id]);
}
dispatchEvent('node:click')
dispatchEvent('node:click');
}
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
use:drag={{ nodeId: id, isSelectable: selectable, disabled: false, handleSelector: undefined, noDragClassName: 'nodrag', store }}
use:drag={{
nodeId: id,
isSelectable: selectable,
disabled: false,
handleSelector: undefined,
noDragClassName: 'nodrag',
store
}}
bind:this={nodeRef}
data-id={id}
class={cc(['svelte-flow__node', `svelte-flow__node-${type || 'default'}`, className])}
@@ -1,8 +1,8 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { createStoreContext } from '$lib/store';
const store = createStoreContext();
onDestroy(() => {
@@ -28,4 +28,3 @@
interactionWidth={$$props.interactionWidth}
style={$$props.style}
/>
@@ -26,4 +26,3 @@
interactionWidth={$$props.interactionWidth}
style={$$props.style}
/>
@@ -17,4 +17,3 @@
<Handle type="target" position={targetPosition} on:connect:start on:connect on:connect:end />
{data?.label}
<Handle type="source" position={sourcePosition} on:connect:start on:connect on:connect:end />