refactor(core,edges): enable vue macros betterDefine and remove duplicate interface defs
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -36,7 +36,6 @@ SmoothStepEdge.props = [
|
|||||||
'targetX',
|
'targetX',
|
||||||
'targetY',
|
'targetY',
|
||||||
'borderRadius',
|
'borderRadius',
|
||||||
'offset',
|
|
||||||
'markerEnd',
|
'markerEnd',
|
||||||
'markerStart',
|
'markerStart',
|
||||||
'style',
|
'style',
|
||||||
|
|||||||
@@ -96,10 +96,7 @@ export interface Edge<Data = ElementData, CustomEvents extends Record<string, Cu
|
|||||||
events?: Partial<EdgeEventsHandler<CustomEvents>>
|
events?: Partial<EdgeEventsHandler<CustomEvents>>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DefaultEdgeOptions = Omit<
|
export type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle'>
|
||||||
Edge,
|
|
||||||
'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'
|
|
||||||
>
|
|
||||||
|
|
||||||
export interface EdgePositions {
|
export interface EdgePositions {
|
||||||
sourceX: number
|
sourceX: number
|
||||||
@@ -155,37 +152,7 @@ export interface EdgeProps<Data = ElementData, CustomEvents = {}> {
|
|||||||
|
|
||||||
/** these props are passed to smooth step edges */
|
/** these props are passed to smooth step edges */
|
||||||
export interface SmoothStepEdgeProps<Data = ElementData, CustomEvents = {}> extends EdgeProps<Data, CustomEvents> {
|
export interface SmoothStepEdgeProps<Data = ElementData, CustomEvents = {}> extends EdgeProps<Data, CustomEvents> {
|
||||||
id: string
|
|
||||||
sourceNode: GraphNode
|
|
||||||
targetNode: GraphNode
|
|
||||||
label?: string | VNode | Component<EdgeTextProps> | Object
|
|
||||||
style?: CSSProperties
|
|
||||||
sourceX: number
|
|
||||||
sourceY: number
|
|
||||||
targetX: number
|
|
||||||
targetY: number
|
|
||||||
selected?: boolean
|
|
||||||
sourcePosition: Position
|
|
||||||
targetPosition: Position
|
|
||||||
sourceHandleId?: string
|
|
||||||
targetHandleId?: string
|
|
||||||
source: string
|
|
||||||
target: string
|
|
||||||
labelStyle?: any
|
|
||||||
labelShowBg?: boolean
|
|
||||||
labelBgStyle?: any
|
|
||||||
labelBgPadding?: [number, number]
|
|
||||||
labelBgBorderRadius?: number
|
|
||||||
animated?: boolean
|
|
||||||
updatable?: boolean
|
|
||||||
markerStart: string
|
|
||||||
markerEnd: string
|
|
||||||
borderRadius?: number
|
borderRadius?: number
|
||||||
offset?: number
|
|
||||||
interactionWidth?: number
|
|
||||||
data: Data
|
|
||||||
/** contextual and custom events of edge */
|
|
||||||
events: EdgeEventsOn<CustomEvents>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseEdgeProps {
|
export interface BaseEdgeProps {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { resolve } from 'path'
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueTypes from 'vite-plugin-vue-type-imports'
|
import vueTypes from 'vite-plugin-vue-type-imports'
|
||||||
|
import VueMacros from 'unplugin-vue-macros/vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import replace from '@rollup/plugin-replace'
|
import replace from '@rollup/plugin-replace'
|
||||||
import pkg from './package.json'
|
import pkg from './package.json'
|
||||||
@@ -39,8 +40,13 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vue({
|
VueMacros({
|
||||||
reactivityTransform: true,
|
betterDefine: true,
|
||||||
|
plugins: {
|
||||||
|
vue: vue({
|
||||||
|
reactivityTransform: true,
|
||||||
|
}),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
vueTypes(),
|
vueTypes(),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
|
|||||||
Reference in New Issue
Block a user