refactor(svelte): cleanup components
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import EdgeWrapper from '$lib/components/edges/EdgeWrapper.svelte';
|
||||
import { EdgeWrapper } from '$lib/components/EdgeWrapper';
|
||||
import { useStore } from '$lib/store';
|
||||
|
||||
const { edgesLayouted, width, height } = useStore();
|
||||
@@ -0,0 +1 @@
|
||||
export { default as EdgeRenderer } from './EdgeRenderer.svelte';
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
import NodeWrapper from '$lib/components/nodes/NodeWrapper.svelte';
|
||||
import { NodeWrapper } from '$lib/components/NodeWrapper';
|
||||
import { useStore } from '$lib/store';
|
||||
|
||||
const { nodes, updateNodeDimensions } = useStore();
|
||||
@@ -0,0 +1 @@
|
||||
export { default as NodeRenderer } from './NodeRenderer.svelte';
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Pane } from './Pane.svelte';
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import cc from 'classcat';
|
||||
import type { PanelProps } from './Panel';
|
||||
import type { PanelProps } from './types';
|
||||
|
||||
interface $$Props extends PanelProps {}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as Panel } from './Panel.svelte';
|
||||
export type { PanelProps } from './types';
|
||||
+9
-8
@@ -4,16 +4,16 @@
|
||||
import cc from 'classcat';
|
||||
|
||||
import { key, createStore } from '$lib/store';
|
||||
import Zoom from '$lib/container/Zoom/index.svelte';
|
||||
import Pane from '$lib/container/Pane/index.svelte';
|
||||
import Viewport from '$lib/container/Viewport.svelte';
|
||||
import NodeRenderer from '$lib/container/NodeRenderer/index.svelte';
|
||||
import EdgeRenderer from '$lib/container/EdgeRenderer/index.svelte';
|
||||
import UserSelection from '$lib/components/UserSelection/index.svelte';
|
||||
import NodeSelection from '$lib/components/NodeSelection/index.svelte';
|
||||
import { Zoom } from '$lib/container/Zoom';
|
||||
import { Pane } from '$lib/container/Pane';
|
||||
import { Viewport } from '$lib/container/Viewport';
|
||||
import { NodeRenderer } from '$lib/container/NodeRenderer';
|
||||
import { EdgeRenderer } from '$lib/container/EdgeRenderer';
|
||||
import { UserSelection } from '$lib/components/UserSelection';
|
||||
import { NodeSelection } from '$lib/components/NodeSelection';
|
||||
import { KeyHandler } from '$lib/components/KeyHandler';
|
||||
import { ConnectionLine } from '$lib/components/ConnectionLine';
|
||||
import type { SvelteFlowProps } from '$lib/types';
|
||||
import type { SvelteFlowProps } from './types';
|
||||
|
||||
type $$Props = SvelteFlowProps;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
nodeTypes
|
||||
});
|
||||
|
||||
|
||||
setContext(key, {
|
||||
getStore: () => store
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as SvelteFlow } from './SvelteFlow.svelte';
|
||||
export type { SvelteFlowProps } from './types';
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { ConnectionLineType } from '@reactflow/system';
|
||||
|
||||
import type { Edge, Node, NodeTypes, KeyDefinition } from '$lib/types';
|
||||
|
||||
export type SvelteFlowProps = {
|
||||
nodes: Node[];
|
||||
edges: Edge[];
|
||||
|
||||
connectionLineType?: ConnectionLineType;
|
||||
selectionKey?: KeyDefinition;
|
||||
deleteKey?: KeyDefinition;
|
||||
nodeTypes?: NodeTypes;
|
||||
fitView?: boolean;
|
||||
class?: string;
|
||||
style?: string;
|
||||
id?: string;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Viewport } from './Viewport.svelte';
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Zoom } from './Zoom.svelte';
|
||||
Reference in New Issue
Block a user