Skip to content

Commit

Permalink
refactor(core): replace PanOnScrollMode
Browse files Browse the repository at this point in the history
Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Jul 15, 2024
1 parent 4c516f5 commit 110b5e0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/container/Viewport/Viewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import type { D3ZoomEvent, ZoomTransform } from 'd3-zoom'
import { zoom, zoomIdentity } from 'd3-zoom'
import { pointer, select } from 'd3-selection'
import { onMounted, ref, toRef, watch } from 'vue'
import { clamp, isMacOs } from '@xyflow/system'
import { PanOnScrollMode, clamp, isMacOs } from '@xyflow/system'
import type { CoordinateExtent, D3ZoomHandler, ViewportTransform } from '../../types'
import { PanOnScrollMode } from '../../types'
import { useKeyPress } from '../../composables/useKeyPress'
import { useVueFlow } from '../../composables/useVueFlow'
import { useResizeHandler } from '../../composables/useResizeHandler'
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ export { useKeyPress } from './composables/useKeyPress'
export { VueFlowError, ErrorCode, isErrorOfType } from './utils/errors'

export * from './types'

export { PanOnScrollMode } from '@xyflow/system'
4 changes: 2 additions & 2 deletions packages/core/src/store/state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isMacOs } from '@xyflow/system'
import { PanOnScrollMode, isMacOs } from '@xyflow/system'
import type { FlowOptions, State } from '../types'
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '../types'
import { ConnectionLineType, ConnectionMode, SelectionMode } from '../types'

import { createHooks } from './hooks'

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types/flow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { CSSProperties } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { D3ZoomEvent } from 'd3-zoom'
import type { PanOnScrollMode } from '@xyflow/system'
import type { VueFlowError } from '../utils'
import type { DefaultEdgeOptions, Edge, EdgeProps, EdgeUpdatable, GraphEdge } from './edge'
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node, NodeProps } from './node'
Expand All @@ -13,7 +14,7 @@ import type {
Connector,
OnConnectStartParams,
} from './connection'
import type { PanOnScrollMode, ViewportTransform } from './zoom'
import type { ViewportTransform } from './zoom'
import type { EdgeTypesObject, NodeTypesObject } from './components'
import type { CustomEvent, EdgeMouseEvent, EdgeUpdateEvent, NodeDragEvent, NodeMouseEvent } from './hooks'
import type { ValidConnectionFunc } from './handle'
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { CSSProperties, ComputedRef, ToRefs } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { PanOnScrollMode } from '@xyflow/system'
import type { ViewportHelper } from '../composables'
import type {
Dimensions,
Expand Down Expand Up @@ -27,7 +28,7 @@ import type {
} from './connection'
import type { DefaultEdgeOptions, Edge, EdgeUpdatable, GraphEdge } from './edge'
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node } from './node'
import type { D3Selection, D3Zoom, D3ZoomHandler, PanOnScrollMode, ViewportTransform } from './zoom'
import type { D3Selection, D3Zoom, D3ZoomHandler, ViewportTransform } from './zoom'
import type { CustomEvent, FlowHooks, FlowHooksEmit, FlowHooksOn } from './hooks'
import type { EdgeChange, NodeChange, NodeDragItem } from './changes'
import type { ConnectingHandle, ValidConnectionFunc } from './handle'
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/types/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ export type D3Zoom = ZoomBehavior<HTMLDivElement, unknown>
export type D3Selection = Selection<HTMLDivElement, any, any, any>
export type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void

export enum PanOnScrollMode {
Free = 'free',
Vertical = 'vertical',
Horizontal = 'horizontal',
}

export interface TransitionOptions {
duration?: number
}
Expand Down

0 comments on commit 110b5e0

Please sign in to comment.