@vef-framework-react/approval 2.17.2 → 2.19.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.
Files changed (74) hide show
  1. package/dist/cjs/api/flow-api.cjs +1 -1
  2. package/dist/cjs/components/form-panel/index.cjs +1 -1
  3. package/dist/cjs/components/principal/index.cjs +1 -1
  4. package/dist/cjs/index.cjs +1 -1
  5. package/dist/cjs/pages/flow-page/designer/basic-step.cjs +1 -1
  6. package/dist/cjs/pages/flow-page/designer/index.cjs +1 -1
  7. package/dist/cjs/plugins/index.cjs +1 -1
  8. package/dist/cjs/types/enums.cjs +1 -1
  9. package/dist/cjs/types/index.cjs +1 -1
  10. package/dist/es/api/admin-api.js +1 -1
  11. package/dist/es/api/category-api.js +1 -1
  12. package/dist/es/api/delegation-api.js +1 -1
  13. package/dist/es/api/flow-api.js +3 -2
  14. package/dist/es/api/index.js +1 -1
  15. package/dist/es/api/instance-api.js +1 -1
  16. package/dist/es/api/my-api.js +1 -1
  17. package/dist/es/api/query.js +1 -1
  18. package/dist/es/components/detail/action-modals.js +1 -1
  19. package/dist/es/components/detail/admin.js +1 -1
  20. package/dist/es/components/detail/drawer.js +1 -1
  21. package/dist/es/components/detail/index.js +1 -1
  22. package/dist/es/components/flow-graph/index.js +1 -1
  23. package/dist/es/components/flow-graph/node.js +1 -1
  24. package/dist/es/components/flow-graph/people-overlay.js +1 -1
  25. package/dist/es/components/flow-graph/people.js +1 -1
  26. package/dist/es/components/form-panel/index.js +5 -3
  27. package/dist/es/components/format.js +1 -1
  28. package/dist/es/components/icon.js +1 -1
  29. package/dist/es/components/index.js +1 -1
  30. package/dist/es/components/principal/index.js +12 -12
  31. package/dist/es/components/status/colors.js +1 -1
  32. package/dist/es/components/status/index.js +1 -1
  33. package/dist/es/components/status/labels.js +1 -1
  34. package/dist/es/components/timeline/index.js +1 -1
  35. package/dist/es/components/user/index.js +1 -1
  36. package/dist/es/index.js +10 -10
  37. package/dist/es/pages/admin-page/index.js +1 -1
  38. package/dist/es/pages/admin-page/instances.js +1 -1
  39. package/dist/es/pages/admin-page/metrics.js +1 -1
  40. package/dist/es/pages/admin-page/projections.js +1 -1
  41. package/dist/es/pages/admin-page/tasks.js +1 -1
  42. package/dist/es/pages/category-page/columns.js +1 -1
  43. package/dist/es/pages/category-page/form.js +1 -1
  44. package/dist/es/pages/category-page/index.js +1 -1
  45. package/dist/es/pages/delegation-page/columns.js +1 -1
  46. package/dist/es/pages/delegation-page/form.js +1 -1
  47. package/dist/es/pages/delegation-page/index.js +1 -1
  48. package/dist/es/pages/flow-page/columns.js +1 -1
  49. package/dist/es/pages/flow-page/designer/basic-step.js +142 -140
  50. package/dist/es/pages/flow-page/designer/flow-step.js +1 -1
  51. package/dist/es/pages/flow-page/designer/form-step.js +1 -1
  52. package/dist/es/pages/flow-page/designer/index.js +87 -70
  53. package/dist/es/pages/flow-page/designer/review-step.js +1 -1
  54. package/dist/es/pages/flow-page/designer/types.js +1 -1
  55. package/dist/es/pages/flow-page/index.js +1 -1
  56. package/dist/es/pages/flow-page/search.js +1 -1
  57. package/dist/es/pages/flow-page/versions.js +1 -1
  58. package/dist/es/pages/index.js +1 -1
  59. package/dist/es/pages/initiate-page/index.js +1 -1
  60. package/dist/es/pages/initiate-page/start-drawer.js +1 -1
  61. package/dist/es/pages/my-instances-page/index.js +1 -1
  62. package/dist/es/pages/task-center-page/index.js +1 -1
  63. package/dist/es/permissions.js +1 -1
  64. package/dist/es/plugins/index.js +4 -2
  65. package/dist/es/types/enums.js +19 -2
  66. package/dist/es/types/index.js +3 -3
  67. package/dist/types/api/flow-api.d.ts +7 -1
  68. package/dist/types/components/principal/index.d.ts +16 -7
  69. package/dist/types/index.d.ts +1 -1
  70. package/dist/types/pages/flow-page/designer/basic-step.d.ts +9 -2
  71. package/dist/types/plugins/index.d.ts +35 -9
  72. package/dist/types/types/enums.d.ts +14 -8
  73. package/dist/types/types/flow.d.ts +13 -1
  74. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useCategoryApi as e } from "../../../api/category-api.js";
3
3
  import { useFlowApi as t } from "../../../api/flow-api.js";
4
4
  import { toEditorPlugins as n, useApprovalPlugins as r } from "../../../plugins/index.js";
@@ -22,28 +22,32 @@ var w = [
22
22
  { title: "审阅提交" }
23
23
  ];
24
24
  function T({ flow: y, tenantId: T, onClose: E }) {
25
- let D = t(), O = e(), k = r(), A = y !== void 0, [j, M] = _(0), [N, P] = _(() => A ? null : l(T)), [F, I] = _(""), [L, R] = _(!0), [z, B] = _(!1), { data: V } = p({
25
+ let D = t(), O = e(), k = r(), A = y !== void 0, [j, M] = _(0), [N, P] = _(() => A ? null : l(T)), [F, oe] = _(""), [I, L] = _(!0), [R, z] = _(!1), { data: B } = p({
26
26
  queryFn: O.findTree,
27
27
  queryKey: [O.findTree.key, {}]
28
- }), H = g(() => i(V ?? []), [V]), { data: U } = p({
28
+ }), V = g(() => i(B ?? []), [B]), { data: H } = p({
29
29
  queryFn: D.findVersions,
30
30
  queryKey: [D.findVersions.key, { flowId: y?.id ?? "" }],
31
31
  enabled: A
32
- }), W = U?.[0]?.id, { data: G } = p({
32
+ }), U = H?.[0]?.id, { data: W } = p({
33
33
  queryFn: D.getGraph,
34
34
  queryKey: [D.getGraph.key, {
35
35
  flowId: y?.id ?? "",
36
- versionId: W ?? ""
36
+ versionId: U ?? ""
37
37
  }],
38
- enabled: A && W !== void 0
39
- }), { data: K } = p({
38
+ enabled: A && U !== void 0
39
+ }), { data: G } = p({
40
40
  queryFn: D.findInitiators,
41
41
  queryKey: [D.findInitiators.key, { flowId: y?.id ?? "" }],
42
42
  enabled: A
43
+ }), { data: K } = p({
44
+ queryFn: D.listKindOptions,
45
+ queryKey: [D.listKindOptions.key, {}],
46
+ staleTime: Infinity
43
47
  });
44
48
  h(() => {
45
- if (!A || N !== null || U === void 0 || K === void 0 || U.length > 0 && G === void 0) return;
46
- let e = G?.version ?? null;
49
+ if (!A || N !== null || H === void 0 || G === void 0 || H.length > 0 && W === void 0) return;
50
+ let e = W?.version ?? null;
47
51
  P({
48
52
  flowId: y.id,
49
53
  basic: {
@@ -60,7 +64,7 @@ function T({ flow: y, tenantId: T, onClose: E }) {
60
64
  isAllInitiationAllowed: y.isAllInitiationAllowed,
61
65
  instanceTitleTemplate: y.instanceTitleTemplate
62
66
  },
63
- initiators: K.map((e) => ({
67
+ initiators: G.map((e) => ({
64
68
  kind: e.kind,
65
69
  ids: e.ids
66
70
  })),
@@ -71,27 +75,39 @@ function T({ flow: y, tenantId: T, onClose: E }) {
71
75
  }, [
72
76
  A,
73
77
  N,
74
- U,
78
+ H,
79
+ W,
75
80
  G,
76
- K,
77
81
  y
78
82
  ]);
79
83
  let q = {
80
84
  shouldShowSuccessFeedback: !1,
81
85
  invalidates: [[D.findFlows.key], [D.findVersions.key]]
82
- }, oe = f({
86
+ }, se = f({
83
87
  mutationFn: D.create,
84
88
  meta: q
85
- }), se = f({
89
+ }), ce = f({
86
90
  mutationFn: D.update,
87
91
  meta: q
88
- }), ce = f({
92
+ }), le = f({
89
93
  mutationFn: D.deploy,
90
94
  meta: q
91
- }), le = f({
95
+ }), ue = f({
92
96
  mutationFn: D.publishVersion,
93
97
  meta: q
94
- }), J = g(() => N?.formSchema ? ie(N.formSchema) : null, [N?.formSchema]), Y = g(() => N?.formSchema ? ae(N.formSchema, k.registries) : null, [N?.formSchema, k.registries]), X = g(() => N ? C(N.flowDefinition, J?.formFields ?? []) : [], [N, J]), ue = g(() => n(k, J?.formFields ?? []), [k, J]), de = m((e) => {
98
+ }), J = g(() => N?.formSchema ? ie(N.formSchema) : null, [N?.formSchema]), Y = g(() => N?.formSchema ? ae(N.formSchema, k.registries) : null, [N?.formSchema, k.registries]), X = g(() => N ? C(N.flowDefinition, {
99
+ formFields: J?.formFields ?? [],
100
+ assigneeKinds: K?.assignees,
101
+ ccKinds: K?.ccs
102
+ }) : [], [
103
+ N,
104
+ J,
105
+ K
106
+ ]), de = g(() => n(k, J?.formFields ?? [], K), [
107
+ k,
108
+ J,
109
+ K
110
+ ]), fe = m((e) => {
95
111
  P((t) => t && {
96
112
  ...t,
97
113
  basic: {
@@ -99,17 +115,17 @@ function T({ flow: y, tenantId: T, onClose: E }) {
99
115
  ...e
100
116
  }
101
117
  });
102
- }, []), Z = m((e) => {
118
+ }, []), pe = m((e) => {
103
119
  P((t) => t && {
104
120
  ...t,
105
121
  initiators: e
106
122
  });
107
- }, []), fe = m((e) => {
123
+ }, []), me = m((e) => {
108
124
  P((t) => t && {
109
125
  ...t,
110
126
  formSchema: e
111
127
  });
112
- }, []), pe = m((e) => {
128
+ }, []), he = m((e) => {
113
129
  P((t) => t && {
114
130
  ...t,
115
131
  flowDefinition: e
@@ -121,70 +137,71 @@ function T({ flow: y, tenantId: T, onClose: E }) {
121
137
  style: { height: "100%" },
122
138
  children: /* @__PURE__ */ x(te, {})
123
139
  });
124
- let Q = N, { basic: $ } = Q, me = [
125
- $.code.trim() !== "" && $.name.trim() !== "" && $.categoryId !== "" && $.instanceTitleTemplate.trim() !== "" && ($.bindingMode !== "business" || d($.businessBinding)) && ($.isAllInitiationAllowed || u(N).length > 0),
140
+ let Z = N, { basic: Q } = Z, ge = [
141
+ Q.code.trim() !== "" && Q.name.trim() !== "" && Q.categoryId !== "" && Q.instanceTitleTemplate.trim() !== "" && (Q.bindingMode !== "business" || d(Q.businessBinding)) && (Q.isAllInitiationAllowed || u(N).length > 0),
126
142
  Y === null || Y.valid,
127
143
  X.length === 0,
128
144
  !0
129
145
  ][j] ?? !1;
130
- async function he() {
131
- B(!0);
146
+ async function $() {
147
+ z(!0);
132
148
  try {
133
- let e = $.bindingMode === "business" ? $.businessBinding : void 0, t = u(Q), n;
134
- n = Q.flowId === void 0 ? (await oe.mutateAsync({
135
- tenantId: $.tenantId,
136
- code: $.code,
137
- name: $.name,
138
- categoryId: $.categoryId,
139
- icon: $.icon,
140
- description: $.description,
141
- labels: $.labels,
142
- bindingMode: $.bindingMode,
149
+ let e = Q.bindingMode === "business" ? Q.businessBinding : void 0, t = u(Z), n;
150
+ n = Z.flowId === void 0 ? (await se.mutateAsync({
151
+ tenantId: Q.tenantId,
152
+ code: Q.code,
153
+ name: Q.name,
154
+ categoryId: Q.categoryId,
155
+ icon: Q.icon,
156
+ description: Q.description,
157
+ labels: Q.labels,
158
+ bindingMode: Q.bindingMode,
143
159
  businessBinding: e,
144
- adminUserIds: $.adminUserIds,
145
- isAllInitiationAllowed: $.isAllInitiationAllowed,
146
- instanceTitleTemplate: $.instanceTitleTemplate,
160
+ adminUserIds: Q.adminUserIds,
161
+ isAllInitiationAllowed: Q.isAllInitiationAllowed,
162
+ instanceTitleTemplate: Q.instanceTitleTemplate,
147
163
  initiators: t
148
- })).id : (await se.mutateAsync({
149
- flowId: Q.flowId,
150
- name: $.name,
151
- icon: $.icon,
152
- description: $.description,
153
- labels: $.labels,
154
- bindingMode: $.bindingMode,
164
+ })).id : (await ce.mutateAsync({
165
+ flowId: Z.flowId,
166
+ name: Q.name,
167
+ icon: Q.icon,
168
+ description: Q.description,
169
+ labels: Q.labels,
170
+ bindingMode: Q.bindingMode,
155
171
  businessBinding: e,
156
- adminUserIds: $.adminUserIds,
157
- isAllInitiationAllowed: $.isAllInitiationAllowed,
158
- instanceTitleTemplate: $.instanceTitleTemplate,
172
+ adminUserIds: Q.adminUserIds,
173
+ isAllInitiationAllowed: Q.isAllInitiationAllowed,
174
+ instanceTitleTemplate: Q.instanceTitleTemplate,
159
175
  initiators: t
160
176
  })).id;
161
- let r = await ce.mutateAsync({
177
+ let r = await le.mutateAsync({
162
178
  flowId: n,
163
179
  description: F.trim() || void 0,
164
- storageMode: Q.storageMode,
165
- flowDefinition: Q.flowDefinition,
166
- formSchema: Q.formSchema ?? void 0
180
+ storageMode: Z.storageMode,
181
+ flowDefinition: Z.flowDefinition,
182
+ formSchema: Z.formSchema ?? void 0
167
183
  });
168
- L && await le.mutateAsync({ versionId: r.id }), re(L ? "流程已部署并发布" : "流程已部署为草稿版本"), E();
184
+ I && await ue.mutateAsync({ versionId: r.id }), re(I ? "流程已部署并发布" : "流程已部署为草稿版本"), E();
169
185
  } catch {} finally {
170
- B(!1);
186
+ z(!1);
171
187
  }
172
188
  }
173
- let ge = [
189
+ let _e = [
174
190
  /* @__PURE__ */ x(a, {
175
- basic: $,
176
- categoryOptions: H,
191
+ basic: Q,
192
+ categoryOptions: V,
193
+ initiatorKinds: K?.initiators,
177
194
  initiators: N.initiators,
178
195
  isEditing: A,
179
- onBasicChange: de,
180
- onInitiatorsChange: Z
196
+ onBasicChange: fe,
197
+ onInitiatorsChange: pe
181
198
  }, "basic"),
182
199
  /* @__PURE__ */ x(s, {
183
200
  initialSchema: N.formSchema ?? void 0,
184
201
  issues: Y?.issues ?? [],
185
202
  registries: k.registries,
186
203
  storageMode: N.storageMode,
187
- onSchemaChange: fe,
204
+ onSchemaChange: me,
188
205
  onStorageModeChange: (e) => P((t) => t && {
189
206
  ...t,
190
207
  storageMode: e
@@ -192,17 +209,17 @@ function T({ flow: y, tenantId: T, onClose: E }) {
192
209
  }, "form"),
193
210
  /* @__PURE__ */ x(o, {
194
211
  errors: X,
195
- plugins: ue,
212
+ plugins: de,
196
213
  value: N.flowDefinition,
197
- onChange: pe
214
+ onChange: he
198
215
  }, "flow"),
199
216
  /* @__PURE__ */ x(ee, {
200
217
  draft: N,
201
218
  fields: J?.fields ?? [],
202
- publishNow: L,
219
+ publishNow: I,
203
220
  versionDescription: F,
204
- onPublishNowChange: R,
205
- onVersionDescriptionChange: I
221
+ onPublishNowChange: L,
222
+ onVersionDescriptionChange: oe
206
223
  }, "review")
207
224
  ];
208
225
  return /* @__PURE__ */ S(b, {
@@ -233,7 +250,7 @@ function T({ flow: y, tenantId: T, onClose: E }) {
233
250
  display: "flex",
234
251
  flexDirection: "column"
235
252
  },
236
- children: ge.map((e, t) => {
253
+ children: _e.map((e, t) => {
237
254
  let n = t === j, r = t === 0 || t === 3;
238
255
  return /* @__PURE__ */ x("div", {
239
256
  style: {
@@ -256,19 +273,19 @@ function T({ flow: y, tenantId: T, onClose: E }) {
256
273
  borderTop: "1px solid var(--vef-color-border-secondary)"
257
274
  },
258
275
  children: [/* @__PURE__ */ x(v, {
259
- disabled: j === 0 || z,
276
+ disabled: j === 0 || R,
260
277
  onClick: () => M((e) => e - 1),
261
278
  children: "上一步"
262
279
  }), j < w.length - 1 ? /* @__PURE__ */ x(v, {
263
- disabled: !me,
280
+ disabled: !ge,
264
281
  type: "primary",
265
282
  onClick: () => M((e) => e + 1),
266
283
  children: "下一步"
267
284
  }) : /* @__PURE__ */ x(v, {
268
- loading: z,
285
+ loading: R,
269
286
  type: "primary",
270
- onClick: () => void he(),
271
- children: L ? "部署并发布" : "部署为草稿"
287
+ onClick: () => void $(),
288
+ children: I ? "部署并发布" : "部署为草稿"
272
289
  })]
273
290
  })
274
291
  ]
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { initiatorsForSubmit as e } from "./types.js";
3
3
  import { Card as t, Descriptions as n, Flex as r, Input as i, Labeled as a, LabelsDisplay as o, Stack as s, Switch as c, Table as l, Tag as u, Text as d, globalCssVars as f } from "@vef-framework-react/components";
4
4
  import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  //#region src/pages/flow-page/designer/types.ts
3
3
  var e = {
4
4
  nodes: [],
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useCategoryApi as e } from "../../api/category-api.js";
3
3
  import { useFlowApi as t } from "../../api/flow-api.js";
4
4
  import { APPROVAL_PERMISSIONS as n } from "../../permissions.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { LabelFilterSelect as e, Select as t, useFormContext as n } from "@vef-framework-react/components";
3
3
  import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
4
4
  //#region src/pages/flow-page/search.tsx
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useFlowApi as e } from "../../api/flow-api.js";
3
3
  import { formatTimestamp as t } from "../../components/format.js";
4
4
  import { VersionStatusTag as n } from "../../components/status/index.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { ApprovalAdminPage as e } from "./admin-page/index.js";
3
3
  import { ApprovalCategoryPage as t } from "./category-page/index.js";
4
4
  import { ApprovalDelegationPage as n } from "./delegation-page/index.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useMyApprovalApi as e } from "../../api/my-api.js";
3
3
  import { FlowIcon as t } from "../../components/icon.js";
4
4
  import { StartInstanceDrawer as n } from "./start-drawer.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useInstanceApi as e } from "../../api/instance-api.js";
3
3
  import { useMyApprovalApi as t } from "../../api/my-api.js";
4
4
  import { InstanceFormPanel as n } from "../../components/form-panel/index.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useInstanceApi as e } from "../../api/instance-api.js";
3
3
  import { useMyApprovalApi as t } from "../../api/my-api.js";
4
4
  import { formatTimestamp as n } from "../../components/format.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { useMyApprovalApi as e } from "../../api/my-api.js";
3
3
  import { formatTimestamp as t } from "../../components/format.js";
4
4
  import { TaskStatusTag as n } from "../../components/status/index.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  //#region src/permissions.ts
3
3
  var e = {
4
4
  category: {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  import { createContext as e, use as t, useMemo as n, useState as r } from "react";
3
3
  import { createApprovalRegistries as i } from "@vef-framework-react/approval-form-bridge";
4
4
  import { jsx as a } from "@emotion/react/jsx-runtime";
@@ -23,10 +23,12 @@ function l() {
23
23
  registries: a
24
24
  }, [e, a]);
25
25
  }
26
- function u(e, t) {
26
+ function u(e, t, n) {
27
27
  return {
28
28
  pickers: e.pickers,
29
29
  globalSubjects: e.globalSubjects,
30
+ assigneeKinds: n?.assignees,
31
+ ccKinds: n?.ccs,
30
32
  formFields: t
31
33
  };
32
34
  }
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
2
  //#region src/types/enums.ts
3
3
  var e = [
4
4
  "approved",
@@ -8,5 +8,22 @@ var e = [
8
8
  function t(t) {
9
9
  return e.includes(t);
10
10
  }
11
+ var n = [
12
+ {
13
+ kind: "user",
14
+ label: "指定用户",
15
+ selection: "user"
16
+ },
17
+ {
18
+ kind: "role",
19
+ label: "指定角色",
20
+ selection: "role"
21
+ },
22
+ {
23
+ kind: "department",
24
+ label: "指定部门",
25
+ selection: "department"
26
+ }
27
+ ];
11
28
  //#endregion
12
- export { e as FINAL_INSTANCE_STATUSES, t as isFinalInstanceStatus };
29
+ export { n as BUILTIN_INITIATOR_KINDS, e as FINAL_INSTANCE_STATUSES, t as isFinalInstanceStatus };
@@ -1,3 +1,3 @@
1
- /*! @vef-framework-react/approval v2.17.2 made by Venus | 2026-08-27T06:56:11.227Z */
2
- import { FINAL_INSTANCE_STATUSES as e, isFinalInstanceStatus as t } from "./enums.js";
3
- export { e as FINAL_INSTANCE_STATUSES, t as isFinalInstanceStatus };
1
+ /*! @vef-framework-react/approval v2.19.0 made by Venus | 2026-09-01T08:50:09.630Z */
2
+ import { BUILTIN_INITIATOR_KINDS as e, FINAL_INSTANCE_STATUSES as t, isFinalInstanceStatus as n } from "./enums.js";
3
+ export { e as BUILTIN_INITIATOR_KINDS, t as FINAL_INSTANCE_STATUSES, n as isFinalInstanceStatus };
@@ -1,6 +1,6 @@
1
1
  import { PaginatedQueryParams } from '@vef-framework-react/components';
2
2
  import { MutationFunction, PaginationResult, QueryFunction } from '@vef-framework-react/core';
3
- import { CreateFlowParams, DeployFlowParams, Flow, FlowGraphBundle, FlowInitiator, FlowSearch, FlowVersion, FlowVersionSummary, PublishVersionParams, ToggleFlowActiveParams, UpdateFlowParams } from '../types';
3
+ import { CreateFlowParams, DeployFlowParams, Flow, FlowGraphBundle, FlowInitiator, FlowSearch, FlowVersion, FlowVersionSummary, KindOptions, PublishVersionParams, ToggleFlowActiveParams, UpdateFlowParams } from '../types';
4
4
  /**
5
5
  * The management API of flow definitions: the paginated list plus the
6
6
  * definition lifecycle (create → deploy → publish) and its auxiliary queries.
@@ -27,6 +27,12 @@ export interface FlowApi {
27
27
  flowId: string;
28
28
  tenantId?: string;
29
29
  }>;
30
+ /**
31
+ * The application's assignee / CC / initiator vocabularies. Application-wide
32
+ * rather than per-flow: every flow is designed against the same registered
33
+ * resolvers.
34
+ */
35
+ listKindOptions: QueryFunction<KindOptions, Record<string, never>>;
30
36
  }
31
37
  /**
32
38
  * Management API for flow definitions.
@@ -1,6 +1,15 @@
1
- import { PrincipalKind } from '@vef-framework-react/approval-flow-editor';
1
+ import { SelectionMode } from '@vef-framework-react/approval-flow-editor';
2
2
  export interface PrincipalSelectProps {
3
- kind: PrincipalKind;
3
+ /**
4
+ * The rule's kind — the first key the picker registry is looked up by.
5
+ */
6
+ kind: string;
7
+ /**
8
+ * What the kind selects — the fallback registry key, so a host kind picking
9
+ * roles reuses the `role` picker. Omitted for the callers that name a
10
+ * built-in slot directly.
11
+ */
12
+ selection?: SelectionMode;
4
13
  value: string[];
5
14
  onChange: (ids: string[]) => void;
6
15
  disabled?: boolean;
@@ -10,9 +19,9 @@ export interface PrincipalSelectProps {
10
19
  maxCount?: number;
11
20
  }
12
21
  /**
13
- * A principal (user / role / department) selection field: renders the host's
14
- * picker from `ApprovalProvider` when one is wired for the kind, else
15
- * degrades to a plain id-tags input so the surrounding dialog stays
16
- * functional.
22
+ * A principal selection field: renders the host's picker from
23
+ * `ApprovalProvider` when one is wired for the kind (or for what the kind
24
+ * selects), else degrades to a plain id-tags input so the surrounding dialog
25
+ * stays functional.
17
26
  */
18
- export declare function PrincipalSelect({ kind, value, onChange, disabled, maxCount }: PrincipalSelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ export declare function PrincipalSelect({ kind, selection, value, onChange, disabled, maxCount }: PrincipalSelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -6,4 +6,4 @@ export type { ActionLogPermissionCodes, ApprovalPermissions, BindingPermissionCo
6
6
  export { ApprovalProvider, toEditorPlugins, useApprovalPlugins } from './plugins';
7
7
  export type { ApprovalPlugins, ApprovalProviderProps, ResolvedApprovalPlugins } from './plugins';
8
8
  export * from './types';
9
- export type { EditorPlugins, PickerProps, PrincipalKind } from '@vef-framework-react/approval-flow-editor';
9
+ export type { EditorPlugins, KindDescriptor, PickerProps, PrincipalKind, SelectionMode } from '@vef-framework-react/approval-flow-editor';
@@ -1,9 +1,16 @@
1
- import { InitiatorParams } from '../../../types';
1
+ import { KindDescriptor } from '@vef-framework-react/approval-flow-editor';
2
+ import { InitiatorKind, InitiatorParams } from '../../../types';
2
3
  import { CategoryTreeOption } from '../../category-page/form';
3
4
  import { FlowDraftBasic } from './types';
4
5
  export interface BasicStepProps {
5
6
  basic: FlowDraftBasic;
6
7
  initiators: InitiatorParams[];
8
+ /**
9
+ * The initiator kinds this application registers, from
10
+ * `approval/flow.list_kind_options`. Omitted (or still loading) falls back
11
+ * to the framework built-ins.
12
+ */
13
+ initiatorKinds?: ReadonlyArray<KindDescriptor<InitiatorKind>>;
7
14
  categoryOptions: CategoryTreeOption[];
8
15
  /**
9
16
  * The flow code is immutable after creation.
@@ -17,4 +24,4 @@ export interface BasicStepProps {
17
24
  * the business binding. Everything here lands in `create`/`update`; the
18
25
  * deployable definition follows in the next steps.
19
26
  */
20
- export declare function BasicStep({ basic, initiators, categoryOptions, isEditing, onBasicChange, onInitiatorsChange }: BasicStepProps): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ export declare function BasicStep({ basic, initiators, initiatorKinds, categoryOptions, isEditing, onBasicChange, onInitiatorsChange }: BasicStepProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- import { EditorPlugins, FormFieldDefinition, PickerProps, PrincipalKind } from '@vef-framework-react/approval-flow-editor';
2
- import { DeviceRegistries } from '@vef-framework-react/form-editor';
1
+ import { EditorPlugins, FormFieldDefinition, PickerProps } from '@vef-framework-react/approval-flow-editor';
2
+ import { DataSourceResolver, DeviceRegistries, LinkageEvaluators } from '@vef-framework-react/form-editor';
3
3
  import { FC, PropsWithChildren, ReactNode } from 'react';
4
+ import { KindOptions } from '../types';
4
5
  /**
5
6
  * Host-integration points shared by every approval page and component. Wrap
6
7
  * the approval routes in one `ApprovalProvider` and every picker, registry,
@@ -8,12 +9,17 @@ import { FC, PropsWithChildren, ReactNode } from 'react';
8
9
  */
9
10
  export interface ApprovalPlugins {
10
11
  /**
11
- * Pickers that resolve concrete ids for each principal kind (user / role /
12
- * department). The flow designer and the runtime action dialogs (transfer,
13
- * add assignee, CC) share them. A kind left unset degrades to a plain
14
- * id-tags input, so the pages stay functional without host wiring.
12
+ * Pickers that resolve concrete ids, keyed by kind. The flow designer and
13
+ * the runtime action dialogs (transfer, add assignee, CC) share them.
14
+ *
15
+ * The three built-in slots (`user` / `role` / `department`) cover every kind
16
+ * that selects the same thing: a rule looks up its own kind first and falls
17
+ * back to its selection mode, so a host assignee kind that picks roles needs
18
+ * no picker of its own, while a kind selecting from a host catalog registers
19
+ * one under that kind's name. A kind left unset degrades to a plain id-tags
20
+ * input, so the pages stay functional without host wiring.
15
21
  */
16
- pickers?: Partial<Record<PrincipalKind, FC<PickerProps>>>;
22
+ pickers?: Partial<Record<string, FC<PickerProps>>>;
17
23
  /**
18
24
  * Form field registries for rendering and designing approval forms.
19
25
  * Defaults to the approval profile from `approval-form-bridge`
@@ -27,6 +33,21 @@ export interface ApprovalPlugins {
27
33
  * `Instance.Globals` at instance start.
28
34
  */
29
35
  globalSubjects?: FormFieldDefinition[];
36
+ /**
37
+ * Turns a form's remote data-source request into options. Without one, every
38
+ * remote source in an approval form resolves to an empty list — the designer
39
+ * lets you configure the request, but nothing fetches it. Wire the host's
40
+ * API client here.
41
+ */
42
+ dataSourceResolver?: DataSourceResolver;
43
+ /**
44
+ * Overrides for expression / script evaluation in form linkage and in
45
+ * data-source parameters bound to the form. Optional: the form runtime falls
46
+ * back to its built-in JavaScript evaluator (`$form` / `$vars` / `$user` /
47
+ * `$node` in scope), so wire this only to swap in a different expression
48
+ * language or sandbox.
49
+ */
50
+ evaluators?: LinkageEvaluators;
30
51
  /**
31
52
  * Renders an instance's opaque business reference as a host-navigable
32
53
  * element (a link to the business record, a drawer trigger, …). Defaults to
@@ -56,6 +77,11 @@ export declare function ApprovalProvider({ plugins, children }: ApprovalProvider
56
77
  export declare function useApprovalPlugins(): ResolvedApprovalPlugins;
57
78
  /**
58
79
  * Projects the approval plugin set into the flow designer's `EditorPlugins`
59
- * shape, layering the deploy-derived form fields on top.
80
+ * shape, layering the deploy-derived form fields and the application's kind
81
+ * catalog on top.
82
+ *
83
+ * `kindOptions` comes from `approval/flow.list_kind_options`; while it is
84
+ * still loading the editor falls back to the framework built-ins, which is
85
+ * why the designer stays usable before the query resolves.
60
86
  */
61
- export declare function toEditorPlugins(plugins: ResolvedApprovalPlugins, formFields: FormFieldDefinition[]): EditorPlugins;
87
+ export declare function toEditorPlugins(plugins: ResolvedApprovalPlugins, formFields: FormFieldDefinition[], kindOptions?: KindOptions): EditorPlugins;
@@ -1,9 +1,4 @@
1
- /**
2
- * Runtime enums of the approval engine, mirroring `approval/enums.go`
3
- * verbatim. Designer-side enums (node kinds, pass rules, …) live in
4
- * `@vef-framework-react/approval-flow-editor`; this file only carries the
5
- * vocabulary the runtime pages consume.
6
- */
1
+ import { KindDescriptor } from '@vef-framework-react/approval-flow-editor';
7
2
  /**
8
3
  * Lifecycle status of an approval instance.
9
4
  */
@@ -59,9 +54,20 @@ export type BindingMode = "standalone" | "business";
59
54
  */
60
55
  export type StorageMode = "json" | "table";
61
56
  /**
62
- * Kind of a flow initiator rule.
57
+ * Kind of a flow initiator rule. Open by design: the backend accepts every
58
+ * kind with a registered `approval.InitiatorResolver`, so the deployable kinds
59
+ * are the ones `approval/flow.list_kind_options` reports — never a union
60
+ * declared here.
61
+ */
62
+ export type InitiatorKind = string;
63
+ /**
64
+ * The framework's own initiator kinds — the vocabulary offered before
65
+ * `approval/flow.list_kind_options` resolves, and for a host that never wires
66
+ * the catalog through. Mirrors the built-in `approval.InitiatorResolver`
67
+ * registrations; a deployment that registers kinds of its own must pass the
68
+ * served catalog instead, or those kinds are simply absent from the designer.
63
69
  */
64
- export type InitiatorKind = "user" | "role" | "department";
70
+ export declare const BUILTIN_INITIATOR_KINDS: ReadonlyArray<KindDescriptor<InitiatorKind>>;
65
71
  /**
66
72
  * Convergence state of one business-record projection.
67
73
  */
@@ -1,4 +1,4 @@
1
- import { FlowDefinition, FormFieldDefinition } from '@vef-framework-react/approval-flow-editor';
1
+ import { AssigneeKind, CcKind, FlowDefinition, FormFieldDefinition, KindDescriptor } from '@vef-framework-react/approval-flow-editor';
2
2
  import { FormSchema } from '@vef-framework-react/form-editor';
3
3
  import { FullAudited } from './base';
4
4
  import { BindingMode, InitiatorKind, InstanceStatus, StorageMode, VersionStatus } from './enums';
@@ -93,6 +93,18 @@ export interface FlowVersionSummary {
93
93
  createdAt: string;
94
94
  createdBy: string;
95
95
  }
96
+ /**
97
+ * The assignee / CC / initiator kinds the running application accepts, as
98
+ * served by `approval/flow.list_kind_options`. Each vocabulary is an open
99
+ * registry on the backend — a host adds a kind by registering a resolver — so
100
+ * this catalog, not a union in the client, is what the designer offers and
101
+ * what a deploy will validate.
102
+ */
103
+ export interface KindOptions {
104
+ assignees: Array<KindDescriptor<AssigneeKind>>;
105
+ ccs: Array<KindDescriptor<CcKind>>;
106
+ initiators: Array<KindDescriptor<InitiatorKind>>;
107
+ }
96
108
  /**
97
109
  * A flow initiator rule, mirroring `approval.FlowInitiator`.
98
110
  */