update(dist): Remove rollup and use vite to build lib

* Remove custom tsconfig paths to avoid resolving issues on published package
This commit is contained in:
Braks
2021-11-06 08:54:35 +01:00
parent 64df75d405
commit 61779638ac
59 changed files with 282 additions and 177 deletions
+5 -4
View File
@@ -1,7 +1,7 @@
import { getHostForElement } from '~/utils'
import { Connection, ConnectionMode, ElementId, HandleType, ValidConnectionFunc } from '~/types'
import useStore from '~/composables/useStore'
import useHooks from '~/composables/useHooks'
import { getHostForElement } from '../utils'
import { Connection, ConnectionMode, ElementId, HandleType, ValidConnectionFunc } from '../types'
import useStore from './useStore'
import useHooks from './useHooks'
type Result = {
elementBelow: Element | null
@@ -157,6 +157,7 @@ export default () => {
hooks.connectEnd.trigger(event)
if (elementEdgeUpdaterType) {
// todo fix missing edge
hooks.edgeUpdateEnd.trigger({ event } as any)
}
+12 -2
View File
@@ -1,5 +1,15 @@
import { Connection, Edge, Elements, EmitFunc, FlowHooks, FlowTransform, Node, OnConnectStartParams, FlowInstance } from '~/types'
import { Hooks } from '~/context'
import {
Connection,
Edge,
Elements,
EmitFunc,
FlowHooks,
FlowTransform,
Node,
OnConnectStartParams,
FlowInstance,
} from '../types'
import { Hooks } from '../context'
// flow event hooks
const hooks = (): FlowHooks => {
+1 -1
View File
@@ -1,6 +1,6 @@
import { Ref } from 'vue'
import { onKeyDown, onKeyPressed, onKeyUp } from '@vueuse/core'
import { KeyCode } from '~/types'
import { KeyCode } from '../types'
// todo cancel keypress for input dom nodes
export default (keyCode: KeyCode, onChange?: (keyPressed: boolean) => void): Ref<boolean> => {
+3 -4
View File
@@ -1,7 +1,6 @@
import { FlowOptions } from '~/types'
import useFlowStore from '~/store/useFlowStore'
import { initialState } from '~/store'
import { Store } from '~/context'
import { FlowOptions } from '../types'
import { useFlowStore, initialState } from '../store'
import { Store } from '../context'
export default (options?: Partial<FlowOptions>) => {
let store = inject(Store)!
+2 -2
View File
@@ -1,5 +1,5 @@
import { ElementId, UpdateNodeInternals } from '~/types'
import useStore from '~/composables/useStore'
import { ElementId, UpdateNodeInternals } from '../types'
import useStore from './useStore'
export default (store = useStore()): UpdateNodeInternals =>
(id: ElementId) => {
+5 -3
View File
@@ -2,9 +2,11 @@ import { D3ZoomEvent, zoom, zoomIdentity, ZoomTransform } from 'd3-zoom'
import { pointer, select } from 'd3-selection'
import { Ref } from 'vue'
import { get } from '@vueuse/core'
import { FlowTransform, PanOnScrollMode, UseZoom, UseZoomOptions } from '~/types'
import { clamp } from '~/utils'
import { useKeyPress, useHooks, useStore } from '~/composables'
import { FlowTransform, PanOnScrollMode, UseZoom, UseZoomOptions } from '../types'
import { clamp } from '../utils'
import useKeyPress from './useKeyPress'
import useHooks from './useHooks'
import useStore from './useStore'
const viewChanged = (prevTransform: FlowTransform, eventTransform: ZoomTransform): boolean =>
prevTransform.x !== eventTransform.x || prevTransform.y !== eventTransform.y || prevTransform.zoom !== eventTransform.k
+3 -3
View File
@@ -1,8 +1,8 @@
// @ts-nocheck
import { zoomIdentity } from 'd3-zoom'
import { getRectOfNodes, pointToRendererPoint, getTransformForBounds } from '~/utils/graph'
import { FitViewParams, FlowTransform, Node, Rect, UseZoomPanHelper, XYPosition } from '~/types'
import useStore from '~/composables/useStore'
import { getRectOfNodes, pointToRendererPoint, getTransformForBounds } from '../utils'
import { FitViewParams, FlowTransform, Node, Rect, UseZoomPanHelper, XYPosition } from '../types'
import useStore from './useStore'
const DEFAULT_PADDING = 0.1