chore(svelte): cleanup

This commit is contained in:
moklick
2023-06-05 16:10:48 +02:00
parent 8354759f57
commit 1b4f4a034e
14 changed files with 44 additions and 44 deletions

View File

@@ -1,13 +1,13 @@
import type { Writable } from 'svelte/store';
import type {
CoordinateExtent,
OnPanZoom,
import {
PanOnScrollMode,
PanZoomInstance,
Transform,
Viewport
XYPanZoom,
type CoordinateExtent,
type OnPanZoom,
type PanZoomInstance,
type Transform,
type Viewport
} from '@xyflow/system';
import { XYPanZoom } from '@xyflow/system';
type ZoomParams = {
transform: Writable<Transform>;

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import { createEventDispatcher, type SvelteComponentTyped } from 'svelte';
import { Position } from '@xyflow/system';
import { getMarkerId } from '@xyflow/system';
import { Position, getMarkerId } from '@xyflow/system';
import { useStore } from '$lib/store';
import BezierEdge from '$lib/components/edges/BezierEdge.svelte';

View File

@@ -1,8 +1,7 @@
<script lang="ts">
import { getContext, createEventDispatcher } from 'svelte';
import cc from 'classcat';
import { Position, type Connection } from '@xyflow/system';
import { XYHandle, isMouseEvent } from '@xyflow/system';
import { Position, type Connection, XYHandle, isMouseEvent } from '@xyflow/system';
import { useStore } from '$lib/store';
import type { HandleComponentProps } from '$lib/types';

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { internalsSymbol } from '@xyflow/system';
import { getPositionWithOrigin } from '@xyflow/system';
import { internalsSymbol, getPositionWithOrigin } from '@xyflow/system';
import { NodeWrapper } from '$lib/components/NodeWrapper';
import { useStore } from '$lib/store';

View File

@@ -30,8 +30,7 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { SelectionMode } from '@xyflow/system';
import { getEventPosition, getNodesInside } from '@xyflow/system';
import { SelectionMode, getEventPosition, getNodesInside } from '@xyflow/system';
import { useStore } from '$lib/store';
import { getConnectedEdges } from '$lib/utils';

View File

@@ -15,7 +15,7 @@
import { Attribution } from '$lib/components/Attribution';
import { useStore } from '$lib/store';
import type { SvelteFlowProps } from './types';
import type { EdgeTypes, NodeTypes } from '$lib/types';
import type { EdgeTypes, NodeTypes } from '$lib/types';
type $$Props = SvelteFlowProps;

View File

@@ -1,13 +1,13 @@
import { get, writable, type Writable } from 'svelte/store';
import type {
Project,
SetCenterOptions,
Viewport,
ViewportHelperFunctionOptions,
XYPosition,
ZoomInOut
import {
pointToRendererPoint,
type Project,
type SetCenterOptions,
type Viewport,
type ViewportHelperFunctionOptions,
type XYPosition,
type ZoomInOut
} from '@xyflow/system';
import { pointToRendererPoint } from '@xyflow/system';
import { useStore } from '$lib/store';
import type { FitViewOptions } from '$lib/types';

View File

@@ -17,8 +17,6 @@ export * from '$lib/utils';
export * from '$lib/hooks/useSvelteFlow';
export * from '@xyflow/system';
export * from '@xyflow/system';
export * from '@xyflow/system';
export default SvelteFlow;

View File

@@ -1,6 +1,13 @@
import { derived } from 'svelte/store';
import { getBezierPath, getSmoothStepPath, getStraightPath } from '@xyflow/system';
import { ConnectionLineType, ConnectionMode, Position, internalsSymbol } from '@xyflow/system';
import {
getBezierPath,
getSmoothStepPath,
getStraightPath,
ConnectionLineType,
ConnectionMode,
Position,
internalsSymbol
} from '@xyflow/system';
import type { SvelteFlowStoreState } from './types';

View File

@@ -1,6 +1,5 @@
import { derived } from 'svelte/store';
import { Position } from '@xyflow/system';
import { getHandle } from '@xyflow/system';
import { Position, getHandle } from '@xyflow/system';
import { getEdgePositions, getNodeData } from '$lib/container/EdgeRenderer/utils';
import type { EdgeLayouted } from '$lib/types';

View File

@@ -1,26 +1,24 @@
import { getContext } from 'svelte';
import { derived, get } from 'svelte/store';
import {
internalsSymbol,
createMarkerIds,
fitView as fitViewUtil,
getDimensions,
getElementsToRemove,
getHandleBounds,
infiniteExtent,
type UpdateNodePositions,
type NodeDimensionUpdate,
internalsSymbol,
type ViewportHelperFunctionOptions,
type Connection,
type XYPosition,
type CoordinateExtent,
type UpdateConnection
} from '@xyflow/system';
import {
createMarkerIds,
fitView as fitViewUtil,
getDimensions,
getElementsToRemove,
getHandleBounds,
infiniteExtent
} from '@xyflow/system';
import { addEdge as addEdgeUtil } from '$lib/utils';
import type { EdgeTypes, NodeTypes, Node, Edge, ConnectionData, FitViewOptions } from '$lib/types';
import type { EdgeTypes, NodeTypes, Node, Edge, FitViewOptions } from '$lib/types';
import { getEdgesLayouted } from './edges-layouted';
import { getConnectionPath } from './connection-path';
import {

View File

@@ -1,5 +1,6 @@
import { readable, writable } from 'svelte/store';
import {
infiniteExtent,
SelectionMode,
ConnectionMode,
ConnectionLineType,
@@ -20,7 +21,6 @@ import StraightEdge from '$lib/components/edges/StraightEdge.svelte';
import SmoothStepEdge from '$lib/components/edges/SmoothStepEdge.svelte';
import StepEdge from '$lib/components/edges/StepEdge.svelte';
import type { ConnectionData, NodeTypes, EdgeTypes, EdgeLayouted, Edge, Node } from '$lib/types';
import { infiniteExtent } from '@xyflow/system';
export const initConnectionData = {
connectionStartHandle: null,

View File

@@ -1,3 +1,4 @@
import type { Writable } from 'svelte/store';
import type {
NodeDimensionUpdate,
XYPosition,
@@ -10,7 +11,6 @@ import type {
import type { initialStoreState } from './initial-store';
import type { Node, Edge, NodeTypes, EdgeTypes, FitViewOptions } from '$lib/types';
import type { Writable } from 'svelte/store';
export type SvelteFlowStoreActions = {
setNodeTypes: (nodeTypes: NodeTypes) => void;

View File

@@ -8,9 +8,11 @@ import {
updateEdgeBase,
getConnectedEdgesBase,
isNumeric,
getNodePositionWithOrigin
getNodePositionWithOrigin,
internalsSymbol,
type XYZPosition
} from '@xyflow/system';
import { internalsSymbol, type XYZPosition } from '@xyflow/system';
import type { DefaultEdgeOptions, DefaultNodeOptions, Edge, Node } from '$lib/types';
export const isNode = isNodeBase<Node, Edge>;