refactor(core): add explicit imports and remove auto-imports

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-05-25 20:48:26 +02:00
committed by Braks
parent 5a86c7cf1d
commit e3e6a03359
63 changed files with 328 additions and 508 deletions
+25
View File
@@ -1,5 +1,7 @@
import { zoomIdentity } from 'd3-zoom'
import type { ComputedRef } from 'vue'
import { until } from '@vueuse/core'
import { useState } from './state'
import type {
Actions,
ComputedGetters,
@@ -20,6 +22,29 @@ import type {
Rect,
State,
} from '~/types'
import { useViewport } from '~/composables'
import {
ErrorCode,
VueFlowError,
addEdgeToStore,
applyChanges,
createAdditionChange,
createGraphNodes,
createRemoveChange,
createSelectionChange,
getConnectedEdges,
getDimensions,
getHandleBounds,
getOverlappingArea,
getSelectionChanges,
isDef,
isEdge,
isNode,
isRect,
nodeToRect,
parseEdge,
updateEdgeAction,
} from '~/utils'
export function useActions(
state: State,
+3
View File
@@ -1,5 +1,8 @@
import type { ComputedRef } from 'vue'
import { computed } from 'vue'
import { defaultEdgeTypes, defaultNodeTypes } from './state'
import type { ComputedGetters, GraphEdge, GraphNode, State } from '~/types'
import { ErrorCode, VueFlowError, getNodesInside, isEdgeVisible } from '~/utils'
export function useGetters(state: State, nodeIds: ComputedRef<string[]>, edgeIds: ComputedRef<string[]>): ComputedGetters {
/**
+3
View File
@@ -1,5 +1,8 @@
import { tryOnScopeDispose } from '@vueuse/core'
import type { Ref } from 'vue'
import { onBeforeMount } from 'vue'
import type { FlowHooks } from '~/types'
import { createExtendedEventHook, warn } from '~/utils'
// flow event hooks
export function createHooks(): FlowHooks {
+4
View File
@@ -0,0 +1,4 @@
export * from './actions'
export * from './getters'
export * from './hooks'
export * from './state'
+2
View File
@@ -1,3 +1,4 @@
import { createHooks } from './hooks'
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '~/types'
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '~/types'
import {
@@ -10,6 +11,7 @@ import {
StepEdge,
StraightEdge,
} from '~/components'
import { isDef } from '~/utils'
export const defaultNodeTypes: DefaultNodeTypes = {
input: InputNode,