fix(core): remove ts-transform-paths and use relative paths
This commit is contained in:
@@ -9,6 +9,6 @@
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./src",
|
||||
"./src"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
"*.css"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "ts-patch install -s",
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build && vite build -c vite.config.iife.ts",
|
||||
"build:watch": "vite build --watch & vite build -c vite.config.iife.ts --watch",
|
||||
@@ -84,8 +83,6 @@
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-nested": "^6.0.1",
|
||||
"ts-patch": "^3.0.2",
|
||||
"typescript-transform-paths": "^3.4.6",
|
||||
"vite": "^4.4.11",
|
||||
"vue-tsc": "^1.8.16"
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { DefineComponent } from 'vue'
|
||||
import { defineComponent, h, inject } from 'vue'
|
||||
import type { ConnectionLineProps } from '~/types'
|
||||
import { ConnectionLineType, ConnectionMode, Position } from '~/types'
|
||||
import { getHandlePosition, getMarkerId } from '~/utils'
|
||||
import { useVueFlow } from '~/composables'
|
||||
import { Slots } from '~/context'
|
||||
import { getBezierPath, getSimpleBezierPath, getSmoothStepPath } from '~/components/Edges/utils'
|
||||
import type { ConnectionLineProps } from '../../types'
|
||||
import { ConnectionLineType, ConnectionMode, Position } from '../../types'
|
||||
import { getHandlePosition, getMarkerId } from '../../utils'
|
||||
import { useVueFlow } from '../../composables'
|
||||
import { Slots } from '../../context'
|
||||
import { getBezierPath, getSimpleBezierPath, getSmoothStepPath } from '../Edges/utils'
|
||||
|
||||
const oppositePosition = {
|
||||
[Position.Left]: Position.Right,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import type { BezierEdgeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
import BaseEdge from './BaseEdge.vue'
|
||||
import { getBezierPath } from './utils'
|
||||
import type { BezierEdgeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
|
||||
const BezierEdge = defineComponent<BezierEdgeProps>({
|
||||
name: 'BezierEdge',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FunctionalComponent, HTMLAttributes } from 'vue'
|
||||
import { h } from 'vue'
|
||||
import { Position } from '~/types'
|
||||
import { Position } from '../../types'
|
||||
|
||||
interface Props extends HTMLAttributes {
|
||||
position: Position
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { computed, defineComponent, h, provide, ref } from 'vue'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import EdgeAnchor from './EdgeAnchor'
|
||||
import type { Connection, EdgeComponent, EdgeUpdatable, GraphEdge, HandleType, MouseTouchEvent } from '~/types'
|
||||
import { ConnectionMode, Position } from '~/types'
|
||||
import { useEdgeHooks, useHandle, useVueFlow } from '~/composables'
|
||||
import { EdgeId, EdgeRef } from '~/context'
|
||||
import type { Connection, EdgeComponent, EdgeUpdatable, GraphEdge, HandleType, MouseTouchEvent } from '../../types'
|
||||
import { ConnectionMode, Position } from '../../types'
|
||||
import { useEdgeHooks, useHandle, useVueFlow } from '../../composables'
|
||||
import { EdgeId, EdgeRef } from '../../context'
|
||||
import {
|
||||
ARIA_EDGE_DESC_KEY,
|
||||
ErrorCode,
|
||||
@@ -13,7 +12,8 @@ import {
|
||||
getEdgePositions,
|
||||
getHandle,
|
||||
getMarkerId,
|
||||
} from '~/utils'
|
||||
} from '../../utils'
|
||||
import EdgeAnchor from './EdgeAnchor'
|
||||
|
||||
interface Props {
|
||||
id: string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import type { SimpleBezierEdgeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
import BaseEdge from './BaseEdge.vue'
|
||||
import { getSimpleBezierPath } from './utils'
|
||||
import type { SimpleBezierEdgeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
|
||||
const SimpleBezierEdge = defineComponent<SimpleBezierEdgeProps>({
|
||||
name: 'SimpleBezierEdge',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import type { SmoothStepEdgeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
import BaseEdge from './BaseEdge.vue'
|
||||
import { getSmoothStepPath } from './utils'
|
||||
import type { SmoothStepEdgeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
|
||||
const SmoothStepEdge = defineComponent<SmoothStepEdgeProps>({
|
||||
name: 'SmoothStepEdge',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import type { StepEdgeProps } from '../../types'
|
||||
import SmoothStepEdge from './SmoothStepEdge'
|
||||
import type { StepEdgeProps } from '~/types'
|
||||
|
||||
const StepEdge = defineComponent<StepEdgeProps>({
|
||||
name: 'StepEdge',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import type { StraightEdgeProps } from '../../types'
|
||||
import BaseEdge from './BaseEdge.vue'
|
||||
import { getStraightPath } from './utils'
|
||||
import type { StraightEdgeProps } from '~/types'
|
||||
|
||||
const StraightEdge = defineComponent<StraightEdgeProps>({
|
||||
name: 'StraightEdge',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Component, FunctionalComponent } from 'vue'
|
||||
import { h } from 'vue'
|
||||
import Handle from '../Handle/Handle.vue'
|
||||
import type { NodeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
import type { NodeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
|
||||
const DefaultNode: FunctionalComponent<NodeProps> = function ({
|
||||
sourcePosition = Position.Bottom,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Component, FunctionalComponent } from 'vue'
|
||||
import { h } from 'vue'
|
||||
import Handle from '../Handle/Handle.vue'
|
||||
import type { NodeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
import type { NodeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
|
||||
const InputNode: FunctionalComponent<NodeProps> = function ({
|
||||
sourcePosition = Position.Bottom,
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { computed, defineComponent, h, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
|
||||
import { until, useVModel } from '@vueuse/core'
|
||||
import type { GraphNode, HandleConnectable, NodeComponent } from '~/types'
|
||||
import { NodeId, NodeRef } from '~/context'
|
||||
import { isInputDOMNode, useDrag, useNodeHooks, useUpdateNodePositions, useVueFlow } from '~/composables'
|
||||
import { ARIA_NODE_DESC_KEY, arrowKeyDiffs, calcNextPosition, elementSelectionKeys, getXYZPos, handleNodeClick } from '~/utils'
|
||||
import {
|
||||
ARIA_NODE_DESC_KEY,
|
||||
arrowKeyDiffs,
|
||||
calcNextPosition,
|
||||
elementSelectionKeys,
|
||||
getXYZPos,
|
||||
handleNodeClick,
|
||||
} from '../../utils'
|
||||
import type { GraphNode, HandleConnectable, NodeComponent } from '../../types'
|
||||
import { NodeId, NodeRef } from '../../context'
|
||||
import { isInputDOMNode, useDrag, useNodeHooks, useUpdateNodePositions, useVueFlow } from '../../composables'
|
||||
|
||||
interface Props {
|
||||
id: string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Component, FunctionalComponent } from 'vue'
|
||||
import { h } from 'vue'
|
||||
import Handle from '../Handle/Handle.vue'
|
||||
import type { NodeProps } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
import type { NodeProps } from '../../types'
|
||||
import { Position } from '../../types'
|
||||
|
||||
const OutputNode: FunctionalComponent<NodeProps> = function ({
|
||||
targetPosition = Position.Top,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useDrag, useUpdateNodePositions, useVueFlow } from '../../composables'
|
||||
import { arrowKeyDiffs, getRectOfNodes } from '~/utils'
|
||||
import { arrowKeyDiffs, getRectOfNodes } from '../../utils'
|
||||
|
||||
const { emits, viewport, getSelectedNodes, noPanClassName, disableKeyboardA11y, userSelectionActive } = $(useVueFlow())
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { SelectionRect } from '~/types'
|
||||
import type { SelectionRect } from '../../types'
|
||||
|
||||
defineProps<{ userSelectionRect: SelectionRect }>()
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Ref } from 'vue'
|
||||
import { ref, watch } from 'vue'
|
||||
import type { MaybeRefOrGetter } from '@vueuse/core'
|
||||
import { toValue } from '@vueuse/core'
|
||||
import { useGetPointerPosition, useVueFlow } from '.'
|
||||
import type { NodeDragEvent, NodeDragItem, XYPosition } from '../types'
|
||||
import {
|
||||
calcAutoPan,
|
||||
calcNextPosition,
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
getEventPosition,
|
||||
handleNodeClick,
|
||||
hasSelector,
|
||||
} from '~/utils'
|
||||
import type { NodeDragEvent, NodeDragItem, XYPosition } from '~/types'
|
||||
} from '../utils'
|
||||
import { useGetPointerPosition, useVueFlow } from '.'
|
||||
|
||||
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { inject, ref } from 'vue'
|
||||
import type { CustomEvent, ElementData } from '../types'
|
||||
import { ErrorCode, VueFlowError } from '../utils'
|
||||
import { EdgeId, EdgeRef } from '../context'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
import type { CustomEvent, ElementData } from '~/types'
|
||||
import { ErrorCode, VueFlowError } from '~/utils'
|
||||
import { EdgeId, EdgeRef } from '~/context'
|
||||
|
||||
/**
|
||||
* Access an edge
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { EdgeEventsEmit, EdgeEventsOn, GraphEdge, VueFlowStore } from '~/types'
|
||||
import { createExtendedEventHook } from '~/utils'
|
||||
import type { EdgeEventsEmit, EdgeEventsOn, GraphEdge, VueFlowStore } from '../types'
|
||||
import { createExtendedEventHook } from '../utils'
|
||||
|
||||
function createEdgeHooks() {
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { MaybeRefOrGetter } from '@vueuse/core'
|
||||
import { toValue } from '@vueuse/core'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
import type { Connection, ConnectionHandle, HandleType, MouseTouchEvent, ValidConnectionFunc } from '~/types'
|
||||
import type { Connection, ConnectionHandle, HandleType, MouseTouchEvent, ValidConnectionFunc } from '../types'
|
||||
import {
|
||||
calcAutoPan,
|
||||
getClosestHandle,
|
||||
@@ -15,7 +14,8 @@ import {
|
||||
pointToRendererPoint,
|
||||
rendererPointToPoint,
|
||||
resetRecentHandle,
|
||||
} from '~/utils'
|
||||
} from '../utils'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
|
||||
interface UseHandleProps {
|
||||
handleId: MaybeRefOrGetter<string | null>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { computed, inject, ref } from 'vue'
|
||||
import type { CustomEvent, ElementData } from '../types'
|
||||
import { ErrorCode, VueFlowError, getConnectedEdges } from '../utils'
|
||||
import { NodeId, NodeRef } from '../context'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
import type { CustomEvent, ElementData } from '~/types'
|
||||
import { NodeId, NodeRef } from '~/context'
|
||||
import { ErrorCode, VueFlowError, getConnectedEdges } from '~/utils'
|
||||
|
||||
/**
|
||||
* Access a node, it's parent (if one exists) and connected edges
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GraphNode, NodeEventsEmit, NodeEventsOn, VueFlowStore } from '~/types'
|
||||
import { createExtendedEventHook } from '~/utils'
|
||||
import type { GraphNode, NodeEventsEmit, NodeEventsOn, VueFlowStore } from '../types'
|
||||
import { createExtendedEventHook } from '../utils'
|
||||
|
||||
function createNodeHooks() {
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { NodeDragItem, XYPosition } from '../types'
|
||||
import { calcNextPosition } from '../utils'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
import type { NodeDragItem, XYPosition } from '~/types'
|
||||
import { calcNextPosition } from '~/utils'
|
||||
|
||||
export function useUpdateNodePositions() {
|
||||
const { getSelectedNodes, nodeExtent, updateNodePositions, findNode, snapGrid, snapToGrid, nodesDraggable, emits } =
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { until } from '@vueuse/core'
|
||||
import { zoomIdentity } from 'd3-zoom'
|
||||
import { computed, ref } from 'vue'
|
||||
import type { ComputedGetters, D3Selection, GraphNode, Project, State, ViewportFunctions } from '~/types'
|
||||
import { clampPosition, getRectOfNodes, getTransformForBounds, pointToRendererPoint, rendererPointToPoint, warn } from '~/utils'
|
||||
import type { ComputedGetters, D3Selection, GraphNode, Project, State, ViewportFunctions } from '../types'
|
||||
import { clampPosition, getRectOfNodes, getTransformForBounds, pointToRendererPoint, rendererPointToPoint, warn } from '../utils'
|
||||
|
||||
interface ExtendedViewport extends ViewportFunctions {
|
||||
initialized: boolean
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { toRefs, tryOnScopeDispose } from '@vueuse/core'
|
||||
import type { EffectScope } from 'vue'
|
||||
import { computed, effectScope, getCurrentScope, inject, provide, reactive, watch } from 'vue'
|
||||
import { useActions, useGetters, useState } from '~/store'
|
||||
import type { EdgeChange, FlowOptions, FlowProps, NodeChange, State, VueFlowStore } from '~/types'
|
||||
import { VueFlow } from '~/context'
|
||||
import { warn } from '~/utils'
|
||||
import type { EdgeChange, FlowOptions, FlowProps, NodeChange, State, VueFlowStore } from '../types'
|
||||
import { warn } from '../utils'
|
||||
import { useActions, useGetters, useState } from '../store'
|
||||
import { VueFlow } from '../context'
|
||||
|
||||
/**
|
||||
* Stores all currently created store instances
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { ToRefs } from 'vue'
|
||||
import { effectScope, isRef, nextTick, onScopeDispose, watch } from 'vue'
|
||||
import type { WatchPausableReturn } from '@vueuse/core'
|
||||
import { toRef, watchPausable } from '@vueuse/core'
|
||||
import type { Connection, FlowProps, VueFlowStore } from '~/types'
|
||||
import { isDef } from '~/utils'
|
||||
import type { Connection, FlowProps, VueFlowStore } from '../types'
|
||||
import { isDef } from '../utils'
|
||||
|
||||
export function useWatchProps(
|
||||
models: ToRefs<Pick<FlowProps, 'nodes' | 'edges' | 'modelValue'>>,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ComputedGetters, State, ViewportFunctions } from '../types'
|
||||
import { useVueFlow } from './useVueFlow'
|
||||
import { useViewport } from './useViewport'
|
||||
import type { ComputedGetters, State, ViewportFunctions } from '~/types'
|
||||
|
||||
/**
|
||||
* @deprecated use {@link useVueFlow} instead (all viewport functions are also available in {@link useVueFlow})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { XYPosition } from '~/types'
|
||||
import type { XYPosition } from '../../types'
|
||||
|
||||
export function getMousePosition(event: MouseEvent, containerBounds: DOMRect): XYPosition {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { InjectionKey, Ref } from 'vue'
|
||||
import type { FlowSlots, VueFlowStore } from '~/types'
|
||||
import type { FlowSlots, VueFlowStore } from '../types'
|
||||
|
||||
export const VueFlow: InjectionKey<VueFlowStore> = Symbol('vueFlow')
|
||||
export const NodeId: InjectionKey<string> = Symbol('nodeId')
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { zoomIdentity } from 'd3-zoom'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import { until } from '@vueuse/core'
|
||||
import { useState } from './state'
|
||||
import type {
|
||||
Actions,
|
||||
ComputedGetters,
|
||||
@@ -21,8 +20,8 @@ import type {
|
||||
NodeSelectionChange,
|
||||
Rect,
|
||||
State,
|
||||
} from '~/types'
|
||||
import { useViewport } from '~/composables'
|
||||
} from '../types'
|
||||
import { useViewport } from '../composables'
|
||||
import {
|
||||
ErrorCode,
|
||||
VueFlowError,
|
||||
@@ -49,7 +48,8 @@ import {
|
||||
nodeToRect,
|
||||
parseEdge,
|
||||
updateEdgeAction,
|
||||
} from '~/utils'
|
||||
} from '../utils'
|
||||
import { useState } from './state'
|
||||
|
||||
export function useActions(
|
||||
id: string,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ComputedRef } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import type { ComputedGetters, GraphEdge, GraphNode, State } from '../types'
|
||||
import { ErrorCode, VueFlowError, getNodesInside, isEdgeVisible } from '../utils'
|
||||
import { defaultEdgeTypes, defaultNodeTypes } from './state'
|
||||
import type { ComputedGetters, GraphEdge, GraphNode, State } from '~/types'
|
||||
import { ErrorCode, VueFlowError, getNodesInside, isEdgeVisible } from '~/utils'
|
||||
|
||||
export function useGetters(state: State, nodeIds: ComputedRef<string[]>, edgeIds: ComputedRef<string[]>): ComputedGetters {
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { tryOnScopeDispose } from '@vueuse/core'
|
||||
import type { Ref } from 'vue'
|
||||
import { onBeforeMount } from 'vue'
|
||||
import type { FlowHooks } from '~/types'
|
||||
import { createExtendedEventHook, warn } from '~/utils'
|
||||
import type { FlowHooks } from '../types'
|
||||
import { createExtendedEventHook, warn } from '../utils'
|
||||
|
||||
// flow event hooks
|
||||
export function createHooks(): FlowHooks {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createHooks } from './hooks'
|
||||
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '~/types'
|
||||
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '~/types'
|
||||
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '../types'
|
||||
import { ConnectionLineType, ConnectionMode, PanOnScrollMode, SelectionMode } from '../types'
|
||||
import {
|
||||
BezierEdge,
|
||||
DefaultNode,
|
||||
@@ -10,8 +9,9 @@ import {
|
||||
SmoothStepEdge,
|
||||
StepEdge,
|
||||
StraightEdge,
|
||||
} from '~/components'
|
||||
import { isDef, isMacOs } from '~/utils'
|
||||
} from '../components'
|
||||
import { isDef, isMacOs } from '../utils'
|
||||
import { createHooks } from './hooks'
|
||||
|
||||
export const defaultNodeTypes: DefaultNodeTypes = {
|
||||
input: InputNode,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CSSProperties, Component, DefineComponent, VNode } from 'vue'
|
||||
import type { BezierEdge, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '../components'
|
||||
import type { NodeProps } from './node'
|
||||
import type { EdgeProps } from './edge'
|
||||
import type { BezierEdge, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '~/components'
|
||||
|
||||
/** Global component names are components registered to the vue instance and are "autoloaded" by their string name */
|
||||
type GlobalComponentName = string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { CSSProperties } from 'vue'
|
||||
import type { KeyFilter } from '@vueuse/core'
|
||||
import type { D3ZoomEvent } from 'd3-zoom'
|
||||
import type { VueFlowError } from '../utils'
|
||||
import type { DefaultEdgeOptions, Edge, EdgeProps, EdgeUpdatable, GraphEdge } from './edge'
|
||||
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node, NodeProps } from './node'
|
||||
import type {
|
||||
@@ -16,9 +17,8 @@ import type { PanOnScrollMode, ViewportTransform } from './zoom'
|
||||
import type { EdgeTypesObject, NodeTypesObject } from './components'
|
||||
import type { CustomEvent, EdgeMouseEvent, EdgeUpdateEvent, NodeDragEvent, NodeMouseEvent } from './hooks'
|
||||
import type { ValidConnectionFunc } from './handle'
|
||||
import type { EdgeChange, NodeChange } from '~/types/changes'
|
||||
import type { VueFlowStore } from '~/types/store'
|
||||
import type { VueFlowError } from '~/utils'
|
||||
import type { EdgeChange, NodeChange } from './changes'
|
||||
import type { VueFlowStore } from './store'
|
||||
|
||||
export type ElementData = any
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { EventHookOn, EventHookTrigger } from '@vueuse/core'
|
||||
import type { D3ZoomEvent } from 'd3-zoom'
|
||||
import type { VueFlowError } from '../utils/errors'
|
||||
import type { EventHookExtended } from '../utils/createExtendedEventHook'
|
||||
import type { GraphEdge } from './edge'
|
||||
import type { GraphNode } from './node'
|
||||
import type { Connection, OnConnectStartParams } from './connection'
|
||||
import type { ViewportTransform } from './zoom'
|
||||
import type { EdgeChange, NodeChange } from './changes'
|
||||
import type { VueFlowStore } from './store'
|
||||
import type { VueFlowError } from '~/utils/errors'
|
||||
import type { EventHookExtended } from '~/utils'
|
||||
|
||||
export type MouseTouchEvent = MouseEvent | TouchEvent
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { XYPosition } from '~/types'
|
||||
import type { XYPosition } from '../types'
|
||||
|
||||
export const ARIA_NODE_DESC_KEY = 'vue-flow__node-desc'
|
||||
export const ARIA_EDGE_DESC_KEY = 'vue-flow__edge-desc'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Dimensions, XYPosition } from '../types'
|
||||
import { clamp } from './graph'
|
||||
import type { Dimensions, XYPosition } from '~/types'
|
||||
|
||||
// returns a number between 0 and 1 that represents the velocity of the movement
|
||||
// when the mouse is close to the edge of the canvas
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { nextTick } from 'vue'
|
||||
import { isDef, isGraphNode } from '.'
|
||||
import type {
|
||||
EdgeAddChange,
|
||||
EdgeChange,
|
||||
@@ -16,7 +15,8 @@ import type {
|
||||
NodeSelectionChange,
|
||||
StyleFunc,
|
||||
Styles,
|
||||
} from '~/types'
|
||||
} from '../types'
|
||||
import { isDef, isGraphNode } from '.'
|
||||
|
||||
function handleParentExpand(updateItem: GraphNode, parent: GraphNode) {
|
||||
if (parent) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { markRaw } from 'vue'
|
||||
import { ErrorCode, VueFlowError, clampPosition, isParentSelected } from '.'
|
||||
import type {
|
||||
Actions,
|
||||
CoordinateExtent,
|
||||
@@ -9,7 +8,8 @@ import type {
|
||||
NodeDragItem,
|
||||
State,
|
||||
XYPosition,
|
||||
} from '~/types'
|
||||
} from '../types'
|
||||
import { ErrorCode, VueFlowError, clampPosition, isParentSelected } from '.'
|
||||
|
||||
export function hasSelector(target: Element, selector: string, node: Element): boolean {
|
||||
let current = target
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Actions, EdgePositions, GraphEdge, GraphNode, HandleElement, Rect, ViewportTransform, XYPosition } from '../types'
|
||||
import { Position } from '../types'
|
||||
import { rectToBox } from '.'
|
||||
import type { Actions, EdgePositions, GraphEdge, GraphNode, HandleElement, Rect, ViewportTransform, XYPosition } from '~/types'
|
||||
import { Position } from '~/types'
|
||||
|
||||
export function getHandlePosition(position: Position, rect: Rect, handle: HandleElement | null): XYPosition {
|
||||
const x = (handle?.x ?? 0) + rect.x
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { markRaw } from 'vue'
|
||||
import { isDef, warn } from '.'
|
||||
import type {
|
||||
Actions,
|
||||
Box,
|
||||
@@ -21,7 +20,8 @@ import type {
|
||||
ViewportTransform,
|
||||
XYPosition,
|
||||
XYZPosition,
|
||||
} from '~/types'
|
||||
} from '../types'
|
||||
import { isDef, warn } from '.'
|
||||
import { useWindow } from '~/composables'
|
||||
|
||||
export function nodeToRect(node: GraphNode): Rect {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { getEventPosition } from '.'
|
||||
import { ConnectionMode } from '~/types'
|
||||
import { ConnectionMode } from '../types'
|
||||
import type {
|
||||
Actions,
|
||||
Connection,
|
||||
@@ -12,7 +11,8 @@ import type {
|
||||
ValidConnectionFunc,
|
||||
ValidHandleResult,
|
||||
XYPosition,
|
||||
} from '~/types'
|
||||
} from '../types'
|
||||
import { getEventPosition } from '.'
|
||||
|
||||
export interface ConnectionHandle extends XYPosition, Dimensions {
|
||||
id: string | null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { nextTick } from 'vue'
|
||||
import type { Actions, GraphNode, HandleElement, Position } from '../types'
|
||||
import { getDimensions } from '.'
|
||||
import type { Actions, GraphNode, HandleElement, Position } from '~/types'
|
||||
|
||||
export function getHandleBounds(selector: string, nodeElement: HTMLDivElement, zoom: number): HandleElement[] | undefined {
|
||||
const handles = nodeElement.querySelectorAll(`.vue-flow__handle${selector}`)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { unref } from 'vue'
|
||||
import type { Actions, Connection, Edge, GraphEdge, GraphNode, Node, State } from '../types'
|
||||
import { ErrorCode, VueFlowError, connectionExists, getEdgeId, isEdge, isNode, parseEdge, parseNode } from '.'
|
||||
import type { Actions, Connection, Edge, GraphEdge, GraphNode, Node, State } from '~/types'
|
||||
|
||||
type NonUndefined<T> = T extends undefined ? never : T
|
||||
|
||||
|
||||
@@ -6,19 +6,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"types": [
|
||||
"vite/client",
|
||||
"vue/macros",
|
||||
],
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
// Transform paths in output .d.ts files (Include this line if you output declarations files)
|
||||
{
|
||||
"transform": "typescript-transform-paths",
|
||||
"afterDeclarations": true
|
||||
}
|
||||
"vue/macros"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["vite.config.ts", "vite.config.iife.ts"],
|
||||
"files": ["package.json"]
|
||||
"include": [
|
||||
"vite.config.ts",
|
||||
"vite.config.iife.ts"
|
||||
],
|
||||
"files": [
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
|
||||
Generated
-36
@@ -330,12 +330,6 @@ importers:
|
||||
postcss-nested:
|
||||
specifier: ^6.0.1
|
||||
version: 6.0.1(postcss@8.4.31)
|
||||
ts-patch:
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
typescript-transform-paths:
|
||||
specifier: ^3.4.6
|
||||
version: 3.4.6(typescript@4.9.5)
|
||||
vite:
|
||||
specifier: ^4.4.11
|
||||
version: 4.4.11(@types/node@18.18.4)
|
||||
@@ -6622,15 +6616,6 @@ packages:
|
||||
ini: 2.0.0
|
||||
dev: true
|
||||
|
||||
/global-prefix@3.0.0:
|
||||
resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==}
|
||||
engines: {node: '>=6'}
|
||||
dependencies:
|
||||
ini: 1.3.8
|
||||
kind-of: 6.0.3
|
||||
which: 1.3.1
|
||||
dev: true
|
||||
|
||||
/globals@11.12.0:
|
||||
resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -10392,18 +10377,6 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/ts-patch@3.0.2:
|
||||
resolution: {integrity: sha512-iTg8euqiNsNM1VDfOsVIsP0bM4kAVXU38n7TGQSkky7YQX/syh6sDPIRkvSS0HjT8ZOr0pq1h+5Le6jdB3hiJQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
chalk: 4.1.2
|
||||
global-prefix: 3.0.0
|
||||
minimist: 1.2.8
|
||||
resolve: 1.22.6
|
||||
semver: 7.5.4
|
||||
strip-ansi: 6.0.1
|
||||
dev: true
|
||||
|
||||
/tsconfig-paths@3.14.2:
|
||||
resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==}
|
||||
dependencies:
|
||||
@@ -10629,15 +10602,6 @@ packages:
|
||||
typescript: 4.9.5
|
||||
dev: true
|
||||
|
||||
/typescript-transform-paths@3.4.6(typescript@4.9.5):
|
||||
resolution: {integrity: sha512-qdgpCk9oRHkIBhznxaHAapCFapJt5e4FbFik7Y4qdqtp6VyC3smAIPoDEIkjZ2eiF7x5+QxUPYNwJAtw0thsTw==}
|
||||
peerDependencies:
|
||||
typescript: '>=3.6.5'
|
||||
dependencies:
|
||||
minimatch: 3.1.2
|
||||
typescript: 4.9.5
|
||||
dev: true
|
||||
|
||||
/typescript@4.9.5:
|
||||
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
|
||||
Reference in New Issue
Block a user