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