Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core,types): replace existing types/enums with those already provided by @xyflow/system #1552

Draft
wants to merge 1 commit into
base: refactor/xyflow-system
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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