diff --git a/examples/App.tsx b/examples/App.tsx deleted file mode 100644 index 81c3fbf9..00000000 --- a/examples/App.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { computed, defineComponent } from 'vue' -import Header from './Header' -import { useRoute } from 'vue-router' - -export default defineComponent({ - name: 'App', - components: { - Header - }, - setup() { - const route = useRoute() - const key = computed(() => route.fullPath) - return () => ( - <> -
- - - ) - } -}) diff --git a/examples/App.vue b/examples/App.vue new file mode 100644 index 00000000..7452d696 --- /dev/null +++ b/examples/App.vue @@ -0,0 +1,7 @@ + + diff --git a/examples/Basic/Basic.vue b/examples/Basic/Basic.vue index 03668b50..6be7e039 100644 --- a/examples/Basic/Basic.vue +++ b/examples/Basic/Basic.vue @@ -1,30 +1,5 @@ - - + diff --git a/examples/CustomConnectionLine/ConnectionLine.vue b/examples/CustomConnectionLine/ConnectionLine.vue index e241f302..e9c4f854 100644 --- a/examples/CustomConnectionLine/ConnectionLine.vue +++ b/examples/CustomConnectionLine/ConnectionLine.vue @@ -1,3 +1,14 @@ + - diff --git a/examples/CustomConnectionLine/CustomConnectionLine.vue b/examples/CustomConnectionLine/CustomConnectionLine.vue index b5e2111c..064d4ead 100644 --- a/examples/CustomConnectionLine/CustomConnectionLine.vue +++ b/examples/CustomConnectionLine/CustomConnectionLine.vue @@ -1,41 +1,21 @@ - - + diff --git a/examples/CustomNode/ColorSelectorNode.vue b/examples/CustomNode/ColorSelectorNode.vue index 474f0f28..a0823f2f 100644 --- a/examples/CustomNode/ColorSelectorNode.vue +++ b/examples/CustomNode/ColorSelectorNode.vue @@ -1,43 +1,35 @@ + - diff --git a/examples/CustomNode/CustomNode.vue b/examples/CustomNode/CustomNode.vue index 512bdc49..beb69089 100644 --- a/examples/CustomNode/CustomNode.vue +++ b/examples/CustomNode/CustomNode.vue @@ -1,25 +1,6 @@ - - + diff --git a/examples/DragNDrop/DnD.vue b/examples/DragNDrop/DnD.vue index 3af29134..52e5e9e7 100644 --- a/examples/DragNDrop/DnD.vue +++ b/examples/DragNDrop/DnD.vue @@ -1,86 +1,58 @@ + - diff --git a/examples/DragNDrop/Sidebar.tsx b/examples/DragNDrop/Sidebar.tsx deleted file mode 100644 index 1288a373..00000000 --- a/examples/DragNDrop/Sidebar.tsx +++ /dev/null @@ -1,25 +0,0 @@ -const onDragStart = (event: DragEvent, nodeType: string) => { - if (event.dataTransfer) { - event.dataTransfer.setData('application/revueflow', nodeType) - event.dataTransfer.effectAllowed = 'move' - } -} - -const Sidebar = () => { - return ( - - ) -} - -export default Sidebar diff --git a/examples/DragNDrop/Sidebar.vue b/examples/DragNDrop/Sidebar.vue new file mode 100644 index 00000000..6e8be2be --- /dev/null +++ b/examples/DragNDrop/Sidebar.vue @@ -0,0 +1,22 @@ + + diff --git a/examples/EdgeTypes/EdgeTypesExample.vue b/examples/EdgeTypes/EdgeTypesExample.vue new file mode 100644 index 00000000..23cacca1 --- /dev/null +++ b/examples/EdgeTypes/EdgeTypesExample.vue @@ -0,0 +1,19 @@ + + diff --git a/examples/EdgeTypes/index.tsx b/examples/EdgeTypes/index.tsx deleted file mode 100644 index ed804335..00000000 --- a/examples/EdgeTypes/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Example for checking the different edge types and source and target positions - */ -import RevueFlow, { - removeElements, - addEdge, - MiniMap, - Controls, - Background, - OnLoadParams, - Connection, - Edge, - Elements -} from '../../src' -import { getElements } from './utils' -import { defineComponent, ref } from 'vue' - -const onLoad = (reactFlowInstance: OnLoadParams) => { - reactFlowInstance.fitView() - console.log(reactFlowInstance.getElements()) -} - -const initialElements = getElements() - -const EdgeTypesFlow = defineComponent({ - setup() { - const elements = ref(initialElements) - const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value)) - const onConnect = (params: Connection | Edge) => (elements.value = addEdge(params, elements.value)) - - return () => ( - - ) - } -}) - -export default EdgeTypesFlow diff --git a/examples/EdgeWithButton/ButtonEdge.vue b/examples/EdgeWithButton/ButtonEdge.vue index cc3c52a9..c119bfd7 100644 --- a/examples/EdgeWithButton/ButtonEdge.vue +++ b/examples/EdgeWithButton/ButtonEdge.vue @@ -59,12 +59,12 @@ const center = computed(() => )