@apform-ui/core 1.14.1 → 1.15.0

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/bpmn.css CHANGED
@@ -1 +1 @@
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%}
1
+ .apf-bpmn-node[data-v-06a5d706]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-start[data-v-06a5d706]{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-06a5d706]{width:16px;height:16px;border-radius:50%;background:var(--c-success, #52c41a)}.apf-bpmn-node__label[data-v-06a5d706]{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-6c6caa4e]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-end[data-v-6c6caa4e]{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-6c6caa4e]{width:16px;height:16px;border-radius:50%;background:var(--c-danger, #e50113)}.apf-bpmn-node__label[data-v-6c6caa4e]{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-5b6a4a18]{display:flex;flex-direction:column;align-items:center}.apf-bpmn-task[data-v-5b6a4a18]{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-5b6a4a18]{font-size:14px;flex-shrink:0}.apf-bpmn-task__label[data-v-5b6a4a18]{font-size:11px;color:var(--c-text-primary, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.apf-bpmn-node[data-v-3ff1b368]{display:flex;flex-direction:column;align-items:center;gap:4px}.apf-bpmn-gateway[data-v-3ff1b368]{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-3ff1b368]{transform:rotate(-45deg);font-size:14px;color:var(--c-warning, #faad14)}.apf-bpmn-node__label[data-v-3ff1b368]{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-41401ec3]{width:100%;height:100%}
package/dist/bpmn.js CHANGED
@@ -1,305 +1,182 @@
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";
1
+ import { defineComponent as m, openBlock as v, createElementBlock as k, createElementVNode as o, toDisplayString as c, createVNode as n, unref as t, computed as T, watch as x, nextTick as $, createBlock as I, withCtx as _, normalizeProps as w, guardReactiveProps as b } from "vue";
2
+ import { Handle as d, Position as l, MarkerType as G, useVueFlow as V, VueFlow as C } from "@vue-flow/core";
3
+ import { Background as F } from "@vue-flow/background";
4
+ import { Controls as N } 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 O = /* @__PURE__ */ _({
8
+ const z = { class: "apf-bpmn-node" }, S = { class: "apf-bpmn-node__label" }, M = /* @__PURE__ */ m({
9
9
  __name: "PreviewStartEvent",
10
10
  props: {
11
- data: { type: Object, required: !0 }
11
+ data: {}
12
12
  },
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;
13
+ setup(e) {
14
+ return (i, s) => (v(), k("div", z, [
15
+ s[0] || (s[0] = o("div", { class: "apf-bpmn-start" }, [
16
+ o("div", { class: "apf-bpmn-start__inner" })
17
+ ], -1)),
18
+ o("div", S, c(e.data.label), 1),
19
+ n(t(d), {
20
+ type: "source",
21
+ position: t(l).Bottom
22
+ }, null, 8, ["position"])
23
+ ]));
21
24
  }
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__ */ _({
25
+ }), u = (e, i) => {
26
+ const s = e.__vccOpts || e;
27
+ for (const [p, f] of i)
28
+ s[p] = f;
29
+ return s;
30
+ }, O = /* @__PURE__ */ u(M, [["__scopeId", "data-v-06a5d706"]]), R = { class: "apf-bpmn-node" }, W = { class: "apf-bpmn-node__label" }, A = /* @__PURE__ */ m({
53
31
  __name: "PreviewEndEvent",
54
32
  props: {
55
- data: { type: Object, required: !0 }
33
+ data: {}
56
34
  },
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;
35
+ setup(e) {
36
+ return (i, s) => (v(), k("div", R, [
37
+ n(t(d), {
38
+ type: "target",
39
+ position: t(l).Top
40
+ }, null, 8, ["position"]),
41
+ s[0] || (s[0] = o("div", { class: "apf-bpmn-end" }, [
42
+ o("div", { class: "apf-bpmn-end__inner" })
43
+ ], -1)),
44
+ o("div", W, c(e.data.label), 1)
45
+ ]));
65
46
  }
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__ */ _({
47
+ }), D = /* @__PURE__ */ u(A, [["__scopeId", "data-v-6c6caa4e"]]), H = { class: "apf-bpmn-node" }, Y = { class: "apf-bpmn-task" }, j = { class: "apf-bpmn-task__icon" }, q = { class: "apf-bpmn-task__label" }, J = /* @__PURE__ */ m({
92
48
  __name: "PreviewTask",
93
49
  props: {
94
- data: { type: Object, required: !0 }
50
+ data: {}
95
51
  },
96
- setup(a, { expose: n }) {
97
- n();
98
- const e = { taskIcons: {
52
+ setup(e) {
53
+ const i = {
99
54
  userTask: "👤",
100
55
  serviceTask: "⚙",
101
56
  scriptTask: "📜",
102
57
  sendTask: "📤",
103
58
  receiveTask: "📥"
104
- }, get Handle() {
105
- return y;
106
- }, get Position() {
107
- return g;
108
- } };
109
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
59
+ };
60
+ return (s, p) => (v(), k("div", H, [
61
+ n(t(d), {
62
+ type: "target",
63
+ position: t(l).Top
64
+ }, null, 8, ["position"]),
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
+ ]));
110
74
  }
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__ */ _({
75
+ }), K = /* @__PURE__ */ u(J, [["__scopeId", "data-v-5b6a4a18"]]), L = { class: "apf-bpmn-node" }, Q = { class: "apf-bpmn-gateway" }, U = { class: "apf-bpmn-gateway__icon" }, X = { class: "apf-bpmn-node__label" }, Z = /* @__PURE__ */ m({
141
76
  __name: "PreviewGateway",
142
77
  props: {
143
- data: { type: Object, required: !0 }
78
+ data: {}
144
79
  },
145
- setup(a, { expose: n }) {
146
- n();
147
- const e = { gatewayIcons: {
80
+ setup(e) {
81
+ const i = {
148
82
  exclusiveGateway: "✕",
149
83
  parallelGateway: "+",
150
84
  inclusiveGateway: "◎"
151
- }, get Handle() {
152
- return y;
153
- }, get Position() {
154
- return g;
155
- } };
156
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
85
+ };
86
+ return (s, p) => (v(), k("div", L, [
87
+ n(t(d), {
88
+ type: "target",
89
+ position: t(l).Top
90
+ }, null, 8, ["position"]),
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
+ ]));
157
100
  }
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__ */ _({
101
+ }), ee = /* @__PURE__ */ u(Z, [["__scopeId", "data-v-3ff1b368"]]), te = /* @__PURE__ */ m({
188
102
  __name: "BpmnFlowPreviewCanvas",
189
103
  props: {
190
- nodes: { type: Array, required: !0 },
191
- edges: { type: Array, required: !0 },
192
- flowId: { type: String, required: !1 }
104
+ nodes: {},
105
+ edges: {},
106
+ flowId: {}
193
107
  },
194
108
  emits: ["node-click", "fit-view"],
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,
109
+ setup(e, { expose: i, emit: s }) {
110
+ const p = e, f = s, y = p.flowId ?? `apf-bpmn-preview-${Math.random().toString(36).slice(2, 8)}`, P = T(
111
+ () => p.nodes.map((a) => ({
112
+ id: a.id,
113
+ type: a.type,
114
+ position: a.position,
115
+ data: a.data,
202
116
  draggable: !0
203
117
  }))
204
- ), E = T(
205
- () => e.edges.map((o) => ({
206
- id: o.id,
207
- source: o.source,
208
- target: o.target,
209
- label: o.label,
118
+ ), h = T(
119
+ () => p.edges.map((a) => ({
120
+ id: a.id,
121
+ source: a.source,
122
+ target: a.target,
123
+ label: a.label,
210
124
  type: "smoothstep",
211
125
  animated: !0,
212
- markerEnd: { type: S.ArrowClosed },
126
+ markerEnd: { type: G.ArrowClosed },
213
127
  style: { stroke: "var(--c-info, #4581e9)", strokeWidth: 1.5 }
214
128
  }))
215
- ), { onNodeClick: b, fitView: k } = I({ id: d });
216
- b(({ node: o }) => {
217
- i("node-click", o.id, o.data);
129
+ ), { onNodeClick: E, fitView: g } = V({ id: y });
130
+ E(({ node: a }) => {
131
+ f("node-click", a.id, a.data);
218
132
  });
219
- function P() {
220
- k({ padding: 0.2 }), i("fit-view");
133
+ function B() {
134
+ g({ padding: 0.2 }), f("fit-view");
221
135
  }
222
- B(
223
- () => [e.nodes, e.edges],
136
+ return x(
137
+ () => [p.nodes, p.edges],
224
138
  async () => {
225
- await C(), setTimeout(() => k({ padding: 0.2 }), 100);
139
+ await $(), setTimeout(() => g({ padding: 0.2 }), 100);
226
140
  },
227
141
  { deep: !0 }
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;
142
+ ), i({ fitView: B }), (a, se) => (v(), I(t(C), {
143
+ id: t(y),
144
+ nodes: P.value,
145
+ edges: h.value,
146
+ "nodes-draggable": !0,
147
+ "nodes-connectable": !1,
148
+ "edges-updatable": !1,
149
+ "elements-selectable": !0,
150
+ "default-viewport": { zoom: 0.8, x: 0, y: 0 },
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"]));
237
178
  }
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 = {
179
+ }), le = /* @__PURE__ */ u(te, [["__scopeId", "data-v-41401ec3"]]), ae = {
303
180
  startEvent: "start-event",
304
181
  endEvent: "end-event",
305
182
  userTask: "task",
@@ -311,15 +188,15 @@ const ue = /* @__PURE__ */ u(oe, [["render", se], ["__scopeId", "data-v-7888bb09
311
188
  parallelGateway: "gateway",
312
189
  inclusiveGateway: "gateway"
313
190
  };
314
- function me(a) {
315
- return re[a] ?? "task";
191
+ function _e(e) {
192
+ return ae[e] ?? "task";
316
193
  }
317
194
  export {
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
195
+ ae as BPMN_TO_PREVIEW_VF_TYPE,
196
+ le as BpmnFlowPreviewCanvas,
197
+ D as BpmnPreviewEndEvent,
198
+ ee as BpmnPreviewGateway,
199
+ O as BpmnPreviewStartEvent,
200
+ K as BpmnPreviewTask,
201
+ _e as resolveBpmnPreviewNodeType
325
202
  };
package/dist/bpmn.umd.cjs CHANGED
@@ -1 +1 @@
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"})}));
1
+ (function(t,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):(t=typeof globalThis<"u"?globalThis:t||self,e(t.ApformUIBpmn={},t.Vue,t.VueFlowCore,t.VueFlowBackground,t.VueFlowControls))})(this,(function(t,e,a,g,u){"use strict";const b={class:"apf-bpmn-node"},P={class:"apf-bpmn-node__label"},V=e.defineComponent({__name:"PreviewStartEvent",props:{data:{}},setup(n){return(i,s)=>(e.openBlock(),e.createElementBlock("div",b,[s[0]||(s[0]=e.createElementVNode("div",{class:"apf-bpmn-start"},[e.createElementVNode("div",{class:"apf-bpmn-start__inner"})],-1)),e.createElementVNode("div",P,e.toDisplayString(n.data.label),1),e.createVNode(e.unref(a.Handle),{type:"source",position:e.unref(a.Position).Bottom},null,8,["position"])]))}}),c=(n,i)=>{const s=n.__vccOpts||n;for(const[r,l]of i)s[r]=l;return s},p=c(V,[["__scopeId","data-v-06a5d706"]]),E={class:"apf-bpmn-node"},N={class:"apf-bpmn-node__label"},f=c(e.defineComponent({__name:"PreviewEndEvent",props:{data:{}},setup(n){return(i,s)=>(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(e.unref(a.Handle),{type:"target",position:e.unref(a.Position).Top},null,8,["position"]),s[0]||(s[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)]))}}),[["__scopeId","data-v-6c6caa4e"]]),T={class:"apf-bpmn-node"},h={class:"apf-bpmn-task"},B={class:"apf-bpmn-task__icon"},C={class:"apf-bpmn-task__label"},m=c(e.defineComponent({__name:"PreviewTask",props:{data:{}},setup(n){const i={userTask:"👤",serviceTask:"⚙",scriptTask:"📜",sendTask:"📤",receiveTask:"📥"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",T,[e.createVNode(e.unref(a.Handle),{type:"target",position:e.unref(a.Position).Top},null,8,["position"]),e.createElementVNode("div",h,[e.createElementVNode("span",B,e.toDisplayString(i[n.data.bpmnType]||"📋"),1),e.createElementVNode("span",C,e.toDisplayString(n.data.label),1)]),e.createVNode(e.unref(a.Handle),{type:"source",position:e.unref(a.Position).Bottom},null,8,["position"])]))}}),[["__scopeId","data-v-5b6a4a18"]]),v={class:"apf-bpmn-node"},$={class:"apf-bpmn-gateway"},x={class:"apf-bpmn-gateway__icon"},I={class:"apf-bpmn-node__label"},_=c(e.defineComponent({__name:"PreviewGateway",props:{data:{}},setup(n){const i={exclusiveGateway:"✕",parallelGateway:"+",inclusiveGateway:"◎"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createVNode(e.unref(a.Handle),{type:"target",position:e.unref(a.Position).Top},null,8,["position"]),e.createElementVNode("div",$,[e.createElementVNode("span",x,e.toDisplayString(i[n.data.bpmnType]||"◆"),1)]),e.createElementVNode("div",I,e.toDisplayString(n.data.label),1),e.createVNode(e.unref(a.Handle),{type:"source",position:e.unref(a.Position).Bottom},null,8,["position"])]))}}),[["__scopeId","data-v-3ff1b368"]]),S=c(e.defineComponent({__name:"BpmnFlowPreviewCanvas",props:{nodes:{},edges:{},flowId:{}},emits:["node-click","fit-view"],setup(n,{expose:i,emit:s}){const r=n,l=s,y=r.flowId??`apf-bpmn-preview-${Math.random().toString(36).slice(2,8)}`,G=e.computed(()=>r.nodes.map(o=>({id:o.id,type:o.type,position:o.position,data:o.data,draggable:!0}))),z=e.computed(()=>r.edges.map(o=>({id:o.id,source:o.source,target:o.target,label:o.label,type:"smoothstep",animated:!0,markerEnd:{type:a.MarkerType.ArrowClosed},style:{stroke:"var(--c-info, #4581e9)",strokeWidth:1.5}}))),{onNodeClick:q,fitView:k}=a.useVueFlow({id:y});q(({node:o})=>{l("node-click",o.id,o.data)});function D(){k({padding:.2}),l("fit-view")}return e.watch(()=>[r.nodes,r.edges],async()=>{await e.nextTick(),setTimeout(()=>k({padding:.2}),100)},{deep:!0}),i({fitView:D}),(o,W)=>(e.openBlock(),e.createBlock(e.unref(a.VueFlow),{id:e.unref(y),nodes:G.value,edges:z.value,"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(d=>[e.createVNode(p,e.normalizeProps(e.guardReactiveProps(d)),null,16)]),"node-end-event":e.withCtx(d=>[e.createVNode(f,e.normalizeProps(e.guardReactiveProps(d)),null,16)]),"node-task":e.withCtx(d=>[e.createVNode(m,e.normalizeProps(e.guardReactiveProps(d)),null,16)]),"node-gateway":e.withCtx(d=>[e.createVNode(_,e.normalizeProps(e.guardReactiveProps(d)),null,16)]),default:e.withCtx(()=>[e.createVNode(e.unref(g.Background),{gap:16,size:.6,color:"#e0e5ec"}),e.createVNode(e.unref(u.Controls),{"show-interactive":!1})]),_:1},8,["id","nodes","edges"]))}}),[["__scopeId","data-v-41401ec3"]]),w={startEvent:"start-event",endEvent:"end-event",userTask:"task",serviceTask:"task",scriptTask:"task",sendTask:"task",receiveTask:"task",exclusiveGateway:"gateway",parallelGateway:"gateway",inclusiveGateway:"gateway"};function F(n){return w[n]??"task"}t.BPMN_TO_PREVIEW_VF_TYPE=w,t.BpmnFlowPreviewCanvas=S,t.BpmnPreviewEndEvent=f,t.BpmnPreviewGateway=_,t.BpmnPreviewStartEvent=p,t.BpmnPreviewTask=m,t.resolveBpmnPreviewNodeType=F,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));