@rytass/bpm-core-react 0.17.2 → 0.17.3
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/CHANGELOG.md +21 -0
- package/dist/chunks/compose-CKs2XmLN.cjs +2 -0
- package/dist/chunks/compose-CKs2XmLN.cjs.map +1 -0
- package/dist/chunks/{compose-_pREPtfN.js → compose-CY3PAzhP.js} +158 -152
- package/dist/chunks/compose-CY3PAzhP.js.map +1 -0
- package/dist/chunks/{designer-BiywgNXs.js → designer-DzmrgVjO.js} +1224 -1214
- package/dist/chunks/designer-DzmrgVjO.js.map +1 -0
- package/dist/chunks/designer-z8hcWEKd.cjs +65 -0
- package/dist/chunks/designer-z8hcWEKd.cjs.map +1 -0
- package/dist/chunks/{detail-DRCTnuKm.cjs → detail-BQSVgVlO.cjs} +2 -2
- package/dist/chunks/{detail-DRCTnuKm.cjs.map → detail-BQSVgVlO.cjs.map} +1 -1
- package/dist/chunks/{detail-DScLf42P.js → detail-B_bSg31B.js} +3 -1
- package/dist/chunks/{detail-DScLf42P.js.map → detail-B_bSg31B.js.map} +1 -1
- package/dist/chunks/language-provider-B3cEbLe4.js +18 -0
- package/dist/chunks/language-provider-B3cEbLe4.js.map +1 -0
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs +2 -0
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -0
- package/dist/chunks/providers-DP7b0TMN.cjs +2 -0
- package/dist/chunks/providers-DP7b0TMN.cjs.map +1 -0
- package/dist/chunks/{providers-J5eyByQj.js → providers-H_vPRsSN.js} +202 -198
- package/dist/chunks/providers-H_vPRsSN.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -21
- package/dist/index.js.map +1 -1
- package/dist/lib/language-provider.d.cts +22 -0
- package/dist/lib/language-provider.d.ts +22 -0
- package/dist/lib/providers.d.cts +9 -1
- package/dist/lib/providers.d.ts +9 -1
- package/dist/next/BPMNextProviders.d.cts +7 -1
- package/dist/next/BPMNextProviders.d.ts +7 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +12 -11
- package/dist/next/index.js.map +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/compose-B7TtrpQJ.cjs +0 -2
- package/dist/chunks/compose-B7TtrpQJ.cjs.map +0 -1
- package/dist/chunks/compose-_pREPtfN.js.map +0 -1
- package/dist/chunks/designer-BiywgNXs.js.map +0 -1
- package/dist/chunks/designer-ttAqv859.cjs +0 -65
- package/dist/chunks/designer-ttAqv859.cjs.map +0 -1
- package/dist/chunks/providers-DHtDZFNA.cjs +0 -2
- package/dist/chunks/providers-DHtDZFNA.cjs.map +0 -1
- package/dist/chunks/providers-J5eyByQj.js.map +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { r as e } from "./router-adapter-DftlFTOd.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as r } from "./
|
|
6
|
-
import { t as i } from "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import T from "@mezzanine-ui/
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
3
|
+
import { i as t } from "./language-provider-B3cEbLe4.js";
|
|
4
|
+
import { r as n } from "./routes-config-yZbESPlw.js";
|
|
5
|
+
import { t as r } from "./FormRendererView-cZGOOjU5.js";
|
|
6
|
+
import { t as i } from "./FormBuilderView-BYL42M0d.js";
|
|
7
|
+
import { t as a } from "./designer-DzmrgVjO.js";
|
|
8
|
+
import { useCallback as o, useEffect as s, useState as c } from "react";
|
|
9
|
+
import { Button as l, Empty as u, FormField as d, Input as f, PageHeader as p, Section as m, SectionGroup as h, Select as g, Step as _, Stepper as v, Table as y, Tag as b, Typography as x } from "@mezzanine-ui/react";
|
|
10
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
|
+
import { FormFieldLayout as T } from "@mezzanine-ui/core/form";
|
|
12
|
+
import E from "@mezzanine-ui/react/ContentHeader";
|
|
13
|
+
import { readFormSchemaLintMessage as D } from "@rytass/bpm-core-client/form";
|
|
14
|
+
import { composeApprovalTemplateWithForm as O, listApprovalTemplateCategoriesPage as k, readWorkflowLintMessage as A } from "@rytass/bpm-core-client/template";
|
|
14
15
|
//#region src/views/templates/compose/steps/ComposeFormStep.tsx
|
|
15
|
-
var
|
|
16
|
+
var j = {
|
|
16
17
|
id: "UNCATEGORIZED",
|
|
17
18
|
name: "未分類"
|
|
18
|
-
},
|
|
19
|
-
function
|
|
20
|
-
let [
|
|
21
|
-
|
|
19
|
+
}, M = 100;
|
|
20
|
+
function N({ categoryId: e, formSchema: t, formUiSchema: n, name: r, onCategoryIdChange: a, onFormChange: o, onNameChange: l }) {
|
|
21
|
+
let [u, p] = c([]);
|
|
22
|
+
s(() => {
|
|
22
23
|
let e = !0;
|
|
23
24
|
return (async () => {
|
|
24
25
|
try {
|
|
25
|
-
let t = await
|
|
26
|
+
let t = await k({
|
|
26
27
|
page: 1,
|
|
27
|
-
pageSize:
|
|
28
|
+
pageSize: M,
|
|
28
29
|
searchText: "",
|
|
29
30
|
status: "ACTIVE"
|
|
30
31
|
});
|
|
@@ -36,44 +37,44 @@ function j({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryI
|
|
|
36
37
|
e = !1;
|
|
37
38
|
};
|
|
38
39
|
}, []);
|
|
39
|
-
let m = [
|
|
40
|
+
let m = [j, ...u.map((e) => ({
|
|
40
41
|
id: e.id,
|
|
41
42
|
name: e.name
|
|
42
|
-
}))],
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
style:
|
|
46
|
-
children: [/* @__PURE__ */
|
|
43
|
+
}))], h = m.find((t) => t.id === e) ?? j;
|
|
44
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
45
|
+
/* @__PURE__ */ w("div", {
|
|
46
|
+
style: P,
|
|
47
|
+
children: [/* @__PURE__ */ C(d, {
|
|
47
48
|
label: "名稱",
|
|
48
|
-
layout:
|
|
49
|
+
layout: T.VERTICAL,
|
|
49
50
|
name: "composeName",
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ C(f, {
|
|
51
52
|
fullWidth: !0,
|
|
52
53
|
onChange: (e) => l(e.target.value),
|
|
53
54
|
placeholder: "例如:請款簽核",
|
|
54
|
-
value:
|
|
55
|
+
value: r
|
|
55
56
|
})
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ C(d, {
|
|
57
58
|
label: "分類(選填)",
|
|
58
|
-
layout:
|
|
59
|
+
layout: T.VERTICAL,
|
|
59
60
|
name: "composeCategory",
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ C(g, {
|
|
61
62
|
clearable: !1,
|
|
62
63
|
fullWidth: !0,
|
|
63
|
-
onChange: (e) => a(e && e.id !==
|
|
64
|
+
onChange: (e) => a(e && e.id !== j.id ? e.id : null),
|
|
64
65
|
options: m,
|
|
65
66
|
placeholder: "未分類",
|
|
66
|
-
value:
|
|
67
|
+
value: h
|
|
67
68
|
})
|
|
68
69
|
})]
|
|
69
70
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ C(x, {
|
|
71
72
|
color: "text-neutral",
|
|
72
73
|
variant: "caption",
|
|
73
74
|
children: "先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。"
|
|
74
75
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
onChange:
|
|
76
|
+
/* @__PURE__ */ C(i, {
|
|
77
|
+
onChange: o,
|
|
77
78
|
value: {
|
|
78
79
|
schema: t,
|
|
79
80
|
uiSchema: n
|
|
@@ -81,75 +82,75 @@ function j({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryI
|
|
|
81
82
|
})
|
|
82
83
|
] });
|
|
83
84
|
}
|
|
84
|
-
var
|
|
85
|
+
var P = {
|
|
85
86
|
display: "grid",
|
|
86
87
|
gap: 16,
|
|
87
88
|
gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))"
|
|
88
89
|
};
|
|
89
90
|
//#endregion
|
|
90
91
|
//#region src/views/templates/compose/steps/ComposeReviewStep.tsx
|
|
91
|
-
function
|
|
92
|
-
let s = o?.nodes ?? [], c = o?.edges ?? [],
|
|
93
|
-
detail:
|
|
92
|
+
function F({ formSchema: e, formUiSchema: t, initiatorPolicyCel: n, name: i, publishError: a, workflowDefinition: o }) {
|
|
93
|
+
let s = o?.nodes ?? [], c = o?.edges ?? [], l = e.fields.length, d = new Map(s.map((e) => [e.id, e.data.label])), f = s.map((e) => ({
|
|
94
|
+
detail: z(e) ?? "—",
|
|
94
95
|
key: e.id,
|
|
95
96
|
label: e.data.label,
|
|
96
|
-
typeLabel:
|
|
97
|
+
typeLabel: R(e)
|
|
97
98
|
})), p = c.filter((e) => !!e.data.condition).map((e) => ({
|
|
98
99
|
condition: e.data.condition ?? "",
|
|
99
100
|
key: e.id,
|
|
100
101
|
source: d.get(e.source) ?? e.source,
|
|
101
102
|
target: d.get(e.target) ?? e.target
|
|
102
103
|
}));
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
style:
|
|
104
|
+
return /* @__PURE__ */ w("div", {
|
|
105
|
+
style: B,
|
|
105
106
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ C(x, {
|
|
107
108
|
component: "h2",
|
|
108
|
-
style:
|
|
109
|
+
style: V,
|
|
109
110
|
variant: "h2",
|
|
110
111
|
children: i || "(未命名)"
|
|
111
112
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
style:
|
|
114
|
-
children: [/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ w("div", {
|
|
114
|
+
style: B,
|
|
115
|
+
children: [/* @__PURE__ */ C(x, {
|
|
115
116
|
variant: "h3",
|
|
116
117
|
children: "表單預覽"
|
|
117
|
-
}),
|
|
118
|
+
}), l > 0 ? /* @__PURE__ */ C(r, {
|
|
118
119
|
dataSourceContext: { kind: "preview" },
|
|
119
120
|
readonly: !0,
|
|
120
121
|
schema: e,
|
|
121
122
|
uiSchema: t
|
|
122
|
-
}) : /* @__PURE__ */
|
|
123
|
+
}) : /* @__PURE__ */ C(u, { title: "尚未設計表單欄位" })]
|
|
123
124
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
style:
|
|
125
|
+
/* @__PURE__ */ w("div", {
|
|
126
|
+
style: B,
|
|
126
127
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ C(x, {
|
|
128
129
|
variant: "h3",
|
|
129
130
|
children: "流程概覽"
|
|
130
131
|
}),
|
|
131
|
-
s.length > 0 ? /* @__PURE__ */
|
|
132
|
-
columns:
|
|
132
|
+
s.length > 0 ? /* @__PURE__ */ C(y, {
|
|
133
|
+
columns: I,
|
|
133
134
|
dataSource: f,
|
|
134
135
|
fullWidth: !0
|
|
135
|
-
}) : /* @__PURE__ */
|
|
136
|
-
p.length > 0 ? /* @__PURE__ */
|
|
136
|
+
}) : /* @__PURE__ */ C(u, { title: "尚未設計流程節點" }),
|
|
137
|
+
p.length > 0 ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(x, {
|
|
137
138
|
color: "text-neutral",
|
|
138
139
|
variant: "caption",
|
|
139
140
|
children: "條件分流"
|
|
140
|
-
}), /* @__PURE__ */
|
|
141
|
-
columns:
|
|
141
|
+
}), /* @__PURE__ */ C(y, {
|
|
142
|
+
columns: L,
|
|
142
143
|
dataSource: p,
|
|
143
144
|
fullWidth: !0
|
|
144
145
|
})] }) : null,
|
|
145
|
-
|
|
146
|
+
n ? /* @__PURE__ */ w(x, {
|
|
146
147
|
color: "text-neutral",
|
|
147
148
|
variant: "caption",
|
|
148
|
-
children: ["發起權限:",
|
|
149
|
+
children: ["發起權限:", n]
|
|
149
150
|
}) : null
|
|
150
151
|
]
|
|
151
152
|
}),
|
|
152
|
-
a ? /* @__PURE__ */
|
|
153
|
+
a ? /* @__PURE__ */ C(x, {
|
|
153
154
|
color: "text-error",
|
|
154
155
|
variant: "body",
|
|
155
156
|
children: a
|
|
@@ -157,10 +158,10 @@ function N({ formSchema: e, formUiSchema: t, initiatorPolicyCel: r, name: i, pub
|
|
|
157
158
|
]
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
|
-
var
|
|
161
|
+
var I = [
|
|
161
162
|
{
|
|
162
163
|
key: "type",
|
|
163
|
-
render: (e) => /* @__PURE__ */
|
|
164
|
+
render: (e) => /* @__PURE__ */ C(b, {
|
|
164
165
|
label: e.typeLabel,
|
|
165
166
|
size: "sub",
|
|
166
167
|
type: "static"
|
|
@@ -179,7 +180,7 @@ var P = [
|
|
|
179
180
|
title: "簽核方式",
|
|
180
181
|
width: 160
|
|
181
182
|
}
|
|
182
|
-
],
|
|
183
|
+
], L = [
|
|
183
184
|
{
|
|
184
185
|
dataIndex: "source",
|
|
185
186
|
key: "source",
|
|
@@ -198,7 +199,7 @@ var P = [
|
|
|
198
199
|
title: "條件"
|
|
199
200
|
}
|
|
200
201
|
];
|
|
201
|
-
function
|
|
202
|
+
function R(e) {
|
|
202
203
|
switch (e.type) {
|
|
203
204
|
case "startEvent": return "開始";
|
|
204
205
|
case "endEvent": return e.data.endState === "REJECTED" ? "結束(駁回)" : "結束(核准)";
|
|
@@ -209,7 +210,7 @@ function I(e) {
|
|
|
209
210
|
default: return "節點";
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
|
-
function
|
|
213
|
+
function z(e) {
|
|
213
214
|
if (e.type !== "userTask") return null;
|
|
214
215
|
switch (e.data.approverResolver.type) {
|
|
215
216
|
case "DIRECT": return "指定成員";
|
|
@@ -224,105 +225,107 @@ function L(e) {
|
|
|
224
225
|
default: return "簽核人";
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
var
|
|
228
|
+
var B = {
|
|
228
229
|
display: "grid",
|
|
229
230
|
gap: 12
|
|
230
|
-
},
|
|
231
|
+
}, V = { marginTop: "var(--mzn-spacing-padding-vertical-spacious)" };
|
|
231
232
|
//#endregion
|
|
232
233
|
//#region src/views/templates/compose/steps/ComposeWorkflowStep.tsx
|
|
233
|
-
function
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
function H({ aiAssistantAvailable: e = !1, formSchema: t, initiatorPolicyCel: n, onInitiatorPolicyChange: r, onWorkflowChange: i, showAiAssistant: o = !1, workflowDefinition: s }) {
|
|
235
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(x, {
|
|
235
236
|
color: "text-neutral",
|
|
236
237
|
variant: "caption",
|
|
237
238
|
children: "設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。"
|
|
238
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ C(a, {
|
|
239
240
|
aiAssistantAvailable: e,
|
|
240
241
|
embedded: !0,
|
|
241
242
|
formSchemaOverride: t,
|
|
242
243
|
initialInitiatorPolicyCel: n,
|
|
243
244
|
initialWorkflowDefinition: s ?? void 0,
|
|
244
245
|
onInitiatorPolicyChange: r,
|
|
245
|
-
onWorkflowChange:
|
|
246
|
+
onWorkflowChange: i,
|
|
246
247
|
showAiAssistant: o
|
|
247
248
|
})] });
|
|
248
249
|
}
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region src/views/templates/compose/use-template-compose-wizard.ts
|
|
251
|
-
var
|
|
252
|
+
var U = {
|
|
252
253
|
fields: [],
|
|
253
254
|
schemaVersion: 1
|
|
254
|
-
},
|
|
255
|
+
}, W = {
|
|
255
256
|
layout: [],
|
|
256
257
|
schemaVersion: 1
|
|
257
258
|
};
|
|
258
|
-
function
|
|
259
|
-
let
|
|
260
|
-
|
|
261
|
-
}, []),
|
|
262
|
-
|
|
263
|
-
}, []),
|
|
264
|
-
|
|
265
|
-
}, []),
|
|
266
|
-
|
|
267
|
-
}, []),
|
|
268
|
-
p(e);
|
|
269
|
-
}, []), E = a((e) => {
|
|
259
|
+
function G() {
|
|
260
|
+
let e = t(), [n, r] = c(0), [i, a] = c(""), [s, l] = c(null), [u, d] = c(U), [f, p] = c(W), [m, h] = c(null), [g, _] = c(null), [v, y] = c("idle"), [b, x] = c(null), S = i.trim().length > 0 && u.fields.length > 0, C = o((e) => {
|
|
261
|
+
r(e);
|
|
262
|
+
}, []), w = o(() => {
|
|
263
|
+
r((e) => e < 2 ? e + 1 : e);
|
|
264
|
+
}, []), T = o(() => {
|
|
265
|
+
r((e) => e > 0 ? e - 1 : e);
|
|
266
|
+
}, []), E = o((e) => {
|
|
267
|
+
d(e.schema), p(e.uiSchema);
|
|
268
|
+
}, []), D = o((e) => {
|
|
270
269
|
h(e);
|
|
270
|
+
}, []), k = o((e) => {
|
|
271
|
+
_(e);
|
|
271
272
|
}, []);
|
|
272
273
|
return {
|
|
273
|
-
canLeaveBasics:
|
|
274
|
-
categoryId:
|
|
275
|
-
currentStep:
|
|
276
|
-
formSchema:
|
|
277
|
-
formUiSchema:
|
|
278
|
-
goBack:
|
|
279
|
-
goNext:
|
|
280
|
-
goToStep:
|
|
281
|
-
initiatorPolicyCel:
|
|
282
|
-
name:
|
|
283
|
-
publish:
|
|
284
|
-
|
|
274
|
+
canLeaveBasics: S,
|
|
275
|
+
categoryId: s,
|
|
276
|
+
currentStep: n,
|
|
277
|
+
formSchema: u,
|
|
278
|
+
formUiSchema: f,
|
|
279
|
+
goBack: T,
|
|
280
|
+
goNext: w,
|
|
281
|
+
goToStep: C,
|
|
282
|
+
initiatorPolicyCel: g,
|
|
283
|
+
name: i,
|
|
284
|
+
publish: o(async () => {
|
|
285
|
+
y("submitting"), x(null);
|
|
286
|
+
let t = m ?? K;
|
|
285
287
|
try {
|
|
286
|
-
let e = await
|
|
288
|
+
let e = await O({
|
|
287
289
|
category: null,
|
|
288
|
-
categoryId:
|
|
290
|
+
categoryId: s,
|
|
289
291
|
formDefinitionId: null,
|
|
290
292
|
formDescription: null,
|
|
291
|
-
formName:
|
|
292
|
-
initiatorPolicyCel:
|
|
293
|
+
formName: i,
|
|
294
|
+
initiatorPolicyCel: g,
|
|
293
295
|
notificationConfig: null,
|
|
294
296
|
publish: !0,
|
|
295
|
-
schema:
|
|
297
|
+
schema: u,
|
|
296
298
|
slaDefaults: null,
|
|
297
299
|
templateDescription: null,
|
|
298
300
|
templateId: null,
|
|
299
|
-
templateName:
|
|
300
|
-
uiSchema:
|
|
301
|
-
workflowDefinition:
|
|
301
|
+
templateName: i,
|
|
302
|
+
uiSchema: f,
|
|
303
|
+
workflowDefinition: t
|
|
302
304
|
});
|
|
303
|
-
return
|
|
304
|
-
} catch (
|
|
305
|
-
return
|
|
305
|
+
return y("success"), e;
|
|
306
|
+
} catch (n) {
|
|
307
|
+
return x(J(n, t, e)), y("error"), null;
|
|
306
308
|
}
|
|
307
309
|
}, [
|
|
308
|
-
|
|
309
|
-
c,
|
|
310
|
+
s,
|
|
310
311
|
u,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
f,
|
|
313
|
+
g,
|
|
314
|
+
e,
|
|
315
|
+
i,
|
|
316
|
+
m
|
|
314
317
|
]),
|
|
315
|
-
publishError:
|
|
316
|
-
publishPhase:
|
|
317
|
-
setCategoryId:
|
|
318
|
-
setFormValue:
|
|
319
|
-
setInitiatorPolicyCel:
|
|
320
|
-
setName:
|
|
321
|
-
setWorkflowDefinition:
|
|
322
|
-
workflowDefinition:
|
|
318
|
+
publishError: b,
|
|
319
|
+
publishPhase: v,
|
|
320
|
+
setCategoryId: l,
|
|
321
|
+
setFormValue: E,
|
|
322
|
+
setInitiatorPolicyCel: k,
|
|
323
|
+
setName: a,
|
|
324
|
+
setWorkflowDefinition: D,
|
|
325
|
+
workflowDefinition: m
|
|
323
326
|
};
|
|
324
327
|
}
|
|
325
|
-
var
|
|
328
|
+
var K = {
|
|
326
329
|
edges: [],
|
|
327
330
|
meta: { schemaVersion: 1 },
|
|
328
331
|
nodes: [{
|
|
@@ -346,46 +349,49 @@ var W = {
|
|
|
346
349
|
},
|
|
347
350
|
type: "endEvent"
|
|
348
351
|
}]
|
|
352
|
+
}, q = {
|
|
353
|
+
en: "An unknown error occurred",
|
|
354
|
+
"zh-TW": "發生未知錯誤"
|
|
349
355
|
};
|
|
350
|
-
function
|
|
351
|
-
return e instanceof Error ?
|
|
356
|
+
function J(e, t, n) {
|
|
357
|
+
return e instanceof Error ? D(A(e.message, t, n)) : q[n];
|
|
352
358
|
}
|
|
353
359
|
//#endregion
|
|
354
360
|
//#region src/views/templates/compose/TemplateComposeWizardView.tsx
|
|
355
|
-
function
|
|
356
|
-
let i = e(), a =
|
|
357
|
-
async function
|
|
361
|
+
function Y({ aiAssistantAvailable: t = !1, showAiAssistant: r = !1 } = {}) {
|
|
362
|
+
let i = e(), a = n(), o = G(), s = o.publishPhase === "submitting";
|
|
363
|
+
async function c() {
|
|
358
364
|
let e = await o.publish();
|
|
359
365
|
e && i.push(a.templateDesigner(e.templateId));
|
|
360
366
|
}
|
|
361
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(E, {
|
|
362
368
|
description: "一次完成表單與流程設計,發佈後即可直接發起。",
|
|
363
369
|
title: "建立模板(表單 + 流程)",
|
|
364
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ C(l, {
|
|
365
371
|
disabled: s,
|
|
366
372
|
onClick: () => i.push(a.templates()),
|
|
367
373
|
variant: "base-secondary",
|
|
368
374
|
children: "返回模板列表"
|
|
369
375
|
})
|
|
370
|
-
}) }), /* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
376
|
+
}) }), /* @__PURE__ */ C(h, { children: /* @__PURE__ */ w(m, { children: [
|
|
377
|
+
/* @__PURE__ */ w(v, {
|
|
372
378
|
currentStep: o.currentStep,
|
|
373
379
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ C(_, {
|
|
375
381
|
description: "設計欄位與版面",
|
|
376
382
|
title: "表單設計"
|
|
377
383
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ C(_, {
|
|
379
385
|
description: "設計簽核節點與條件",
|
|
380
386
|
title: "流程設計"
|
|
381
387
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ C(_, {
|
|
383
389
|
description: "確認後發佈",
|
|
384
390
|
title: "檢視並發佈"
|
|
385
391
|
})
|
|
386
392
|
]
|
|
387
393
|
}),
|
|
388
|
-
o.currentStep === 0 ? /* @__PURE__ */
|
|
394
|
+
o.currentStep === 0 ? /* @__PURE__ */ C(N, {
|
|
389
395
|
categoryId: o.categoryId,
|
|
390
396
|
formSchema: o.formSchema,
|
|
391
397
|
formUiSchema: o.formUiSchema,
|
|
@@ -394,8 +400,8 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
394
400
|
onFormChange: o.setFormValue,
|
|
395
401
|
onNameChange: o.setName
|
|
396
402
|
}) : null,
|
|
397
|
-
o.currentStep === 1 ? /* @__PURE__ */
|
|
398
|
-
aiAssistantAvailable:
|
|
403
|
+
o.currentStep === 1 ? /* @__PURE__ */ C(H, {
|
|
404
|
+
aiAssistantAvailable: t,
|
|
399
405
|
formSchema: o.formSchema,
|
|
400
406
|
initiatorPolicyCel: o.initiatorPolicyCel,
|
|
401
407
|
onInitiatorPolicyChange: o.setInitiatorPolicyCel,
|
|
@@ -403,7 +409,7 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
403
409
|
showAiAssistant: r,
|
|
404
410
|
workflowDefinition: o.workflowDefinition
|
|
405
411
|
}) : null,
|
|
406
|
-
o.currentStep === 2 ? /* @__PURE__ */
|
|
412
|
+
o.currentStep === 2 ? /* @__PURE__ */ C(F, {
|
|
407
413
|
formSchema: o.formSchema,
|
|
408
414
|
formUiSchema: o.formUiSchema,
|
|
409
415
|
initiatorPolicyCel: o.initiatorPolicyCel,
|
|
@@ -411,29 +417,29 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
411
417
|
publishError: o.publishError,
|
|
412
418
|
workflowDefinition: o.workflowDefinition
|
|
413
419
|
}) : null,
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
style:
|
|
416
|
-
children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ w("div", {
|
|
421
|
+
style: X,
|
|
422
|
+
children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */ C(x, {
|
|
417
423
|
color: "text-neutral",
|
|
418
424
|
variant: "caption",
|
|
419
425
|
children: "請填寫模板名稱、表單名稱,並至少新增一個表單欄位。"
|
|
420
|
-
}) : /* @__PURE__ */
|
|
421
|
-
style:
|
|
422
|
-
children: [/* @__PURE__ */
|
|
426
|
+
}) : /* @__PURE__ */ C("span", {}), /* @__PURE__ */ w("div", {
|
|
427
|
+
style: Z,
|
|
428
|
+
children: [/* @__PURE__ */ C(l, {
|
|
423
429
|
disabled: o.currentStep === 0 || s,
|
|
424
430
|
onClick: o.goBack,
|
|
425
431
|
variant: "base-secondary",
|
|
426
432
|
children: "上一步"
|
|
427
|
-
}), o.currentStep < 2 ? /* @__PURE__ */
|
|
433
|
+
}), o.currentStep < 2 ? /* @__PURE__ */ C(l, {
|
|
428
434
|
disabled: o.currentStep === 0 && !o.canLeaveBasics,
|
|
429
435
|
onClick: o.goNext,
|
|
430
436
|
variant: "base-primary",
|
|
431
437
|
children: "下一步"
|
|
432
|
-
}) : /* @__PURE__ */
|
|
438
|
+
}) : /* @__PURE__ */ C(l, {
|
|
433
439
|
disabled: s,
|
|
434
440
|
loading: s,
|
|
435
441
|
onClick: () => {
|
|
436
|
-
|
|
442
|
+
c();
|
|
437
443
|
},
|
|
438
444
|
variant: "base-primary",
|
|
439
445
|
children: "發佈"
|
|
@@ -442,17 +448,17 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
|
|
|
442
448
|
})
|
|
443
449
|
] }) })] });
|
|
444
450
|
}
|
|
445
|
-
var
|
|
451
|
+
var X = {
|
|
446
452
|
alignItems: "center",
|
|
447
453
|
display: "flex",
|
|
448
454
|
marginTop: "var(--mzn-spacing-padding-vertical-spacious)",
|
|
449
455
|
justifyContent: "space-between",
|
|
450
456
|
gap: 16
|
|
451
|
-
},
|
|
457
|
+
}, Z = {
|
|
452
458
|
display: "flex",
|
|
453
459
|
gap: 8
|
|
454
460
|
};
|
|
455
461
|
//#endregion
|
|
456
|
-
export {
|
|
462
|
+
export { G as i, U as n, W as r, Y as t };
|
|
457
463
|
|
|
458
|
-
//# sourceMappingURL=compose-
|
|
464
|
+
//# sourceMappingURL=compose-CY3PAzhP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-CY3PAzhP.js","names":["_Fragment","_Fragment","_Fragment","_Fragment","useRouterAdapter","useBPMLanguage","useBPMRoutes","FormRenderer","FormBuilderView","TemplateDesignerView","Fragment$1","ContentHeader","UNCATEGORIZED_OPTION","CATEGORY_PAGE_SIZE","ComposeFormStep","categoryOptions","setCategoryOptions","useState","active","result","listApprovalTemplateCategoriesPage","selectOptions","category","selectedOption","option","categoryId","BASICS_GRID_STYLE","FormField","FormFieldLayout","Input","onNameChange","event","name","Select","onCategoryIdChange","Typography","onFormChange","formSchema","formUiSchema","ComposeReviewStep","nodes","workflowDefinition","edges","fieldCount","nodeLabelById","node","nodeRows","readNodeDetail","readNodeTypeLabel","branchRows","edge","STACK_STYLE","TITLE_STYLE","Empty","Table","NODE_COLUMNS","BRANCH_COLUMNS","initiatorPolicyCel","publishError","Tag","record","ComposeWorkflowStep","EMPTY_COMPOSE_FORM_SCHEMA","EMPTY_COMPOSE_FORM_UI_SCHEMA","useTemplateComposeWizard","language","currentStep","setCurrentStep","setName","setCategoryId","setFormSchema","setFormUiSchema","setWorkflowDefinitionState","setInitiatorPolicyCelState","publishPhase","setPublishPhase","setPublishError","canLeaveBasics","goToStep","useCallback","step","goNext","goBack","setFormValue","next","setWorkflowDefinition","definition","setInitiatorPolicyCel","cel","submittedDefinition","EMPTY_WORKFLOW_DEFINITION","composeApprovalTemplateWithForm","requestError","readErrorMessage","UNKNOWN_ERROR_MESSAGES","error","readFormSchemaLintMessage","readWorkflowLintMessage","TemplateComposeWizardView","router","routes","wizard","submitting","handlePublish","PageHeader","Button","SectionGroup","Section","Stepper","Step","FOOTER_STYLE","FOOTER_ACTIONS_STYLE"],"sources":["../../src/views/templates/compose/steps/ComposeFormStep.tsx","../../src/views/templates/compose/steps/ComposeReviewStep.tsx","../../src/views/templates/compose/steps/ComposeWorkflowStep.tsx","../../src/views/templates/compose/use-template-compose-wizard.ts","../../src/views/templates/compose/TemplateComposeWizardView.tsx"],"sourcesContent":["'use client';\n\nimport type { ChangeEvent, ReactElement } from 'react';\nimport { useEffect, useState } from 'react';\nimport { FormField, Input, Select, Typography } from '@mezzanine-ui/react';\nimport { FormFieldLayout } from '@mezzanine-ui/core/form';\nimport type { SelectValue } from '@mezzanine-ui/react/Select';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport {\n ApprovalTemplateCategoryRecord,\n listApprovalTemplateCategoriesPage,\n} from '@rytass/bpm-core-client/template';\nimport { FormBuilderView } from '../../../forms/builder';\n\nconst UNCATEGORIZED_OPTION: SelectValue = {\n id: 'UNCATEGORIZED',\n name: '未分類',\n};\n\nconst CATEGORY_PAGE_SIZE = 100;\n\nexport interface ComposeFormStepProps {\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly onNameChange: (value: string) => void;\n readonly onCategoryIdChange: (value: string | null) => void;\n readonly onFormChange: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n}\n\nexport function ComposeFormStep({\n categoryId,\n formSchema,\n formUiSchema,\n name,\n onCategoryIdChange,\n onFormChange,\n onNameChange,\n}: ComposeFormStepProps): ReactElement {\n const [categoryOptions, setCategoryOptions] = useState<\n readonly ApprovalTemplateCategoryRecord[]\n >([]);\n\n useEffect((): (() => void) => {\n let active = true;\n\n void (async (): Promise<void> => {\n try {\n const result = await listApprovalTemplateCategoriesPage({\n page: 1,\n pageSize: CATEGORY_PAGE_SIZE,\n searchText: '',\n status: 'ACTIVE',\n });\n\n if (active) {\n setCategoryOptions(result.categories);\n }\n } catch {\n if (active) {\n setCategoryOptions([]);\n }\n }\n })();\n\n return (): void => {\n active = false;\n };\n }, []);\n\n const selectOptions: SelectValue[] = [\n UNCATEGORIZED_OPTION,\n ...categoryOptions.map((category) => ({\n id: category.id,\n name: category.name,\n })),\n ];\n const selectedOption =\n selectOptions.find((option) => option.id === categoryId) ??\n UNCATEGORIZED_OPTION;\n\n return (\n <>\n <div style={BASICS_GRID_STYLE}>\n <FormField\n label=\"名稱\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeName\"\n >\n <Input\n fullWidth\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n onNameChange(event.target.value)\n }\n placeholder=\"例如:請款簽核\"\n value={name}\n />\n </FormField>\n <FormField\n label=\"分類(選填)\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeCategory\"\n >\n <Select\n clearable={false}\n fullWidth\n onChange={(option): void =>\n onCategoryIdChange(\n option && option.id !== UNCATEGORIZED_OPTION.id\n ? option.id\n : null,\n )\n }\n options={selectOptions}\n placeholder=\"未分類\"\n value={selectedOption}\n />\n </FormField>\n </div>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。\n </Typography>\n <FormBuilderView\n onChange={onFormChange}\n value={{ schema: formSchema, uiSchema: formUiSchema }}\n />\n </>\n );\n}\n\nconst BASICS_GRID_STYLE = {\n display: 'grid',\n gap: 16,\n gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',\n} as const;\n","'use client';\n\nimport type { CSSProperties, ReactElement } from 'react';\nimport { Empty, Table, Tag, Typography } from '@mezzanine-ui/react';\nimport type { TableColumn } from '@mezzanine-ui/core/table';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type {\n WorkflowDefinition,\n WorkflowNode,\n} from '@rytass/bpm-core-shared/workflow';\nimport { FormRenderer } from '../../../forms/renderer/FormRendererView';\n\ntype FlowNodeRow = Readonly<\n Record<string, unknown> & {\n detail: string;\n key: string;\n label: string;\n typeLabel: string;\n }\n>;\n\ntype BranchRow = Readonly<\n Record<string, unknown> & {\n condition: string;\n key: string;\n source: string;\n target: string;\n }\n>;\n\nexport interface ComposeReviewStepProps {\n readonly name: string;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishError: string | null;\n}\n\nexport function ComposeReviewStep({\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n publishError,\n workflowDefinition,\n}: ComposeReviewStepProps): ReactElement {\n const nodes = workflowDefinition?.nodes ?? [];\n const edges = workflowDefinition?.edges ?? [];\n const fieldCount = formSchema.fields.length;\n const nodeLabelById = new Map(\n nodes.map((node) => [node.id, node.data.label] as const),\n );\n const nodeRows: FlowNodeRow[] = nodes.map((node) => ({\n detail: readNodeDetail(node) ?? '—',\n key: node.id,\n label: node.data.label,\n typeLabel: readNodeTypeLabel(node),\n }));\n const branchRows: BranchRow[] = edges\n .filter((edge) => Boolean(edge.data.condition))\n .map((edge) => ({\n condition: edge.data.condition ?? '',\n key: edge.id,\n source: nodeLabelById.get(edge.source) ?? edge.source,\n target: nodeLabelById.get(edge.target) ?? edge.target,\n }));\n\n return (\n <div style={STACK_STYLE}>\n <Typography component=\"h2\" style={TITLE_STYLE} variant=\"h2\">\n {name || '(未命名)'}\n </Typography>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">表單預覽</Typography>\n {fieldCount > 0 ? (\n <FormRenderer\n dataSourceContext={{ kind: 'preview' }}\n readonly\n schema={formSchema}\n uiSchema={formUiSchema}\n />\n ) : (\n <Empty title=\"尚未設計表單欄位\" />\n )}\n </div>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">流程概覽</Typography>\n {nodes.length > 0 ? (\n <Table columns={NODE_COLUMNS} dataSource={nodeRows} fullWidth />\n ) : (\n <Empty title=\"尚未設計流程節點\" />\n )}\n {branchRows.length > 0 ? (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 條件分流\n </Typography>\n <Table columns={BRANCH_COLUMNS} dataSource={branchRows} fullWidth />\n </>\n ) : null}\n {initiatorPolicyCel ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 發起權限:{initiatorPolicyCel}\n </Typography>\n ) : null}\n </div>\n\n {publishError ? (\n <Typography color=\"text-error\" variant=\"body\">\n {publishError}\n </Typography>\n ) : null}\n </div>\n );\n}\n\nconst NODE_COLUMNS: TableColumn<FlowNodeRow>[] = [\n {\n key: 'type',\n render: (record: FlowNodeRow): ReactElement => (\n <Tag label={record.typeLabel} size=\"sub\" type=\"static\" />\n ),\n title: '類型',\n width: 130,\n },\n { dataIndex: 'label', key: 'label', title: '節點' },\n { dataIndex: 'detail', key: 'detail', title: '簽核方式', width: 160 },\n];\n\nconst BRANCH_COLUMNS: TableColumn<BranchRow>[] = [\n { dataIndex: 'source', key: 'source', title: '來源', width: 180 },\n { dataIndex: 'target', key: 'target', title: '目標', width: 180 },\n { dataIndex: 'condition', key: 'condition', title: '條件' },\n];\n\nfunction readNodeTypeLabel(node: WorkflowNode): string {\n switch (node.type) {\n case 'startEvent':\n return '開始';\n case 'endEvent':\n return node.data.endState === 'REJECTED' ? '結束(駁回)' : '結束(核准)';\n case 'userTask':\n return '簽核';\n case 'serviceTask':\n return '服務';\n case 'exclusiveGateway':\n return '條件閘道';\n case 'parallelGateway':\n return '平行閘道';\n default:\n return '節點';\n }\n}\n\nfunction readNodeDetail(node: WorkflowNode): string | null {\n if (node.type !== 'userTask') {\n return null;\n }\n\n switch (node.data.approverResolver.type) {\n case 'DIRECT':\n return '指定成員';\n case 'POSITION':\n return '指定職位';\n case 'ORG_UNIT_MEMBER':\n return '單位成員';\n case 'ORG_UNIT_POSITION':\n return '單位職位';\n case 'ORG_MANAGER':\n return '主管';\n case 'ORG_MANAGER_CHAIN':\n return '主管鏈';\n case 'ORG_UNIT_MANAGER':\n return '單位主管';\n case 'DYNAMIC_FORM':\n return '依表單欄位指定';\n case 'EXPRESSION':\n return '運算式';\n default:\n return '簽核人';\n }\n}\n\nconst STACK_STYLE: CSSProperties = {\n display: 'grid',\n gap: 12,\n};\n\n// Match the breathing room between the stepper and the PageHeader, which is the\n// Section's top padding token.\nconst TITLE_STYLE: CSSProperties = {\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n};\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { Typography } from '@mezzanine-ui/react';\nimport type { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport { TemplateDesignerView } from '../../designer';\n\nexport interface ComposeWorkflowStepProps {\n readonly formSchema: FormDefinitionSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly onWorkflowChange: (definition: WorkflowDefinition) => void;\n readonly onInitiatorPolicyChange: (cel: string | null) => void;\n /**\n * Show the AI assistant button inside the embedded designer's side panel.\n * Follows the same opt-in contract as the standalone designer page; default\n * hidden. Wired up the stack from the server page's `BPM_AI_ASSISTANT_ENABLED`.\n */\n readonly showAiAssistant?: boolean;\n /**\n * Whether the LLM backend is configured (host has an API key). When `false`\n * the AI button shows disabled as a placeholder. Default `false`.\n */\n readonly aiAssistantAvailable?: boolean;\n}\n\nexport function ComposeWorkflowStep({\n aiAssistantAvailable = false,\n formSchema,\n initiatorPolicyCel,\n onInitiatorPolicyChange,\n onWorkflowChange,\n showAiAssistant = false,\n workflowDefinition,\n}: ComposeWorkflowStepProps): ReactElement {\n return (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。\n </Typography>\n <TemplateDesignerView\n aiAssistantAvailable={aiAssistantAvailable}\n embedded\n formSchemaOverride={formSchema}\n initialInitiatorPolicyCel={initiatorPolicyCel}\n initialWorkflowDefinition={workflowDefinition ?? undefined}\n onInitiatorPolicyChange={onInitiatorPolicyChange}\n onWorkflowChange={onWorkflowChange}\n showAiAssistant={showAiAssistant}\n />\n </>\n );\n}\n","'use client';\n\nimport { useCallback, useState } from 'react';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport {\n useBPMLanguage,\n type BPMLanguage,\n} from '../../../lib/language-provider';\nimport { readFormSchemaLintMessage } from '@rytass/bpm-core-client/form';\nimport {\n ComposeApprovalTemplateWithFormResult,\n composeApprovalTemplateWithForm,\n readWorkflowLintMessage,\n} from '@rytass/bpm-core-client/template';\n\nexport type ComposeWizardStep = 0 | 1 | 2;\n\nexport type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';\n\nexport const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema = {\n fields: [],\n schemaVersion: 1,\n};\n\nexport const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema = {\n layout: [],\n schemaVersion: 1,\n};\n\nexport interface TemplateComposeWizard {\n readonly currentStep: ComposeWizardStep;\n /**\n * Single user-facing name. Persisted to both the template and the form\n * (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`\n * boundary — the DB keeps two columns, the UI keeps one field.\n */\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishPhase: ComposePublishPhase;\n readonly publishError: string | null;\n readonly canLeaveBasics: boolean;\n readonly goToStep: (step: ComposeWizardStep) => void;\n readonly goNext: () => void;\n readonly goBack: () => void;\n readonly setName: (value: string) => void;\n readonly setCategoryId: (value: string | null) => void;\n readonly setFormValue: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;\n readonly setInitiatorPolicyCel: (cel: string | null) => void;\n readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;\n}\n\n/**\n * Owns the cross-step state for the unified \"form + flow\" template wizard.\n *\n * Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema\n * feeds Step 1 (流程) as the field source for condition branches, so the\n * embedded designer never needs a published form version. Step 2 (檢視發佈)\n * submits everything through the atomic `composeApprovalTemplateWithForm`\n * mutation.\n */\nexport function useTemplateComposeWizard(): TemplateComposeWizard {\n const language = useBPMLanguage();\n const [currentStep, setCurrentStep] = useState<ComposeWizardStep>(0);\n const [name, setName] = useState('');\n const [categoryId, setCategoryId] = useState<string | null>(null);\n const [formSchema, setFormSchema] = useState<FormDefinitionSchema>(\n EMPTY_COMPOSE_FORM_SCHEMA,\n );\n const [formUiSchema, setFormUiSchema] = useState<FormUiSchema>(\n EMPTY_COMPOSE_FORM_UI_SCHEMA,\n );\n const [workflowDefinition, setWorkflowDefinitionState] =\n useState<WorkflowDefinition | null>(null);\n const [initiatorPolicyCel, setInitiatorPolicyCelState] = useState<\n string | null\n >(null);\n const [publishPhase, setPublishPhase] = useState<ComposePublishPhase>('idle');\n const [publishError, setPublishError] = useState<string | null>(null);\n\n const canLeaveBasics = name.trim().length > 0 && formSchema.fields.length > 0;\n\n const goToStep = useCallback((step: ComposeWizardStep): void => {\n setCurrentStep(step);\n }, []);\n\n const goNext = useCallback((): void => {\n setCurrentStep((step) =>\n step < 2 ? ((step + 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const goBack = useCallback((): void => {\n setCurrentStep((step) =>\n step > 0 ? ((step - 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const setFormValue = useCallback(\n (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }): void => {\n setFormSchema(next.schema);\n setFormUiSchema(next.uiSchema);\n },\n [],\n );\n\n const setWorkflowDefinition = useCallback(\n (definition: WorkflowDefinition): void => {\n setWorkflowDefinitionState(definition);\n },\n [],\n );\n\n const setInitiatorPolicyCel = useCallback((cel: string | null): void => {\n setInitiatorPolicyCelState(cel);\n }, []);\n\n const publish =\n useCallback(async (): Promise<ComposeApprovalTemplateWithFormResult | null> => {\n setPublishPhase('submitting');\n setPublishError(null);\n\n const submittedDefinition =\n workflowDefinition ?? EMPTY_WORKFLOW_DEFINITION;\n\n try {\n const result = await composeApprovalTemplateWithForm({\n category: null,\n categoryId,\n formDefinitionId: null,\n formDescription: null,\n // One UI name fans out to both persisted columns.\n formName: name,\n initiatorPolicyCel,\n notificationConfig: null,\n publish: true,\n schema: formSchema,\n slaDefaults: null,\n templateDescription: null,\n templateId: null,\n templateName: name,\n uiSchema: formUiSchema,\n workflowDefinition: submittedDefinition,\n });\n\n setPublishPhase('success');\n\n return result;\n } catch (requestError: unknown) {\n setPublishError(\n readErrorMessage(requestError, submittedDefinition, language),\n );\n setPublishPhase('error');\n\n return null;\n }\n }, [\n categoryId,\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n language,\n name,\n workflowDefinition,\n ]);\n\n return {\n canLeaveBasics,\n categoryId,\n currentStep,\n formSchema,\n formUiSchema,\n goBack,\n goNext,\n goToStep,\n initiatorPolicyCel,\n name,\n publish,\n publishError,\n publishPhase,\n setCategoryId,\n setFormValue,\n setInitiatorPolicyCel,\n setName,\n setWorkflowDefinition,\n workflowDefinition,\n };\n}\n\nconst EMPTY_WORKFLOW_DEFINITION: WorkflowDefinition = {\n edges: [],\n meta: { schemaVersion: 1 },\n nodes: [\n {\n data: { label: '開始' },\n id: 'start',\n position: { x: 80, y: 160 },\n type: 'startEvent',\n },\n {\n data: { endState: 'APPROVED', label: '完成', triggerMode: 'AND' },\n id: 'end',\n position: { x: 560, y: 160 },\n type: 'endEvent',\n },\n ],\n};\n\nconst UNKNOWN_ERROR_MESSAGES: Readonly<Record<BPMLanguage, string>> = {\n en: 'An unknown error occurred',\n 'zh-TW': '發生未知錯誤',\n};\n\nfunction readErrorMessage(\n error: unknown,\n submittedDefinition: WorkflowDefinition,\n language: BPMLanguage,\n): string {\n // Publish failures can carry stable `FORM_DATA_SOURCE_*` codes and\n // structural lines that name nodes by id; map both to readable copy and\n // leave every other message untouched.\n return error instanceof Error\n ? readFormSchemaLintMessage(\n readWorkflowLintMessage(error.message, submittedDefinition, language),\n )\n : UNKNOWN_ERROR_MESSAGES[language];\n}\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport {\n Button,\n PageHeader,\n Section,\n SectionGroup,\n Step,\n Stepper,\n Typography,\n} from '@mezzanine-ui/react';\nimport ContentHeader from '@mezzanine-ui/react/ContentHeader';\nimport { useRouterAdapter } from '../../../lib/router-adapter';\nimport { useBPMRoutes } from '../../../lib/routes-config';\nimport { ComposeFormStep } from './steps/ComposeFormStep';\nimport { ComposeReviewStep } from './steps/ComposeReviewStep';\nimport { ComposeWorkflowStep } from './steps/ComposeWorkflowStep';\nimport { useTemplateComposeWizard } from './use-template-compose-wizard';\n\nexport interface TemplateComposeWizardViewProps {\n /**\n * Show the workflow designer AI assistant inside Step 1 (流程設計). Opt-in,\n * default hidden — the server page maps `BPM_AI_ASSISTANT_ENABLED` to it.\n */\n readonly showAiAssistant?: boolean;\n /**\n * Whether the LLM backend is configured (host has an API key). When `false`\n * the AI button shows disabled as a placeholder. Default `false`.\n */\n readonly aiAssistantAvailable?: boolean;\n}\n\n/**\n * Unified \"form + flow\" template creation wizard. Walks the user through\n * Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both\n * sides atomically through `composeApprovalTemplateWithForm`. This is the\n * template entry point; the form builder is intentionally controlled here\n * instead of exposed as a standalone `/forms` page.\n */\nexport function TemplateComposeWizardView({\n aiAssistantAvailable = false,\n showAiAssistant = false,\n}: TemplateComposeWizardViewProps = {}): ReactElement {\n const router = useRouterAdapter();\n const routes = useBPMRoutes();\n const wizard = useTemplateComposeWizard();\n const submitting = wizard.publishPhase === 'submitting';\n\n async function handlePublish(): Promise<void> {\n const result = await wizard.publish();\n\n if (result) {\n router.push(routes.templateDesigner(result.templateId));\n }\n }\n\n return (\n <>\n <PageHeader>\n <ContentHeader\n description=\"一次完成表單與流程設計,發佈後即可直接發起。\"\n title=\"建立模板(表單 + 流程)\"\n >\n <Button\n disabled={submitting}\n onClick={(): void => router.push(routes.templates())}\n variant=\"base-secondary\"\n >\n 返回模板列表\n </Button>\n </ContentHeader>\n </PageHeader>\n\n <SectionGroup>\n <Section>\n <Stepper currentStep={wizard.currentStep}>\n <Step description=\"設計欄位與版面\" title=\"表單設計\" />\n <Step description=\"設計簽核節點與條件\" title=\"流程設計\" />\n <Step description=\"確認後發佈\" title=\"檢視並發佈\" />\n </Stepper>\n\n {wizard.currentStep === 0 ? (\n <ComposeFormStep\n categoryId={wizard.categoryId}\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n name={wizard.name}\n onCategoryIdChange={wizard.setCategoryId}\n onFormChange={wizard.setFormValue}\n onNameChange={wizard.setName}\n />\n ) : null}\n\n {wizard.currentStep === 1 ? (\n <ComposeWorkflowStep\n aiAssistantAvailable={aiAssistantAvailable}\n formSchema={wizard.formSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n onInitiatorPolicyChange={wizard.setInitiatorPolicyCel}\n onWorkflowChange={wizard.setWorkflowDefinition}\n showAiAssistant={showAiAssistant}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n {wizard.currentStep === 2 ? (\n <ComposeReviewStep\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n name={wizard.name}\n publishError={wizard.publishError}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n <div style={FOOTER_STYLE}>\n {wizard.currentStep === 0 && !wizard.canLeaveBasics ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 請填寫模板名稱、表單名稱,並至少新增一個表單欄位。\n </Typography>\n ) : (\n <span />\n )}\n <div style={FOOTER_ACTIONS_STYLE}>\n <Button\n disabled={wizard.currentStep === 0 || submitting}\n onClick={wizard.goBack}\n variant=\"base-secondary\"\n >\n 上一步\n </Button>\n {wizard.currentStep < 2 ? (\n <Button\n disabled={wizard.currentStep === 0 && !wizard.canLeaveBasics}\n onClick={wizard.goNext}\n variant=\"base-primary\"\n >\n 下一步\n </Button>\n ) : (\n <Button\n disabled={submitting}\n loading={submitting}\n onClick={(): void => {\n void handlePublish();\n }}\n variant=\"base-primary\"\n >\n 發佈\n </Button>\n )}\n </div>\n </div>\n </Section>\n </SectionGroup>\n </>\n );\n}\n\nconst FOOTER_STYLE = {\n alignItems: 'center',\n display: 'flex',\n // Match the breathing room used elsewhere (the Section's top padding token).\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n justifyContent: 'space-between',\n gap: 16,\n} as const;\n\nconst FOOTER_ACTIONS_STYLE = {\n display: 'flex',\n gap: 8,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAMY,IAAoC;CACxC,IAAI;CACJ,MAAM;AACR,GAEMC,IAAqB;AAe3B,SAAgBC,EAAgB,EAC9B,eACA,eACA,iBACA,SACA,uBACA,iBACA,mBACqC;CACrC,IAAM,CAACC,GAAiBC,KAAsBC,EAE5C,CAAC,CAAC;CAEJ,QAA8B;EAC5B,IAAIC,IAAS;EAqBb,QAnBM,YAA2B;GAC/B,IAAI;IACF,IAAMC,IAAS,MAAMC,EAAmC;KACtD,MAAM;KACN,UAAUP;KACV,YAAY;KACZ,QAAQ;IACV,CAAC;IAED,AAAIK,KACFF,EAAmBG,EAAO,UAAU;GAExC,QAAQ;IACN,AAAID,KACFF,EAAmB,CAAC,CAAC;GAEzB;EACF,EAAA,CAAG,SAEgB;GACjB,IAAS;EACX;CACF,GAAG,CAAC,CAAC;CAEL,IAAMK,IAA+B,CACnCT,GACA,GAAGG,EAAgB,KAAK,OAAc;EACpC,IAAIO,EAAS;EACb,MAAMA,EAAS;CACjB,EAAE,CACJ,GACMC,IACJF,EAAc,MAAM,MAAWG,EAAO,OAAOC,CAAU,KACvDb;CAEF,OACE,kBAAAZ,GAAA,EAAA,UAAA;EACE,kBAAC,OAAD;GAAK,OAAO0B;GAAZ,UAAA,CACE,kBAACC,GAAD;IACE,OAAM;IACN,QAAQC,EAAgB;IACxB,MAAK;IAEL,UAAA,kBAACC,GAAD;KACE,WAAA;KACA,WAAW,MACTC,EAAaC,EAAM,OAAO,KAAK;KAEjC,aAAY;KACZ,OAAOC;IACR,CAAA;GACQ,CAAA,GACX,kBAACL,GAAD;IACE,OAAM;IACN,QAAQC,EAAgB;IACxB,MAAK;IAEL,UAAA,kBAACK,GAAD;KACE,WAAW;KACX,WAAA;KACA,WAAW,MACTC,EACEV,KAAUA,EAAO,OA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