@apform-ui/core 1.13.0 → 1.14.1
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/__tests__/resolveResultBlocks.spec.d.ts +1 -0
- package/dist/apform-ui.css +1 -1
- package/dist/apform-ui.js +19216 -12847
- package/dist/apform-ui.umd.cjs +59 -59
- package/dist/bpmn.css +1 -1
- package/dist/bpmn.js +268 -145
- package/dist/bpmn.umd.cjs +1 -1
- package/dist/chat.css +1 -1
- package/dist/chat.js +11191 -7394
- package/dist/chat.umd.cjs +62 -62
- package/dist/components/CodePreviewBlock/CodePreviewBlock.vue.d.ts +12 -0
- package/dist/components/CodePreviewBlock/index.d.ts +1 -0
- package/dist/components/HitlResultPreview/HitlResultPreview.vue.d.ts +8 -0
- package/dist/components/HitlResultPreview/index.d.ts +1 -0
- package/dist/components/JsonDetailDialog/JsonDetailDialog.vue.d.ts +1 -0
- package/dist/components/KeyValuePreview/KeyValuePreview.vue.d.ts +7 -0
- package/dist/components/KeyValuePreview/index.d.ts +1 -0
- package/dist/components/NodeResultPreview/NodeResultPreview.vue.d.ts +22 -0
- package/dist/components/NodeResultPreview/index.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/utils/resolveResultBlocks.d.ts +46 -0
- package/package.json +1 -1
package/dist/bpmn.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.apf-bpmn-node[data-v-
|
|
1
|
+
.apf-bpmn-node[data-v-da2f5a21]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-start[data-v-da2f5a21]{width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--c-success, #52c41a) 15%,transparent);border:2px solid var(--c-success, #52c41a);display:flex;align-items:center;justify-content:center}.apf-bpmn-start__inner[data-v-da2f5a21]{width:16px;height:16px;border-radius:50%;background:var(--c-success, #52c41a)}.apf-bpmn-node__label[data-v-da2f5a21]{font-size:11px;color:var(--c-text-primary, #333);white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.apf-bpmn-node[data-v-fda0cd5a]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-end[data-v-fda0cd5a]{width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--c-danger, #e50113) 8%,transparent);border:2px solid var(--c-danger, #e50113);display:flex;align-items:center;justify-content:center}.apf-bpmn-end__inner[data-v-fda0cd5a]{width:16px;height:16px;border-radius:50%;background:var(--c-danger, #e50113)}.apf-bpmn-node__label[data-v-fda0cd5a]{font-size:11px;color:var(--c-text-primary, #333);white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.apf-bpmn-node[data-v-e2c4c526]{display:flex;flex-direction:column;align-items:center}.apf-bpmn-task[data-v-e2c4c526]{min-width:100px;max-width:160px;padding:8px 12px;background:color-mix(in srgb,var(--c-info, #4581e9) 8%,transparent);border:1.5px solid var(--c-info, #4581e9);border-radius:6px;display:flex;align-items:center;gap:6px}.apf-bpmn-task__icon[data-v-e2c4c526]{font-size:14px;flex-shrink:0}.apf-bpmn-task__label[data-v-e2c4c526]{font-size:11px;color:var(--c-text-primary, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.apf-bpmn-node[data-v-f93b454a]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-gateway[data-v-f93b454a]{width:32px;height:32px;background:color-mix(in srgb,var(--c-warning, #faad14) 10%,transparent);border:1.5px solid var(--c-warning, #faad14);transform:rotate(45deg);display:flex;align-items:center;justify-content:center}.apf-bpmn-gateway__icon[data-v-f93b454a]{transform:rotate(-45deg);font-size:14px;color:var(--c-warning, #faad14)}.apf-bpmn-node__label[data-v-f93b454a]{font-size:11px;color:var(--c-text-primary, #333);white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}.apf-bpmn-canvas[data-v-7888bb09]{width:100%;height:100%}
|
package/dist/bpmn.js
CHANGED
|
@@ -1,182 +1,305 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { Background as
|
|
4
|
-
import { Controls as
|
|
1
|
+
import { defineComponent as _, openBlock as v, createElementBlock as w, createElementVNode as r, toDisplayString as p, createVNode as s, computed as T, watch as B, nextTick as C, createBlock as x, withCtx as l, normalizeProps as m, guardReactiveProps as f } from "vue";
|
|
2
|
+
import { Position as g, Handle as y, MarkerType as S, useVueFlow as I, VueFlow as F } from "@vue-flow/core";
|
|
3
|
+
import { Background as G } from "@vue-flow/background";
|
|
4
|
+
import { Controls as H } from "@vue-flow/controls";
|
|
5
5
|
import "@vue-flow/core/dist/style.css";
|
|
6
6
|
import "@vue-flow/core/dist/theme-default.css";
|
|
7
7
|
import "@vue-flow/controls/dist/style.css";
|
|
8
|
-
const
|
|
8
|
+
const O = /* @__PURE__ */ _({
|
|
9
9
|
__name: "PreviewStartEvent",
|
|
10
10
|
props: {
|
|
11
|
-
data: {}
|
|
11
|
+
data: { type: Object, required: !0 }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
position: t(l).Bottom
|
|
22
|
-
}, null, 8, ["position"])
|
|
23
|
-
]));
|
|
13
|
+
setup(a, { expose: n }) {
|
|
14
|
+
n();
|
|
15
|
+
const t = { get Handle() {
|
|
16
|
+
return y;
|
|
17
|
+
}, get Position() {
|
|
18
|
+
return g;
|
|
19
|
+
} };
|
|
20
|
+
return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
|
|
24
21
|
}
|
|
25
|
-
}), u = (
|
|
26
|
-
const
|
|
27
|
-
for (const [
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
},
|
|
22
|
+
}), u = (a, n) => {
|
|
23
|
+
const t = a.__vccOpts || a;
|
|
24
|
+
for (const [e, i] of n)
|
|
25
|
+
t[e] = i;
|
|
26
|
+
return t;
|
|
27
|
+
}, V = { class: "apf-bpmn-node" }, j = { class: "apf-bpmn-node__label" };
|
|
28
|
+
function q(a, n, t, e, i, d) {
|
|
29
|
+
return v(), w("div", V, [
|
|
30
|
+
n[0] || (n[0] = r(
|
|
31
|
+
"div",
|
|
32
|
+
{ class: "apf-bpmn-start" },
|
|
33
|
+
[
|
|
34
|
+
r("div", { class: "apf-bpmn-start__inner" })
|
|
35
|
+
],
|
|
36
|
+
-1
|
|
37
|
+
/* CACHED */
|
|
38
|
+
)),
|
|
39
|
+
r(
|
|
40
|
+
"div",
|
|
41
|
+
j,
|
|
42
|
+
p(t.data.label),
|
|
43
|
+
1
|
|
44
|
+
/* TEXT */
|
|
45
|
+
),
|
|
46
|
+
s(e.Handle, {
|
|
47
|
+
type: "source",
|
|
48
|
+
position: e.Position.Bottom
|
|
49
|
+
}, null, 8, ["position"])
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
const N = /* @__PURE__ */ u(O, [["render", q], ["__scopeId", "data-v-da2f5a21"], ["__file", "/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewStartEvent.vue"]]), $ = /* @__PURE__ */ _({
|
|
31
53
|
__name: "PreviewEndEvent",
|
|
32
54
|
props: {
|
|
33
|
-
data: {}
|
|
55
|
+
data: { type: Object, required: !0 }
|
|
34
56
|
},
|
|
35
|
-
setup(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
], -1)),
|
|
44
|
-
o("div", W, c(e.data.label), 1)
|
|
45
|
-
]));
|
|
57
|
+
setup(a, { expose: n }) {
|
|
58
|
+
n();
|
|
59
|
+
const t = { get Handle() {
|
|
60
|
+
return y;
|
|
61
|
+
}, get Position() {
|
|
62
|
+
return g;
|
|
63
|
+
} };
|
|
64
|
+
return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
|
|
46
65
|
}
|
|
47
|
-
}),
|
|
66
|
+
}), z = { class: "apf-bpmn-node" }, U = { class: "apf-bpmn-node__label" };
|
|
67
|
+
function A(a, n, t, e, i, d) {
|
|
68
|
+
return v(), w("div", z, [
|
|
69
|
+
s(e.Handle, {
|
|
70
|
+
type: "target",
|
|
71
|
+
position: e.Position.Top
|
|
72
|
+
}, null, 8, ["position"]),
|
|
73
|
+
n[0] || (n[0] = r(
|
|
74
|
+
"div",
|
|
75
|
+
{ class: "apf-bpmn-end" },
|
|
76
|
+
[
|
|
77
|
+
r("div", { class: "apf-bpmn-end__inner" })
|
|
78
|
+
],
|
|
79
|
+
-1
|
|
80
|
+
/* CACHED */
|
|
81
|
+
)),
|
|
82
|
+
r(
|
|
83
|
+
"div",
|
|
84
|
+
U,
|
|
85
|
+
p(t.data.label),
|
|
86
|
+
1
|
|
87
|
+
/* TEXT */
|
|
88
|
+
)
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
const M = /* @__PURE__ */ u($, [["render", A], ["__scopeId", "data-v-fda0cd5a"], ["__file", "/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewEndEvent.vue"]]), R = /* @__PURE__ */ _({
|
|
48
92
|
__name: "PreviewTask",
|
|
49
93
|
props: {
|
|
50
|
-
data: {}
|
|
94
|
+
data: { type: Object, required: !0 }
|
|
51
95
|
},
|
|
52
|
-
setup(
|
|
53
|
-
|
|
96
|
+
setup(a, { expose: n }) {
|
|
97
|
+
n();
|
|
98
|
+
const e = { taskIcons: {
|
|
54
99
|
userTask: "👤",
|
|
55
100
|
serviceTask: "⚙",
|
|
56
101
|
scriptTask: "📜",
|
|
57
102
|
sendTask: "📤",
|
|
58
103
|
receiveTask: "📥"
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
o("div", Y, [
|
|
66
|
-
o("span", j, c(i[e.data.bpmnType] || "📋"), 1),
|
|
67
|
-
o("span", q, c(e.data.label), 1)
|
|
68
|
-
]),
|
|
69
|
-
n(t(d), {
|
|
70
|
-
type: "source",
|
|
71
|
-
position: t(l).Bottom
|
|
72
|
-
}, null, 8, ["position"])
|
|
73
|
-
]));
|
|
104
|
+
}, get Handle() {
|
|
105
|
+
return y;
|
|
106
|
+
}, get Position() {
|
|
107
|
+
return g;
|
|
108
|
+
} };
|
|
109
|
+
return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
|
|
74
110
|
}
|
|
75
|
-
}),
|
|
111
|
+
}), W = { class: "apf-bpmn-node" }, D = { class: "apf-bpmn-task" }, Y = { class: "apf-bpmn-task__icon" }, J = { class: "apf-bpmn-task__label" };
|
|
112
|
+
function K(a, n, t, e, i, d) {
|
|
113
|
+
return v(), w("div", W, [
|
|
114
|
+
s(e.Handle, {
|
|
115
|
+
type: "target",
|
|
116
|
+
position: e.Position.Top
|
|
117
|
+
}, null, 8, ["position"]),
|
|
118
|
+
r("div", D, [
|
|
119
|
+
r(
|
|
120
|
+
"span",
|
|
121
|
+
Y,
|
|
122
|
+
p(e.taskIcons[t.data.bpmnType] || "📋"),
|
|
123
|
+
1
|
|
124
|
+
/* TEXT */
|
|
125
|
+
),
|
|
126
|
+
r(
|
|
127
|
+
"span",
|
|
128
|
+
J,
|
|
129
|
+
p(t.data.label),
|
|
130
|
+
1
|
|
131
|
+
/* TEXT */
|
|
132
|
+
)
|
|
133
|
+
]),
|
|
134
|
+
s(e.Handle, {
|
|
135
|
+
type: "source",
|
|
136
|
+
position: e.Position.Bottom
|
|
137
|
+
}, null, 8, ["position"])
|
|
138
|
+
]);
|
|
139
|
+
}
|
|
140
|
+
const L = /* @__PURE__ */ u(R, [["render", K], ["__scopeId", "data-v-e2c4c526"], ["__file", "/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewTask.vue"]]), Q = /* @__PURE__ */ _({
|
|
76
141
|
__name: "PreviewGateway",
|
|
77
142
|
props: {
|
|
78
|
-
data: {}
|
|
143
|
+
data: { type: Object, required: !0 }
|
|
79
144
|
},
|
|
80
|
-
setup(
|
|
81
|
-
|
|
145
|
+
setup(a, { expose: n }) {
|
|
146
|
+
n();
|
|
147
|
+
const e = { gatewayIcons: {
|
|
82
148
|
exclusiveGateway: "✕",
|
|
83
149
|
parallelGateway: "+",
|
|
84
150
|
inclusiveGateway: "◎"
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
o("div", Q, [
|
|
92
|
-
o("span", U, c(i[e.data.bpmnType] || "◆"), 1)
|
|
93
|
-
]),
|
|
94
|
-
o("div", X, c(e.data.label), 1),
|
|
95
|
-
n(t(d), {
|
|
96
|
-
type: "source",
|
|
97
|
-
position: t(l).Bottom
|
|
98
|
-
}, null, 8, ["position"])
|
|
99
|
-
]));
|
|
151
|
+
}, get Handle() {
|
|
152
|
+
return y;
|
|
153
|
+
}, get Position() {
|
|
154
|
+
return g;
|
|
155
|
+
} };
|
|
156
|
+
return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
|
|
100
157
|
}
|
|
101
|
-
}),
|
|
158
|
+
}), X = { class: "apf-bpmn-node" }, Z = { class: "apf-bpmn-gateway" }, ee = { class: "apf-bpmn-gateway__icon" }, te = { class: "apf-bpmn-node__label" };
|
|
159
|
+
function ne(a, n, t, e, i, d) {
|
|
160
|
+
return v(), w("div", X, [
|
|
161
|
+
s(e.Handle, {
|
|
162
|
+
type: "target",
|
|
163
|
+
position: e.Position.Top
|
|
164
|
+
}, null, 8, ["position"]),
|
|
165
|
+
r("div", Z, [
|
|
166
|
+
r(
|
|
167
|
+
"span",
|
|
168
|
+
ee,
|
|
169
|
+
p(e.gatewayIcons[t.data.bpmnType] || "◆"),
|
|
170
|
+
1
|
|
171
|
+
/* TEXT */
|
|
172
|
+
)
|
|
173
|
+
]),
|
|
174
|
+
r(
|
|
175
|
+
"div",
|
|
176
|
+
te,
|
|
177
|
+
p(t.data.label),
|
|
178
|
+
1
|
|
179
|
+
/* TEXT */
|
|
180
|
+
),
|
|
181
|
+
s(e.Handle, {
|
|
182
|
+
type: "source",
|
|
183
|
+
position: e.Position.Bottom
|
|
184
|
+
}, null, 8, ["position"])
|
|
185
|
+
]);
|
|
186
|
+
}
|
|
187
|
+
const ae = /* @__PURE__ */ u(Q, [["render", ne], ["__scopeId", "data-v-f93b454a"], ["__file", "/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewGateway.vue"]]), oe = /* @__PURE__ */ _({
|
|
102
188
|
__name: "BpmnFlowPreviewCanvas",
|
|
103
189
|
props: {
|
|
104
|
-
nodes: {},
|
|
105
|
-
edges: {},
|
|
106
|
-
flowId: {}
|
|
190
|
+
nodes: { type: Array, required: !0 },
|
|
191
|
+
edges: { type: Array, required: !0 },
|
|
192
|
+
flowId: { type: String, required: !1 }
|
|
107
193
|
},
|
|
108
194
|
emits: ["node-click", "fit-view"],
|
|
109
|
-
setup(
|
|
110
|
-
const
|
|
111
|
-
() =>
|
|
112
|
-
id:
|
|
113
|
-
type:
|
|
114
|
-
position:
|
|
115
|
-
data:
|
|
195
|
+
setup(a, { expose: n, emit: t }) {
|
|
196
|
+
const e = a, i = t, d = e.flowId ?? `apf-bpmn-preview-${Math.random().toString(36).slice(2, 8)}`, c = T(
|
|
197
|
+
() => e.nodes.map((o) => ({
|
|
198
|
+
id: o.id,
|
|
199
|
+
type: o.type,
|
|
200
|
+
position: o.position,
|
|
201
|
+
data: o.data,
|
|
116
202
|
draggable: !0
|
|
117
203
|
}))
|
|
118
|
-
),
|
|
119
|
-
() =>
|
|
120
|
-
id:
|
|
121
|
-
source:
|
|
122
|
-
target:
|
|
123
|
-
label:
|
|
204
|
+
), E = T(
|
|
205
|
+
() => e.edges.map((o) => ({
|
|
206
|
+
id: o.id,
|
|
207
|
+
source: o.source,
|
|
208
|
+
target: o.target,
|
|
209
|
+
label: o.label,
|
|
124
210
|
type: "smoothstep",
|
|
125
211
|
animated: !0,
|
|
126
|
-
markerEnd: { type:
|
|
212
|
+
markerEnd: { type: S.ArrowClosed },
|
|
127
213
|
style: { stroke: "var(--c-info, #4581e9)", strokeWidth: 1.5 }
|
|
128
214
|
}))
|
|
129
|
-
), { onNodeClick:
|
|
130
|
-
|
|
131
|
-
|
|
215
|
+
), { onNodeClick: b, fitView: k } = I({ id: d });
|
|
216
|
+
b(({ node: o }) => {
|
|
217
|
+
i("node-click", o.id, o.data);
|
|
132
218
|
});
|
|
133
|
-
function
|
|
134
|
-
|
|
219
|
+
function P() {
|
|
220
|
+
k({ padding: 0.2 }), i("fit-view");
|
|
135
221
|
}
|
|
136
|
-
|
|
137
|
-
() => [
|
|
222
|
+
B(
|
|
223
|
+
() => [e.nodes, e.edges],
|
|
138
224
|
async () => {
|
|
139
|
-
await
|
|
225
|
+
await C(), setTimeout(() => k({ padding: 0.2 }), 100);
|
|
140
226
|
},
|
|
141
227
|
{ deep: !0 }
|
|
142
|
-
),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"min-zoom": 0.2,
|
|
152
|
-
"max-zoom": 2,
|
|
153
|
-
"fit-view-on-init": "",
|
|
154
|
-
class: "apf-bpmn-canvas"
|
|
155
|
-
}, {
|
|
156
|
-
"node-start-event": _((r) => [
|
|
157
|
-
n(O, w(b(r)), null, 16)
|
|
158
|
-
]),
|
|
159
|
-
"node-end-event": _((r) => [
|
|
160
|
-
n(D, w(b(r)), null, 16)
|
|
161
|
-
]),
|
|
162
|
-
"node-task": _((r) => [
|
|
163
|
-
n(K, w(b(r)), null, 16)
|
|
164
|
-
]),
|
|
165
|
-
"node-gateway": _((r) => [
|
|
166
|
-
n(ee, w(b(r)), null, 16)
|
|
167
|
-
]),
|
|
168
|
-
default: _(() => [
|
|
169
|
-
n(t(F), {
|
|
170
|
-
gap: 16,
|
|
171
|
-
size: 0.6,
|
|
172
|
-
color: "#e0e5ec"
|
|
173
|
-
}),
|
|
174
|
-
n(t(N), { "show-interactive": !1 })
|
|
175
|
-
]),
|
|
176
|
-
_: 1
|
|
177
|
-
}, 8, ["id", "nodes", "edges"]));
|
|
228
|
+
), n({ fitView: P });
|
|
229
|
+
const h = { props: e, emit: i, instanceId: d, vfNodes: c, vfEdges: E, onNodeClick: b, fitView: k, handleFitView: P, get VueFlow() {
|
|
230
|
+
return F;
|
|
231
|
+
}, get Background() {
|
|
232
|
+
return G;
|
|
233
|
+
}, get Controls() {
|
|
234
|
+
return H;
|
|
235
|
+
}, PreviewStartEvent: N, PreviewEndEvent: M, PreviewTask: L, PreviewGateway: ae };
|
|
236
|
+
return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
|
|
178
237
|
}
|
|
179
|
-
})
|
|
238
|
+
});
|
|
239
|
+
function se(a, n, t, e, i, d) {
|
|
240
|
+
return v(), x(e.VueFlow, {
|
|
241
|
+
id: e.instanceId,
|
|
242
|
+
nodes: e.vfNodes,
|
|
243
|
+
edges: e.vfEdges,
|
|
244
|
+
"nodes-draggable": !0,
|
|
245
|
+
"nodes-connectable": !1,
|
|
246
|
+
"edges-updatable": !1,
|
|
247
|
+
"elements-selectable": !0,
|
|
248
|
+
"default-viewport": { zoom: 0.8, x: 0, y: 0 },
|
|
249
|
+
"min-zoom": 0.2,
|
|
250
|
+
"max-zoom": 2,
|
|
251
|
+
"fit-view-on-init": "",
|
|
252
|
+
class: "apf-bpmn-canvas"
|
|
253
|
+
}, {
|
|
254
|
+
"node-start-event": l((c) => [
|
|
255
|
+
s(
|
|
256
|
+
e.PreviewStartEvent,
|
|
257
|
+
m(f(c)),
|
|
258
|
+
null,
|
|
259
|
+
16
|
|
260
|
+
/* FULL_PROPS */
|
|
261
|
+
)
|
|
262
|
+
]),
|
|
263
|
+
"node-end-event": l((c) => [
|
|
264
|
+
s(
|
|
265
|
+
e.PreviewEndEvent,
|
|
266
|
+
m(f(c)),
|
|
267
|
+
null,
|
|
268
|
+
16
|
|
269
|
+
/* FULL_PROPS */
|
|
270
|
+
)
|
|
271
|
+
]),
|
|
272
|
+
"node-task": l((c) => [
|
|
273
|
+
s(
|
|
274
|
+
e.PreviewTask,
|
|
275
|
+
m(f(c)),
|
|
276
|
+
null,
|
|
277
|
+
16
|
|
278
|
+
/* FULL_PROPS */
|
|
279
|
+
)
|
|
280
|
+
]),
|
|
281
|
+
"node-gateway": l((c) => [
|
|
282
|
+
s(
|
|
283
|
+
e.PreviewGateway,
|
|
284
|
+
m(f(c)),
|
|
285
|
+
null,
|
|
286
|
+
16
|
|
287
|
+
/* FULL_PROPS */
|
|
288
|
+
)
|
|
289
|
+
]),
|
|
290
|
+
default: l(() => [
|
|
291
|
+
s(e.Background, {
|
|
292
|
+
gap: 16,
|
|
293
|
+
size: 0.6,
|
|
294
|
+
color: "#e0e5ec"
|
|
295
|
+
}),
|
|
296
|
+
s(e.Controls, { "show-interactive": !1 })
|
|
297
|
+
]),
|
|
298
|
+
_: 1
|
|
299
|
+
/* STABLE */
|
|
300
|
+
}, 8, ["id", "nodes", "edges"]);
|
|
301
|
+
}
|
|
302
|
+
const ue = /* @__PURE__ */ u(oe, [["render", se], ["__scopeId", "data-v-7888bb09"], ["__file", "/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/BpmnFlowPreviewCanvas.vue"]]), re = {
|
|
180
303
|
startEvent: "start-event",
|
|
181
304
|
endEvent: "end-event",
|
|
182
305
|
userTask: "task",
|
|
@@ -188,15 +311,15 @@ const z = { class: "apf-bpmn-node" }, S = { class: "apf-bpmn-node__label" }, M =
|
|
|
188
311
|
parallelGateway: "gateway",
|
|
189
312
|
inclusiveGateway: "gateway"
|
|
190
313
|
};
|
|
191
|
-
function
|
|
192
|
-
return
|
|
314
|
+
function me(a) {
|
|
315
|
+
return re[a] ?? "task";
|
|
193
316
|
}
|
|
194
317
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
318
|
+
re as BPMN_TO_PREVIEW_VF_TYPE,
|
|
319
|
+
ue as BpmnFlowPreviewCanvas,
|
|
320
|
+
M as BpmnPreviewEndEvent,
|
|
321
|
+
ae as BpmnPreviewGateway,
|
|
322
|
+
N as BpmnPreviewStartEvent,
|
|
323
|
+
L as BpmnPreviewTask,
|
|
324
|
+
me as resolveBpmnPreviewNodeType
|
|
202
325
|
};
|
package/dist/bpmn.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vue-flow/core"),require("@vue-flow/background"),require("@vue-flow/controls"),require("@vue-flow/core/dist/style.css"),require("@vue-flow/core/dist/theme-default.css"),require("@vue-flow/controls/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-flow/core","@vue-flow/background","@vue-flow/controls","@vue-flow/core/dist/style.css","@vue-flow/core/dist/theme-default.css","@vue-flow/controls/dist/style.css"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.ApformUIBpmn={},a.Vue,a.VueFlowCore,a.VueFlowBackground,a.VueFlowControls))})(this,(function(a,e,i,k,b){"use strict";const E=e.defineComponent({__name:"PreviewStartEvent",props:{data:{type:Object,required:!0}},setup(s,{expose:o}){o();const n={get Handle(){return i.Handle},get Position(){return i.Position}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),p=(s,o)=>{const n=s.__vccOpts||s;for(const[t,d]of o)n[t]=d;return n},h={class:"apf-bpmn-node"},V={class:"apf-bpmn-node__label"};function B(s,o,n,t,d,l){return e.openBlock(),e.createElementBlock("div",h,[o[0]||(o[0]=e.createElementVNode("div",{class:"apf-bpmn-start"},[e.createElementVNode("div",{class:"apf-bpmn-start__inner"})],-1)),e.createElementVNode("div",V,e.toDisplayString(n.data.label),1),e.createVNode(t.Handle,{type:"source",position:t.Position.Bottom},null,8,["position"])])}const m=p(E,[["render",B],["__scopeId","data-v-da2f5a21"],["__file","/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewStartEvent.vue"]]),T=e.defineComponent({__name:"PreviewEndEvent",props:{data:{type:Object,required:!0}},setup(s,{expose:o}){o();const n={get Handle(){return i.Handle},get Position(){return i.Position}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),C={class:"apf-bpmn-node"},N={class:"apf-bpmn-node__label"};function S(s,o,n,t,d,l){return e.openBlock(),e.createElementBlock("div",C,[e.createVNode(t.Handle,{type:"target",position:t.Position.Top},null,8,["position"]),o[0]||(o[0]=e.createElementVNode("div",{class:"apf-bpmn-end"},[e.createElementVNode("div",{class:"apf-bpmn-end__inner"})],-1)),e.createElementVNode("div",N,e.toDisplayString(n.data.label),1)])}const f=p(T,[["render",S],["__scopeId","data-v-fda0cd5a"],["__file","/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewEndEvent.vue"]]),F=e.defineComponent({__name:"PreviewTask",props:{data:{type:Object,required:!0}},setup(s,{expose:o}){o();const t={taskIcons:{userTask:"👤",serviceTask:"⚙",scriptTask:"📜",sendTask:"📤",receiveTask:"📥"},get Handle(){return i.Handle},get Position(){return i.Position}};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),I={class:"apf-bpmn-node"},x={class:"apf-bpmn-task"},q={class:"apf-bpmn-task__icon"},H={class:"apf-bpmn-task__label"};function O(s,o,n,t,d,l){return e.openBlock(),e.createElementBlock("div",I,[e.createVNode(t.Handle,{type:"target",position:t.Position.Top},null,8,["position"]),e.createElementVNode("div",x,[e.createElementVNode("span",q,e.toDisplayString(t.taskIcons[n.data.bpmnType]||"📋"),1),e.createElementVNode("span",H,e.toDisplayString(n.data.label),1)]),e.createVNode(t.Handle,{type:"source",position:t.Position.Bottom},null,8,["position"])])}const w=p(F,[["render",O],["__scopeId","data-v-e2c4c526"],["__file","/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewTask.vue"]]),j=e.defineComponent({__name:"PreviewGateway",props:{data:{type:Object,required:!0}},setup(s,{expose:o}){o();const t={gatewayIcons:{exclusiveGateway:"✕",parallelGateway:"+",inclusiveGateway:"◎"},get Handle(){return i.Handle},get Position(){return i.Position}};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),G={class:"apf-bpmn-node"},z={class:"apf-bpmn-gateway"},$={class:"apf-bpmn-gateway__icon"},D={class:"apf-bpmn-node__label"};function R(s,o,n,t,d,l){return e.openBlock(),e.createElementBlock("div",G,[e.createVNode(t.Handle,{type:"target",position:t.Position.Top},null,8,["position"]),e.createElementVNode("div",z,[e.createElementVNode("span",$,e.toDisplayString(t.gatewayIcons[n.data.bpmnType]||"◆"),1)]),e.createElementVNode("div",D,e.toDisplayString(n.data.label),1),e.createVNode(t.Handle,{type:"source",position:t.Position.Bottom},null,8,["position"])])}const u=p(j,[["render",R],["__scopeId","data-v-f93b454a"],["__file","/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/nodes/PreviewGateway.vue"]]),U=e.defineComponent({__name:"BpmnFlowPreviewCanvas",props:{nodes:{type:Array,required:!0},edges:{type:Array,required:!0},flowId:{type:String,required:!1}},emits:["node-click","fit-view"],setup(s,{expose:o,emit:n}){const t=s,d=n,l=t.flowId??`apf-bpmn-preview-${Math.random().toString(36).slice(2,8)}`,c=e.computed(()=>t.nodes.map(r=>({id:r.id,type:r.type,position:r.position,data:r.data,draggable:!0}))),Y=e.computed(()=>t.edges.map(r=>({id:r.id,source:r.source,target:r.target,label:r.label,type:"smoothstep",animated:!0,markerEnd:{type:i.MarkerType.ArrowClosed},style:{stroke:"var(--c-info, #4581e9)",strokeWidth:1.5}}))),{onNodeClick:y,fitView:_}=i.useVueFlow({id:l});y(({node:r})=>{d("node-click",r.id,r.data)});function v(){_({padding:.2}),d("fit-view")}e.watch(()=>[t.nodes,t.edges],async()=>{await e.nextTick(),setTimeout(()=>_({padding:.2}),100)},{deep:!0}),o({fitView:v});const P={props:t,emit:d,instanceId:l,vfNodes:c,vfEdges:Y,onNodeClick:y,fitView:_,handleFitView:v,get VueFlow(){return i.VueFlow},get Background(){return k.Background},get Controls(){return b.Controls},PreviewStartEvent:m,PreviewEndEvent:f,PreviewTask:w,PreviewGateway:u};return Object.defineProperty(P,"__isScriptSetup",{enumerable:!1,value:!0}),P}});function M(s,o,n,t,d,l){return e.openBlock(),e.createBlock(t.VueFlow,{id:t.instanceId,nodes:t.vfNodes,edges:t.vfEdges,"nodes-draggable":!0,"nodes-connectable":!1,"edges-updatable":!1,"elements-selectable":!0,"default-viewport":{zoom:.8,x:0,y:0},"min-zoom":.2,"max-zoom":2,"fit-view-on-init":"",class:"apf-bpmn-canvas"},{"node-start-event":e.withCtx(c=>[e.createVNode(t.PreviewStartEvent,e.normalizeProps(e.guardReactiveProps(c)),null,16)]),"node-end-event":e.withCtx(c=>[e.createVNode(t.PreviewEndEvent,e.normalizeProps(e.guardReactiveProps(c)),null,16)]),"node-task":e.withCtx(c=>[e.createVNode(t.PreviewTask,e.normalizeProps(e.guardReactiveProps(c)),null,16)]),"node-gateway":e.withCtx(c=>[e.createVNode(t.PreviewGateway,e.normalizeProps(e.guardReactiveProps(c)),null,16)]),default:e.withCtx(()=>[e.createVNode(t.Background,{gap:16,size:.6,color:"#e0e5ec"}),e.createVNode(t.Controls,{"show-interactive":!1})]),_:1},8,["id","nodes","edges"])}const A=p(U,[["render",M],["__scopeId","data-v-7888bb09"],["__file","/Users/yangdongnan/work/schema-platform/ui/packages/core/src/components/Chat/BpmnFlowPreviewCanvas/BpmnFlowPreviewCanvas.vue"]]),g={startEvent:"start-event",endEvent:"end-event",userTask:"task",serviceTask:"task",scriptTask:"task",sendTask:"task",receiveTask:"task",exclusiveGateway:"gateway",parallelGateway:"gateway",inclusiveGateway:"gateway"};function W(s){return g[s]??"task"}a.BPMN_TO_PREVIEW_VF_TYPE=g,a.BpmnFlowPreviewCanvas=A,a.BpmnPreviewEndEvent=f,a.BpmnPreviewGateway=u,a.BpmnPreviewStartEvent=m,a.BpmnPreviewTask=w,a.resolveBpmnPreviewNodeType=W,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|