refactor: change pkg scope to vue-flow

This commit is contained in:
braks
2022-10-08 15:44:21 +02:00
committed by Braks
parent eb507c8e76
commit 8567e3733b
163 changed files with 288 additions and 288 deletions

View File

@@ -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)

View File

@@ -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,

View File

@@ -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

View File

@@ -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": {

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -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.

View File

@@ -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' {

View File

@@ -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 {

View File

@@ -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'

View File

@@ -1,4 +1,4 @@
import type { XYPosition } from '@braks/vue-flow'
import type { XYPosition } from '@vue-flow/core'
const gridRatio = 10

View File

@@ -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'