chore(core): remove unnecessary import paths

This commit is contained in:
braks
2022-11-06 19:20:39 +01:00
committed by Braks
parent f9af2d36fd
commit 650e7527ae
20 changed files with 13 additions and 39 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { Background, Controls, MiniMap } from '@vue-flow/additional-components'
import type { Elements } from '@vue-flow/core'
import { VueFlow, isNode, useVueFlow } from '~/index'
import { VueFlow, isNode, useVueFlow } from '@vue-flow/core'
const elements = ref<Elements>([
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
+7 -1
View File
@@ -42,7 +42,7 @@ declare global {
const createEventHook: typeof import('@vueuse/core')['createEventHook']
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
const createGraphNodes: typeof import('./utils/store')['createGraphNodes']
const createHooks: typeof import('./store/hooks')['createHooks']
const createHooks: typeof import('./store/index')['createHooks']
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
const createRemoveChange: typeof import('./utils/changes')['createRemoveChange']
@@ -59,6 +59,8 @@ declare global {
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope']
const extendRef: typeof import('@vueuse/core')['extendRef']
const getBezierEdgeCenter: typeof import('./components/Edges/utils/general')['getBezierEdgeCenter']
const getBezierPath: typeof import('./components/Edges/utils/bezier')['getBezierPath']
const getBoundsofRects: typeof import('./utils/graph')['getBoundsofRects']
const getConnectedEdges: typeof import('./utils/graph')['getConnectedEdges']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
@@ -79,6 +81,10 @@ declare global {
const getOverlappingArea: typeof import('./utils/graph')['getOverlappingArea']
const getRectOfNodes: typeof import('./utils/graph')['getRectOfNodes']
const getSelectionChanges: typeof import('./utils/changes')['getSelectionChanges']
const getSimpleBezierPath: typeof import('./components/Edges/utils/simple-bezier')['getSimpleBezierPath']
const getSimpleEdgeCenter: typeof import('./components/Edges/utils/general')['getSimpleEdgeCenter']
const getSmoothStepPath: typeof import('./components/Edges/utils/smoothstep')['getSmoothStepPath']
const getStraightPath: typeof import('./components/Edges/utils/straight')['getStraightPath']
const getTransformForBounds: typeof import('./utils/graph')['getTransformForBounds']
const getXYZPos: typeof import('./utils/graph')['getXYZPos']
const getters: typeof import('./store/getters')['default']
@@ -1,9 +1,6 @@
<script lang="ts" setup>
import { getBezierPath, getSimpleBezierPath, getSmoothStepPath } from '../Edges/utils'
import type { GraphNode, HandleElement } from '../../types'
import { ConnectionLineType, Position } from '../../types'
import { useVueFlow } from '../../composables'
import { Slots } from '../../context'
import { getMarkerId } from '../../utils'
const { sourceNode } = defineProps<{
@@ -1,5 +1,4 @@
import type { FunctionalComponent } from 'vue'
import { getBezierPath } from './utils'
import BaseEdge from './BaseEdge'
import { Position } from '~/types'
import type { EdgeProps } from '~/types'
@@ -1,9 +1,7 @@
<script lang="ts" setup>
import { useVueFlow } from '../../composables'
const { viewportRef } = useVueFlow()
const teleportTarget = $computed(() => viewportRef.value?.getElementsByClassName('vue-flow__edge-labels')[0])
const teleportTarget = computed(() => viewportRef.value?.getElementsByClassName('vue-flow__edge-labels')[0])
</script>
<script lang="ts">
@@ -1,5 +1,4 @@
import type { FunctionalComponent } from 'vue'
import { getSimpleBezierPath } from './utils'
import BaseEdge from './BaseEdge'
import { Position } from '~/types'
import type { EdgeProps } from '~/types'
@@ -1,5 +1,4 @@
import type { FunctionalComponent } from 'vue'
import { getSmoothStepPath } from './utils'
import BaseEdge from './BaseEdge'
import type { SmoothStepEdgeProps } from '~/types'
import { Position } from '~/types'
@@ -1,6 +1,5 @@
import type { FunctionalComponent } from 'vue'
import BaseEdge from './BaseEdge'
import { getStraightPath } from './utils'
import type { EdgeProps } from '~/types'
const StraightEdge: FunctionalComponent<EdgeProps> = function ({
@@ -1,9 +1,6 @@
import EdgeAnchor from './EdgeAnchor'
import type { Connection, EdgeComponent, EdgeUpdatable, GraphEdge, GraphNode, HandleType } from '~/types'
import { ConnectionMode, Position } from '~/types'
import { connectionExists, getEdgePositions, getHandle, getMarkerId } from '~/utils'
import { EdgeId, EdgeRef } from '~/context'
import { useEdgeHooks, useHandle, useVueFlow } from '~/composables'
interface Props {
id: string
@@ -1,9 +1,7 @@
<script lang="ts" setup>
import { isFunction, isString } from '@vueuse/core'
import { useHandle, useNode, useVueFlow } from '../../composables'
import type { Position } from '../../types'
import type { HandleProps } from '../../types/handle'
import { getDimensions } from '../../utils'
const { position = 'top' as Position, connectable, id, isValidConnection, ...props } = defineProps<HandleProps>()
@@ -1,9 +1,5 @@
<script lang="ts" setup>
import { useVModel } from '@vueuse/core'
import { useDrag, useNodeHooks, useVueFlow } from '../../composables'
import type { GraphNode, HandleConnectable, NodeComponent, SnapGrid, XYZPosition } from '../../types'
import { NodeId, NodeRef } from '../../context'
import { getConnectedEdges, getXYZPos, handleNodeClick } from '../../utils'
const { id, type, name, draggable, selectable, connectable, ...props } = defineProps<{
id: string
@@ -1,7 +1,4 @@
<script lang="ts" setup>
import { useDrag, useVueFlow } from '../../composables'
import { getRectOfNodes } from '../../utils'
const { emits, setState, viewport, getSelectedNodes, snapToGrid, snapGrid, noPanClassName } = $(useVueFlow())
const el = ref()
@@ -1,7 +1,5 @@
<script lang="ts" setup>
import { useVueFlow } from '../../composables'
import type { SelectionRect as Rect } from '../../types'
import { getConnectedEdges, getNodesInside } from '../../utils'
import SelectionRect from './SelectionRect.vue'
import { getMousePosition } from './utils'
@@ -1,11 +1,8 @@
<script lang="ts" setup>
import type { CSSProperties, EffectScope } from 'vue'
import type { EffectScope } from 'vue'
import EdgeWrapper from '../../components/Edges/Wrapper'
import ConnectionLine from '../../components/ConnectionLine/ConnectionLine.vue'
import { useVueFlow } from '../../composables'
import { groupEdgesByZLevel, warn } from '../../utils'
import type { EdgeComponent, EdgeUpdatable, GraphEdge } from '../../types'
import { Slots } from '../../context'
import MarkerDefinitions from './MarkerDefinitions.vue'
const slots = inject(Slots)
@@ -1,7 +1,5 @@
<script lang="ts" setup>
import { useVueFlow } from '../../composables'
import type { EdgeMarkerType, MarkerProps, MarkerType } from '../../types/edge'
import { getMarkerId } from '../../utils'
import Marker from './Marker.vue'
const { edges, connectionLineOptions, defaultMarkerColor: defaultColor } = $(useVueFlow())
@@ -1,9 +1,6 @@
<script lang="ts" setup>
import { NodeWrapper } from '../../components'
import type { GraphNode, HandleConnectable, NodeComponent } from '../../types'
import { useVueFlow } from '../../composables'
import { Slots } from '../../context'
import { warn } from '../../utils'
const slots = inject(Slots)
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import type { GraphNode } from '../../types'
import { useKeyPress, useVueFlow } from '../../composables'
import { NodesSelection, UserSelection } from '../../components'
const {
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import NodeRenderer from '../NodeRenderer/NodeRenderer.vue'
import EdgeRenderer from '../EdgeRenderer/EdgeRenderer.vue'
import { useVueFlow, useWindow } from '../../composables'
import type { Dimensions } from '../../types'
const { id, viewport, dimensions, fitViewOnInit, emits, fitView, ...rest } = useVueFlow()
@@ -38,6 +38,7 @@ const props = withDefaults(defineProps<FlowProps>(), {
autoConnect: undefined,
elevateEdgesOnSelect: undefined,
})
const emit = defineEmits<{
(event: 'nodesChange', changes: NodeChange[]): void
(event: 'edgesChange', changes: EdgeChange[]): void
@@ -94,7 +95,7 @@ const emit = defineEmits<{
(event: 'update:nodes', value: GraphNode[]): void
(event: 'update:edges', value: GraphEdge[]): void
}>()
console.log('flubarg')
const modelValue = useVModel(props, 'modelValue', emit)
const modelNodes = useVModel(props, 'nodes', emit)
const modelEdges = useVModel(props, 'edges', emit)
+1 -1
View File
@@ -47,7 +47,7 @@ export default defineConfig({
vueTypes(),
AutoImport({
imports: ['vue', '@vueuse/core', 'vue/macros'],
dirs: ['./src/utils/**', './src/composables/**', './src/context/**', './src/store/**'],
dirs: ['./src/utils/**', './src/composables/**', './src/context/**', './src/store/**', './src/components/Edges/utils/**'],
dts: 'src/auto-imports.d.ts',
}),
replace({