feat: add path alias for src

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-06 09:38:02 +01:00
parent 27c72e0022
commit aaf5f608f5
52 changed files with 299 additions and 245 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import { CSSProperties } from 'vue'
import { ArrowHeadType, ElementId, Position } from '../../types'
import { getCenter, getMarkerEnd, getBezierPath } from './utils'
import EdgeText from './EdgeText.vue'
import { ArrowHeadType, ElementId, Position } from '~/types'
interface BezierEdgeProps {
id: ElementId
+9 -9
View File
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { getEdgePositions, getHandle, getSourceTargetNodes, isEdgeVisible } from '../../container/EdgeRenderer/utils'
import { isEdge } from '../../utils'
import { ConnectionMode, Edge, EdgeType, Position } from '../../types'
import { useHandle, useHooks, useStore } from '../../composables'
import EdgeAnchor from './EdgeAnchor.vue'
import { getEdgePositions, getHandle, getSourceTargetNodes, isEdgeVisible } from '~/container/EdgeRenderer/utils'
import { isEdge } from '~/utils'
import { ConnectionMode, Edge, EdgeType, Position } from '~/types'
import { useHandle, useHooks, useStore } from '~/composables'
interface EdgeProps {
type: EdgeType
@@ -97,14 +97,14 @@ const targetNodeHandles = computed(() =>
: nodes.value.targetNode?.__rf?.handleBounds.target ?? nodes.value.targetNode?.__rf?.handleBounds.source,
)
const sourceHandle = computed(
() => nodes.value.sourceNode && getHandle(nodes.value.sourceNode.__rf?.handleBounds.source, props.edge.sourceHandle || null),
)
const targetHandle = computed(() => getHandle(targetNodeHandles.value, props.edge.targetHandle || null))
const sourceHandle = computed(() => {
if (nodes.value.sourceNode) return getHandle(nodes.value.sourceNode.__rf?.handleBounds.source, props.edge.sourceHandle ?? null)
})
const targetHandle = computed(() => getHandle(targetNodeHandles.value, props.edge.targetHandle ?? null))
const sourcePosition = computed(() => (sourceHandle.value ? sourceHandle.value.position : Position.Bottom))
const targetPosition = computed(() => (targetHandle.value ? targetHandle.value.position : Position.Top))
const isSelected = computed(() => store.selectedElements?.some((elm) => isEdge(elm) && elm.id === props.edge.id) || false)
const isSelected = computed(() => store.selectedElements?.some((elm) => isEdge(elm) && elm.id === props.edge.id) ?? false)
const edgePos = computed(() =>
getEdgePositions(
nodes.value.sourceNode,
+1 -1
View File
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { HTMLAttributes } from 'vue'
import { Position } from '../../types'
import { Position } from '~/types'
const shiftX = (x: number, shift: number, position: Position): number => {
if (position === Position.Left) return x - shift
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { ArrowHeadType, ElementId, Position } from '../../types'
import EdgeText from './EdgeText.vue'
import { getCenter, getMarkerEnd, getSmoothStepPath } from './utils'
import { ArrowHeadType, ElementId, Position } from '~/types'
export interface EdgeSmoothStepProps {
id: ElementId
+1 -1
View File
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { ArrowHeadType, ElementId, Position } from '../../types'
import SmoothStepEdge from './SmoothStepEdge.vue'
import { ArrowHeadType, ElementId, Position } from '~/types'
export interface EdgeStepProps {
id: ElementId
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { ArrowHeadType, ElementId, Position } from '../../types'
import EdgeText from './EdgeText.vue'
import { getMarkerEnd, getBezierPath } from './utils'
import { ArrowHeadType, ElementId, Position } from '~/types'
interface StraightEdgeProps {
id: ElementId
+1 -1
View File
@@ -1,4 +1,4 @@
import { ArrowHeadType, Position } from '../../types'
import { ArrowHeadType, Position } from '~/types'
export const getMarkerEnd = (arrowHeadType?: ArrowHeadType, markerEndId?: string): string => {
if (typeof markerEndId !== 'undefined' && markerEndId) {