chore(svelte): cleanup
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
## 0.0.22
|
||||
|
||||
- add `connectionLine` slot for rendering a custom connection line
|
||||
- add `connectionLineStyle` and `connectionLineContainerStyle` props
|
||||
- add `useConnection` hook
|
||||
- add `nodeDragThreshold` prop
|
||||
- add `fitViewOptions` prop
|
||||
- add `defaultEdgeOptions` prop
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
export let containerStyle: string = '';
|
||||
export let style: string = '';
|
||||
export let usingCustomLine: boolean = false;
|
||||
export let isCustomComponent: boolean = false;
|
||||
|
||||
const { width, height, connection } = useStore();
|
||||
</script>
|
||||
@@ -15,7 +15,7 @@
|
||||
<g class={cc(['svelte-flow__connection', $connection.status])} {style}>
|
||||
<slot name="connectionLine" />
|
||||
<!-- slot fallbacks do not work if slots are forwarded in parent -->
|
||||
{#if !usingCustomLine}
|
||||
{#if !isCustomComponent}
|
||||
<path d={$connection.path} fill="none" class="svelte-flow__connection-path" />
|
||||
{/if}
|
||||
</g>
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
<ConnectionLine
|
||||
containerStyle={connectionLineContainerStyle}
|
||||
style={connectionLineStyle}
|
||||
usingCustomLine={$$slots.connectionLine}
|
||||
isCustomComponent={$$slots.connectionLine}
|
||||
>
|
||||
<slot name="connectionLine" slot="connectionLine" />
|
||||
</ConnectionLine>
|
||||
|
||||
@@ -95,9 +95,7 @@ export function useSvelteFlow(): {
|
||||
{ duration: options?.duration }
|
||||
);
|
||||
},
|
||||
fitView: (fitViewOptions?: FitViewOptions) => {
|
||||
fitView(get(nodes), fitViewOptions);
|
||||
},
|
||||
fitView,
|
||||
project: (position: XYPosition) => {
|
||||
const _snapGrid = get(snapGrid);
|
||||
return pointToRendererPoint(
|
||||
|
||||
@@ -23,7 +23,7 @@ export type SvelteFlowStoreActions = {
|
||||
setMinZoom: (minZoom: number) => void;
|
||||
setMaxZoom: (maxZoom: number) => void;
|
||||
setTranslateExtent: (extent: CoordinateExtent) => void;
|
||||
fitView: (nodes: Node[], options?: FitViewOptions) => boolean;
|
||||
fitView: (options?: FitViewOptions) => boolean;
|
||||
updateNodePositions: UpdateNodePositions;
|
||||
updateNodeDimensions: (updates: NodeDimensionUpdate[]) => void;
|
||||
unselectNodesAndEdges: () => void;
|
||||
|
||||
Reference in New Issue
Block a user