@nocobase/plugin-flow-engine 2.1.0-alpha.17 → 2.1.0-alpha.19

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 (56) hide show
  1. package/dist/externalVersion.js +11 -11
  2. package/dist/node_modules/ses/package.json +1 -1
  3. package/dist/node_modules/zod/package.json +1 -1
  4. package/dist/server/flow-surfaces/action-scope.js +3 -1
  5. package/dist/server/flow-surfaces/apply/compiler.js +84 -5
  6. package/dist/server/flow-surfaces/approval/blueprint-service.d.ts +84 -0
  7. package/dist/server/flow-surfaces/approval/blueprint-service.js +589 -0
  8. package/dist/server/flow-surfaces/approval/blueprint.d.ts +21 -0
  9. package/dist/server/flow-surfaces/approval/blueprint.js +190 -0
  10. package/dist/server/flow-surfaces/approval/builder.d.ts +225 -0
  11. package/dist/server/flow-surfaces/approval/builder.js +384 -0
  12. package/dist/server/flow-surfaces/approval/catalog-specs.d.ts +33 -0
  13. package/dist/server/flow-surfaces/approval/catalog-specs.js +156 -0
  14. package/dist/server/flow-surfaces/approval/index.d.ts +14 -0
  15. package/dist/server/flow-surfaces/approval/index.js +40 -0
  16. package/dist/server/flow-surfaces/approval/runtime-config.d.ts +44 -0
  17. package/dist/server/flow-surfaces/approval/runtime-config.js +299 -0
  18. package/dist/server/flow-surfaces/approval/semantic-use.d.ts +23 -0
  19. package/dist/server/flow-surfaces/approval/semantic-use.js +155 -0
  20. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +36 -2
  21. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +7 -0
  22. package/dist/server/flow-surfaces/builder.d.ts +2 -0
  23. package/dist/server/flow-surfaces/builder.js +83 -10
  24. package/dist/server/flow-surfaces/catalog.d.ts +10 -0
  25. package/dist/server/flow-surfaces/catalog.js +368 -9
  26. package/dist/server/flow-surfaces/chart-config.d.ts +1 -1
  27. package/dist/server/flow-surfaces/compose-compiler.d.ts +1 -0
  28. package/dist/server/flow-surfaces/compose-compiler.js +2 -1
  29. package/dist/server/flow-surfaces/configure-options.js +61 -3
  30. package/dist/server/flow-surfaces/constants.d.ts +342 -5
  31. package/dist/server/flow-surfaces/constants.js +59 -125
  32. package/dist/server/flow-surfaces/default-action-popup.d.ts +1 -0
  33. package/dist/server/flow-surfaces/default-action-popup.js +6 -2
  34. package/dist/server/flow-surfaces/field-semantics.js +2 -1
  35. package/dist/server/flow-surfaces/index.js +21 -273
  36. package/dist/server/flow-surfaces/locator.js +8 -6
  37. package/dist/server/flow-surfaces/node-use-sets.js +15 -3
  38. package/dist/server/flow-surfaces/placement.js +11 -7
  39. package/dist/server/flow-surfaces/planning/action-specs.d.ts +1 -1
  40. package/dist/server/flow-surfaces/planning/compiler.d.ts +1 -1
  41. package/dist/server/flow-surfaces/planning/key-kind.js +7 -5
  42. package/dist/server/flow-surfaces/reaction/registry.d.ts +13 -0
  43. package/dist/server/flow-surfaces/reaction/registry.js +13 -0
  44. package/dist/server/flow-surfaces/service-utils.d.ts +10 -14
  45. package/dist/server/flow-surfaces/service-utils.js +4 -2
  46. package/dist/server/flow-surfaces/service.d.ts +63 -1
  47. package/dist/server/flow-surfaces/service.js +1058 -109
  48. package/dist/server/flow-surfaces/surface-context.d.ts +1 -0
  49. package/dist/server/flow-surfaces/surface-context.js +99 -19
  50. package/dist/server/flow-surfaces/types.d.ts +4 -1
  51. package/dist/swagger/flow-surfaces.d.ts +406 -2
  52. package/dist/swagger/flow-surfaces.examples.d.ts +164 -0
  53. package/dist/swagger/flow-surfaces.examples.js +184 -0
  54. package/dist/swagger/flow-surfaces.js +390 -76
  55. package/dist/swagger/index.d.ts +406 -2
  56. package/package.json +2 -2
@@ -130,281 +130,29 @@ async function runFlowSurfaceAction(ctx, next, handler) {
130
130
  await next();
131
131
  }
132
132
  }
133
+ function invokeFlowSurfaceServiceAction(service, actionName, values, options = {}) {
134
+ const handler = service[actionName];
135
+ return handler.call(service, values, options);
136
+ }
133
137
  function registerFlowSurfacesResource(plugin) {
134
138
  const service = new import_service.FlowSurfacesService(plugin);
135
- const actions = {
136
- catalog: async (ctx, next) => {
137
- await runFlowSurfaceAction(ctx, next, () => service.catalog(getValues(ctx)));
138
- },
139
- context: async (ctx, next) => {
140
- await runFlowSurfaceAction(ctx, next, () => service.context(getValues(ctx)));
141
- },
142
- get: async (ctx, next) => {
143
- await runFlowSurfaceAction(ctx, next, () => service.get(getReadValues(ctx)));
144
- },
145
- describeSurface: async (ctx, next) => {
146
- await runFlowSurfaceAction(ctx, next, () => service.describeSurface(getValues(ctx)));
147
- },
148
- getReactionMeta: async (ctx, next) => {
149
- await runFlowSurfaceAction(ctx, next, () => service.getReactionMeta(getValues(ctx)));
150
- },
151
- setFieldValueRules: async (ctx, next) => {
152
- await runFlowSurfaceAction(
153
- ctx,
154
- next,
155
- () => service.transaction((transaction) => service.setFieldValueRules(getValues(ctx), { transaction }))
156
- );
157
- },
158
- setBlockLinkageRules: async (ctx, next) => {
159
- await runFlowSurfaceAction(
160
- ctx,
161
- next,
162
- () => service.transaction((transaction) => service.setBlockLinkageRules(getValues(ctx), { transaction }))
163
- );
164
- },
165
- setFieldLinkageRules: async (ctx, next) => {
166
- await runFlowSurfaceAction(
167
- ctx,
168
- next,
169
- () => service.transaction((transaction) => service.setFieldLinkageRules(getValues(ctx), { transaction }))
170
- );
171
- },
172
- setActionLinkageRules: async (ctx, next) => {
173
- await runFlowSurfaceAction(
174
- ctx,
175
- next,
176
- () => service.transaction((transaction) => service.setActionLinkageRules(getValues(ctx), { transaction }))
177
- );
178
- },
179
- applyBlueprint: async (ctx, next) => {
180
- await runFlowSurfaceAction(
181
- ctx,
182
- next,
183
- () => service.transaction((transaction) => service.applyBlueprint(getValues(ctx), { transaction }))
184
- );
185
- },
186
- listTemplates: async (ctx, next) => {
187
- await runFlowSurfaceAction(ctx, next, () => service.listTemplates(getValues(ctx)));
188
- },
189
- getTemplate: async (ctx, next) => {
190
- await runFlowSurfaceAction(ctx, next, () => service.getTemplate(getValues(ctx)));
191
- },
192
- saveTemplate: async (ctx, next) => {
193
- await runFlowSurfaceAction(
194
- ctx,
195
- next,
196
- () => service.transaction((transaction) => service.saveTemplate(getValues(ctx), { transaction }))
197
- );
198
- },
199
- updateTemplate: async (ctx, next) => {
200
- await runFlowSurfaceAction(
201
- ctx,
202
- next,
203
- () => service.transaction((transaction) => service.updateTemplate(getValues(ctx), { transaction }))
204
- );
205
- },
206
- destroyTemplate: async (ctx, next) => {
207
- await runFlowSurfaceAction(
208
- ctx,
209
- next,
210
- () => service.transaction((transaction) => service.destroyTemplate(getValues(ctx), { transaction }))
211
- );
212
- },
213
- convertTemplateToCopy: async (ctx, next) => {
214
- await runFlowSurfaceAction(
215
- ctx,
216
- next,
217
- () => service.transaction((transaction) => service.convertTemplateToCopy(getValues(ctx), { transaction }))
218
- );
219
- },
220
- compose: async (ctx, next) => {
221
- await runFlowSurfaceAction(
222
- ctx,
223
- next,
224
- () => service.transaction((transaction) => service.compose(getValues(ctx), { transaction }))
225
- );
226
- },
227
- configure: async (ctx, next) => {
228
- await runFlowSurfaceAction(
229
- ctx,
230
- next,
231
- () => service.transaction((transaction) => service.configure(getValues(ctx), { transaction }))
232
- );
233
- },
234
- createMenu: async (ctx, next) => {
235
- await runFlowSurfaceAction(
236
- ctx,
237
- next,
238
- () => service.transaction((transaction) => service.createMenu(getValues(ctx), { transaction }))
239
- );
240
- },
241
- updateMenu: async (ctx, next) => {
242
- await runFlowSurfaceAction(
243
- ctx,
244
- next,
245
- () => service.transaction((transaction) => service.updateMenu(getValues(ctx), { transaction }))
246
- );
247
- },
248
- createPage: async (ctx, next) => {
249
- await runFlowSurfaceAction(
250
- ctx,
251
- next,
252
- () => service.transaction((transaction) => service.createPage(getValues(ctx), { transaction }))
253
- );
254
- },
255
- destroyPage: async (ctx, next) => {
256
- await runFlowSurfaceAction(
257
- ctx,
258
- next,
259
- () => service.transaction((transaction) => service.destroyPage(getValues(ctx), { transaction }))
260
- );
261
- },
262
- addTab: async (ctx, next) => {
263
- await runFlowSurfaceAction(
264
- ctx,
265
- next,
266
- () => service.transaction((transaction) => service.addTab(getValues(ctx), { transaction }))
267
- );
268
- },
269
- updateTab: async (ctx, next) => {
270
- await runFlowSurfaceAction(
271
- ctx,
272
- next,
273
- () => service.transaction((transaction) => service.updateTab(getValues(ctx), { transaction }))
274
- );
275
- },
276
- moveTab: async (ctx, next) => {
277
- await runFlowSurfaceAction(
278
- ctx,
279
- next,
280
- () => service.transaction((transaction) => service.moveTab(getValues(ctx), { transaction }))
281
- );
282
- },
283
- removeTab: async (ctx, next) => {
284
- await runFlowSurfaceAction(
285
- ctx,
286
- next,
287
- () => service.transaction((transaction) => service.removeTab(getValues(ctx), { transaction }))
288
- );
289
- },
290
- addPopupTab: async (ctx, next) => {
291
- await runFlowSurfaceAction(
292
- ctx,
293
- next,
294
- () => service.transaction((transaction) => service.addPopupTab(getValues(ctx), { transaction }))
295
- );
296
- },
297
- updatePopupTab: async (ctx, next) => {
298
- await runFlowSurfaceAction(
299
- ctx,
300
- next,
301
- () => service.transaction((transaction) => service.updatePopupTab(getValues(ctx), { transaction }))
302
- );
303
- },
304
- movePopupTab: async (ctx, next) => {
305
- await runFlowSurfaceAction(
306
- ctx,
307
- next,
308
- () => service.transaction((transaction) => service.movePopupTab(getValues(ctx), { transaction }))
309
- );
310
- },
311
- removePopupTab: async (ctx, next) => {
312
- await runFlowSurfaceAction(
313
- ctx,
314
- next,
315
- () => service.transaction((transaction) => service.removePopupTab(getValues(ctx), { transaction }))
316
- );
317
- },
318
- addBlock: async (ctx, next) => {
319
- await runFlowSurfaceAction(
320
- ctx,
321
- next,
322
- () => service.transaction((transaction) => service.addBlock(getValues(ctx), { transaction }))
323
- );
324
- },
325
- addBlocks: async (ctx, next) => {
326
- await runFlowSurfaceAction(ctx, next, () => service.addBlocks(getValues(ctx)));
327
- },
328
- addField: async (ctx, next) => {
329
- await runFlowSurfaceAction(
330
- ctx,
331
- next,
332
- () => service.transaction((transaction) => service.addField(getValues(ctx), { transaction }))
333
- );
334
- },
335
- addFields: async (ctx, next) => {
336
- await runFlowSurfaceAction(ctx, next, () => service.addFields(getValues(ctx)));
337
- },
338
- addAction: async (ctx, next) => {
339
- await runFlowSurfaceAction(
340
- ctx,
341
- next,
342
- () => service.transaction((transaction) => service.addAction(getValues(ctx), { transaction }))
343
- );
344
- },
345
- addActions: async (ctx, next) => {
346
- await runFlowSurfaceAction(ctx, next, () => service.addActions(getValues(ctx)));
347
- },
348
- addRecordAction: async (ctx, next) => {
349
- await runFlowSurfaceAction(
350
- ctx,
351
- next,
352
- () => service.transaction((transaction) => service.addRecordAction(getValues(ctx), { transaction }))
353
- );
354
- },
355
- addRecordActions: async (ctx, next) => {
356
- await runFlowSurfaceAction(ctx, next, () => service.addRecordActions(getValues(ctx)));
357
- },
358
- updateSettings: async (ctx, next) => {
359
- await runFlowSurfaceAction(
360
- ctx,
361
- next,
362
- () => service.transaction((transaction) => service.updateSettings(getValues(ctx), { transaction }))
363
- );
364
- },
365
- setEventFlows: async (ctx, next) => {
366
- await runFlowSurfaceAction(
367
- ctx,
368
- next,
369
- () => service.transaction((transaction) => service.setEventFlows(getValues(ctx), { transaction }))
370
- );
371
- },
372
- setLayout: async (ctx, next) => {
373
- await runFlowSurfaceAction(
374
- ctx,
375
- next,
376
- () => service.transaction((transaction) => service.setLayout(getValues(ctx), { transaction }))
377
- );
378
- },
379
- moveNode: async (ctx, next) => {
380
- await runFlowSurfaceAction(
381
- ctx,
382
- next,
383
- () => service.transaction((transaction) => service.moveNode(getValues(ctx), { transaction }))
384
- );
385
- },
386
- removeNode: async (ctx, next) => {
387
- await runFlowSurfaceAction(
388
- ctx,
389
- next,
390
- () => service.transaction((transaction) => service.removeNode(getValues(ctx), { transaction }))
391
- );
392
- },
393
- mutate: async (ctx, next) => {
394
- await runFlowSurfaceAction(
395
- ctx,
396
- next,
397
- () => service.transaction((transaction) => service.mutate(getValues(ctx), { transaction }))
398
- );
399
- },
400
- apply: async (ctx, next) => {
401
- await runFlowSurfaceAction(
402
- ctx,
403
- next,
404
- () => service.transaction((transaction) => service.apply(getValues(ctx), { transaction }))
405
- );
406
- }
407
- };
139
+ const actions = Object.fromEntries(
140
+ import_constants.FLOW_SURFACES_ACTION_NAMES.map((actionName) => [
141
+ actionName,
142
+ async (ctx, next) => {
143
+ await runFlowSurfaceAction(ctx, next, async () => {
144
+ const definition = import_constants.FLOW_SURFACE_ACTION_DEFINITIONS[actionName];
145
+ const values = definition.valueSource === "read" ? getReadValues(ctx) : getValues(ctx);
146
+ if (definition.transaction) {
147
+ return service.transaction(
148
+ (transaction) => invokeFlowSurfaceServiceAction(service, actionName, values, { transaction })
149
+ );
150
+ }
151
+ return invokeFlowSurfaceServiceAction(service, actionName, values);
152
+ });
153
+ }
154
+ ])
155
+ );
408
156
  plugin.app.acl.registerSnippet({
409
157
  name: "ui.flowSurfaces",
410
158
  actions: ["flowSurfaces:*"]
@@ -40,6 +40,7 @@ __export(locator_exports, {
40
40
  });
41
41
  module.exports = __toCommonJS(locator_exports);
42
42
  var import_lodash = __toESM(require("lodash"));
43
+ var import_approval = require("./approval");
43
44
  var import_chart_config = require("./chart-config");
44
45
  var import_errors = require("./errors");
45
46
  class SurfaceLocator {
@@ -96,7 +97,7 @@ class SurfaceLocator {
96
97
  let cursor = uid;
97
98
  while (cursor) {
98
99
  const model = await this.repository.findModelById(cursor, { transaction, includeAsyncNode: true });
99
- const resourceInit = import_lodash.default.get(model, ["stepParams", "resourceSettings", "init"]) || ((model == null ? void 0 : model.use) === "ChartBlockModel" ? (0, import_chart_config.getChartBuilderResourceInit)(import_lodash.default.get(model, ["stepParams", "chartSettings", "configure"])) : null);
100
+ const resourceInit = import_lodash.default.get(model, ["stepParams", "resourceSettings", "init"]) || import_lodash.default.get(model, ["stepParams", "TriggerChildPageSettings", "init"]) || import_lodash.default.get(model, ["stepParams", "ApprovalChildPageSettings", "init"]) || ((model == null ? void 0 : model.use) === "ChartBlockModel" ? (0, import_chart_config.getChartBuilderResourceInit)(import_lodash.default.get(model, ["stepParams", "chartSettings", "configure"])) : null);
100
101
  if ((resourceInit == null ? void 0 : resourceInit.dataSourceKey) && (resourceInit == null ? void 0 : resourceInit.collectionName)) {
101
102
  return {
102
103
  ownerUid: cursor,
@@ -210,19 +211,20 @@ class SurfaceLocator {
210
211
  }
211
212
  }
212
213
  function inferKind(use) {
213
- if (use === "RouteModel") {
214
+ const normalized = (0, import_approval.normalizeApprovalSemanticUse)(use);
215
+ if (normalized === "RouteModel") {
214
216
  return "node";
215
217
  }
216
- if (use === "RootPageModel" || use === "ChildPageModel") {
218
+ if (normalized === "RootPageModel" || normalized === "ChildPageModel") {
217
219
  return "page";
218
220
  }
219
- if (use === "RootPageTabModel" || use === "ChildPageTabModel") {
221
+ if (normalized === "RootPageTabModel" || normalized === "ChildPageTabModel") {
220
222
  return "tab";
221
223
  }
222
- if (/GridModel$/.test(use || "")) {
224
+ if (/GridModel$/.test(normalized || "")) {
223
225
  return "grid";
224
226
  }
225
- if (/BlockModel$/.test(use || "")) {
227
+ if (/BlockModel$/.test(normalized || "")) {
226
228
  return "block";
227
229
  }
228
230
  return "node";
@@ -35,6 +35,7 @@ __export(node_use_sets_exports, {
35
35
  STATIC_CONTENT_BLOCK_USES: () => STATIC_CONTENT_BLOCK_USES
36
36
  });
37
37
  module.exports = __toCommonJS(node_use_sets_exports);
38
+ var import_approval = require("./approval");
38
39
  const COLLECTION_BLOCK_USES = /* @__PURE__ */ new Set([
39
40
  "TableBlockModel",
40
41
  "CreateFormModel",
@@ -45,7 +46,9 @@ const COLLECTION_BLOCK_USES = /* @__PURE__ */ new Set([
45
46
  "ListBlockModel",
46
47
  "GridCardBlockModel",
47
48
  "MapBlockModel",
48
- "CommentsBlockModel"
49
+ "CommentsBlockModel",
50
+ ...import_approval.APPROVAL_FORM_BLOCK_USES,
51
+ ...import_approval.APPROVAL_DETAILS_BLOCK_USES
49
52
  ]);
50
53
  const STATIC_CONTENT_BLOCK_USES = /* @__PURE__ */ new Set([
51
54
  "MarkdownBlockModel",
@@ -59,7 +62,8 @@ const FIELD_WRAPPER_USES = /* @__PURE__ */ new Set([
59
62
  "FormAssociationItemModel",
60
63
  "DetailsItemModel",
61
64
  "FilterFormItemModel",
62
- "TableColumnModel"
65
+ "TableColumnModel",
66
+ ...import_approval.APPROVAL_FIELD_WRAPPER_USES
63
67
  ]);
64
68
  const CREATABLE_STANDALONE_FIELD_USES = /* @__PURE__ */ new Set(["JSColumnModel", "JSItemModel"]);
65
69
  const STANDALONE_FIELD_NODE_USES = /* @__PURE__ */ new Set([...CREATABLE_STANDALONE_FIELD_USES, "FormJSFieldItemModel"]);
@@ -99,7 +103,15 @@ const ACTION_BUTTON_USES = /* @__PURE__ */ new Set([
99
103
  "JSFormActionModel",
100
104
  "JSItemActionModel",
101
105
  "FilterFormJSActionModel",
102
- "JSActionModel"
106
+ "JSActionModel",
107
+ "ApplyFormSubmitModel",
108
+ "ApplyFormSaveDraftModel",
109
+ "ApplyFormWithdrawModel",
110
+ "ProcessFormApproveModel",
111
+ "ProcessFormRejectModel",
112
+ "ProcessFormReturnModel",
113
+ "ProcessFormDelegateModel",
114
+ "ProcessFormAddAssigneeModel"
103
115
  ]);
104
116
  const JS_BLOCK_USES = /* @__PURE__ */ new Set(["JSBlockModel"]);
105
117
  // Annotate the CommonJS export names for ESM import in node:
@@ -49,6 +49,7 @@ __export(placement_exports, {
49
49
  isTabsRouteType: () => isTabsRouteType
50
50
  });
51
51
  module.exports = __toCommonJS(placement_exports);
52
+ var import_approval = require("./approval");
52
53
  var import_node_use_sets = require("./node-use-sets");
53
54
  const FLOW_SURFACE_POPUP_HOST_USES = /* @__PURE__ */ new Set([
54
55
  "AddNewActionModel",
@@ -94,22 +95,22 @@ function isPopupHostUse(use) {
94
95
  return FLOW_SURFACE_POPUP_HOST_USES.has(use || "");
95
96
  }
96
97
  function isFormBlockUse(use) {
97
- return FLOW_SURFACE_FORM_BLOCK_USES.has(use || "");
98
+ return FLOW_SURFACE_FORM_BLOCK_USES.has((0, import_approval.normalizeApprovalSemanticUse)(use) || "");
98
99
  }
99
100
  function isDetailsBlockUse(use) {
100
- return FLOW_SURFACE_DETAILS_BLOCK_USES.has(use || "");
101
+ return FLOW_SURFACE_DETAILS_BLOCK_USES.has((0, import_approval.normalizeApprovalSemanticUse)(use) || "");
101
102
  }
102
103
  function isFilterFormBlockUse(use) {
103
- return FLOW_SURFACE_FILTER_FORM_BLOCK_USES.has(use || "");
104
+ return FLOW_SURFACE_FILTER_FORM_BLOCK_USES.has((0, import_approval.normalizeApprovalSemanticUse)(use) || "");
104
105
  }
105
106
  function isGridUse(use) {
106
- return FLOW_SURFACE_GRID_USES.has(use || "");
107
+ return FLOW_SURFACE_GRID_USES.has((0, import_approval.normalizeApprovalSemanticUse)(use) || "");
107
108
  }
108
109
  function isFieldWrapperUse(use) {
109
110
  return FLOW_SURFACE_FIELD_WRAPPER_USES.has(use || "");
110
111
  }
111
112
  function isPageModelUse(use) {
112
- return FLOW_SURFACE_PAGE_MODEL_USES.has(use || "");
113
+ return FLOW_SURFACE_PAGE_MODEL_USES.has((0, import_approval.normalizeApprovalSemanticUse)(use) || "");
113
114
  }
114
115
  function isPageRouteType(routeLike) {
115
116
  var _a;
@@ -128,10 +129,13 @@ function canCatalogAddBlock(input) {
128
129
  if (!node && !resolved) {
129
130
  return true;
130
131
  }
132
+ if ((0, import_approval.isApprovalTaskCardGridUse)(node == null ? void 0 : node.use)) {
133
+ return false;
134
+ }
131
135
  if (isGridUse(node == null ? void 0 : node.use) || isPageModelUse(node == null ? void 0 : node.use)) {
132
136
  return true;
133
137
  }
134
- if (isPopupHostUse(node == null ? void 0 : node.use) || ((_b = (_a = node == null ? void 0 : node.subModels) == null ? void 0 : _a.page) == null ? void 0 : _b.use) === "ChildPageModel") {
138
+ if (isPopupHostUse(node == null ? void 0 : node.use) || (0, import_approval.normalizeApprovalSemanticUse)((_b = (_a = node == null ? void 0 : node.subModels) == null ? void 0 : _a.page) == null ? void 0 : _b.use) === "ChildPageModel") {
135
139
  return true;
136
140
  }
137
141
  if (!(node == null ? void 0 : node.use) && isTabsRouteType(resolved == null ? void 0 : resolved.tabRoute) || (node == null ? void 0 : node.use) === "RouteModel" && isTabsRouteType(resolved == null ? void 0 : resolved.route)) {
@@ -149,7 +153,7 @@ function isFieldContainerUse(parentUse, subKey) {
149
153
  return subKey === "items" && (isGridUse(parentUse) || isFormBlockUse(parentUse) || isDetailsBlockUse(parentUse) || isFilterFormBlockUse(parentUse));
150
154
  }
151
155
  function isBlockContainerUse(parentUse, subKey) {
152
- return subKey === "items" && (isGridUse(parentUse) || isPopupHostUse(parentUse));
156
+ return subKey === "items" && (isGridUse(parentUse) && !(0, import_approval.isApprovalTaskCardGridUse)(parentUse) || isPopupHostUse(parentUse));
153
157
  }
154
158
  function isActionContainerUse(parentUse) {
155
159
  return [
@@ -161,7 +161,7 @@ export type FlowSurfacePlanOnlyActionName = {
161
161
  executionKind: 'planOnly';
162
162
  } ? K : never;
163
163
  }[FlowSurfacePlanStepActionName];
164
- export declare const FLOW_SURFACE_PLAN_STEP_ACTIONS: ("createMenu" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "compose" | "configure" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy")[];
164
+ export declare const FLOW_SURFACE_PLAN_STEP_ACTIONS: ("createMenu" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy" | "compose" | "configure" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode")[];
165
165
  export declare function getFlowSurfacePlanSelectorRequirements(selectorMode: FlowSurfacePlanSelectorMode): {
166
166
  readonly requiresTarget: false;
167
167
  readonly requiresSource: false;
@@ -27,7 +27,7 @@ type CompilePlanStepDeps = NormalizePlanSelectorDeps & {
27
27
  export declare function normalizePlanSelector(actionName: string, selector: any, deps: NormalizePlanSelectorDeps, fieldName?: string, options?: NormalizePlanSelectorOptions): FlowSurfacePlanSelector;
28
28
  export declare function normalizePlanSteps(actionName: string, values: FlowSurfacePlanRequestValues, deps: NormalizePlanStepsDeps): {
29
29
  id: string;
30
- action: "createMenu" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "compose" | "configure" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy";
30
+ action: "createMenu" | "setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "convertTemplateToCopy" | "compose" | "configure" | "createPage" | "destroyPage" | "addTab" | "updateTab" | "moveTab" | "removeTab" | "addPopupTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "updateSettings" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode";
31
31
  selectors: _.Dictionary<any>;
32
32
  values: Record<string, any>;
33
33
  }[];
@@ -31,24 +31,26 @@ __export(key_kind_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(key_kind_exports);
33
33
  var import_node_use_sets = require("../node-use-sets");
34
+ var import_approval = require("../approval");
34
35
  var import_errors = require("../errors");
35
36
  var import_placement = require("../placement");
36
37
  var import_service_utils = require("../service-utils");
37
38
  function buildPlanKeyKind(node, resolvedKind) {
38
39
  const use = String((node == null ? void 0 : node.use) || "").trim();
39
- if (use === "RootPageModel" || resolvedKind === "page") {
40
+ const semanticUse = (0, import_approval.normalizeApprovalSemanticUse)(use);
41
+ if (semanticUse === "RootPageModel" || resolvedKind === "page") {
40
42
  return "page";
41
43
  }
42
- if (use === "RootPageTabModel" || resolvedKind === "tab") {
44
+ if (semanticUse === "RootPageTabModel" || resolvedKind === "tab") {
43
45
  return "tab";
44
46
  }
45
- if (use === "ChildPageModel") {
47
+ if (semanticUse === "ChildPageModel") {
46
48
  return "popupPage";
47
49
  }
48
- if (use === "ChildPageTabModel") {
50
+ if (semanticUse === "ChildPageTabModel") {
49
51
  return "popupTab";
50
52
  }
51
- if (use === "BlockGridModel" || resolvedKind === "grid") {
53
+ if (semanticUse === "BlockGridModel" || resolvedKind === "grid") {
52
54
  return "grid";
53
55
  }
54
56
  if ((0, import_placement.isPopupHostUse)(use)) {
@@ -51,7 +51,12 @@ export declare const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE: {
51
51
  readonly CreateFormModel: readonly ["fieldValue", "blockLinkage", "fieldLinkage"];
52
52
  readonly EditFormModel: readonly ["fieldValue", "blockLinkage", "fieldLinkage"];
53
53
  readonly FormBlockModel: readonly ["blockLinkage", "fieldLinkage"];
54
+ readonly ApplyFormModel: readonly ["fieldValue", "blockLinkage", "fieldLinkage"];
55
+ readonly ProcessFormModel: readonly ["fieldValue", "blockLinkage", "fieldLinkage"];
54
56
  readonly DetailsBlockModel: readonly ["blockLinkage", "fieldLinkage"];
57
+ readonly ApprovalDetailsModel: readonly ["blockLinkage", "fieldLinkage"];
58
+ readonly ApplyTaskCardDetailsModel: readonly ["blockLinkage", "fieldLinkage"];
59
+ readonly ApprovalTaskCardDetailsModel: readonly ["blockLinkage", "fieldLinkage"];
55
60
  readonly TableBlockModel: readonly ["blockLinkage"];
56
61
  readonly ListBlockModel: readonly ["blockLinkage"];
57
62
  readonly GridCardBlockModel: readonly ["blockLinkage"];
@@ -89,6 +94,14 @@ export declare const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE: {
89
94
  readonly FilterActionModel: readonly ["actionLinkage"];
90
95
  readonly ExpandCollapseActionModel: readonly ["actionLinkage"];
91
96
  readonly FormSubmitActionModel: readonly ["actionLinkage"];
97
+ readonly ApplyFormSubmitModel: readonly ["actionLinkage"];
98
+ readonly ApplyFormSaveDraftModel: readonly ["actionLinkage"];
99
+ readonly ApplyFormWithdrawModel: readonly ["actionLinkage"];
100
+ readonly ProcessFormApproveModel: readonly ["actionLinkage"];
101
+ readonly ProcessFormRejectModel: readonly ["actionLinkage"];
102
+ readonly ProcessFormReturnModel: readonly ["actionLinkage"];
103
+ readonly ProcessFormDelegateModel: readonly ["actionLinkage"];
104
+ readonly ProcessFormAddAssigneeModel: readonly ["actionLinkage"];
92
105
  readonly FilterFormSubmitActionModel: readonly ["actionLinkage"];
93
106
  readonly FilterFormResetActionModel: readonly ["actionLinkage"];
94
107
  readonly FilterFormCollapseActionModel: readonly ["actionLinkage"];
@@ -81,7 +81,12 @@ const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE = {
81
81
  CreateFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
82
82
  EditFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
83
83
  FormBlockModel: ["blockLinkage", "fieldLinkage"],
84
+ ApplyFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
85
+ ProcessFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
84
86
  DetailsBlockModel: ["blockLinkage", "fieldLinkage"],
87
+ ApprovalDetailsModel: ["blockLinkage", "fieldLinkage"],
88
+ ApplyTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
89
+ ApprovalTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
85
90
  TableBlockModel: ["blockLinkage"],
86
91
  ListBlockModel: ["blockLinkage"],
87
92
  GridCardBlockModel: ["blockLinkage"],
@@ -119,6 +124,14 @@ const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE = {
119
124
  FilterActionModel: ["actionLinkage"],
120
125
  ExpandCollapseActionModel: ["actionLinkage"],
121
126
  FormSubmitActionModel: ["actionLinkage"],
127
+ ApplyFormSubmitModel: ["actionLinkage"],
128
+ ApplyFormSaveDraftModel: ["actionLinkage"],
129
+ ApplyFormWithdrawModel: ["actionLinkage"],
130
+ ProcessFormApproveModel: ["actionLinkage"],
131
+ ProcessFormRejectModel: ["actionLinkage"],
132
+ ProcessFormReturnModel: ["actionLinkage"],
133
+ ProcessFormDelegateModel: ["actionLinkage"],
134
+ ProcessFormAddAssigneeModel: ["actionLinkage"],
122
135
  FilterFormSubmitActionModel: ["actionLinkage"],
123
136
  FilterFormResetActionModel: ["actionLinkage"],
124
137
  FilterFormCollapseActionModel: ["actionLinkage"],
@@ -52,23 +52,19 @@ export declare function hasDefinedValue(input: Record<string, any>, keys: string
52
52
  export declare function ensureNoRawSimpleChangeKeys(changes: Record<string, any>): void;
53
53
  export declare function ensureNoRawDirectAddKeys(actionName: string, values: Record<string, any>, rawKeys: string[]): void;
54
54
  export declare function ensureNoDirectActionScopeKey(actionName: 'addAction' | 'addRecordAction', values: Record<string, any>): void;
55
- export declare function normalizeComposeFieldSpec(input: any, index: number): {
55
+ export type NormalizedComposeFieldSpec = {
56
56
  index: number;
57
57
  key: string;
58
- fieldPath: string;
59
- settings: {};
60
- popup: any;
61
- } | {
62
- target: string;
63
- settings: any;
64
- popup: any;
65
- type?: string;
66
- renderer?: string;
67
- associationPathName: string;
68
58
  fieldPath?: string;
69
- index: number;
70
- key: string;
59
+ associationPathName?: string;
60
+ renderer?: string;
61
+ type?: string;
62
+ target?: string;
63
+ settings: Record<string, any>;
64
+ popup?: Record<string, any>;
65
+ __autoPopupForRelationField?: boolean;
71
66
  };
67
+ export declare function normalizeComposeFieldSpec(input: any, index: number): NormalizedComposeFieldSpec;
72
68
  export declare function normalizeComposeActionSpec(input: any, index: number): {
73
69
  key: string;
74
70
  type: string;
@@ -96,7 +92,7 @@ export declare function splitComposeFieldChanges(changes: Record<string, any>, w
96
92
  wrapperChanges: _.Dictionary<any>;
97
93
  fieldChanges: _.Dictionary<any>;
98
94
  };
99
- export declare function getCatalogRecordActionContainerUse(use?: string): "TableActionsColumnModel" | "ListItemModel" | "GridCardItemModel" | "DetailsBlockModel";
95
+ export declare function getCatalogRecordActionContainerUse(use?: string): "DetailsBlockModel" | "TableActionsColumnModel" | "ListItemModel" | "GridCardItemModel";
100
96
  export declare function normalizeRowSpans(spans?: Array<number | undefined>): number[];
101
97
  export declare function normalizePublicBlockHeightMode(input: any): string;
102
98
  export declare function normalizeStoredChartCardHeightMode(input: any): string;
@@ -295,7 +295,8 @@ function normalizeComposeFieldSpec(input, index) {
295
295
  key: fieldPath2,
296
296
  fieldPath: fieldPath2,
297
297
  settings: {},
298
- popup: void 0
298
+ popup: void 0,
299
+ __autoPopupForRelationField: true
299
300
  };
300
301
  }
301
302
  if (!import_lodash.default.isPlainObject(input)) {
@@ -332,7 +333,8 @@ function normalizeComposeFieldSpec(input, index) {
332
333
  ...semanticType ? { type: semanticType } : {},
333
334
  target: typeof input.target === "string" ? String(input.target || "").trim() || void 0 : void 0,
334
335
  settings: import_lodash.default.isPlainObject(input.settings) ? input.settings : {},
335
- popup: import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0
336
+ popup: import_lodash.default.isPlainObject(input.popup) ? input.popup : void 0,
337
+ __autoPopupForRelationField: input.__autoPopupForRelationField === true
336
338
  };
337
339
  }
338
340
  function normalizeComposeActionSpec(input, index) {