feat(ui): author parallel workflow branches on canvas
This commit is contained in:
1 parent
81121d03b0
commit
c812192800
11 files changed
+262
-125
No files matched your search
@@ -3,8 +3,9 @@ import { computed } from "vue";
|
||||
import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, type EdgeProps } from "@vue-flow/core";
|
||||
|
||||
import AddStepMenu from "./AddStepMenu.vue";
|
||||
import type { StepPath } from "./workflow-edit";
|
||||
|
||||
const props = defineProps<EdgeProps<{ insertAfter?: number; types: string[]; editable: boolean; onInsert: (after: number, type: string) => void }>>();
|
||||
const props = defineProps<EdgeProps<{ insertAfter?: StepPath; types: string[]; editable: boolean; onInsert: (after: StepPath, type: string) => void }>>();
|
||||
|
||||
const path = computed(() =>
|
||||
getSmoothStepPath({
|
||||
@@ -26,7 +27,7 @@ const path = computed(() =>
|
||||
class="workflow-insert absolute"
|
||||
:style="{ transform: `translate(-50%, -50%) translate(${path[1]}px, ${path[2]}px)`, pointerEvents: 'all' }"
|
||||
>
|
||||
<AddStepMenu :types="data.types" @pick="data.onInsert(data.insertAfter!, $event)" />
|
||||
<AddStepMenu :types="data.types" :label="data.insertAfter.length > 2 ? `Add a step in ${data.insertAfter[3]}` : undefined" @pick="data.onInsert(data.insertAfter!, $event)" />
|
||||
</div>
|
||||
</EdgeLabelRenderer>
|
||||
</template>
|
||||
Reference in new issue
Block a user