From 597f799fa442e228e21910ee40cbc5970671be71 Mon Sep 17 00:00:00 2001 From: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 15 Jun 2022 22:38:57 +0200 Subject: [PATCH] docs: add multiple transition animations to teleport example # What's changed? * add fade and shrink animations to teleportable nodes * demonstrate using `updateNodeDimensions` to properly align edges after a resizing transition --- docs/components/Repl.vue | 3 +- docs/components/examples/index.ts | 3 +- docs/components/examples/teleport/App.vue | 4 +- .../examples/teleport/TeleportableNode.vue | 62 +++------- docs/components/examples/teleport/index.ts | 1 + docs/components/examples/teleport/style.css | 41 ++++++- .../examples/teleport/useTransition.js | 109 ++++++++++++++++++ 7 files changed, 167 insertions(+), 56 deletions(-) create mode 100644 docs/components/examples/teleport/useTransition.js diff --git a/docs/components/Repl.vue b/docs/components/Repl.vue index 287edcbe..98708f4e 100644 --- a/docs/components/Repl.vue +++ b/docs/components/Repl.vue @@ -28,7 +28,8 @@ body, .vue-flow__minimap { transform: scale(75%); transform-origin: bottom right; -}` +} +\n` const store = new ReplStore({ showOutput: true, diff --git a/docs/components/examples/index.ts b/docs/components/examples/index.ts index ca465a70..6d92740d 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, TeleportCSS, TeleportSidebar, TeleportableNode } from './teleport' +import { TeleportApp, TeleportCSS, TeleportSidebar, TeleportableNode, TeleportableUseTransition } from './teleport' export const exampleImports = { basic: { @@ -94,6 +94,7 @@ export const exampleImports = { 'App.vue': TeleportApp, 'Sidebar.vue': TeleportSidebar, 'TeleportableNode.vue': TeleportableNode, + 'useTransition.js': TeleportableUseTransition, 'style.css': TeleportCSS, }, } diff --git a/docs/components/examples/teleport/App.vue b/docs/components/examples/teleport/App.vue index d53175b6..9ef3e18c 100644 --- a/docs/components/examples/teleport/App.vue +++ b/docs/components/examples/teleport/App.vue @@ -1,5 +1,5 @@