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 28, 2024
1 parent 3aff262 commit d465d1b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/container/Viewport/Viewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const transform = computed(() => `translate(${viewport.value.x}px,${viewport.val

<script lang="ts">
export default {
name: 'Transform',
name: 'Viewport',
compatConfig: { MODE: 3 },
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ export { VueFlowError, ErrorCode, isErrorOfType } from './utils/errors'
export * from './types'

// todo: add more re-exports
export { type Viewport } from '@xyflow/system'
export { type Viewport, 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: 1 addition & 2 deletions packages/core/src/types/flow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CSSProperties } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { Viewport } from '@xyflow/system'
import type { PanOnScrollMode, Viewport } 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 +13,6 @@ import type {
Connector,
OnConnectStartParams,
} from './connection'
import type { PanOnScrollMode } from './zoom'
import type { EdgeTypesObject, NodeTypesObject } from './components'
import type { CustomEvent, EdgeMouseEvent, EdgeUpdateEvent, MouseTouchEvent, NodeDragEvent, NodeMouseEvent } from './hooks'
import type { ValidConnectionFunc } from './handle'
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/types/store.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CSSProperties, ComputedRef, ToRefs } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { PanZoomInstance, Viewport } from '@xyflow/system'
import type { PanOnScrollMode, PanZoomInstance, Viewport } from '@xyflow/system'
import type { ViewportHelper } from '../composables'
import type {
Dimensions,
Expand Down Expand Up @@ -28,7 +28,6 @@ import type {
} from './connection'
import type { DefaultEdgeOptions, Edge, EdgeUpdatable, GraphEdge } from './edge'
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node } from './node'
import type { PanOnScrollMode } 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
@@ -1,12 +1,6 @@
import type { Viewport } from '@xyflow/system'
import type { Rect, XYPosition } from './flow'

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

export interface TransitionOptions {
duration?: number
}
Expand Down

0 comments on commit d465d1b

Please sign in to comment.