@rytass/bpm-core-react 0.17.2 → 0.17.4

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/chunks/{compose-_pREPtfN.js → compose-b-vhcOb1.js} +155 -156
  3. package/dist/chunks/compose-b-vhcOb1.js.map +1 -0
  4. package/dist/chunks/compose-fdwBNiyg.cjs +2 -0
  5. package/dist/chunks/compose-fdwBNiyg.cjs.map +1 -0
  6. package/dist/chunks/designer-CbOCuXHH.cjs +65 -0
  7. package/dist/chunks/designer-CbOCuXHH.cjs.map +1 -0
  8. package/dist/chunks/{designer-BiywgNXs.js → designer-Dn49G9s-.js} +1046 -1070
  9. package/dist/chunks/designer-Dn49G9s-.js.map +1 -0
  10. package/dist/chunks/{detail-DRCTnuKm.cjs → detail-BQSVgVlO.cjs} +2 -2
  11. package/dist/chunks/{detail-DRCTnuKm.cjs.map → detail-BQSVgVlO.cjs.map} +1 -1
  12. package/dist/chunks/{detail-DScLf42P.js → detail-B_bSg31B.js} +3 -1
  13. package/dist/chunks/{detail-DScLf42P.js.map → detail-B_bSg31B.js.map} +1 -1
  14. package/dist/chunks/language-provider-B3cEbLe4.js +18 -0
  15. package/dist/chunks/language-provider-B3cEbLe4.js.map +1 -0
  16. package/dist/chunks/language-provider-Bdnx3Gxl.cjs +2 -0
  17. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -0
  18. package/dist/chunks/providers-DP7b0TMN.cjs +2 -0
  19. package/dist/chunks/providers-DP7b0TMN.cjs.map +1 -0
  20. package/dist/chunks/{providers-J5eyByQj.js → providers-H_vPRsSN.js} +202 -198
  21. package/dist/chunks/providers-H_vPRsSN.js.map +1 -0
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +1 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +22 -21
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/language-provider.d.cts +22 -0
  29. package/dist/lib/language-provider.d.ts +22 -0
  30. package/dist/lib/providers.d.cts +9 -1
  31. package/dist/lib/providers.d.ts +9 -1
  32. package/dist/next/BPMNextProviders.d.cts +7 -1
  33. package/dist/next/BPMNextProviders.d.ts +7 -1
  34. package/dist/next/index.cjs +1 -1
  35. package/dist/next/index.cjs.map +1 -1
  36. package/dist/next/index.js +12 -11
  37. package/dist/next/index.js.map +1 -1
  38. package/dist/pages/instances/detail/index.cjs +1 -1
  39. package/dist/pages/instances/detail/index.js +1 -1
  40. package/dist/pages/templates/compose/index.cjs +1 -1
  41. package/dist/pages/templates/compose/index.js +1 -1
  42. package/dist/pages/templates/designer/index.cjs +1 -1
  43. package/dist/pages/templates/designer/index.js +1 -1
  44. package/dist/views/instances/detail/index.cjs +1 -1
  45. package/dist/views/instances/detail/index.js +1 -1
  46. package/dist/views/templates/compose/index.cjs +1 -1
  47. package/dist/views/templates/compose/index.js +1 -1
  48. package/dist/views/templates/designer/index.cjs +1 -1
  49. package/dist/views/templates/designer/index.js +1 -1
  50. package/dist/views/templates/template-error-message.d.cts +9 -0
  51. package/dist/views/templates/template-error-message.d.ts +9 -0
  52. package/package.json +3 -3
  53. package/dist/chunks/compose-B7TtrpQJ.cjs +0 -2
  54. package/dist/chunks/compose-B7TtrpQJ.cjs.map +0 -1
  55. package/dist/chunks/compose-_pREPtfN.js.map +0 -1
  56. package/dist/chunks/designer-BiywgNXs.js.map +0 -1
  57. package/dist/chunks/designer-ttAqv859.cjs +0 -65
  58. package/dist/chunks/designer-ttAqv859.cjs.map +0 -1
  59. package/dist/chunks/providers-DHtDZFNA.cjs +0 -2
  60. package/dist/chunks/providers-DHtDZFNA.cjs.map +0 -1
  61. package/dist/chunks/providers-J5eyByQj.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ ## 0.17.4 (2026-10-19)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **form:** translate DataSource error copy per language ([787e7a3](https://github.com/Rytass/BPMCore/commit/787e7a3))
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **react:** name condition operators after the field in the template designer ([54d530a](https://github.com/Rytass/BPMCore/commit/54d530a))
10
+ - **react:** sample multiple-selection fields as arrays in the dry run ([295c23a](https://github.com/Rytass/BPMCore/commit/295c23a))
11
+
12
+ ### ❤️ Thank You
13
+
14
+ - Chia Yu Pai @fantasywind
15
+ - Kai-Chieh Yang
16
+
17
+ ## 0.17.3 (2026-10-19)
18
+
19
+ ### 🚀 Features
20
+
21
+ - **react:** add a BPM message language provider ([355b15c](https://github.com/Rytass/BPMCore/commit/355b15c))
22
+ - **template:** translate publish lint lines per language ([60fa7bc](https://github.com/Rytass/BPMCore/commit/60fa7bc))
23
+ - **react:** enlarge approval comments in the instance history ([b3bb37c](https://github.com/Rytass/BPMCore/commit/b3bb37c))
24
+ - **react:** show structural publish failures in Chinese with node names ([ba90fbd](https://github.com/Rytass/BPMCore/commit/ba90fbd))
25
+ - **client:** translate structural publish-lint lines into designer copy ([490339c](https://github.com/Rytass/BPMCore/commit/490339c))
26
+
27
+ ### 🩹 Fixes
28
+
29
+ - **template:** address review of the lint translation ([26d7a54](https://github.com/Rytass/BPMCore/commit/26d7a54))
30
+ - **react:** sample money fields as numbers in the designer dry run ([35dbd9a](https://github.com/Rytass/BPMCore/commit/35dbd9a))
31
+ - **client:** cover blank node labels and never throw while translating lint ([0a8b3af](https://github.com/Rytass/BPMCore/commit/0a8b3af))
32
+
33
+ ### ❤️ Thank You
34
+
35
+ - Chia Yu Pai @fantasywind
36
+ - Kai-Chieh Yang
37
+
1
38
  ## 0.17.2 (2026-10-18)
2
39
 
3
40
  ### 🚀 Features
@@ -1,79 +1,79 @@
1
1
  "use client";
2
2
  import { r as e } from "./router-adapter-DftlFTOd.js";
3
- import { r as t } from "./routes-config-yZbESPlw.js";
4
- import { t as n } from "./FormRendererView-cZGOOjU5.js";
5
- import { t as r } from "./FormBuilderView-BYL42M0d.js";
6
- import { t as i } from "./designer-BiywgNXs.js";
7
- import { useCallback as a, useEffect as o, useState as s } from "react";
8
- import { Button as c, Empty as l, FormField as u, Input as d, PageHeader as f, Section as p, SectionGroup as m, Select as h, Step as g, Stepper as _, Table as v, Tag as y, Typography as b } from "@mezzanine-ui/react";
9
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
10
- import { FormFieldLayout as w } from "@mezzanine-ui/core/form";
11
- import T from "@mezzanine-ui/react/ContentHeader";
12
- import { readFormSchemaLintMessage as E } from "@rytass/bpm-core-client/form";
13
- import { composeApprovalTemplateWithForm as D, listApprovalTemplateCategoriesPage as O } from "@rytass/bpm-core-client/template";
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 { n as a, t as o } from "./designer-Dn49G9s-.js";
8
+ import { useCallback as s, useEffect as c, useState as l } from "react";
9
+ import { Button as u, Empty as d, FormField as f, Input as p, PageHeader as m, Section as h, SectionGroup as g, Select as _, Step as v, Stepper as y, Table as b, Tag as x, Typography as S } from "@mezzanine-ui/react";
10
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
11
+ import { FormFieldLayout as E } from "@mezzanine-ui/core/form";
12
+ import D from "@mezzanine-ui/react/ContentHeader";
13
+ import { composeApprovalTemplateWithForm as O, listApprovalTemplateCategoriesPage as k } from "@rytass/bpm-core-client/template";
14
14
  //#region src/views/templates/compose/steps/ComposeFormStep.tsx
15
- var k = {
15
+ var A = {
16
16
  id: "UNCATEGORIZED",
17
17
  name: "未分類"
18
- }, A = 100;
19
- function j({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryIdChange: a, onFormChange: c, onNameChange: l }) {
20
- let [f, p] = s([]);
21
- o(() => {
18
+ }, j = 100;
19
+ function M({ categoryId: e, formSchema: t, formUiSchema: n, name: r, onCategoryIdChange: a, onFormChange: o, onNameChange: s }) {
20
+ let [u, d] = l([]);
21
+ c(() => {
22
22
  let e = !0;
23
23
  return (async () => {
24
24
  try {
25
- let t = await O({
25
+ let t = await k({
26
26
  page: 1,
27
- pageSize: A,
27
+ pageSize: j,
28
28
  searchText: "",
29
29
  status: "ACTIVE"
30
30
  });
31
- e && p(t.categories);
31
+ e && d(t.categories);
32
32
  } catch {
33
- e && p([]);
33
+ e && d([]);
34
34
  }
35
35
  })(), () => {
36
36
  e = !1;
37
37
  };
38
38
  }, []);
39
- let m = [k, ...f.map((e) => ({
39
+ let m = [A, ...u.map((e) => ({
40
40
  id: e.id,
41
41
  name: e.name
42
- }))], g = m.find((t) => t.id === e) ?? k;
43
- return /* @__PURE__ */ C(x, { children: [
44
- /* @__PURE__ */ C("div", {
45
- style: M,
46
- children: [/* @__PURE__ */ S(u, {
42
+ }))], h = m.find((t) => t.id === e) ?? A;
43
+ return /* @__PURE__ */ T(C, { children: [
44
+ /* @__PURE__ */ T("div", {
45
+ style: N,
46
+ children: [/* @__PURE__ */ w(f, {
47
47
  label: "名稱",
48
- layout: w.VERTICAL,
48
+ layout: E.VERTICAL,
49
49
  name: "composeName",
50
- children: /* @__PURE__ */ S(d, {
50
+ children: /* @__PURE__ */ w(p, {
51
51
  fullWidth: !0,
52
- onChange: (e) => l(e.target.value),
52
+ onChange: (e) => s(e.target.value),
53
53
  placeholder: "例如:請款簽核",
54
- value: i
54
+ value: r
55
55
  })
56
- }), /* @__PURE__ */ S(u, {
56
+ }), /* @__PURE__ */ w(f, {
57
57
  label: "分類(選填)",
58
- layout: w.VERTICAL,
58
+ layout: E.VERTICAL,
59
59
  name: "composeCategory",
60
- children: /* @__PURE__ */ S(h, {
60
+ children: /* @__PURE__ */ w(_, {
61
61
  clearable: !1,
62
62
  fullWidth: !0,
63
- onChange: (e) => a(e && e.id !== k.id ? e.id : null),
63
+ onChange: (e) => a(e && e.id !== A.id ? e.id : null),
64
64
  options: m,
65
65
  placeholder: "未分類",
66
- value: g
66
+ value: h
67
67
  })
68
68
  })]
69
69
  }),
70
- /* @__PURE__ */ S(b, {
70
+ /* @__PURE__ */ w(S, {
71
71
  color: "text-neutral",
72
72
  variant: "caption",
73
73
  children: "先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。"
74
74
  }),
75
- /* @__PURE__ */ S(r, {
76
- onChange: c,
75
+ /* @__PURE__ */ w(i, {
76
+ onChange: o,
77
77
  value: {
78
78
  schema: t,
79
79
  uiSchema: n
@@ -81,75 +81,75 @@ function j({ categoryId: e, formSchema: t, formUiSchema: n, name: i, onCategoryI
81
81
  })
82
82
  ] });
83
83
  }
84
- var M = {
84
+ var N = {
85
85
  display: "grid",
86
86
  gap: 16,
87
87
  gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))"
88
88
  };
89
89
  //#endregion
90
90
  //#region src/views/templates/compose/steps/ComposeReviewStep.tsx
91
- function N({ formSchema: e, formUiSchema: t, initiatorPolicyCel: r, name: i, publishError: a, workflowDefinition: o }) {
92
- let s = o?.nodes ?? [], c = o?.edges ?? [], u = e.fields.length, d = new Map(s.map((e) => [e.id, e.data.label])), f = s.map((e) => ({
93
- detail: L(e) ?? "—",
91
+ function P({ formSchema: e, formUiSchema: t, initiatorPolicyCel: n, name: i, publishError: a, workflowDefinition: o }) {
92
+ let s = o?.nodes ?? [], c = o?.edges ?? [], l = e.fields.length, u = new Map(s.map((e) => [e.id, e.data.label])), f = s.map((e) => ({
93
+ detail: R(e) ?? "—",
94
94
  key: e.id,
95
95
  label: e.data.label,
96
- typeLabel: I(e)
96
+ typeLabel: L(e)
97
97
  })), p = c.filter((e) => !!e.data.condition).map((e) => ({
98
98
  condition: e.data.condition ?? "",
99
99
  key: e.id,
100
- source: d.get(e.source) ?? e.source,
101
- target: d.get(e.target) ?? e.target
100
+ source: u.get(e.source) ?? e.source,
101
+ target: u.get(e.target) ?? e.target
102
102
  }));
103
- return /* @__PURE__ */ C("div", {
104
- style: R,
103
+ return /* @__PURE__ */ T("div", {
104
+ style: z,
105
105
  children: [
106
- /* @__PURE__ */ S(b, {
106
+ /* @__PURE__ */ w(S, {
107
107
  component: "h2",
108
- style: z,
108
+ style: B,
109
109
  variant: "h2",
110
110
  children: i || "(未命名)"
111
111
  }),
112
- /* @__PURE__ */ C("div", {
113
- style: R,
114
- children: [/* @__PURE__ */ S(b, {
112
+ /* @__PURE__ */ T("div", {
113
+ style: z,
114
+ children: [/* @__PURE__ */ w(S, {
115
115
  variant: "h3",
116
116
  children: "表單預覽"
117
- }), u > 0 ? /* @__PURE__ */ S(n, {
117
+ }), l > 0 ? /* @__PURE__ */ w(r, {
118
118
  dataSourceContext: { kind: "preview" },
119
119
  readonly: !0,
120
120
  schema: e,
121
121
  uiSchema: t
122
- }) : /* @__PURE__ */ S(l, { title: "尚未設計表單欄位" })]
122
+ }) : /* @__PURE__ */ w(d, { title: "尚未設計表單欄位" })]
123
123
  }),
124
- /* @__PURE__ */ C("div", {
125
- style: R,
124
+ /* @__PURE__ */ T("div", {
125
+ style: z,
126
126
  children: [
127
- /* @__PURE__ */ S(b, {
127
+ /* @__PURE__ */ w(S, {
128
128
  variant: "h3",
129
129
  children: "流程概覽"
130
130
  }),
131
- s.length > 0 ? /* @__PURE__ */ S(v, {
132
- columns: P,
131
+ s.length > 0 ? /* @__PURE__ */ w(b, {
132
+ columns: F,
133
133
  dataSource: f,
134
134
  fullWidth: !0
135
- }) : /* @__PURE__ */ S(l, { title: "尚未設計流程節點" }),
136
- p.length > 0 ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, {
135
+ }) : /* @__PURE__ */ w(d, { title: "尚未設計流程節點" }),
136
+ p.length > 0 ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
137
137
  color: "text-neutral",
138
138
  variant: "caption",
139
139
  children: "條件分流"
140
- }), /* @__PURE__ */ S(v, {
141
- columns: F,
140
+ }), /* @__PURE__ */ w(b, {
141
+ columns: I,
142
142
  dataSource: p,
143
143
  fullWidth: !0
144
144
  })] }) : null,
145
- r ? /* @__PURE__ */ C(b, {
145
+ n ? /* @__PURE__ */ T(S, {
146
146
  color: "text-neutral",
147
147
  variant: "caption",
148
- children: ["發起權限:", r]
148
+ children: ["發起權限:", n]
149
149
  }) : null
150
150
  ]
151
151
  }),
152
- a ? /* @__PURE__ */ S(b, {
152
+ a ? /* @__PURE__ */ w(S, {
153
153
  color: "text-error",
154
154
  variant: "body",
155
155
  children: a
@@ -157,10 +157,10 @@ function N({ formSchema: e, formUiSchema: t, initiatorPolicyCel: r, name: i, pub
157
157
  ]
158
158
  });
159
159
  }
160
- var P = [
160
+ var F = [
161
161
  {
162
162
  key: "type",
163
- render: (e) => /* @__PURE__ */ S(y, {
163
+ render: (e) => /* @__PURE__ */ w(x, {
164
164
  label: e.typeLabel,
165
165
  size: "sub",
166
166
  type: "static"
@@ -179,7 +179,7 @@ var P = [
179
179
  title: "簽核方式",
180
180
  width: 160
181
181
  }
182
- ], F = [
182
+ ], I = [
183
183
  {
184
184
  dataIndex: "source",
185
185
  key: "source",
@@ -198,7 +198,7 @@ var P = [
198
198
  title: "條件"
199
199
  }
200
200
  ];
201
- function I(e) {
201
+ function L(e) {
202
202
  switch (e.type) {
203
203
  case "startEvent": return "開始";
204
204
  case "endEvent": return e.data.endState === "REJECTED" ? "結束(駁回)" : "結束(核准)";
@@ -209,7 +209,7 @@ function I(e) {
209
209
  default: return "節點";
210
210
  }
211
211
  }
212
- function L(e) {
212
+ function R(e) {
213
213
  if (e.type !== "userTask") return null;
214
214
  switch (e.data.approverResolver.type) {
215
215
  case "DIRECT": return "指定成員";
@@ -224,105 +224,107 @@ function L(e) {
224
224
  default: return "簽核人";
225
225
  }
226
226
  }
227
- var R = {
227
+ var z = {
228
228
  display: "grid",
229
229
  gap: 12
230
- }, z = { marginTop: "var(--mzn-spacing-padding-vertical-spacious)" };
230
+ }, B = { marginTop: "var(--mzn-spacing-padding-vertical-spacious)" };
231
231
  //#endregion
232
232
  //#region src/views/templates/compose/steps/ComposeWorkflowStep.tsx
233
- function B({ aiAssistantAvailable: e = !1, formSchema: t, initiatorPolicyCel: n, onInitiatorPolicyChange: r, onWorkflowChange: a, showAiAssistant: o = !1, workflowDefinition: s }) {
234
- return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(b, {
233
+ function V({ aiAssistantAvailable: e = !1, formSchema: t, initiatorPolicyCel: n, onInitiatorPolicyChange: r, onWorkflowChange: i, showAiAssistant: a = !1, workflowDefinition: s }) {
234
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
235
235
  color: "text-neutral",
236
236
  variant: "caption",
237
237
  children: "設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。"
238
- }), /* @__PURE__ */ S(i, {
238
+ }), /* @__PURE__ */ w(o, {
239
239
  aiAssistantAvailable: e,
240
240
  embedded: !0,
241
241
  formSchemaOverride: t,
242
242
  initialInitiatorPolicyCel: n,
243
243
  initialWorkflowDefinition: s ?? void 0,
244
244
  onInitiatorPolicyChange: r,
245
- onWorkflowChange: a,
246
- showAiAssistant: o
245
+ onWorkflowChange: i,
246
+ showAiAssistant: a
247
247
  })] });
248
248
  }
249
249
  //#endregion
250
250
  //#region src/views/templates/compose/use-template-compose-wizard.ts
251
- var V = {
251
+ var H = {
252
252
  fields: [],
253
253
  schemaVersion: 1
254
- }, H = {
254
+ }, U = {
255
255
  layout: [],
256
256
  schemaVersion: 1
257
257
  };
258
- function U() {
259
- let [e, t] = s(0), [n, r] = s(""), [i, o] = s(null), [c, l] = s(V), [u, d] = s(H), [f, p] = s(null), [m, h] = s(null), [g, _] = s("idle"), [v, y] = s(null), b = n.trim().length > 0 && c.fields.length > 0, x = a((e) => {
260
- t(e);
261
- }, []), S = a(() => {
262
- t((e) => e < 2 ? e + 1 : e);
263
- }, []), C = a(() => {
264
- t((e) => e > 0 ? e - 1 : e);
265
- }, []), w = a((e) => {
266
- l(e.schema), d(e.uiSchema);
267
- }, []), T = a((e) => {
268
- p(e);
269
- }, []), E = a((e) => {
270
- h(e);
258
+ function W() {
259
+ let e = t(), [n, r] = l(0), [i, o] = l(""), [c, u] = l(null), [d, f] = l(H), [p, m] = l(U), [h, g] = l(null), [_, v] = l(null), [y, b] = l("idle"), [x, S] = l(null), C = i.trim().length > 0 && d.fields.length > 0, w = s((e) => {
260
+ r(e);
261
+ }, []), T = s(() => {
262
+ r((e) => e < 2 ? e + 1 : e);
263
+ }, []), E = s(() => {
264
+ r((e) => e > 0 ? e - 1 : e);
265
+ }, []), D = s((e) => {
266
+ f(e.schema), m(e.uiSchema);
267
+ }, []), k = s((e) => {
268
+ g(e);
269
+ }, []), A = s((e) => {
270
+ v(e);
271
271
  }, []);
272
272
  return {
273
- canLeaveBasics: b,
274
- categoryId: i,
275
- currentStep: e,
276
- formSchema: c,
277
- formUiSchema: u,
278
- goBack: C,
279
- goNext: S,
280
- goToStep: x,
281
- initiatorPolicyCel: m,
282
- name: n,
283
- publish: a(async () => {
284
- _("submitting"), y(null);
273
+ canLeaveBasics: C,
274
+ categoryId: c,
275
+ currentStep: n,
276
+ formSchema: d,
277
+ formUiSchema: p,
278
+ goBack: E,
279
+ goNext: T,
280
+ goToStep: w,
281
+ initiatorPolicyCel: _,
282
+ name: i,
283
+ publish: s(async () => {
284
+ b("submitting"), S(null);
285
+ let t = h ?? G;
285
286
  try {
286
- let e = await D({
287
+ let e = await O({
287
288
  category: null,
288
- categoryId: i,
289
+ categoryId: c,
289
290
  formDefinitionId: null,
290
291
  formDescription: null,
291
- formName: n,
292
- initiatorPolicyCel: m,
292
+ formName: i,
293
+ initiatorPolicyCel: _,
293
294
  notificationConfig: null,
294
295
  publish: !0,
295
- schema: c,
296
+ schema: d,
296
297
  slaDefaults: null,
297
298
  templateDescription: null,
298
299
  templateId: null,
299
- templateName: n,
300
- uiSchema: u,
301
- workflowDefinition: f ?? W
300
+ templateName: i,
301
+ uiSchema: p,
302
+ workflowDefinition: t
302
303
  });
303
- return _("success"), e;
304
- } catch (e) {
305
- return y(G(e)), _("error"), null;
304
+ return b("success"), e;
305
+ } catch (n) {
306
+ return S(a(n, e, t)), b("error"), null;
306
307
  }
307
308
  }, [
308
- i,
309
309
  c,
310
- u,
311
- m,
312
- n,
313
- f
310
+ d,
311
+ p,
312
+ _,
313
+ e,
314
+ i,
315
+ h
314
316
  ]),
315
- publishError: v,
316
- publishPhase: g,
317
- setCategoryId: o,
318
- setFormValue: w,
319
- setInitiatorPolicyCel: E,
320
- setName: r,
321
- setWorkflowDefinition: T,
322
- workflowDefinition: f
317
+ publishError: x,
318
+ publishPhase: y,
319
+ setCategoryId: u,
320
+ setFormValue: D,
321
+ setInitiatorPolicyCel: A,
322
+ setName: o,
323
+ setWorkflowDefinition: k,
324
+ workflowDefinition: h
323
325
  };
324
326
  }
325
- var W = {
327
+ var G = {
326
328
  edges: [],
327
329
  meta: { schemaVersion: 1 },
328
330
  nodes: [{
@@ -347,45 +349,42 @@ var W = {
347
349
  type: "endEvent"
348
350
  }]
349
351
  };
350
- function G(e) {
351
- return e instanceof Error ? E(e.message) : "發生未知錯誤";
352
- }
353
352
  //#endregion
354
353
  //#region src/views/templates/compose/TemplateComposeWizardView.tsx
355
- function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
356
- let i = e(), a = t(), o = U(), s = o.publishPhase === "submitting";
357
- async function l() {
354
+ function K({ aiAssistantAvailable: t = !1, showAiAssistant: r = !1 } = {}) {
355
+ let i = e(), a = n(), o = W(), s = o.publishPhase === "submitting";
356
+ async function c() {
358
357
  let e = await o.publish();
359
358
  e && i.push(a.templateDesigner(e.templateId));
360
359
  }
361
- return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(f, { children: /* @__PURE__ */ S(T, {
360
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(D, {
362
361
  description: "一次完成表單與流程設計,發佈後即可直接發起。",
363
362
  title: "建立模板(表單 + 流程)",
364
- children: /* @__PURE__ */ S(c, {
363
+ children: /* @__PURE__ */ w(u, {
365
364
  disabled: s,
366
365
  onClick: () => i.push(a.templates()),
367
366
  variant: "base-secondary",
368
367
  children: "返回模板列表"
369
368
  })
370
- }) }), /* @__PURE__ */ S(m, { children: /* @__PURE__ */ C(p, { children: [
371
- /* @__PURE__ */ C(_, {
369
+ }) }), /* @__PURE__ */ w(g, { children: /* @__PURE__ */ T(h, { children: [
370
+ /* @__PURE__ */ T(y, {
372
371
  currentStep: o.currentStep,
373
372
  children: [
374
- /* @__PURE__ */ S(g, {
373
+ /* @__PURE__ */ w(v, {
375
374
  description: "設計欄位與版面",
376
375
  title: "表單設計"
377
376
  }),
378
- /* @__PURE__ */ S(g, {
377
+ /* @__PURE__ */ w(v, {
379
378
  description: "設計簽核節點與條件",
380
379
  title: "流程設計"
381
380
  }),
382
- /* @__PURE__ */ S(g, {
381
+ /* @__PURE__ */ w(v, {
383
382
  description: "確認後發佈",
384
383
  title: "檢視並發佈"
385
384
  })
386
385
  ]
387
386
  }),
388
- o.currentStep === 0 ? /* @__PURE__ */ S(j, {
387
+ o.currentStep === 0 ? /* @__PURE__ */ w(M, {
389
388
  categoryId: o.categoryId,
390
389
  formSchema: o.formSchema,
391
390
  formUiSchema: o.formUiSchema,
@@ -394,8 +393,8 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
394
393
  onFormChange: o.setFormValue,
395
394
  onNameChange: o.setName
396
395
  }) : null,
397
- o.currentStep === 1 ? /* @__PURE__ */ S(B, {
398
- aiAssistantAvailable: n,
396
+ o.currentStep === 1 ? /* @__PURE__ */ w(V, {
397
+ aiAssistantAvailable: t,
399
398
  formSchema: o.formSchema,
400
399
  initiatorPolicyCel: o.initiatorPolicyCel,
401
400
  onInitiatorPolicyChange: o.setInitiatorPolicyCel,
@@ -403,7 +402,7 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
403
402
  showAiAssistant: r,
404
403
  workflowDefinition: o.workflowDefinition
405
404
  }) : null,
406
- o.currentStep === 2 ? /* @__PURE__ */ S(N, {
405
+ o.currentStep === 2 ? /* @__PURE__ */ w(P, {
407
406
  formSchema: o.formSchema,
408
407
  formUiSchema: o.formUiSchema,
409
408
  initiatorPolicyCel: o.initiatorPolicyCel,
@@ -411,29 +410,29 @@ function K({ aiAssistantAvailable: n = !1, showAiAssistant: r = !1 } = {}) {
411
410
  publishError: o.publishError,
412
411
  workflowDefinition: o.workflowDefinition
413
412
  }) : null,
414
- /* @__PURE__ */ C("div", {
413
+ /* @__PURE__ */ T("div", {
415
414
  style: q,
416
- children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */ S(b, {
415
+ children: [o.currentStep === 0 && !o.canLeaveBasics ? /* @__PURE__ */ w(S, {
417
416
  color: "text-neutral",
418
417
  variant: "caption",
419
418
  children: "請填寫模板名稱、表單名稱,並至少新增一個表單欄位。"
420
- }) : /* @__PURE__ */ S("span", {}), /* @__PURE__ */ C("div", {
419
+ }) : /* @__PURE__ */ w("span", {}), /* @__PURE__ */ T("div", {
421
420
  style: J,
422
- children: [/* @__PURE__ */ S(c, {
421
+ children: [/* @__PURE__ */ w(u, {
423
422
  disabled: o.currentStep === 0 || s,
424
423
  onClick: o.goBack,
425
424
  variant: "base-secondary",
426
425
  children: "上一步"
427
- }), o.currentStep < 2 ? /* @__PURE__ */ S(c, {
426
+ }), o.currentStep < 2 ? /* @__PURE__ */ w(u, {
428
427
  disabled: o.currentStep === 0 && !o.canLeaveBasics,
429
428
  onClick: o.goNext,
430
429
  variant: "base-primary",
431
430
  children: "下一步"
432
- }) : /* @__PURE__ */ S(c, {
431
+ }) : /* @__PURE__ */ w(u, {
433
432
  disabled: s,
434
433
  loading: s,
435
434
  onClick: () => {
436
- l();
435
+ c();
437
436
  },
438
437
  variant: "base-primary",
439
438
  children: "發佈"
@@ -453,6 +452,6 @@ var q = {
453
452
  gap: 8
454
453
  };
455
454
  //#endregion
456
- export { U as i, V as n, H as r, K as t };
455
+ export { W as i, H as n, U as r, K as t };
457
456
 
458
- //# sourceMappingURL=compose-_pREPtfN.js.map
457
+ //# sourceMappingURL=compose-b-vhcOb1.js.map