@kestra-io/ui-libs 0.0.83 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/SplitCellsHorizontal.vue.d.ts +5 -0
- package/dist/assets/icons/SplitCellsHorizontal.vue.d.ts.map +1 -0
- package/dist/assets/icons/SplitCellsVertical.vue.d.ts +5 -0
- package/dist/assets/icons/SplitCellsVertical.vue.d.ts.map +1 -0
- package/dist/components/buttons/AddTaskButton.vue.d.ts +6 -0
- package/dist/components/buttons/AddTaskButton.vue.d.ts.map +1 -0
- package/dist/components/content/Alert.vue.d.ts +21 -0
- package/dist/components/content/Alert.vue.d.ts.map +1 -0
- package/dist/components/content/Collapse.vue.d.ts +21 -0
- package/dist/components/content/Collapse.vue.d.ts.map +1 -0
- package/dist/components/content/ConfigPropertyCard.vue.d.ts +11 -0
- package/dist/components/content/ConfigPropertyCard.vue.d.ts.map +1 -0
- package/dist/components/content/MDCRenderer.vue.d.ts +3 -0
- package/dist/components/content/MDCRenderer.vue.d.ts.map +1 -0
- package/dist/components/content/Mermaid.vue.d.ts +18 -0
- package/dist/components/content/Mermaid.vue.d.ts.map +1 -0
- package/dist/components/content/NextLink.vue.d.ts +18 -0
- package/dist/components/content/NextLink.vue.d.ts.map +1 -0
- package/dist/components/content/ProseBlockquote.vue.d.ts +18 -0
- package/dist/components/content/ProseBlockquote.vue.d.ts.map +1 -0
- package/dist/components/content/ProseCode.vue.d.ts +18 -0
- package/dist/components/content/ProseCode.vue.d.ts.map +1 -0
- package/dist/components/content/ProsePre.vue.d.ts +31 -0
- package/dist/components/content/ProsePre.vue.d.ts.map +1 -0
- package/dist/components/content/ProseTable.vue.d.ts +18 -0
- package/dist/components/content/ProseTable.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/misc/Duration.vue.d.ts +6 -0
- package/dist/components/misc/Duration.vue.d.ts.map +1 -0
- package/dist/components/misc/ExecutionInformations.vue.d.ts +14 -0
- package/dist/components/misc/ExecutionInformations.vue.d.ts.map +1 -0
- package/dist/components/misc/State.vue.d.ts +8 -0
- package/dist/components/misc/State.vue.d.ts.map +1 -0
- package/dist/components/misc/TaskIcon.vue.d.ts +13 -0
- package/dist/components/misc/TaskIcon.vue.d.ts.map +1 -0
- package/dist/components/misc/Tooltip.vue.d.ts +29 -0
- package/dist/components/misc/Tooltip.vue.d.ts.map +1 -0
- package/dist/components/nodes/BasicNode.vue.d.ts +71 -0
- package/dist/components/nodes/BasicNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/ClusterNode.vue.d.ts +49 -0
- package/dist/components/nodes/ClusterNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/CollapsedClusterNode.vue.d.ts +190 -0
- package/dist/components/nodes/CollapsedClusterNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/DependenciesNode.vue.d.ts +65 -0
- package/dist/components/nodes/DependenciesNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/DotNode.vue.d.ts +133 -0
- package/dist/components/nodes/DotNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/EdgeNode.vue.d.ts +103 -0
- package/dist/components/nodes/EdgeNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/TaskNode.vue.d.ts +202 -0
- package/dist/components/nodes/TaskNode.vue.d.ts.map +1 -0
- package/dist/components/nodes/TriggerNode.vue.d.ts +170 -0
- package/dist/components/nodes/TriggerNode.vue.d.ts.map +1 -0
- package/dist/components/plugins/PropertyDetail.vue.d.ts +32 -0
- package/dist/components/plugins/PropertyDetail.vue.d.ts.map +1 -0
- package/dist/components/plugins/PropertyType.vue.d.ts +31 -0
- package/dist/components/plugins/PropertyType.vue.d.ts.map +1 -0
- package/dist/components/plugins/SchemaToCode.vue.d.ts +22 -0
- package/dist/components/plugins/SchemaToCode.vue.d.ts.map +1 -0
- package/dist/components/plugins/SchemaToHtml.vue.d.ts +53 -0
- package/dist/components/plugins/SchemaToHtml.vue.d.ts.map +1 -0
- package/dist/components/topology/Topology.vue.d.ts +157 -0
- package/dist/components/topology/Topology.vue.d.ts.map +1 -0
- package/dist/composables/getMDCParser.d.ts +3 -0
- package/dist/composables/getMDCParser.d.ts.map +1 -0
- package/dist/composables/useMarkdownParser.d.ts +4 -0
- package/dist/composables/useMarkdownParser.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/kestra-ui.js +15093 -10840
- package/dist/kestra-ui.js.map +1 -1
- package/dist/kestra-ui.umd.cjs +47 -21
- package/dist/kestra-ui.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/Utils.d.ts +14 -0
- package/dist/utils/Utils.d.ts.map +1 -0
- package/dist/utils/VueFlowUtils.d.ts +93 -0
- package/dist/utils/VueFlowUtils.d.ts.map +1 -0
- package/dist/utils/YamlUtils.d.ts +42 -0
- package/dist/utils/YamlUtils.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +33 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/global.d.ts +14 -0
- package/dist/utils/global.d.ts.map +1 -0
- package/dist/utils/state.d.ts +42 -0
- package/dist/utils/state.d.ts.map +1 -0
- package/package.json +45 -9
- package/src/components/buttons/AddTaskButton.vue +10 -15
- package/src/components/content/Alert.vue +8 -10
- package/src/components/content/Collapse.vue +10 -23
- package/src/components/content/ConfigPropertyCard.vue +8 -19
- package/src/components/content/MDCRenderer.vue +3 -2
- package/src/components/content/Mermaid.vue +2 -2
- package/src/components/content/NextLink.vue +1 -7
- package/src/components/content/ProseBlockquote.vue +0 -3
- package/src/components/content/ProsePre.vue +56 -73
- package/src/components/content/ProseTable.vue +0 -3
- package/src/components/index.ts +19 -0
- package/src/components/misc/Duration.vue +86 -86
- package/src/components/misc/ExecutionInformations.vue +94 -87
- package/src/components/misc/State.vue +47 -45
- package/src/components/misc/TaskIcon.vue +68 -83
- package/src/components/misc/Tooltip.vue +32 -34
- package/src/components/nodes/BasicNode.vue +5 -5
- package/src/components/nodes/ClusterNode.vue +3 -3
- package/src/components/nodes/CollapsedClusterNode.vue +3 -3
- package/src/components/nodes/DependenciesNode.vue +42 -45
- package/src/components/nodes/EdgeNode.vue +35 -35
- package/src/components/nodes/TaskNode.vue +8 -8
- package/src/components/nodes/TriggerNode.vue +4 -4
- package/src/components/plugins/PropertyDetail.vue +16 -23
- package/src/components/plugins/PropertyType.vue +32 -8
- package/src/components/plugins/SchemaToCode.vue +56 -77
- package/src/components/plugins/SchemaToHtml.vue +38 -14
- package/src/components/topology/Topology.vue +140 -126
- package/src/composables/getMDCParser.ts +13 -0
- package/src/composables/{useMarkdownParser.js → useMarkdownParser.ts} +39 -33
- package/src/index.ts +9 -0
- package/src/material-icons.d.ts +5 -0
- package/src/scss/color-palette.scss +73 -0
- package/src/scss/theme-dark.scss +160 -0
- package/src/scss/theme-light.scss +160 -0
- package/src/utils/Utils.ts +80 -0
- package/src/utils/VueFlowUtils.ts +707 -0
- package/src/utils/YamlUtils.ts +643 -0
- package/src/utils/{constants.js → constants.ts} +16 -18
- package/src/utils/global.ts +36 -0
- package/src/utils/{state.js → state.ts} +17 -8
- package/src/vite.d.ts +1 -0
- package/dist/_theme-dark.scss +0 -20
- package/dist/_variables.scss +0 -119
- package/src/components/index.js +0 -29
- package/src/index.js +0 -7
- package/src/utils/Utils.js +0 -62
- package/src/utils/VueFlowUtils.js +0 -502
- package/src/utils/YamlUtils.js +0 -554
- package/src/utils/global.js +0 -23
|
@@ -1,15 +1,111 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<VueFlow
|
|
3
|
+
:id="id"
|
|
4
|
+
:default-marker-color="cssVariable('--bs-cyan')"
|
|
5
|
+
fit-view-on-init
|
|
6
|
+
:nodes-draggable="false"
|
|
7
|
+
:nodes-connectable="false"
|
|
8
|
+
:elevate-nodes-on-select="false"
|
|
9
|
+
:elevate-edges-on-select="false"
|
|
10
|
+
>
|
|
11
|
+
<Background :pattern-color="darkTheme ? cssVariable('--bs-grey-500') : cssVariable('--bs-grey-300')" />
|
|
12
|
+
|
|
13
|
+
<template #node-cluster="clusterProps">
|
|
14
|
+
<ClusterNode
|
|
15
|
+
v-bind="clusterProps"
|
|
16
|
+
@collapse="collapseCluster($event, true)"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<template #node-dot="dotProps">
|
|
21
|
+
<DotNode
|
|
22
|
+
v-bind="dotProps"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<template #node-task="taskProps">
|
|
27
|
+
<TaskNode
|
|
28
|
+
v-bind="taskProps"
|
|
29
|
+
:icons="icons"
|
|
30
|
+
:icon-component="iconComponent"
|
|
31
|
+
@edit="emit(EVENTS.EDIT, $event)"
|
|
32
|
+
@delete="emit(EVENTS.DELETE, $event)"
|
|
33
|
+
@expand="expand($event)"
|
|
34
|
+
@open-link="emit(EVENTS.OPEN_LINK, $event)"
|
|
35
|
+
@show-logs="emit(EVENTS.SHOW_LOGS, $event)"
|
|
36
|
+
@show-description="emit(EVENTS.SHOW_DESCRIPTION, $event)"
|
|
37
|
+
@show-condition="emit(EVENTS.SHOW_CONDITION, $event)"
|
|
38
|
+
@mouseover="onMouseOver($event)"
|
|
39
|
+
@mouseleave="onMouseLeave()"
|
|
40
|
+
@add-error="emit('on-add-flowable-error', $event)"
|
|
41
|
+
:enable-subflow-interaction="enableSubflowInteraction"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<template #node-trigger="triggerProps">
|
|
46
|
+
<TriggerNode
|
|
47
|
+
v-bind="triggerProps"
|
|
48
|
+
:icons="icons"
|
|
49
|
+
:icon-component="iconComponent"
|
|
50
|
+
:is-read-only="isReadOnly"
|
|
51
|
+
:is-allowed-edit="isAllowedEdit"
|
|
52
|
+
@delete="emit(EVENTS.DELETE, $event)"
|
|
53
|
+
@edit="emit(EVENTS.EDIT, $event)"
|
|
54
|
+
@show-description="emit(EVENTS.SHOW_DESCRIPTION, $event)"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<template #node-collapsedcluster="CollapsedProps">
|
|
59
|
+
<CollapsedClusterNode
|
|
60
|
+
v-bind="CollapsedProps"
|
|
61
|
+
@expand="expand($event)"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<template #edge-edge="EdgeProps">
|
|
66
|
+
<EdgeNode
|
|
67
|
+
v-bind="EdgeProps"
|
|
68
|
+
:yaml-source="source"
|
|
69
|
+
@add-task="emit(EVENTS.ADD_TASK, $event)"
|
|
70
|
+
:is-read-only="isReadOnly"
|
|
71
|
+
:is-allowed-edit="isAllowedEdit"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<Controls :show-interactive="false">
|
|
76
|
+
<ControlButton @click="emit('toggle-orientation', $event)" v-if="toggleOrientationButton">
|
|
77
|
+
<SplitCellsVertical :size="48" v-if="!isHorizontal" />
|
|
78
|
+
<SplitCellsHorizontal v-if="isHorizontal" />
|
|
79
|
+
</ControlButton>
|
|
80
|
+
</Controls>
|
|
81
|
+
</VueFlow>
|
|
82
|
+
</template>
|
|
83
|
+
<script lang="ts" setup>
|
|
84
|
+
import {computed, nextTick, onMounted, PropType, ref, watch} from "vue";
|
|
85
|
+
import {useVueFlow, VueFlow, XYPosition} from "@vue-flow/core";
|
|
5
86
|
import {ControlButton, Controls} from "@vue-flow/controls";
|
|
87
|
+
import {Background} from "@vue-flow/background";
|
|
88
|
+
// @ts-expect-error no types for internals necessary
|
|
89
|
+
import ClusterNode from "../nodes/ClusterNode.vue";
|
|
90
|
+
// @ts-expect-error no types for internals necessary
|
|
91
|
+
import DotNode from "../nodes/DotNode.vue";
|
|
92
|
+
// @ts-expect-error no types for internals necessary
|
|
93
|
+
import EdgeNode from "../nodes/EdgeNode.vue";
|
|
94
|
+
// @ts-expect-error no types for internals necessary
|
|
95
|
+
import TaskNode from "../nodes/TaskNode.vue";
|
|
96
|
+
// @ts-expect-error no types for internals necessary
|
|
97
|
+
import TriggerNode from "../nodes/TriggerNode.vue"
|
|
98
|
+
// @ts-expect-error no types for internals necessary
|
|
99
|
+
import CollapsedClusterNode from "../nodes/CollapsedClusterNode.vue";
|
|
100
|
+
// @ts-expect-error no types for internals necessary
|
|
6
101
|
import SplitCellsVertical from "../../assets/icons/SplitCellsVertical.vue";
|
|
102
|
+
// @ts-expect-error no types for internals necessary
|
|
7
103
|
import SplitCellsHorizontal from "../../assets/icons/SplitCellsHorizontal.vue";
|
|
8
|
-
import {cssVariable} from "../../utils/global
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
104
|
+
import {cssVariable} from "../../utils/global";
|
|
105
|
+
import {CLUSTER_PREFIX, EVENTS} from "../../utils/constants"
|
|
106
|
+
import Utils from "../../utils/Utils"
|
|
107
|
+
import VueFlowUtils, {type FlowGraph} from "../../utils/VueFlowUtils";
|
|
108
|
+
import {YamlUtils} from "../../utils/YamlUtils"
|
|
13
109
|
|
|
14
110
|
const props = defineProps({
|
|
15
111
|
id: {
|
|
@@ -38,7 +134,7 @@
|
|
|
38
134
|
default: false,
|
|
39
135
|
},
|
|
40
136
|
flowGraph: {
|
|
41
|
-
type: Object
|
|
137
|
+
type: Object as PropType<FlowGraph>,
|
|
42
138
|
required: true
|
|
43
139
|
},
|
|
44
140
|
flowId: {
|
|
@@ -70,11 +166,11 @@
|
|
|
70
166
|
});
|
|
71
167
|
|
|
72
168
|
const dragging = ref(false);
|
|
73
|
-
const lastPosition = ref(
|
|
169
|
+
const lastPosition = ref<XYPosition | null>()
|
|
74
170
|
const {getNodes, onNodeDrag, onNodeDragStart, onNodeDragStop, fitView, setElements} = useVueFlow({id: props.id});
|
|
75
171
|
const edgeReplacer = ref({});
|
|
76
|
-
const hiddenNodes = ref([]);
|
|
77
|
-
const collapsed = ref(new Set());
|
|
172
|
+
const hiddenNodes = ref<string[]>([]);
|
|
173
|
+
const collapsed = ref(new Set<string>());
|
|
78
174
|
const clusterToNode = ref([])
|
|
79
175
|
|
|
80
176
|
const emit = defineEmits(
|
|
@@ -112,11 +208,11 @@
|
|
|
112
208
|
VueFlowUtils.cleanGraph(props.id);
|
|
113
209
|
|
|
114
210
|
nextTick(() => {
|
|
115
|
-
|
|
211
|
+
emit("loading", true);
|
|
116
212
|
|
|
117
213
|
// Workaround due to start & end nodes regeneration when fetching the graph again
|
|
118
214
|
const oldCollapsed = collapsed.value;
|
|
119
|
-
collapsed.value = new Set();
|
|
215
|
+
collapsed.value = new Set<string>();
|
|
120
216
|
hiddenNodes.value = [];
|
|
121
217
|
edgeReplacer.value = {};
|
|
122
218
|
oldCollapsed.forEach(n => collapseCluster(CLUSTER_PREFIX + n, false, false))
|
|
@@ -136,18 +232,16 @@
|
|
|
136
232
|
props.isAllowedEdit,
|
|
137
233
|
props.enableSubflowInteraction
|
|
138
234
|
);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
235
|
+
if(elements) {
|
|
236
|
+
setElements(elements);
|
|
237
|
+
fitView();
|
|
238
|
+
emit("loading", false);
|
|
239
|
+
}
|
|
142
240
|
})
|
|
143
241
|
}
|
|
144
242
|
|
|
145
|
-
const forwardEvent = (type, payload) => {
|
|
146
|
-
emit(type, payload);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
243
|
// Graph interactions functions
|
|
150
|
-
const onMouseOver = (node) => {
|
|
244
|
+
const onMouseOver = (node: any) => {
|
|
151
245
|
if (!dragging.value) {
|
|
152
246
|
VueFlowUtils.linkedElements(props.id, node.uid).forEach((n) => {
|
|
153
247
|
if (n?.type === "task") {
|
|
@@ -178,19 +272,21 @@
|
|
|
178
272
|
lastPosition.value = e.node.position;
|
|
179
273
|
})
|
|
180
274
|
|
|
181
|
-
onNodeDragStop((e) => {
|
|
275
|
+
onNodeDragStop((e:any) => {
|
|
182
276
|
dragging.value = false;
|
|
183
277
|
if (checkIntersections(e.intersections, e.node) === null) {
|
|
184
278
|
const taskNode1 = e.node;
|
|
185
279
|
// check multiple intersection with task
|
|
186
|
-
const taskNode2 = e.intersections.find(n => n.type === "task");
|
|
280
|
+
const taskNode2 = e.intersections.find((n:any) => n.type === "task");
|
|
187
281
|
if (taskNode2) {
|
|
188
282
|
try {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
283
|
+
if(props.source){
|
|
284
|
+
emit("swapped-task", {
|
|
285
|
+
newSource: YamlUtils.swapTasks(props.source, Utils.afterLastDot(taskNode1.id) ?? "", Utils.afterLastDot(taskNode2.id) ?? ""),
|
|
286
|
+
swappedTasks: [taskNode1.id, taskNode2.id]
|
|
287
|
+
})
|
|
288
|
+
}
|
|
289
|
+
} catch (e: any) {
|
|
194
290
|
emit("message", {
|
|
195
291
|
variant: "error",
|
|
196
292
|
title: "cannot swap tasks",
|
|
@@ -218,7 +314,7 @@
|
|
|
218
314
|
.map(cluster => cluster.cluster.taskNode.uid + ".");
|
|
219
315
|
})
|
|
220
316
|
|
|
221
|
-
onNodeDrag((e) => {
|
|
317
|
+
onNodeDrag((e: any) => {
|
|
222
318
|
resetNodesStyle();
|
|
223
319
|
getNodes.value.filter(n => n.id !== e.node.id).forEach(n => {
|
|
224
320
|
if (n.type === "trigger" || (n.type === "task" && (n.id.startsWith(e.node.id + ".") || e.node.id.startsWith(n.id + "."))) || subflowPrefixes?.value?.some(subflowPrefix => n.id.startsWith(subflowPrefix))) {
|
|
@@ -227,8 +323,8 @@
|
|
|
227
323
|
n.style = {...n.style, opacity: "1"}
|
|
228
324
|
}
|
|
229
325
|
})
|
|
230
|
-
if (!checkIntersections(e.intersections, e.node) && e.intersections.filter(n => n.type === "task").length === 1) {
|
|
231
|
-
e.intersections.forEach(n => {
|
|
326
|
+
if (!checkIntersections(e.intersections, e.node) && e.intersections.filter((n:any) => n.type === "task").length === 1) {
|
|
327
|
+
e.intersections.forEach((n:any) => {
|
|
232
328
|
if (n.type === "task") {
|
|
233
329
|
n.style = {...n.style, outline: "0.5px solid " + cssVariable("--bs-primary")}
|
|
234
330
|
n.class = "rounded-3"
|
|
@@ -239,31 +335,31 @@
|
|
|
239
335
|
}
|
|
240
336
|
})
|
|
241
337
|
|
|
242
|
-
const checkIntersections = (intersections, node) => {
|
|
243
|
-
const tasksMeet = intersections.filter(n => n.type === "task").map(n => Utils.afterLastDot(n.id));
|
|
338
|
+
const checkIntersections = (intersections:any, node:any) => {
|
|
339
|
+
const tasksMeet = intersections.filter((n:any) => n.type === "task").map((n:any) => Utils.afterLastDot(n.id));
|
|
244
340
|
if (tasksMeet.length > 1) {
|
|
245
341
|
return "toomuchtaskerror";
|
|
246
342
|
}
|
|
247
343
|
try {
|
|
248
|
-
if (tasksMeet.length === 1 && YamlUtils.isParentChildrenRelation(props.source, Utils.afterLastDot(tasksMeet[0]), Utils.afterLastDot(node.id))) {
|
|
344
|
+
if (tasksMeet.length === 1 && props.source && YamlUtils.isParentChildrenRelation(props.source, Utils.afterLastDot(tasksMeet[0]) ?? "", Utils.afterLastDot(node.id) ?? "")) {
|
|
249
345
|
return "parentchildrenerror";
|
|
250
346
|
}
|
|
251
|
-
} catch
|
|
347
|
+
} catch {
|
|
252
348
|
return "parentchildrenerror";
|
|
253
349
|
}
|
|
254
|
-
if (intersections.filter(n => n.type === "trigger").length > 0) {
|
|
350
|
+
if (intersections.filter((n:any) => n.type === "trigger").length > 0) {
|
|
255
351
|
return "triggererror";
|
|
256
352
|
}
|
|
257
353
|
return null;
|
|
258
354
|
}
|
|
259
355
|
|
|
260
|
-
const collapseCluster = (clusterUid, regenerate, recursive) => {
|
|
261
|
-
const cluster = props.flowGraph.clusters.find(cluster => cluster.cluster.uid.endsWith(clusterUid));
|
|
356
|
+
const collapseCluster = (clusterUid: string, regenerate: boolean, recursive = false) => {
|
|
357
|
+
const cluster:any = props.flowGraph.clusters.find(cluster => cluster.cluster.uid.endsWith(clusterUid));
|
|
262
358
|
const nodeId = clusterUid.replace(CLUSTER_PREFIX, "");
|
|
263
359
|
collapsed.value.add(nodeId)
|
|
264
360
|
|
|
265
|
-
hiddenNodes.value = hiddenNodes.value.concat(cluster.nodes.filter(e => e !== nodeId || recursive));
|
|
266
|
-
hiddenNodes.value = hiddenNodes.value.concat([cluster.cluster.uid])
|
|
361
|
+
hiddenNodes.value = hiddenNodes.value.concat(cluster.nodes.filter((e:any) => e !== nodeId || recursive));
|
|
362
|
+
hiddenNodes.value = hiddenNodes.value.concat([cluster.cluster.uid] as string[])
|
|
267
363
|
edgeReplacer.value = {
|
|
268
364
|
...edgeReplacer.value,
|
|
269
365
|
[cluster.cluster.uid]: nodeId,
|
|
@@ -282,13 +378,13 @@
|
|
|
282
378
|
}
|
|
283
379
|
}
|
|
284
380
|
|
|
285
|
-
const expand = (expandData) => {
|
|
381
|
+
const expand = (expandData:any) => {
|
|
286
382
|
const taskTypesWithSubflows = [
|
|
287
383
|
"io.kestra.core.tasks.flows.Flow", "io.kestra.core.tasks.flows.Subflow", "io.kestra.plugin.core.flow.Subflow",
|
|
288
384
|
"io.kestra.core.tasks.flows.ForEachItem$ForEachItemExecutable", "io.kestra.plugin.core.flow.ForEachItem$ForEachItemExecutable"
|
|
289
385
|
];
|
|
290
386
|
if (taskTypesWithSubflows.includes(expandData.type) && !props.expandedSubflows.includes(expandData.id)) {
|
|
291
|
-
|
|
387
|
+
emit("expand-subflow", [...props.expandedSubflows, expandData.id]);
|
|
292
388
|
return;
|
|
293
389
|
}
|
|
294
390
|
edgeReplacer.value = {};
|
|
@@ -304,88 +400,6 @@
|
|
|
304
400
|
const darkTheme = document.getElementsByTagName("html")[0].className.indexOf("dark") >= 0;
|
|
305
401
|
|
|
306
402
|
</script>
|
|
307
|
-
<template>
|
|
308
|
-
<VueFlow
|
|
309
|
-
:id="id"
|
|
310
|
-
:default-marker-color="cssVariable('--bs-cyan')"
|
|
311
|
-
fit-view-on-init
|
|
312
|
-
:nodes-draggable="false"
|
|
313
|
-
:nodes-connectable="false"
|
|
314
|
-
:elevate-nodes-on-select="false"
|
|
315
|
-
:elevate-edges-on-select="false"
|
|
316
|
-
>
|
|
317
|
-
<Background :pattern-color="darkTheme ? cssVariable('--bs-grey-500') : cssVariable('--bs-grey-300')" />
|
|
318
|
-
|
|
319
|
-
<template #node-cluster="clusterProps">
|
|
320
|
-
<ClusterNode
|
|
321
|
-
v-bind="clusterProps"
|
|
322
|
-
@collapse="collapseCluster($event, true)"
|
|
323
|
-
/>
|
|
324
|
-
</template>
|
|
325
|
-
|
|
326
|
-
<template #node-dot="dotProps">
|
|
327
|
-
<DotNode
|
|
328
|
-
v-bind="dotProps"
|
|
329
|
-
/>
|
|
330
|
-
</template>
|
|
331
|
-
|
|
332
|
-
<template #node-task="taskProps">
|
|
333
|
-
<TaskNode
|
|
334
|
-
v-bind="taskProps"
|
|
335
|
-
:icons="icons"
|
|
336
|
-
:icon-component="iconComponent"
|
|
337
|
-
@edit="forwardEvent(EVENTS.EDIT, $event)"
|
|
338
|
-
@delete="forwardEvent(EVENTS.DELETE, $event)"
|
|
339
|
-
@expand="expand($event)"
|
|
340
|
-
@open-link="forwardEvent(EVENTS.OPEN_LINK, $event)"
|
|
341
|
-
@show-logs="forwardEvent(EVENTS.SHOW_LOGS, $event)"
|
|
342
|
-
@show-description="forwardEvent(EVENTS.SHOW_DESCRIPTION, $event)"
|
|
343
|
-
@show-condition="forwardEvent(EVENTS.SHOW_CONDITION, $event)"
|
|
344
|
-
@mouseover="onMouseOver($event)"
|
|
345
|
-
@mouseleave="onMouseLeave()"
|
|
346
|
-
@add-error="forwardEvent('on-add-flowable-error', $event)"
|
|
347
|
-
:enable-subflow-interaction="enableSubflowInteraction"
|
|
348
|
-
/>
|
|
349
|
-
</template>
|
|
350
|
-
|
|
351
|
-
<template #node-trigger="triggerProps">
|
|
352
|
-
<TriggerNode
|
|
353
|
-
v-bind="triggerProps"
|
|
354
|
-
:icons="icons"
|
|
355
|
-
:icon-component="iconComponent"
|
|
356
|
-
:is-read-only="isReadOnly"
|
|
357
|
-
:is-allowed-edit="isAllowedEdit"
|
|
358
|
-
@delete="forwardEvent(EVENTS.DELETE, $event)"
|
|
359
|
-
@edit="forwardEvent(EVENTS.EDIT, $event)"
|
|
360
|
-
@show-description="forwardEvent(EVENTS.SHOW_DESCRIPTION, $event)"
|
|
361
|
-
/>
|
|
362
|
-
</template>
|
|
363
|
-
|
|
364
|
-
<template #node-collapsedcluster="CollapsedProps">
|
|
365
|
-
<CollapsedClusterNode
|
|
366
|
-
v-bind="CollapsedProps"
|
|
367
|
-
@expand="expand($event)"
|
|
368
|
-
/>
|
|
369
|
-
</template>
|
|
370
|
-
|
|
371
|
-
<template #edge-edge="EdgeProps">
|
|
372
|
-
<EdgeNode
|
|
373
|
-
v-bind="EdgeProps"
|
|
374
|
-
:yaml-source="source"
|
|
375
|
-
@add-task="forwardEvent(EVENTS.ADD_TASK, $event)"
|
|
376
|
-
:is-read-only="isReadOnly"
|
|
377
|
-
:is-allowed-edit="isAllowedEdit"
|
|
378
|
-
/>
|
|
379
|
-
</template>
|
|
380
|
-
|
|
381
|
-
<Controls :show-interactive="false">
|
|
382
|
-
<ControlButton @click="forwardEvent('toggle-orientation', $event)" v-if="toggleOrientationButton">
|
|
383
|
-
<SplitCellsVertical :size="48" v-if="!isHorizontal" />
|
|
384
|
-
<SplitCellsHorizontal v-if="isHorizontal" />
|
|
385
|
-
</ControlButton>
|
|
386
|
-
</Controls>
|
|
387
|
-
</VueFlow>
|
|
388
|
-
</template>
|
|
389
403
|
|
|
390
404
|
<style scoped lang="scss">
|
|
391
405
|
:deep(.unused-path) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {MDParser} from "./useMarkdownParser"
|
|
2
|
+
|
|
3
|
+
let parser:MDParser
|
|
4
|
+
|
|
5
|
+
export default async function getMDCParser() {
|
|
6
|
+
if(parser){
|
|
7
|
+
return parser
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const {default: useMarkdownParser} = await import("./useMarkdownParser")
|
|
11
|
+
parser = await useMarkdownParser();
|
|
12
|
+
return parser
|
|
13
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {createMarkdownParser, createShikiHighlighter, rehypeHighlight
|
|
1
|
+
import {createMarkdownParser, createShikiHighlighter, rehypeHighlight} from "@nuxtjs/mdc/runtime";
|
|
2
|
+
import type {MDCParserResult} from "@nuxtjs/mdc";
|
|
2
3
|
import GithubLight from "shiki/themes/github-light.mjs";
|
|
3
4
|
import GithubDark from "shiki/themes/github-dark.mjs";
|
|
4
5
|
import Bash from "shiki/langs/bash.mjs";
|
|
@@ -30,43 +31,48 @@ import Typescript from "shiki/langs/typescript.mjs";
|
|
|
30
31
|
import Xml from "shiki/langs/xml.mjs";
|
|
31
32
|
import Yaml from "shiki/langs/yaml.mjs";
|
|
32
33
|
|
|
34
|
+
|
|
35
|
+
const langsMap: Record<string, any> = {
|
|
36
|
+
bash: Bash,
|
|
37
|
+
c: C,
|
|
38
|
+
cpp: Cpp,
|
|
39
|
+
csv: Csv,
|
|
40
|
+
dockerfile: Dockerfile,
|
|
41
|
+
go: Go,
|
|
42
|
+
groovy: Groovy,
|
|
43
|
+
handlebars: Handlebars,
|
|
44
|
+
hcl: Hcl,
|
|
45
|
+
ini: Ini,
|
|
46
|
+
java: Java,
|
|
47
|
+
javascript: Javascript,
|
|
48
|
+
json: Json,
|
|
49
|
+
markdown: Markdown,
|
|
50
|
+
mermaid: Mermaid,
|
|
51
|
+
perl: Perl,
|
|
52
|
+
php: Php,
|
|
53
|
+
python: Python,
|
|
54
|
+
r: R,
|
|
55
|
+
ruby: Ruby,
|
|
56
|
+
rust: Rust,
|
|
57
|
+
scala: Scala,
|
|
58
|
+
sql: Sql,
|
|
59
|
+
systemd: Systemd,
|
|
60
|
+
twig: Twig,
|
|
61
|
+
typescript: Typescript,
|
|
62
|
+
xml: Xml,
|
|
63
|
+
yaml: Yaml,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type MDParser = (md: string) => Promise<MDCParserResult>
|
|
67
|
+
|
|
33
68
|
export default function useMarkdownParser() {
|
|
34
|
-
let parser;
|
|
69
|
+
let parser: MDParser;
|
|
35
70
|
|
|
36
|
-
return async (markdown) => {
|
|
71
|
+
return async (markdown:string) => {
|
|
37
72
|
if (!parser) {
|
|
38
73
|
const {bundledLanguagesInfo} = await import("shiki/langs");
|
|
39
74
|
|
|
40
|
-
|
|
41
|
-
bash: Bash,
|
|
42
|
-
c: C,
|
|
43
|
-
cpp: Cpp,
|
|
44
|
-
csv: Csv,
|
|
45
|
-
dockerfile: Dockerfile,
|
|
46
|
-
go: Go,
|
|
47
|
-
groovy: Groovy,
|
|
48
|
-
handlebars: Handlebars,
|
|
49
|
-
hcl: Hcl,
|
|
50
|
-
ini: Ini,
|
|
51
|
-
java: Java,
|
|
52
|
-
javascript: Javascript,
|
|
53
|
-
json: Json,
|
|
54
|
-
markdown: Markdown,
|
|
55
|
-
mermaid: Mermaid,
|
|
56
|
-
perl: Perl,
|
|
57
|
-
php: Php,
|
|
58
|
-
python: Python,
|
|
59
|
-
r: R,
|
|
60
|
-
ruby: Ruby,
|
|
61
|
-
rust: Rust,
|
|
62
|
-
scala: Scala,
|
|
63
|
-
sql: Sql,
|
|
64
|
-
systemd: Systemd,
|
|
65
|
-
twig: Twig,
|
|
66
|
-
typescript: Typescript,
|
|
67
|
-
xml: Xml,
|
|
68
|
-
yaml: Yaml,
|
|
69
|
-
};
|
|
75
|
+
|
|
70
76
|
Object.entries(langsMap).forEach(([langId, lang]) => {
|
|
71
77
|
const info = bundledLanguagesInfo.find(i => i.aliases?.includes?.(langId) || i.id === langId);
|
|
72
78
|
if (!info) {
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export {YamlUtils} from "./utils/YamlUtils";
|
|
2
|
+
export {cssVariable} from "./utils/global";
|
|
3
|
+
export {default as Utils} from "./utils/Utils";
|
|
4
|
+
export {default as VueFlowUtils} from "./utils/VueFlowUtils";
|
|
5
|
+
|
|
6
|
+
import "./scss/theme-light.scss";
|
|
7
|
+
import "./scss/theme-dark.scss";
|
|
8
|
+
|
|
9
|
+
export * from "./components/index";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
$base-blue-100: #a2cdff;
|
|
2
|
+
$base-blue-200: #7fbbff;
|
|
3
|
+
$base-blue-300: #5bb8ff;
|
|
4
|
+
$base-blue-400: #3991ff;
|
|
5
|
+
$base-blue-50: #c7fdff;
|
|
6
|
+
$base-blue-500: #1761fd;
|
|
7
|
+
$base-blue-600: #134ecc;
|
|
8
|
+
$base-blue-700: #0e3b9a;
|
|
9
|
+
$base-blue-800: #0a2869;
|
|
10
|
+
$base-blue-900: #051538;
|
|
11
|
+
$base-green-100: #beefe2;
|
|
12
|
+
$base-green-200: #7cdfc4;
|
|
13
|
+
$base-green-300: #21ce9c;
|
|
14
|
+
$base-green-400: #02be8a;
|
|
15
|
+
$base-green-50: #e4f9f3;
|
|
16
|
+
$base-green-500: #029e73;
|
|
17
|
+
$base-green-600: #017f5c;
|
|
18
|
+
$base-green-700: #016046;
|
|
19
|
+
$base-green-800: #014230;
|
|
20
|
+
$base-green-900: #002319;
|
|
21
|
+
$base-black: #060709;
|
|
22
|
+
$base-gray-100: #cfd3d6;
|
|
23
|
+
$base-gray-200: #ecebef;
|
|
24
|
+
$base-gray-300: #9797a6;
|
|
25
|
+
$base-gray-400: #404559;
|
|
26
|
+
$base-gray-50: #f9f9fa;
|
|
27
|
+
$base-gray-500: #2f3342;
|
|
28
|
+
$base-gray-600: #2c303f;
|
|
29
|
+
$base-gray-700: #21242e;
|
|
30
|
+
$base-gray-800: #21242e;
|
|
31
|
+
$base-gray-900: #1c1e27;
|
|
32
|
+
$base-gray-950: #060709;
|
|
33
|
+
$base-white: #ffffff;
|
|
34
|
+
$base-orange-100: #f3c4a1;
|
|
35
|
+
$base-orange-200: #eeae7e;
|
|
36
|
+
$base-orange-300: #e9985b;
|
|
37
|
+
$base-orange-400: #e58238;
|
|
38
|
+
$base-orange-50: #fff2ea;
|
|
39
|
+
$base-orange-500: #dd5f00;
|
|
40
|
+
$base-orange-600: #c15300;
|
|
41
|
+
$base-orange-700: #a64700;
|
|
42
|
+
$base-orange-800: #8a3b00;
|
|
43
|
+
$base-orange-900: #6f3000;
|
|
44
|
+
$base-purple-100: #bbbbff;
|
|
45
|
+
$base-purple-200: #a396ff;
|
|
46
|
+
$base-purple-300: #9470ff;
|
|
47
|
+
$base-purple-400: #8c4bff;
|
|
48
|
+
$base-purple-50: #e0e0ff;
|
|
49
|
+
$base-purple-500: #8405ff;
|
|
50
|
+
$base-purple-600: #7400df;
|
|
51
|
+
$base-purple-700: #6300bf;
|
|
52
|
+
$base-purple-800: #53009f;
|
|
53
|
+
$base-purple-900: #420080;
|
|
54
|
+
$base-red-100: #fec9cb;
|
|
55
|
+
$base-red-200: #fd9297;
|
|
56
|
+
$base-red-300: #fd7278;
|
|
57
|
+
$base-red-400: #e3262f;
|
|
58
|
+
$base-red-50: #fff2f3;
|
|
59
|
+
$base-red-500: #ab0009;
|
|
60
|
+
$base-red-600: #870007;
|
|
61
|
+
$base-red-700: #5a0005;
|
|
62
|
+
$base-red-800: #470004;
|
|
63
|
+
$base-red-900: #260002;
|
|
64
|
+
$base-yellow-100: #fdedb3;
|
|
65
|
+
$base-yellow-200: #fdeaa8;
|
|
66
|
+
$base-yellow-300: #fde89d;
|
|
67
|
+
$base-yellow-400: #fde592;
|
|
68
|
+
$base-yellow-50: #fffbef;
|
|
69
|
+
$base-yellow-500: #fce07c;
|
|
70
|
+
$base-yellow-600: #ddc46d;
|
|
71
|
+
$base-yellow-700: #bda85d;
|
|
72
|
+
$base-yellow-800: #9e8c4e;
|
|
73
|
+
$base-yellow-900: #7e703e;
|