Skip to content

Commit 110b5e0

Browse files
committed
refactor(core): replace PanOnScrollMode
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
1 parent 4c516f5 commit 110b5e0

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

packages/core/src/container/Viewport/Viewport.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import type { D3ZoomEvent, ZoomTransform } from 'd3-zoom'
33
import { zoom, zoomIdentity } from 'd3-zoom'
44
import { pointer, select } from 'd3-selection'
55
import { onMounted, ref, toRef, watch } from 'vue'
6-
import { clamp, isMacOs } from '@xyflow/system'
6+
import { PanOnScrollMode, clamp, isMacOs } from '@xyflow/system'
77
import type { CoordinateExtent, D3ZoomHandler, ViewportTransform } from '../../types'
8-
import { PanOnScrollMode } from '../../types'
98
import { useKeyPress } from '../../composables/useKeyPress'
109
import { useVueFlow } from '../../composables/useVueFlow'
1110
import { useResizeHandler } from '../../composables/useResizeHandler'

packages/core/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,5 @@ export { useKeyPress } from './composables/useKeyPress'
6767
export { VueFlowError, ErrorCode, isErrorOfType } from './utils/errors'
6868

6969
export * from './types'
70+
71+
export { PanOnScrollMode } from '@xyflow/system'

packages/core/src/store/state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { isMacOs } from '@xyflow/system'
1+
import { PanOnScrollMode, isMacOs } from '@xyflow/system'
22
import type { FlowOptions, State } from '../types'
3-
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '../types'
3+
import { ConnectionLineType, ConnectionMode, SelectionMode } from '../types'
44

55
import { createHooks } from './hooks'
66

packages/core/src/types/flow.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { CSSProperties } from 'vue'
22
import type { KeyFilter } from '@vueuse/core'
33
import type { D3ZoomEvent } from 'd3-zoom'
4+
import type { PanOnScrollMode } from '@xyflow/system'
45
import type { VueFlowError } from '../utils'
56
import type { DefaultEdgeOptions, Edge, EdgeProps, EdgeUpdatable, GraphEdge } from './edge'
67
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node, NodeProps } from './node'
@@ -13,7 +14,7 @@ import type {
1314
Connector,
1415
OnConnectStartParams,
1516
} from './connection'
16-
import type { PanOnScrollMode, ViewportTransform } from './zoom'
17+
import type { ViewportTransform } from './zoom'
1718
import type { EdgeTypesObject, NodeTypesObject } from './components'
1819
import type { CustomEvent, EdgeMouseEvent, EdgeUpdateEvent, NodeDragEvent, NodeMouseEvent } from './hooks'
1920
import type { ValidConnectionFunc } from './handle'

packages/core/src/types/store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { CSSProperties, ComputedRef, ToRefs } from 'vue'
22
import type { KeyFilter } from '@vueuse/core'
3+
import type { PanOnScrollMode } from '@xyflow/system'
34
import type { ViewportHelper } from '../composables'
45
import type {
56
Dimensions,
@@ -27,7 +28,7 @@ import type {
2728
} from './connection'
2829
import type { DefaultEdgeOptions, Edge, EdgeUpdatable, GraphEdge } from './edge'
2930
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node } from './node'
30-
import type { D3Selection, D3Zoom, D3ZoomHandler, PanOnScrollMode, ViewportTransform } from './zoom'
31+
import type { D3Selection, D3Zoom, D3ZoomHandler, ViewportTransform } from './zoom'
3132
import type { CustomEvent, FlowHooks, FlowHooksEmit, FlowHooksOn } from './hooks'
3233
import type { EdgeChange, NodeChange, NodeDragItem } from './changes'
3334
import type { ConnectingHandle, ValidConnectionFunc } from './handle'

packages/core/src/types/zoom.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ export type D3Zoom = ZoomBehavior<HTMLDivElement, unknown>
66
export type D3Selection = Selection<HTMLDivElement, any, any, any>
77
export type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void
88

9-
export enum PanOnScrollMode {
10-
Free = 'free',
11-
Vertical = 'vertical',
12-
Horizontal = 'horizontal',
13-
}
14-
159
export interface TransitionOptions {
1610
duration?: number
1711
}

0 commit comments

Comments
 (0)