Skip to content

Commit 308338f

Browse files
committed
refactor(core): remove exports from barrel files
1 parent 259514a commit 308338f

File tree

8 files changed

+45
-42
lines changed

8 files changed

+45
-42
lines changed

packages/core/src/components/Edges/utils/bezier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Position } from '../../..//types'
1+
import { Position } from '../../../types'
22
import { getBezierEdgeCenter } from './general'
33

44
export interface GetBezierPathParams {

packages/core/src/components/Edges/utils/simple-bezier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Position } from '../../..//types'
1+
import { Position } from '../../../types'
22
import { getBezierEdgeCenter } from './general'
33

44
export interface GetSimpleBezierPathParams {

packages/core/src/components/Edges/utils/smoothstep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { XYPosition } from '../../..//types'
2-
import { Position } from '../../..//types'
1+
import type { XYPosition } from '../../../types'
2+
import { Position } from '../../../types'
33
import { getSimpleEdgeCenter } from './general'
44

55
export interface GetSmoothStepPathParams {

packages/core/src/index.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ export { default as Handle } from './components/Handle/Handle.vue'
99

1010
export { default as Panel } from './components/Panel/Panel.vue'
1111

12-
export {
13-
StraightEdge,
14-
StepEdge,
15-
BezierEdge,
16-
SimpleBezierEdge,
17-
SmoothStepEdge,
18-
BaseEdge,
19-
EdgeText,
20-
EdgeLabelRenderer,
21-
} from './components/Edges'
12+
export { default as StraightEdge } from './components/Edges/StraightEdge'
13+
export { default as StepEdge } from './components/Edges/StepEdge'
14+
export { default as BezierEdge } from './components/Edges/BezierEdge'
15+
export { default as SimpleBezierEdge } from './components/Edges/SimpleBezierEdge'
16+
export { default as SmoothStepEdge } from './components/Edges/SmoothStepEdge'
17+
export { default as BaseEdge } from './components/Edges/BaseEdge.vue'
18+
export { default as EdgeText } from './components/Edges/EdgeText.vue'
19+
export { default as EdgeLabelRenderer } from './components/Edges/EdgeLabelRenderer.vue'
2220

2321
export {
2422
getBezierPath,
@@ -43,7 +41,7 @@ export {
4341
getRectOfNodes,
4442
pointToRendererPoint,
4543
rendererPointToPoint,
46-
/** @deprecated will be removed in the next major version, use `rendererPointToPoint` instead */
44+
/** @deprecated - will be removed in the next major version, use `rendererPointToPoint` instead */
4745
rendererPointToPoint as graphPosToZoomedPos,
4846
getNodesInside,
4947
getMarkerId,
@@ -53,12 +51,13 @@ export {
5351
} from './utils/graph'
5452

5553
/**
54+
* @deprecated - Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead
5655
* Intended for options API
5756
* In composition API you can access apply utilities from `useVueFlow`
5857
*/
5958
export { applyChanges, applyEdgeChanges, applyNodeChanges } from './utils/changes'
6059

61-
export { defaultEdgeTypes, defaultNodeTypes } from './store/state'
60+
export { defaultEdgeTypes, defaultNodeTypes } from './utils/defaultNodesEdges'
6261

6362
export { VueFlow as VueFlowInjection, NodeId as NodeIdInjection } from './context'
6463

packages/core/src/store/getters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ComputedRef } from 'vue'
22
import { computed } from 'vue'
33
import type { ComputedGetters, GraphEdge, GraphNode, State } from '../types'
44
import { ErrorCode, VueFlowError, getNodesInside, isEdgeVisible } from '../utils'
5-
import { defaultEdgeTypes, defaultNodeTypes } from './state'
5+
import { defaultEdgeTypes, defaultNodeTypes } from '../utils/defaultNodesEdges'
66

77
export function useGetters(state: State, nodeIds: ComputedRef<string[]>, edgeIds: ComputedRef<string[]>): ComputedGetters {
88
/**

packages/core/src/store/state.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,9 @@
1-
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '../types'
1+
import type { FlowOptions, State } from '../types'
22
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '../types'
3-
import {
4-
BezierEdge,
5-
DefaultNode,
6-
InputNode,
7-
OutputNode,
8-
SimpleBezierEdge,
9-
SmoothStepEdge,
10-
StepEdge,
11-
StraightEdge,
12-
} from '../components'
3+
134
import { isMacOs } from '../utils'
145
import { createHooks } from './hooks'
156

16-
export const defaultNodeTypes: DefaultNodeTypes = {
17-
input: InputNode,
18-
default: DefaultNode,
19-
output: OutputNode,
20-
}
21-
22-
export const defaultEdgeTypes: DefaultEdgeTypes = {
23-
default: BezierEdge,
24-
straight: StraightEdge,
25-
step: StepEdge,
26-
smoothstep: SmoothStepEdge,
27-
simplebezier: SimpleBezierEdge,
28-
}
29-
307
export function useState(): State {
318
return {
329
vueFlowRef: null,

packages/core/src/utils/changes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ export function applyChanges<
203203
return elements
204204
}
205205

206+
/** @deprecated Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead */
206207
export function applyEdgeChanges(changes: EdgeChange[], edges: GraphEdge[]) {
207208
return applyChanges(changes, edges)
208209
}
210+
211+
/** @deprecated Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead */
209212
export function applyNodeChanges(changes: NodeChange[], nodes: GraphNode[]) {
210213
return applyChanges(changes, nodes)
211214
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { DefaultEdgeTypes, DefaultNodeTypes } from '../types'
2+
3+
import DefaultNode from '../components/Nodes/DefaultNode'
4+
import OutputNode from '../components/Nodes/OutputNode'
5+
import InputNode from '../components/Nodes/InputNode'
6+
import StraightEdge from '../components/Edges/StraightEdge'
7+
import StepEdge from '../components/Edges/StepEdge'
8+
import BezierEdge from '../components/Edges/BezierEdge'
9+
import SimpleBezierEdge from '../components/Edges/SimpleBezierEdge'
10+
import SmoothStepEdge from '../components/Edges/SmoothStepEdge'
11+
12+
export const defaultNodeTypes: DefaultNodeTypes = {
13+
input: InputNode,
14+
default: DefaultNode,
15+
output: OutputNode,
16+
}
17+
18+
export const defaultEdgeTypes: DefaultEdgeTypes = {
19+
default: BezierEdge,
20+
straight: StraightEdge,
21+
step: StepEdge,
22+
smoothstep: SmoothStepEdge,
23+
simplebezier: SimpleBezierEdge,
24+
}

0 commit comments

Comments
 (0)