diff --git a/docs/components/examples/index.ts b/docs/components/examples/index.ts index 6c349821..ca465a70 100644 --- a/docs/components/examples/index.ts +++ b/docs/components/examples/index.ts @@ -14,7 +14,7 @@ import { HiddenApp } from './hidden' import { InteractionApp, InteractionCSS, InteractionControls } from './interaction' import { MultiApp, MultiCSS, MultiFlow } from './multi' import { HorizontalApp, HorizontalElements } from './horizontal' -import { TeleportApp, TeleportSidebar, TeleportCSS } from './teleport' +import { TeleportApp, TeleportCSS, TeleportSidebar, TeleportableNode } from './teleport' export const exampleImports = { basic: { @@ -93,6 +93,7 @@ export const exampleImports = { teleport: { 'App.vue': TeleportApp, 'Sidebar.vue': TeleportSidebar, + 'TeleportableNode.vue': TeleportableNode, 'style.css': TeleportCSS, }, } diff --git a/docs/components/examples/teleport/App.vue b/docs/components/examples/teleport/App.vue index d66482e6..6177b2a0 100644 --- a/docs/components/examples/teleport/App.vue +++ b/docs/components/examples/teleport/App.vue @@ -1,23 +1,30 @@ diff --git a/docs/components/examples/teleport/TeleportableNode.vue b/docs/components/examples/teleport/TeleportableNode.vue new file mode 100644 index 00000000..55b2ea13 --- /dev/null +++ b/docs/components/examples/teleport/TeleportableNode.vue @@ -0,0 +1,45 @@ + + + diff --git a/docs/components/examples/teleport/index.ts b/docs/components/examples/teleport/index.ts index 82855be9..aeb04916 100644 --- a/docs/components/examples/teleport/index.ts +++ b/docs/components/examples/teleport/index.ts @@ -1,3 +1,4 @@ export { default as TeleportApp } from './App.vue?raw' export { default as TeleportSidebar } from './Sidebar.vue?raw' +export { default as TeleportableNode } from './TeleportableNode.vue?raw' export { default as TeleportCSS } from './style.css' diff --git a/docs/components/examples/teleport/style.css b/docs/components/examples/teleport/style.css index 0c04f63c..4c2470b9 100644 --- a/docs/components/examples/teleport/style.css +++ b/docs/components/examples/teleport/style.css @@ -11,8 +11,8 @@ padding: 15px 10px; font-size: 12px; background: rgba(16, 185, 129, 0.75); - -webkit-box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.3); - box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.3); + -webkit-box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3); + box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3); } .teleportflow aside .port > * { @@ -20,8 +20,8 @@ margin-bottom: 10px; cursor: grab; font-weight: 500; - -webkit-box-shadow: 5px 5px 10px 2px rgba(0,0,0,0.25); - box-shadow: 5px 5px 10px 2px rgba(0,0,0,0.25); + -webkit-box-shadow: 5px 5px 10px 2px rgba(0, 0, 0, 0.25); + box-shadow: 5px 5px 10px 2px rgba(0, 0, 0, 0.25); } .teleportflow aside .description { @@ -50,3 +50,11 @@ gap: 5px; } } + +.teleportable { + padding: 10px; + background: white; + border: 1px solid black; + border-radius: 10px; + color: black +} diff --git a/docs/src/.vuepress/components.d.ts b/docs/src/.vuepress/components.d.ts index f14b8376..93704a9e 100644 --- a/docs/src/.vuepress/components.d.ts +++ b/docs/src/.vuepress/components.d.ts @@ -29,6 +29,7 @@ declare module 'vue' { Repl: typeof import('./../../components/Repl.vue')['default'] RGB: typeof import('./../../components/home/flows/RGB.vue')['default'] Sidebar: typeof import('./../../components/examples/dnd/Sidebar.vue')['default'] + TeleportableNode: typeof import('./../../components/examples/teleport/TeleportableNode.vue')['default'] } } diff --git a/packages/vue-flow/src/components/Nodes/NodeWrapper.vue b/packages/vue-flow/src/components/Nodes/NodeWrapper.vue index 34bf2078..77168670 100644 --- a/packages/vue-flow/src/components/Nodes/NodeWrapper.vue +++ b/packages/vue-flow/src/components/Nodes/NodeWrapper.vue @@ -246,40 +246,38 @@ export default { diff --git a/packages/vue-flow/src/types/node.ts b/packages/vue-flow/src/types/node.ts index 5048ed10..ec99f633 100644 --- a/packages/vue-flow/src/types/node.ts +++ b/packages/vue-flow/src/types/node.ts @@ -1,4 +1,4 @@ -import type { Component, TeleportProps, VNode } from 'vue' +import type { Component, VNode } from 'vue' import type { BaseElement, Dimensions, ElementData, Position, SnapGrid, XYPosition, XYZPosition } from './flow' import type { DefaultNodeTypes, NodeComponent } from './components' import type { HandleElement, ValidConnectionFunc } from './handle' @@ -69,9 +69,6 @@ export interface GraphNode extends Node { isParent: boolean selected: boolean dragging: boolean - - /** teleports node element to specified dom location, this property is _not_ available on initial load, only after viewpane is ready */ - teleport?: TeleportProps['to'] } /** these props are passed to node components */