refactor: change pkg scope to vue-flow
This commit is contained in:
@@ -6,18 +6,18 @@ __Custom edge that avoids crossing nodes__
|
||||
|
||||
```bash
|
||||
# install
|
||||
$ yarn add @braks/vue-flow-pathfinding-edge
|
||||
$ yarn add @vue-flow/core-pathfinding-edge
|
||||
|
||||
# or
|
||||
$ npm i --save @braks/vue-flow-pathfinding-edge
|
||||
$ npm i --save @vue-flow/core-pathfinding-edge
|
||||
```
|
||||
|
||||
## 🎮 Quickstart
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
||||
import { PathFindingEdge } from '@braks/vue-flow-pathfinding-edge'
|
||||
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||
import { PathFindingEdge } from '@vue-flow/core-pathfinding-edge'
|
||||
import initialElements from './initial-elements'
|
||||
|
||||
const elements = ref(initialElements)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Connection, Edge, Elements } from '@braks/vue-flow'
|
||||
import { Background, VueFlow, addEdge } from '@braks/vue-flow'
|
||||
import type { Connection, Edge, Elements } from '@vue-flow/core'
|
||||
import { Background, VueFlow, addEdge } from '@vue-flow/core'
|
||||
import { ref } from 'vue'
|
||||
import initialElements from './elements'
|
||||
import { PathFindingEdge, PerfectArrow } from '~/index'
|
||||
@@ -31,8 +31,8 @@ const onConnect = (params: Edge | Connection) => (elements.value = addEdge(param
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@import '@braks/vue-flow/dist/style.css';
|
||||
@import '@braks/vue-flow/dist/theme-default.css';
|
||||
@import '@vue-flow/core/dist/style.css';
|
||||
@import '@vue-flow/core/dist/theme-default.css';
|
||||
|
||||
html,
|
||||
body,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { EdgeMarkerType, Elements } from '@braks/vue-flow'
|
||||
import { MarkerType } from '@braks/vue-flow'
|
||||
import type { EdgeMarkerType, Elements } from '@vue-flow/core'
|
||||
import { MarkerType } from '@vue-flow/core'
|
||||
|
||||
const markerEnd: EdgeMarkerType = MarkerType.Arrow
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@braks/vue-flow-pathfinding-edge",
|
||||
"name": "@vue-flow/pathfinding-edge",
|
||||
"version": "0.2.2",
|
||||
"private": false,
|
||||
"repository": {
|
||||
@@ -34,7 +34,7 @@
|
||||
"perfect-arrows": "^0.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@braks/vue-flow": "workspace:*",
|
||||
"@vue-flow/core": "workspace:*",
|
||||
"@types/pathfinding": "^0.0.5",
|
||||
"@vitejs/plugin-vue": "^2.3.4",
|
||||
"ts-patch": "^2.0.1",
|
||||
@@ -45,7 +45,7 @@
|
||||
"vue-tsc": "^0.40.13"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@braks/vue-flow": "^0.4.29",
|
||||
"@vue-flow/core": "^0.4.29",
|
||||
"vue": "^3.2.25"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { EdgeText, getEdgeCenter } from '@braks/vue-flow'
|
||||
import { EdgeText, getEdgeCenter } from '@vue-flow/core'
|
||||
import type { CSSProperties } from 'vue'
|
||||
import { getArrow } from 'perfect-arrows'
|
||||
import type { PerfectArrowProps } from '../types'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Position } from '@braks/vue-flow'
|
||||
import { BezierEdge, EdgeText, getEdgeCenter, useVueFlow } from '@braks/vue-flow'
|
||||
import type { Position } from '@vue-flow/core'
|
||||
import { BezierEdge, EdgeText, getEdgeCenter, useVueFlow } from '@vue-flow/core'
|
||||
import type { PathFindingEdgeProps } from '../types'
|
||||
import { createGrid, gridRatio } from './createGrid'
|
||||
import { drawSmoothLinePath } from './drawSvgPath'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Grid } from 'pathfinding'
|
||||
import type { Position } from '@braks/vue-flow'
|
||||
import type { Position } from '@vue-flow/core'
|
||||
import { getNextPointFromPosition, guaranteeWalkablePath } from './guaranteeWalkablePath'
|
||||
import { graphToGridPoint } from './pointConversion'
|
||||
import { round } from './utils'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { XYPosition } from '@braks/vue-flow'
|
||||
import type { XYPosition } from '@vue-flow/core'
|
||||
|
||||
/**
|
||||
* Draws an SVG path from a list of points, using straight lines.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AStarFinder, DiagonalMovement, Util } from 'pathfinding'
|
||||
import type { Grid, Heuristic } from 'pathfinding'
|
||||
import type { XYPosition } from '@braks/vue-flow'
|
||||
import type { XYPosition } from '@vue-flow/core'
|
||||
|
||||
// https://www.npmjs.com/package/pathfinding#advanced-usage
|
||||
declare module 'pathfinding' {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GraphNode, XYPosition } from '@braks/vue-flow'
|
||||
import type { GraphNode, XYPosition } from '@vue-flow/core'
|
||||
import { roundDown, roundUp } from './utils'
|
||||
|
||||
export interface NodeBoundingBox {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Grid } from 'pathfinding'
|
||||
import type { Position, XYPosition } from '@braks/vue-flow'
|
||||
import type { Position, XYPosition } from '@vue-flow/core'
|
||||
|
||||
type Direction = 'top' | 'bottom' | 'left' | 'right'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { XYPosition } from '@braks/vue-flow'
|
||||
import type { XYPosition } from '@vue-flow/core'
|
||||
|
||||
const gridRatio = 10
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { EdgeProps, Position } from '@braks/vue-flow'
|
||||
import type { EdgeProps, Position } from '@vue-flow/core'
|
||||
import type { CSSProperties } from 'vue'
|
||||
import type { ArrowOptions } from 'perfect-arrows'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user