refactor: change pkg scope to vue-flow
This commit is contained in:
@@ -59,10 +59,10 @@ the [examples](https://vueflow.dev/examples/).
|
|||||||
## 🛠 Setup
|
## 🛠 Setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm i @braks/vue-flow
|
$ npm i @vue-flow/core
|
||||||
|
|
||||||
# or
|
# or
|
||||||
$ yarn add @braks/vue-flow
|
$ yarn add @vue-flow/core
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🎮 Quickstart
|
## 🎮 Quickstart
|
||||||
@@ -80,7 +80,7 @@ A basic setup looks like this:
|
|||||||
```vue
|
```vue
|
||||||
<!-- Flowchart.vue -->
|
<!-- Flowchart.vue -->
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{
|
{
|
||||||
@@ -111,10 +111,10 @@ const elements = ref([
|
|||||||
|
|
||||||
```css
|
```css
|
||||||
/* import the required styles */
|
/* import the required styles */
|
||||||
@import "@braks/vue-flow/dist/style.css";
|
@import "@vue-flow/core/dist/style.css";
|
||||||
|
|
||||||
/* import the default theme (optional) */
|
/* import the default theme (optional) */
|
||||||
@import "@braks/vue-flow/dist/theme-default.css";
|
@import "@vue-flow/core/dist/theme-default.css";
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🪴 Vue 2
|
### 🪴 Vue 2
|
||||||
@@ -181,4 +181,4 @@ This project is built with
|
|||||||
Many thanks to the kind individuals who leave a star.
|
Many thanks to the kind individuals who leave a star.
|
||||||
Your support is much appreciated!
|
Your support is much appreciated!
|
||||||
|
|
||||||
[](https://github.com/bcakmakoglu/vue-flow/stargazers)
|
[](https://github.com/bcakmakoglu/vue-flow/stargazers)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Repl, ReplStore } from '@vue/repl'
|
import { Repl, ReplStore } from '@vue/repl'
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import '@vue/repl/style.css'
|
import '@vue/repl/style.css'
|
||||||
import { exampleImports } from './examples'
|
import { exampleImports } from './examples'
|
||||||
|
|
||||||
const props = defineProps<{ example: keyof typeof exampleImports; mainFile?: string; dependencies?: Record<string, string> }>()
|
const props = defineProps<{ example: keyof typeof exampleImports; mainFile?: string; dependencies?: Record<string, string> }>()
|
||||||
const { vueFlowVersion } = useVueFlow()
|
const { vueFlowVersion } = useVueFlow()
|
||||||
let css = `@import 'https://cdn.jsdelivr.net/npm/@braks/vue-flow@${vueFlowVersion.value}/dist/style.css';
|
let css = `@import 'https://cdn.jsdelivr.net/npm/@vue-flow/core@${vueFlowVersion.value}/dist/style.css';
|
||||||
@import 'https://cdn.jsdelivr.net/npm/@braks/vue-flow@${vueFlowVersion.value}/dist/theme-default.css';
|
@import 'https://cdn.jsdelivr.net/npm/@vue-flow/core@${vueFlowVersion.value}/dist/theme-default.css';
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
@@ -71,7 +71,7 @@ onMounted(async () => {
|
|||||||
// pre-set import map
|
// pre-set import map
|
||||||
store.setImportMap({
|
store.setImportMap({
|
||||||
imports: {
|
imports: {
|
||||||
'@braks/vue-flow': `${location.origin}/vue-flow.es.js`,
|
'@vue-flow/core': `${location.origin}/vue-flow.es.js`,
|
||||||
...additionalImports,
|
...additionalImports,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { initialElements } from './initial-elements.js'
|
import { initialElements } from './initial-elements.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarkerType } from '@braks/vue-flow'
|
import { MarkerType } from '@vue-flow/core'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can pass elements together as a v-model value
|
* You can pass elements together as a v-model value
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, BackgroundVariant, VueFlow } from '@braks/vue-flow'
|
import { Background, BackgroundVariant, VueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import CustomConnectionLine from './CustomConnectionLine.vue'
|
import CustomConnectionLine from './CustomConnectionLine.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ConnectionMode, MiniMap, Position, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { ConnectionMode, MiniMap, Position, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { computed, h, onMounted, ref } from 'vue'
|
import { computed, h, onMounted, ref } from 'vue'
|
||||||
import ColorSelectorNode from './CustomNode.vue'
|
import ColorSelectorNode from './CustomNode.vue'
|
||||||
import { presets } from './presets.js'
|
import { presets } from './presets.js'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { presets } from './presets.js'
|
import { presets } from './presets.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import Sidebar from './Sidebar.vue'
|
import Sidebar from './Sidebar.vue'
|
||||||
|
|
||||||
let id = 0
|
let id = 0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MarkerType, MiniMap, VueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MarkerType, MiniMap, VueFlow } from '@vue-flow/core'
|
||||||
import { h, ref } from 'vue'
|
import { h, ref } from 'vue'
|
||||||
import CustomEdge from './CustomEdge.vue'
|
import CustomEdge from './CustomEdge.vue'
|
||||||
import CustomEdge2 from './CustomEdge2.vue'
|
import CustomEdge2 from './CustomEdge2.vue'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { getBezierPath, getEdgeCenter, useVueFlow } from '@braks/vue-flow'
|
import { getBezierPath, getEdgeCenter, useVueFlow } from '@vue-flow/core'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { EdgeText, getBezierPath, getEdgeCenter } from '@braks/vue-flow'
|
import { EdgeText, getBezierPath, getEdgeCenter } from '@vue-flow/core'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, BackgroundVariant, Controls, MiniMap, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, BackgroundVariant, Controls, MiniMap, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { nodes, addNodes, edges, addEdges, onConnect, onPaneReady, onNodeDragStop, dimensions } = useVueFlow()
|
const { nodes, addNodes, edges, addEdges, onConnect, onPaneReady, onNodeDragStop, dimensions } = useVueFlow()
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Controls, MiniMap, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Controls, MiniMap, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref, watchEffect } from 'vue'
|
import { ref, watchEffect } from 'vue'
|
||||||
|
|
||||||
const isHidden = ref(false)
|
const isHidden = ref(false)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MiniMap, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { initialElements } from './initial-elements.js'
|
import { initialElements } from './initial-elements.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarkerType, Position } from '@braks/vue-flow'
|
import { MarkerType, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
export const initialElements = [
|
export const initialElements = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import InteractionControls from './InteractionControls.vue'
|
import InteractionControls from './InteractionControls.vue'
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ const elements = ref([
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow class="interactionflow" v-model="elements" :fit-view-on-init="true">
|
<VueFlow v-model="elements" class="interactionflow" :fit-view-on-init="true">
|
||||||
<InteractionControls />
|
<InteractionControls />
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, VueFlow, isNode } from '@braks/vue-flow'
|
import { Background, VueFlow, isNode } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, ConnectionMode, Controls, MiniMap, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, ConnectionMode, Controls, MiniMap, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
const { onConnect, nodes, edges, addEdges, addNodes } = useVueFlow({
|
const { onConnect, nodes, edges, addEdges, addNodes } = useVueFlow({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import Controls from './Controls.vue'
|
import Controls from './Controls.vue'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const flowKey = 'example-flow'
|
const flowKey = 'example-flow'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { nextTick, ref } from 'vue'
|
import { nextTick, ref } from 'vue'
|
||||||
import { getElements } from './utils.js'
|
import { getElements } from './utils.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import Sidebar from './Sidebar.vue'
|
import Sidebar from './Sidebar.vue'
|
||||||
import TeleportableNode from './TeleportableNode.vue'
|
import TeleportableNode from './TeleportableNode.vue'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
import { useTeleport } from './useTransition.js'
|
import { useTeleport } from './useTransition.js'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getConnectedEdges, useVueFlow } from '@braks/vue-flow'
|
import { getConnectedEdges, useVueFlow } from '@vue-flow/core'
|
||||||
import { nextTick, ref } from 'vue'
|
import { nextTick, ref } from 'vue'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ConnectionMode, Position, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { ConnectionMode, Position, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import TransitionEdge from './TransitionEdge.vue'
|
import TransitionEdge from './TransitionEdge.vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { TransitionPresets, useDebounceFn, useTransition, watchDebounced } from '@vueuse/core'
|
import { TransitionPresets, useDebounceFn, useTransition, watchDebounced } from '@vueuse/core'
|
||||||
import { getBezierPath, useVueFlow } from '@braks/vue-flow'
|
import { getBezierPath, useVueFlow } from '@vue-flow/core'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ConnectionMode, Controls, VueFlow, addEdge, updateEdge } from '@braks/vue-flow'
|
import { ConnectionMode, Controls, VueFlow, addEdge, updateEdge } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
|
|
||||||
const defaultLabel = '-'
|
const defaultLabel = '-'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, addEdge } from '@braks/vue-flow'
|
import { VueFlow, addEdge } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import CustomInput from './CustomInput.vue'
|
import CustomInput from './CustomInput.vue'
|
||||||
import CustomNode from './CustomNode.vue'
|
import CustomNode from './CustomNode.vue'
|
||||||
@@ -28,8 +28,8 @@ const onConnect = (params) => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VueFlow
|
<VueFlow
|
||||||
class="validationflow"
|
|
||||||
v-model="elements"
|
v-model="elements"
|
||||||
|
class="validationflow"
|
||||||
@connect="onConnect"
|
@connect="onConnect"
|
||||||
@pane-ready="onLoad"
|
@pane-ready="onLoad"
|
||||||
@connect-start="onConnectStart"
|
@connect-start="onConnectStart"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isValidTargetPos: {
|
isValidTargetPos: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Star from '~icons/carbon/star'
|
|||||||
import Download from '~icons/carbon/download'
|
import Download from '~icons/carbon/download'
|
||||||
|
|
||||||
const githubData = await $fetch('https://api.github.com/repos/bcakmakoglu/vue-flow?page=$i&per_page=100')
|
const githubData = await $fetch('https://api.github.com/repos/bcakmakoglu/vue-flow?page=$i&per_page=100')
|
||||||
const npmData = await $fetch('https://api.npmjs.org/downloads/point/last-month/@braks/vue-flow')
|
const npmData = await $fetch('https://api.npmjs.org/downloads/point/last-month/@vue-flow/core')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { VueFlowStore } from '@braks/vue-flow'
|
import type { VueFlowStore } from '@vue-flow/core'
|
||||||
import Basic from './flows/Basic.vue'
|
import Basic from './flows/Basic.vue'
|
||||||
import RGB from './flows/RGB.vue'
|
import RGB from './flows/RGB.vue'
|
||||||
import Nested from './flows/Nested.vue'
|
import Nested from './flows/Nested.vue'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import type { EdgeProps, MarkerType, Position } from '@braks/vue-flow'
|
import type { EdgeProps, MarkerType, Position } from '@vue-flow/core'
|
||||||
import { getBezierPath } from '@braks/vue-flow'
|
import { getBezierPath } from '@vue-flow/core'
|
||||||
|
|
||||||
interface CustomEdgeProps extends EdgeProps {
|
interface CustomEdgeProps extends EdgeProps {
|
||||||
source: string
|
source: string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import type { Elements } from '@braks/vue-flow'
|
import type { Elements } from '@vue-flow/core'
|
||||||
import { Background, Controls, MiniMap, Position, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, Position, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const emit = defineEmits(['pane'])
|
const emit = defineEmits(['pane'])
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { ClassFunc, GraphEdge, GraphNode, StyleFunc } from '@braks/vue-flow'
|
import type { ClassFunc, GraphEdge, GraphNode, StyleFunc } from '@vue-flow/core'
|
||||||
import { Background, ConnectionLineType, Controls, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, ConnectionLineType, Controls, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import Cross from '~icons/mdi/window-close'
|
import Cross from '~icons/mdi/window-close'
|
||||||
|
|
||||||
const emit = defineEmits(['pane'])
|
const emit = defineEmits(['pane'])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Background, Handle, Position, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, Handle, Position, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
||||||
import confetti from 'canvas-confetti'
|
import confetti from 'canvas-confetti'
|
||||||
import colors from 'windicss/colors'
|
import colors from 'windicss/colors'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Background, ConnectionMode, Controls, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, ConnectionMode, Controls, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { breakpointsTailwind } from '@vueuse/core'
|
import { breakpointsTailwind } from '@vueuse/core'
|
||||||
|
|
||||||
const emit = defineEmits(['pane'])
|
const emit = defineEmits(['pane'])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { MiniMapNodeFunc } from '@braks/vue-flow'
|
import type { MiniMapNodeFunc } from '@vue-flow/core'
|
||||||
import { Background, BackgroundVariant, Controls, MiniMap, VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { Background, BackgroundVariant, Controls, MiniMap, VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
import { breakpointsTailwind } from '@vueuse/core'
|
import { breakpointsTailwind } from '@vueuse/core'
|
||||||
import CustomEdge from '../edges/Custom.vue'
|
import CustomEdge from '../edges/Custom.vue'
|
||||||
import RGBNode from '../nodes/Input.vue'
|
import RGBNode from '../nodes/Input.vue'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { NodeProps } from '@braks/vue-flow'
|
import type { NodeProps } from '@vue-flow/core'
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
interface RGBNodeProps extends NodeProps {
|
interface RGBNodeProps extends NodeProps {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { NodeProps } from '@braks/vue-flow'
|
import type { NodeProps } from '@vue-flow/core'
|
||||||
import { Handle, Position } from '@braks/vue-flow'
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
interface RBGOutputNodeProps extends NodeProps {
|
interface RBGOutputNodeProps extends NodeProps {
|
||||||
rgb: string
|
rgb: string
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "docs2",
|
"name": "@vue-flow/docs",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"@algolia/client-search": "^4.14.2",
|
"@algolia/client-search": "^4.14.2",
|
||||||
"@animxyz/core": "^0.6.6",
|
"@animxyz/core": "^0.6.6",
|
||||||
"@animxyz/vue3": "^0.6.7",
|
"@animxyz/vue3": "^0.6.7",
|
||||||
"@braks/vue-flow": "workspace:*",
|
"@vue-flow/core": "workspace:*",
|
||||||
"@stackblitz/sdk": "^1.8.0",
|
"@stackblitz/sdk": "^1.8.0",
|
||||||
"@vue/repl": "1.1.2",
|
"@vue/repl": "1.1.2",
|
||||||
"blobity": "^0.2.1",
|
"blobity": "^0.2.1",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Icons from 'unplugin-icons/vite'
|
|||||||
import IconsResolver from 'unplugin-icons/resolver'
|
import IconsResolver from 'unplugin-icons/resolver'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { copyVueFlowPlugin } from './copy-plugin'
|
import { copyVueFlowPlugin } from './copy-plugin'
|
||||||
import head from './head'
|
import head from './head'
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ export function copyVueFlowPlugin(): Plugin {
|
|||||||
return {
|
return {
|
||||||
name: 'copy-vue-flow',
|
name: 'copy-vue-flow',
|
||||||
generateBundle() {
|
generateBundle() {
|
||||||
const filePath = resolve(__dirname, '../../node_modules/@braks/vue-flow/dist/vue-flow.es.js')
|
const filePath = resolve(__dirname, '../../node_modules/@vue-flow/core/dist/vue-flow.es.js')
|
||||||
if (!existsSync(filePath)) {
|
if (!existsSync(filePath)) {
|
||||||
throw new Error(`@braks/vue-flow/dist/vue-flow.es.js not built. ` + `Run "pnpm -w build" first.`)
|
throw new Error(`@vue-flow/core/dist/vue-flow.es.js not built. ` + `Run "pnpm -w build" first.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emitFile({
|
this.emitFile({
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import DefaultTheme from 'vitepress/theme'
|
|||||||
import Layout from './layouts/default.vue'
|
import Layout from './layouts/default.vue'
|
||||||
import 'virtual:windi.css'
|
import 'virtual:windi.css'
|
||||||
import '@animxyz/core'
|
import '@animxyz/core'
|
||||||
import '@braks/vue-flow/dist/style.css'
|
import '@vue-flow/core/dist/style.css'
|
||||||
import '@braks/vue-flow/dist/theme-default.css'
|
import '@vue-flow/core/dist/theme-default.css'
|
||||||
import './../../assets/index.css'
|
import './../../assets/index.css'
|
||||||
|
|
||||||
const CustomTheme = {
|
const CustomTheme = {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Thus accessing the internal state of Vue Flow becomes super easy when using comp
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow, VueFlow } from '@braks/vue-flow'
|
import { useVueFlow, VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { nodes, edges } = useVueFlow({
|
const { nodes, edges } = useVueFlow({
|
||||||
nodes: [
|
nodes: [
|
||||||
@@ -51,7 +51,7 @@ It requires a valid Vue Flow store in its context.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useZoomPanHelper } from '@braks/vue-flow'
|
import { useZoomPanHelper } from '@vue-flow/core'
|
||||||
|
|
||||||
const { fitView } = useZoomPanHelper()
|
const { fitView } = useZoomPanHelper()
|
||||||
</script>
|
</script>
|
||||||
@@ -71,8 +71,8 @@ This is how the default handle component is built:
|
|||||||
```vue
|
```vue
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NodeId, useHandle, useVueFlow } from '@braks/vue-flow'
|
import { NodeId, useHandle, useVueFlow } from '@vue-flow/core'
|
||||||
import type { HandleProps, Position } from '@braks/vue-flow'
|
import type { HandleProps, Position } from '@vue-flow/core'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<HandleProps>(), {
|
const props = withDefaults(defineProps<HandleProps>(), {
|
||||||
type: 'source',
|
type: 'source',
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Generally you create edges by adding them to the model-value or the edges prop o
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script>
|
<script>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { VueFlow },
|
components: { VueFlow },
|
||||||
@@ -61,7 +61,7 @@ directly to the state.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const initialNodes = ref([
|
const initialNodes = ref([
|
||||||
{
|
{
|
||||||
@@ -197,7 +197,7 @@ will expect a slot to have the name `edge-custom`.
|
|||||||
|
|
||||||
```vue{18,26}
|
```vue{18,26}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import CustomEdge from './CustomEdge.vue'
|
import CustomEdge from './CustomEdge.vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
@@ -360,7 +360,7 @@ to your edge components.
|
|||||||
|
|
||||||
```vue{19-26}
|
```vue{19-26}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{
|
{
|
||||||
@@ -397,7 +397,7 @@ triggered when the edge is clicked.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { EdgeProps, EdgeEventsOn } from '@braks/vue-flow'
|
import type { EdgeProps, EdgeEventsOn } from '@vue-flow/core'
|
||||||
|
|
||||||
// define your events
|
// define your events
|
||||||
interface CustomEdgeEvents {
|
interface CustomEdgeEvents {
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm i --save @braks/vue-flow
|
npm i --save @vue-flow/core
|
||||||
|
|
||||||
yarn add @braks/vue-flow
|
yarn add @vue-flow/core
|
||||||
|
|
||||||
pnpm i @braks/vue-flow
|
pnpm i @vue-flow/core
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -28,7 +28,7 @@ source (node id) and a target (node id).
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
// Nodes
|
// Nodes
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Generally you create nodes by adding them to the model-value or the nodes prop o
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script>
|
<script>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { VueFlow },
|
components: { VueFlow },
|
||||||
@@ -57,7 +57,7 @@ directly to the state.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const initialNodes = ref([
|
const initialNodes = ref([
|
||||||
{
|
{
|
||||||
@@ -94,7 +94,7 @@ which expects an array of [changes](/typedocs/types/NodeChange) to be applied to
|
|||||||
|
|
||||||
```vue{11,17-22}
|
```vue{11,17-22}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const initialNodes = ref([
|
const initialNodes = ref([
|
||||||
{
|
{
|
||||||
@@ -200,7 +200,7 @@ will expect a slot to have the name `node-custom`.
|
|||||||
|
|
||||||
```vue{9,16}
|
```vue{9,16}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import CustomNode from './CustomNode.vue'
|
import CustomNode from './CustomNode.vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
@@ -341,7 +341,7 @@ to your node components.
|
|||||||
|
|
||||||
```vue{9-13}
|
```vue{9-13}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{
|
{
|
||||||
@@ -370,7 +370,7 @@ triggered when the node is clicked.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { NodeProps, NodeEventsOn } from '@braks/vue-flow'
|
import type { NodeProps, NodeEventsOn } from '@vue-flow/core'
|
||||||
|
|
||||||
// define your events
|
// define your events
|
||||||
interface CustomNodeEvents {
|
interface CustomNodeEvents {
|
||||||
@@ -440,7 +440,7 @@ or you can emit the `updateNodeInternals` event from your custom node component
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { updateNodeInternals } = useVueFlow()
|
const { updateNodeInternals } = useVueFlow()
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ the default theme) can be skipped.
|
|||||||
|
|
||||||
```css
|
```css
|
||||||
/* these are necessary styles for vue flow */
|
/* these are necessary styles for vue flow */
|
||||||
@import '@braks/vue-flow/dist/style.css';
|
@import '@vue-flow/core/dist/style.css';
|
||||||
|
|
||||||
/* this contains the default theme, these are optional styles */
|
/* this contains the default theme, these are optional styles */
|
||||||
@import '@braks/vue-flow/dist/theme-default.css';
|
@import '@vue-flow/core/dist/theme-default.css';
|
||||||
```
|
```
|
||||||
|
|
||||||
## Customizing default theme
|
## Customizing default theme
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ All default edge components are exported and can be used or extended if necessar
|
|||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
// CustomEdge.vue
|
// CustomEdge.vue
|
||||||
import { EdgeProps, BezierEdge } from '@braks/vue-flow'
|
import { EdgeProps, BezierEdge } from '@vue-flow/core'
|
||||||
|
|
||||||
const props = defineProps<EdgeProps>()
|
const props = defineProps<EdgeProps>()
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
```vue{13}
|
```vue{13}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, isEdge } from '@braks/vue-flow'
|
import { VueFlow, isEdge } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, },
|
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, },
|
||||||
@@ -44,7 +44,7 @@ const toggleClass = () => {
|
|||||||
|
|
||||||
```vue{13}
|
```vue{13}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, isNode } from '@braks/vue-flow'
|
import { VueFlow, isNode } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
||||||
@@ -83,7 +83,7 @@ of [`useVueFlow`](/guide/composables#usevueflow/)
|
|||||||
|
|
||||||
```vue{12}
|
```vue{12}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, addEdge } from '@braks/vue-flow'
|
import { VueFlow, addEdge } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
||||||
@@ -116,7 +116,7 @@ of [`useVueFlow`](/guide/composables#usevueflow/)
|
|||||||
|
|
||||||
```vue{12}
|
```vue{12}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, updateEdge } from '@braks/vue-flow'
|
import { VueFlow, updateEdge } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ instance provided by [`onPaneReady`](/typedocs/interfaces/FlowEvents#paneready).
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { onPaneReady } = useVueFlow()
|
const { onPaneReady } = useVueFlow()
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ onPaneReady((instance) => instance.fitView())
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script>
|
<script>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { VueFlow },
|
components: { VueFlow },
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ as options to the [`useVueFlow`](/guide/composables#usevueflow) composable.
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
useVueFlow({
|
useVueFlow({
|
||||||
defaultZoom: 0.5,
|
defaultZoom: 0.5,
|
||||||
@@ -91,7 +91,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
||||||
@@ -123,7 +123,7 @@ const elements = ref([
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const nodes = ref([
|
const nodes = ref([
|
||||||
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
||||||
@@ -153,7 +153,7 @@ const nodes = ref([
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const nodes = ref([
|
const nodes = ref([
|
||||||
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
|
||||||
@@ -188,7 +188,7 @@ const edges = ref([
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import CustomNode from './CustomNode.vue'
|
import CustomNode from './CustomNode.vue'
|
||||||
|
|
||||||
const nodeTypes = {
|
const nodeTypes = {
|
||||||
@@ -225,7 +225,7 @@ const edges = ref([
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import CustomEdge from './CustomEdge.vue'
|
import CustomEdge from './CustomEdge.vue'
|
||||||
|
|
||||||
const edgeTypes = {
|
const edgeTypes = {
|
||||||
@@ -265,7 +265,7 @@ const edges = ref([
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const nodes = ref([
|
const nodes = ref([
|
||||||
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 } },
|
{ id: '1', label: 'Node 1', position: { x: 250, y: 5 } },
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ state is reactive and changes will be reflected on the graph.
|
|||||||
|
|
||||||
```vue{4-6}
|
```vue{4-6}
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { getNodes, onPaneReady } = useVueFlow({
|
const { getNodes, onPaneReady } = useVueFlow({
|
||||||
... // you can pass any VueFlowProp to the composable as a static option
|
... // you can pass any VueFlowProp to the composable as a static option
|
||||||
@@ -59,7 +59,7 @@ available as an injection in the component tree.
|
|||||||
```vue{5-6}
|
```vue{5-6}
|
||||||
<script>
|
<script>
|
||||||
// Container.vue
|
// Container.vue
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
// initialize a store instance in this context, so it is available when calling inject(VueFlow)
|
// initialize a store instance in this context, so it is available when calling inject(VueFlow)
|
||||||
useVueFlow()
|
useVueFlow()
|
||||||
@@ -70,7 +70,7 @@ Now we can easily access our current state instance from our Sidebar without pas
|
|||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { nodesSelectionActive, addSelectedNodes, getNodes } = useVueFlow()
|
const { nodesSelectionActive, addSelectedNodes, getNodes } = useVueFlow()
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ when mounted.
|
|||||||
|
|
||||||
```vue{4,32}
|
```vue{4,32}
|
||||||
<script>
|
<script>
|
||||||
import { VueFlow, useVueFlow } from '@braks/vue-flow'
|
import { VueFlow, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const { addEdges, onConnect } = useVueFlow({ id: 'options-api' })
|
const { addEdges, onConnect } = useVueFlow({ id: 'options-api' })
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isEdge, useVueFlow } from '@braks/vue-flow'
|
import { isEdge, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { StartHandle } from '@braks/vue-flow'
|
import type { StartHandle } from '@vue-flow/core'
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements(2, 2)
|
const { nodes, edges } = getElements(2, 2)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isEdge, useVueFlow } from '@braks/vue-flow'
|
import { isEdge, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements(2, 2)
|
const { nodes, edges } = getElements(2, 2)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { GraphEdge, GraphNode } from '@braks/vue-flow'
|
import type { GraphEdge, GraphNode } from '@vue-flow/core'
|
||||||
import { isNode, useVueFlow } from '@braks/vue-flow'
|
import { isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isEdge, isNode, useVueFlow } from '@braks/vue-flow'
|
import { isEdge, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes } = getElements()
|
const { nodes } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isNode, useVueFlow } from '@braks/vue-flow'
|
import { isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isNode, useVueFlow } from '@braks/vue-flow'
|
import { isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isRef } from 'vue'
|
import { isRef } from 'vue'
|
||||||
import type { State } from '@braks/vue-flow'
|
import type { State } from '@vue-flow/core'
|
||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
describe('Store Action: `setState`', () => {
|
describe('Store Action: `setState`', () => {
|
||||||
let store = useVueFlow()
|
let store = useVueFlow()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes, edges } = getElements()
|
const { nodes, edges } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes } = getElements()
|
const { nodes } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
import { getElements } from '../../../utils'
|
import { getElements } from '../../../utils'
|
||||||
|
|
||||||
const { nodes } = getElements()
|
const { nodes } = getElements()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
describe('Check if nodes are connectable', () => {
|
describe('Check if nodes are connectable', () => {
|
||||||
const store = useVueFlow({ id: 'test' })
|
const store = useVueFlow({ id: 'test' })
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useVueFlow } from '@braks/vue-flow'
|
import { useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
describe('Check if edges are updatable', () => {
|
describe('Check if edges are updatable', () => {
|
||||||
const store = useVueFlow({ id: 'test' })
|
const store = useVueFlow({ id: 'test' })
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, VueFlow } from '@braks/vue-flow'
|
import { Background, VueFlow } from '@vue-flow/core'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Controls, VueFlow } from '@braks/vue-flow'
|
import { Controls, VueFlow } from '@vue-flow/core'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { MiniMap, VueFlow } from '@braks/vue-flow'
|
import { MiniMap, VueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
nodes: {
|
nodes: {
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
|
|
||||||
// Import necessary styles
|
// Import necessary styles
|
||||||
import '@braks/vue-flow/dist/style.css'
|
import '@vue-flow/core/dist/style.css'
|
||||||
import '@braks/vue-flow/dist/theme-default.css'
|
import '@vue-flow/core/dist/theme-default.css'
|
||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands'
|
import './commands'
|
||||||
@@ -24,8 +24,8 @@ import './commands'
|
|||||||
// require('./commands')
|
// require('./commands')
|
||||||
|
|
||||||
import { mount } from 'cypress/vue'
|
import { mount } from 'cypress/vue'
|
||||||
import { VueFlow } from '@braks/vue-flow'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import type { FlowProps } from '@braks/vue-flow'
|
import type { FlowProps } from '@vue-flow/core'
|
||||||
|
|
||||||
const mountVueFlow = (props?: FlowProps, attrs?: Record<string, any>) => {
|
const mountVueFlow = (props?: FlowProps, attrs?: Record<string, any>) => {
|
||||||
cy.mount(VueFlow, {
|
cy.mount(VueFlow, {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Edge, Node } from '@braks/vue-flow'
|
import type { Edge, Node } from '@vue-flow/core'
|
||||||
|
|
||||||
export function getElements(xElements = 10, yElements = 10) {
|
export function getElements(xElements = 10, yElements = 10) {
|
||||||
const initialNodes: Node[] = []
|
const initialNodes: Node[] = []
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
"open": "cypress open"
|
"open": "cypress open"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braks/vue-flow": "workspace:*"
|
"@vue-flow/core": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cypress": "^10.9.0",
|
"cypress": "^10.9.0",
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@import '@braks/vue-flow/dist/style.css';
|
@import '@vue-flow/core/dist/style.css';
|
||||||
@import '@braks/vue-flow/dist/theme-default.css';
|
@import '@vue-flow/core/dist/theme-default.css';
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { initialElements } from './initial-elements.js'
|
import { initialElements } from './initial-elements.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarkerType } from '@braks/vue-flow'
|
import { MarkerType } from '@vue-flow/core'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can pass elements together as a v-model value
|
* You can pass elements together as a v-model value
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"dev": "nuxt dev"
|
"dev": "nuxt dev"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braks/vue-flow": "workspace:*"
|
"@vue-flow/core": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"nuxt": "3.0.0-rc.11"
|
"nuxt": "3.0.0-rc.11"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"lint": "eslint --ext .js,.ts,.vue ./"
|
"lint": "eslint --ext .js,.ts,.vue ./"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braks/vue-flow": "workspace:*",
|
"@vue-flow/core": "workspace:*",
|
||||||
"@quasar/extras": "^1.15.4",
|
"@quasar/extras": "^1.15.4",
|
||||||
"quasar": "^2.9.2",
|
"quasar": "^2.9.2",
|
||||||
"vue": "^3.2.37",
|
"vue": "^3.2.37",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { initialElements } from './initial-elements.js'
|
import { initialElements } from './initial-elements.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { initialElements } from './customized-elements.js'
|
import { initialElements } from './customized-elements.js'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarkerType } from '@braks/vue-flow'
|
import { MarkerType } from '@vue-flow/core'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can pass elements together as a v-model value
|
* You can pass elements together as a v-model value
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarkerType } from '@braks/vue-flow'
|
import { MarkerType } from '@vue-flow/core'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can pass elements together as a v-model value
|
* You can pass elements together as a v-model value
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* app global css */
|
/* app global css */
|
||||||
@import "@braks/vue-flow/dist/style.css";
|
@import "@vue-flow/core/dist/style.css";
|
||||||
@import "@braks/vue-flow/dist/theme-default.css";
|
@import "@vue-flow/core/dist/theme-default.css";
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/* import the required styles */
|
/* import the required styles */
|
||||||
@import 'node_modules/@braks/vue-flow/dist/style.css';
|
@import 'node_modules/@vue-flow/core/dist/style.css';
|
||||||
|
|
||||||
/* import the default theme (optional) */
|
/* import the default theme (optional) */
|
||||||
@import 'node_modules/@braks/vue-flow/dist/theme-default.css';
|
@import 'node_modules/@vue-flow/core/dist/theme-default.css';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: #111;
|
color: #111;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore ."
|
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braks/vue-flow": "workspace:*"
|
"@vue-flow/core": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/dagre": "^0.7.47",
|
"@types/dagre": "^0.7.47",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Elements } from '@braks/vue-flow'
|
import type { Elements } from '@vue-flow/core'
|
||||||
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, isNode, useVueFlow } from '@vue-flow/core'
|
||||||
|
|
||||||
const elements = ref<Elements>([
|
const elements = ref<Elements>([
|
||||||
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
{ id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 }, class: 'light' },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Elements, FlowEvents, VueFlowStore } from '@braks/vue-flow'
|
import type { Elements, FlowEvents, VueFlowStore } from '@vue-flow/core'
|
||||||
import { Background, Controls, MiniMap, VueFlow, addEdge, isNode } from '@braks/vue-flow'
|
import { Background, Controls, MiniMap, VueFlow, addEdge, isNode } from '@vue-flow/core'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'BasicOptionsAPI',
|
name: 'BasicOptionsAPI',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Position, ValidConnectionFunc } from '@braks/vue-flow'
|
import type { Position, ValidConnectionFunc } from '@vue-flow/core'
|
||||||
import { Handle } from '@braks/vue-flow'
|
import { Handle } from '@vue-flow/core'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Elements } from '@braks/vue-flow'
|
import type { Elements } from '@vue-flow/core'
|
||||||
import { Background, BackgroundVariant, VueFlow } from '@braks/vue-flow'
|
import { Background, BackgroundVariant, VueFlow } from '@vue-flow/core'
|
||||||
import ConnectionLine from './ConnectionLine.vue'
|
import ConnectionLine from './ConnectionLine.vue'
|
||||||
|
|
||||||
const elements = ref<Elements>([
|
const elements = ref<Elements>([
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user