Compare commits
10 Commits
1b15e24bb3
...
cd63e3d0b0
| Author | SHA1 | Date | |
|---|---|---|---|
| cd63e3d0b0 | |||
|
|
782aeab2eb | ||
|
|
52a0301248 | ||
|
|
8c1d390c8f | ||
|
|
8073306b67 | ||
|
|
75a2e052db | ||
|
|
f330bee888 | ||
|
|
87b2d2c4e8 | ||
|
|
d98d3b57c2 | ||
|
|
474e830d08 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -2,6 +2,28 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [1.48.2] - 2026-01-28
|
||||
|
||||
[87b2d2c](87b2d2c4e8b8e1e321a9cb0795987672b13de913)...[52a0301](52a030124876245ddc7e32e30445ba506246503d)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Use autoscale prop to check if resize handle should scale (#2012) ([75a2e05](75a2e052dbe3d2930fa67a0b5fd5715210d14803))
|
||||
- Disable selection on drag when panning mode is active (#2014) ([8c1d390](8c1d390c8f84bfb216f324bf72e633e40de0efe2))
|
||||
|
||||
## [1.48.1] - 2025-12-17
|
||||
|
||||
[09cb136](09cb136ab7326da269f2e97f926880be0605cff6)...[87b2d2c](87b2d2c4e8b8e1e321a9cb0795987672b13de913)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Add missing `ts` script type to getting started example (#1971) ([1b15e24](1b15e24bb3d9e3dcc2f6b0f45be875098a71df18))
|
||||
- Use connecting handle to update connection (#1996) ([474e830](474e830d081f548777cf5518961fde5dc68a8039))
|
||||
|
||||
### Reverts
|
||||
|
||||
- Block pane ctx menu if panOnDrag includes [2] (right-click) (#2001) ([d98d3b5](d98d3b57c2a6721b1de66acbedac7cb5128712ae))
|
||||
|
||||
## [1.48.0] - 2025-11-21
|
||||
|
||||
[ff69823](ff69823b9db45da9dd012852b8b7ec50bb45c6a9)...[09cb136](09cb136ab7326da269f2e97f926880be0605cff6)
|
||||
|
||||
16272
_pnpm-lock.yaml
generated
Normal file
16272
_pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@
|
||||
"dotenv": "^16.4.5",
|
||||
"ohmyfetch": "^0.4.21",
|
||||
"typedoc": "^0.26.11",
|
||||
"typedoc-plugin-markdown": "^4.2.10",
|
||||
"typedoc-plugin-markdown": "4.2.10",
|
||||
"typedoc-plugin-merge-modules": "^6.0.3",
|
||||
"unplugin-auto-import": "^0.18.3",
|
||||
"unplugin-icons": "^0.20.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Edge, Node, ValidConnectionFunc } from '@vue-flow/core'
|
||||
import { ConnectionMode, Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||
import type { Edge, Node } from '@vue-flow/core'
|
||||
import { Panel, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||
|
||||
import { Background } from '@vue-flow/background'
|
||||
import { Controls } from '@vue-flow/controls'
|
||||
@@ -45,22 +45,10 @@ function resetViewport() {
|
||||
function toggleclass() {
|
||||
return nodes.value.forEach((el) => (el.class = el.class === 'light' ? 'dark' : 'light'))
|
||||
}
|
||||
|
||||
const isValidConnection: ValidConnectionFunc = (...args) => {
|
||||
console.log(args)
|
||||
return true
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VueFlow
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:connection-mode="ConnectionMode.Strict"
|
||||
:is-valid-connection="isValidConnection"
|
||||
fit-view-on-init
|
||||
class="vue-flow-basic-example"
|
||||
>
|
||||
<VueFlow :nodes="nodes" :edges="edges" class="vue-flow-basic-example" fit-view-on-init>
|
||||
<Background />
|
||||
<MiniMap />
|
||||
<Controls />
|
||||
|
||||
20
packages/background/LICENSE
Normal file
20
packages/background/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019-2024 webkid GmbH
|
||||
Copyright (c) 2021-2024 Burak Cakmakoglu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -45,6 +45,21 @@
|
||||
"*.d.ts"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vue-tsc": "^1.8.16",
|
||||
"@tooling/eslint-config": "0.0.0",
|
||||
"@tooling/tsconfig": "0.0.0",
|
||||
"@tooling/vite-config": "0.0.0",
|
||||
"@vue-flow/core": "1.41.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
@@ -54,20 +69,5 @@
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tooling/eslint-config": "workspace:*",
|
||||
"@tooling/tsconfig": "workspace:*",
|
||||
"@tooling/vite-config": "workspace:*",
|
||||
"@vue-flow/core": "workspace:*",
|
||||
"vue-tsc": "^1.8.16"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
packages/controls/LICENSE
Normal file
20
packages/controls/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019-2025 webkid GmbH
|
||||
Copyright (c) 2021-2025 Burak Cakmakoglu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -48,6 +48,22 @@
|
||||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite-svg-loader": "^4.0.0",
|
||||
"vue-tsc": "^1.8.16",
|
||||
"@tooling/eslint-config": "0.0.0",
|
||||
"@tooling/tsconfig": "0.0.0",
|
||||
"@tooling/vite-config": "0.0.0",
|
||||
"@vue-flow/core": "1.45.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
@@ -57,21 +73,5 @@
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tooling/eslint-config": "workspace:*",
|
||||
"@tooling/tsconfig": "workspace:*",
|
||||
"@tooling/vite-config": "workspace:*",
|
||||
"@vue-flow/core": "workspace:*",
|
||||
"vite-svg-loader": "^4.0.0",
|
||||
"vue-tsc": "^1.8.16"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,19 @@
|
||||
# @vue-flow/core
|
||||
|
||||
## 1.48.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2014](https://github.com/bcakmakoglu/vue-flow/pull/2014) [`c81d765`](https://github.com/bcakmakoglu/vue-flow/commit/c81d7657ba9e541f0f0c97a01cd62c777f177d30) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Disable selection on drag by setting the keycode to `true` when panning mode is active.
|
||||
|
||||
## 1.48.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1996](https://github.com/bcakmakoglu/vue-flow/pull/1996) [`1c9732a`](https://github.com/bcakmakoglu/vue-flow/commit/1c9732ae99313cce9d8125571b51440931f9a9b0) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Use the connecting handle result when updating a connection, so we get an accurate connection position for `toPosition`.
|
||||
|
||||
- [#2001](https://github.com/bcakmakoglu/vue-flow/pull/2001) [`08d57fa`](https://github.com/bcakmakoglu/vue-flow/commit/08d57fa1609e1fc7b966fb08a99fbf4756bc11b5) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Block pane ctx-menu from triggering if panOnDrag includes btn 2 (right-click) and let viewport emit pane ctx menu.
|
||||
|
||||
## 1.48.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
20
packages/core/LICENSE
Normal file
20
packages/core/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019-2025 webkid GmbH
|
||||
Copyright (c) 2021-2025 Burak Cakmakoglu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
174
packages/core/README.md
Normal file
174
packages/core/README.md
Normal file
@@ -0,0 +1,174 @@
|
||||
# Vue Flow 🌊
|
||||
|
||||
[](https://vueflow.dev/)
|
||||

|
||||

|
||||

|
||||
|
||||
__Vue Flow: A highly customizable Vue 3 Flowchart component.__
|
||||
|
||||
You can find a detailed explanation on how to get started [here](https://vueflow.dev/guide/)
|
||||
or jump right into the [examples](https://vueflow.dev/examples/).
|
||||
|
||||
## Table of contents
|
||||
|
||||
* [⭐️ Features](#-features)
|
||||
|
||||
* [🛠 Setup](#-setup)
|
||||
|
||||
* [🎮 Quickstart](#-quickstart)
|
||||
|
||||
+ [🪴 Vue 2](#-vue-2)
|
||||
|
||||
* [🧪 Development](#-development)
|
||||
|
||||
+ [🐳 Dev Container](#-dev-container)
|
||||
|
||||
* [ Discord](#-discord)
|
||||
|
||||
* [💝 Special Thanks](#-special-thanks)
|
||||
|
||||
* [⭐ Stargazers](#-stargazers)
|
||||
|
||||
## ⭐️ Features
|
||||
|
||||
- 👶 __Easy setup__: Get started hassle-free - Built-in zoom- & pan features, element dragging, selection and much more
|
||||
|
||||
- 🎨 __Customizable__: Use your custom nodes, edges and connection lines and expand on Vue Flows' functionality
|
||||
|
||||
- 🚀 __Fast__: Tracks changes reactively and only re-renders the appropriate elements
|
||||
|
||||
- 🧲 __Utils & Composition__: Comes with graph helper and state composable functions for advanced uses
|
||||
|
||||
- 📦 __Additional Components__:
|
||||
|
||||
- 🖼 Background: With two built-in patterns and some configuration options like height, width or color.
|
||||
|
||||
- 🧭 Minimap: Shows current nodes in a small map shape in the bottom right corner
|
||||
|
||||
- 🕹 Controls: Control zoom behavior from a panel on the bottom left
|
||||
|
||||
- 🤖 And (many) more to come...
|
||||
|
||||
- 🦾 __Reliable__: Fully written in TypeScript
|
||||
|
||||
## 🛠 Setup
|
||||
|
||||
```bash
|
||||
$ npm i @vue-flow/core
|
||||
|
||||
# or
|
||||
$ pnpm i @vue-flow/core
|
||||
|
||||
# or
|
||||
$ yarn add @vue-flow/core
|
||||
```
|
||||
|
||||
## 🎮 Quickstart
|
||||
|
||||
In Vue Flow, an application structure consists of __nodes__ and __edges__, all of which are categorised as __elements__.
|
||||
|
||||
__Each element requires a unique id.__
|
||||
|
||||
Nodes additionally need an __XY-position__, while edges require a __source__ and a __target__, both represented by node ids.
|
||||
|
||||
```vue
|
||||
<!-- Flowchart.vue -->
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { VueFlow } from '@vue-flow/core'
|
||||
|
||||
const nodes = ref([
|
||||
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
||||
{ id: '2', label: 'Node 2', position: { x: 100, y: 100 } },
|
||||
{ id: '3', label: 'Node 3', position: { x: 400, y: 100 } },
|
||||
{ id: '4', label: 'Node 4', position: { x: 400, y: 200 } },
|
||||
])
|
||||
|
||||
const edges = ref([
|
||||
{ id: 'e1-2', source: '1', target: '2', animated: true },
|
||||
{ id: 'e1-3', source: '1', target: '3' },
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VueFlow v-model:nodes="nodes" v-model:edges="edges"></VueFlow>
|
||||
</template>
|
||||
```
|
||||
|
||||
⚠️ __Make sure to import the necessary styles:__
|
||||
|
||||
```css
|
||||
/* import the required styles */
|
||||
@import "@vue-flow/core/dist/style.css";
|
||||
|
||||
/* import the default theme (optional) */
|
||||
@import "@vue-flow/core/dist/theme-default.css";
|
||||
```
|
||||
|
||||
Do __not__ scope these styles with `scoped` in your component.
|
||||
|
||||
### 🪴 Vue 2
|
||||
|
||||
**_This library doesn't work with Vue 2._**
|
||||
|
||||
Vue Flow uses features that are exclusive to Vue 3, therefore
|
||||
there is no support for Vue 2, nor will there be any support in the future, sorry.
|
||||
|
||||
## 🧪 Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Node.js v20+](https://nodejs.org/)
|
||||
- [pnpm v9+](https://pnpm.io/)
|
||||
|
||||
```bash
|
||||
# install pnpm if you haven't already
|
||||
$ npm i -g pnpm
|
||||
|
||||
# start examples
|
||||
$ pnpm dev
|
||||
|
||||
# build all packages
|
||||
$ pnpm build
|
||||
```
|
||||
|
||||
### 🐳 Dev Container
|
||||
|
||||
To start using development containers, install the `Docker` extension
|
||||
for VSCode.
|
||||
After installing the extension, open the connection menu either
|
||||
on the bottom left or open it via the commands tab.
|
||||
Select the `Open Folder in Container` option to mount the project.
|
||||
|
||||
The development container will spin up all packages example apps and forward
|
||||
the ports to your machine.
|
||||
|
||||
##  Discord
|
||||
|
||||
[Join the Vue Flow Discord server!](https://discord.gg/rwt6CBk4b5)
|
||||
|
||||
Here you can ask questions to the community, propose ideas for new features
|
||||
or share your work that you have built with Vue Flow.
|
||||
|
||||
## 💝 Special Thanks
|
||||
|
||||
This project is built with
|
||||
|
||||
- [React Flow](https://reactflow.dev/)
|
||||
- Vue flow is heavily based on [webkids'](https://webkid.io/) [ReactFlow](https://reactflow.dev/). I wholeheartedly
|
||||
thank them for their amazing work! Without them VueFlow would not exist.
|
||||
Please consider [donating](https://github.com/sponsors/wbkd) or subscribing to [ReactFlow Pro](https://reactflow.dev/pro).
|
||||
|
||||
- [D3.js](https://d3js.org/)
|
||||
- D3 makes all the zoom and pan actions in Vue Flow possible.
|
||||
|
||||
- [VueUse](https://vueuse.org/)
|
||||
- VueUse is a collection of essential vue composition utilities
|
||||
|
||||
## ⭐ Stargazers
|
||||
|
||||
Many thanks to the kind individuals who leave a star.
|
||||
Your support is much appreciated!
|
||||
|
||||
[](https://github.com/bcakmakoglu/vue-flow/stargazers)
|
||||
@@ -54,19 +54,6 @@
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build && vite build -c vite.config.iife.ts",
|
||||
"build:watch": "vite build --watch & vite build -c vite.config.iife.ts --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && tsc -p ./tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch & tsc -p ./tsconfig.build.json --watch",
|
||||
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"prepublishOnly": "shx cp ../../README.md .",
|
||||
"postpublish": "shx rm README.md",
|
||||
"test": "exit 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
@@ -79,8 +66,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-replace": "^5.0.3",
|
||||
"@tooling/eslint-config": "workspace:*",
|
||||
"@tooling/tsconfig": "workspace:*",
|
||||
"@types/d3-drag": "^3.0.7",
|
||||
"@types/d3-interpolate": "^3.0.4",
|
||||
"@types/d3-selection": "^3.0.11",
|
||||
@@ -92,6 +77,19 @@
|
||||
"postcss-cli": "^10.1.0",
|
||||
"postcss-nested": "^6.0.1",
|
||||
"vite": "^4.4.11",
|
||||
"vue-tsc": "^1.8.16"
|
||||
"vue-tsc": "^1.8.16",
|
||||
"@tooling/tsconfig": "0.0.0",
|
||||
"@tooling/eslint-config": "0.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build && vite build -c vite.config.iife.ts",
|
||||
"build:watch": "vite build --watch & vite build -c vite.config.iife.ts --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && tsc -p ./tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch & tsc -p ./tsconfig.build.json --watch",
|
||||
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,7 @@ export function useHandle({
|
||||
}
|
||||
|
||||
const connectingHandle = closestHandle ?? result.toHandle
|
||||
|
||||
updateConnection(
|
||||
connectingHandle && isValid
|
||||
? rendererPointToPoint(
|
||||
@@ -254,7 +255,7 @@ export function useHandle({
|
||||
viewport.value,
|
||||
)
|
||||
: connectionPosition,
|
||||
result.toHandle,
|
||||
connectingHandle,
|
||||
getConnectionStatus(!!connectingHandle, isValid),
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, toRef, watch } from 'vue'
|
||||
import { shallowRef, toRef, watch } from 'vue'
|
||||
import UserSelection from '../../components/UserSelection/UserSelection.vue'
|
||||
import NodesSelection from '../../components/NodesSelection/NodesSelection.vue'
|
||||
import type { EdgeChange, NodeChange } from '../../types'
|
||||
@@ -33,15 +33,16 @@ const {
|
||||
connectionLookup,
|
||||
defaultEdgeOptions,
|
||||
connectionStartHandle,
|
||||
panOnDrag,
|
||||
} = useVueFlow()
|
||||
|
||||
const container = ref<HTMLDivElement | null>(null)
|
||||
const container = shallowRef<HTMLDivElement | null>(null)
|
||||
|
||||
const selectedNodeIds = ref<Set<string>>(new Set())
|
||||
const selectedNodeIds = shallowRef<Set<string>>(new Set())
|
||||
|
||||
const selectedEdgeIds = ref<Set<string>>(new Set())
|
||||
const selectedEdgeIds = shallowRef<Set<string>>(new Set())
|
||||
|
||||
const containerBounds = ref<DOMRect>()
|
||||
const containerBounds = shallowRef<DOMRect | null>(null)
|
||||
|
||||
const hasActiveSelection = toRef(() => elementsSelectable.value && (isSelecting || userSelectionActive.value))
|
||||
|
||||
@@ -95,8 +96,10 @@ function onClick(event: MouseEvent) {
|
||||
}
|
||||
|
||||
function onContextMenu(event: MouseEvent) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
if (Array.isArray(panOnDrag.value) && panOnDrag.value?.includes(2)) {
|
||||
event.preventDefault()
|
||||
return
|
||||
}
|
||||
|
||||
emits.paneContextMenu(event)
|
||||
}
|
||||
@@ -106,7 +109,7 @@ function onWheel(event: WheelEvent) {
|
||||
}
|
||||
|
||||
function onPointerDown(event: PointerEvent) {
|
||||
containerBounds.value = vueFlowRef.value?.getBoundingClientRect()
|
||||
containerBounds.value = vueFlowRef.value?.getBoundingClientRect() ?? null
|
||||
|
||||
if (
|
||||
!elementsSelectable.value ||
|
||||
|
||||
@@ -61,9 +61,7 @@ let prevTransform: ViewportTransform = {
|
||||
}
|
||||
|
||||
const panKeyPressed = useKeyPress(panActivationKeyCode)
|
||||
|
||||
const selectionKeyPressed = useKeyPress(selectionKeyCode)
|
||||
|
||||
const zoomKeyPressed = useKeyPress(zoomActivationKeyCode)
|
||||
|
||||
const shouldPanOnDrag = toRef(
|
||||
@@ -74,7 +72,11 @@ const shouldPanOnDrag = toRef(
|
||||
|
||||
const shouldPanOnScroll = toRef(() => panKeyPressed.value || panOnScroll.value)
|
||||
|
||||
const isSelecting = toRef(() => selectionKeyPressed.value || (selectionKeyCode.value === true && shouldPanOnDrag.value !== true))
|
||||
const shouldSelectOnDrag = toRef(() => selectionKeyCode.value === true && shouldPanOnDrag.value !== true)
|
||||
|
||||
const isSelecting = toRef(
|
||||
() => (selectionKeyPressed.value && selectionKeyCode.value !== true) || userSelectionActive.value || shouldSelectOnDrag.value,
|
||||
)
|
||||
|
||||
const connectionInProgress = toRef(() => connectionStartHandle.value !== null)
|
||||
|
||||
@@ -229,7 +231,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
// if selection key code is true and panOnDrag tries to use left mouse button we prevent it
|
||||
if (selectionKeyCode.value === true && Array.isArray(panOnDrag.value) && panOnDrag.value.includes(0) && eventButton === 0) {
|
||||
if (shouldSelectOnDrag.value && Array.isArray(panOnDrag.value) && panOnDrag.value.includes(0) && eventButton === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
20
packages/minimap/LICENSE
Normal file
20
packages/minimap/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019-2025 webkid GmbH
|
||||
Copyright (c) 2021-2025 Burak Cakmakoglu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -46,16 +46,6 @@
|
||||
"*.d.ts"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
"build:watch": "vite build --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
@@ -65,16 +55,26 @@
|
||||
"d3-zoom": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tooling/eslint-config": "workspace:*",
|
||||
"@tooling/tsconfig": "workspace:*",
|
||||
"@tooling/vite-config": "workspace:*",
|
||||
"@types/d3-selection": "^3.0.7",
|
||||
"@types/d3-zoom": "^3.0.5",
|
||||
"@vue-flow/core": "workspace:*",
|
||||
"vue-tsc": "^1.8.16"
|
||||
"vue-tsc": "^1.8.16",
|
||||
"@tooling/eslint-config": "0.0.0",
|
||||
"@tooling/tsconfig": "0.0.0",
|
||||
"@vue-flow/core": "1.46.0",
|
||||
"@tooling/vite-config": "0.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
"build:watch": "vite build --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
# @vue-flow/node-resizer
|
||||
|
||||
## 1.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2012](https://github.com/bcakmakoglu/vue-flow/pull/2012) [`de9c276`](https://github.com/bcakmakoglu/vue-flow/commit/de9c2768e8f65c6cd913023f13044ba93aceda5b) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Use auto-scale prop to determine whether a resize handle should be scaled.
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
20
packages/node-resizer/LICENSE
Normal file
20
packages/node-resizer/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2019-2025 webkid GmbH
|
||||
Copyright (c) 2021-2025 Burak Cakmakoglu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -48,16 +48,6 @@
|
||||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
"build:watch": "vite build --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
@@ -67,16 +57,26 @@
|
||||
"d3-selection": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tooling/eslint-config": "workspace:*",
|
||||
"@tooling/tsconfig": "workspace:*",
|
||||
"@tooling/vite-config": "workspace:*",
|
||||
"@types/d3-drag": "^3.0.4",
|
||||
"@types/d3-selection": "^3.0.7",
|
||||
"@vue-flow/core": "workspace:*",
|
||||
"vue-tsc": "^1.8.16"
|
||||
"vue-tsc": "^1.8.16",
|
||||
"@tooling/eslint-config": "0.0.0",
|
||||
"@tooling/tsconfig": "0.0.0",
|
||||
"@tooling/vite-config": "0.0.0",
|
||||
"@vue-flow/core": "1.45.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm types:watch & pnpm build:watch",
|
||||
"build": "vite build",
|
||||
"build:watch": "vite build --watch",
|
||||
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
|
||||
"types:watch": "vue-tsc --declaration --emitDeclarationOnly --watch",
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix --ignore-pattern !**/* ./dist",
|
||||
"test": "exit 0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,10 @@ const positionClassNames = computed(() => controlPosition.value.split('-'))
|
||||
|
||||
const controlStyle = toRef(() => (props.color ? { [StylingProperty[props.variant]]: props.color } : {}))
|
||||
|
||||
const isHandleControl = toRef(() => props.variant === ResizeControlVariant.Handle)
|
||||
|
||||
const scale = computed(() => (isHandleControl.value && props.autoScale ? `${Math.max(1 / viewport.value.zoom, 1)}` : undefined))
|
||||
|
||||
watchEffect((onCleanup) => {
|
||||
if (!resizeControlRef.value || !props.nodeId) {
|
||||
return
|
||||
@@ -243,7 +247,7 @@ export default {
|
||||
:class="[...positionClassNames, variant, noDragClassName]"
|
||||
:style="{
|
||||
...controlStyle,
|
||||
scale: variant === ResizeControlVariant.Handle ? `${Math.max(1 / viewport.zoom, 1)}` : undefined,
|
||||
scale,
|
||||
}"
|
||||
>
|
||||
<slot />
|
||||
|
||||
12744
pnpm-lock.yaml
generated
12744
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user