@nocobase/plugin-flow-engine 2.1.0-beta.2 → 2.1.0-beta.20

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 (244) hide show
  1. package/LICENSE +201 -661
  2. package/README.md +79 -9
  3. package/dist/ai/ai-employees/nathan/index.d.ts +10 -0
  4. package/dist/ai/ai-employees/nathan/index.js +41 -0
  5. package/dist/ai/ai-employees/nathan/prompt.md +132 -0
  6. package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +69 -0
  7. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.js +2 -2
  8. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.js +2 -2
  9. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.js +2 -2
  10. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.js +2 -2
  11. package/dist/ai/docs/runjs/context/block-model.md +35 -35
  12. package/dist/ai/docs/runjs/context/collection-field.md +53 -51
  13. package/dist/ai/docs/runjs/context/collection.md +39 -39
  14. package/dist/ai/docs/runjs/context/data-source-manager.md +40 -30
  15. package/dist/ai/docs/runjs/context/data-source.md +52 -44
  16. package/dist/ai/docs/runjs/context/element.md +44 -38
  17. package/dist/ai/docs/runjs/context/exit-all.md +37 -35
  18. package/dist/ai/docs/runjs/context/exit.md +38 -35
  19. package/dist/ai/docs/runjs/context/filter-manager.md +36 -30
  20. package/dist/ai/docs/runjs/context/form.md +57 -57
  21. package/dist/ai/docs/runjs/context/get-model.md +22 -21
  22. package/dist/ai/docs/runjs/context/get-value.md +20 -19
  23. package/dist/ai/docs/runjs/context/get-var.md +61 -55
  24. package/dist/ai/docs/runjs/context/i18n.md +17 -14
  25. package/dist/ai/docs/runjs/context/import-async.md +333 -45
  26. package/dist/ai/docs/runjs/context/init-resource.md +20 -20
  27. package/dist/ai/docs/runjs/context/libs.md +31 -31
  28. package/dist/ai/docs/runjs/context/location.md +34 -31
  29. package/dist/ai/docs/runjs/context/logger.md +41 -40
  30. package/dist/ai/docs/runjs/context/make-resource.md +27 -26
  31. package/dist/ai/docs/runjs/context/message.md +42 -41
  32. package/dist/ai/docs/runjs/context/modal.md +44 -44
  33. package/dist/ai/docs/runjs/context/model.md +36 -33
  34. package/dist/ai/docs/runjs/context/notification.md +41 -40
  35. package/dist/ai/docs/runjs/context/off.md +14 -14
  36. package/dist/ai/docs/runjs/context/on.md +30 -29
  37. package/dist/ai/docs/runjs/context/open-view.md +40 -40
  38. package/dist/ai/docs/runjs/context/render.md +37 -32
  39. package/dist/ai/docs/runjs/context/request.md +46 -45
  40. package/dist/ai/docs/runjs/context/require-async.md +28 -25
  41. package/dist/ai/docs/runjs/context/resource.md +34 -34
  42. package/dist/ai/docs/runjs/context/route.md +36 -34
  43. package/dist/ai/docs/runjs/context/router.md +43 -31
  44. package/dist/ai/docs/runjs/context/set-value.md +18 -17
  45. package/dist/ai/docs/runjs/context/sql.md +7 -15
  46. package/dist/ai/docs/runjs/context/t.md +20 -17
  47. package/dist/ai/docs/runjs/context/view.md +49 -46
  48. package/dist/ai/docs/runjs/document.md +1 -0
  49. package/dist/ai/docs/runjs/import-modules.md +32 -32
  50. package/dist/ai/docs/runjs/index.md +13 -13
  51. package/dist/ai/docs/runjs/jsx.md +19 -19
  52. package/dist/ai/docs/runjs/model/form-block-model.md +1 -3
  53. package/dist/ai/docs/runjs/render.md +15 -15
  54. package/dist/ai/docs/runjs/resource/api-resource.md +53 -53
  55. package/dist/ai/docs/runjs/resource/multi-record-resource.md +64 -64
  56. package/dist/ai/docs/runjs/resource/single-record-resource.md +55 -55
  57. package/dist/ai/docs/runjs/resource/sql-resource.md +57 -57
  58. package/dist/ai/docs/runjs/window.md +5 -5
  59. package/dist/client/index.js +1 -1
  60. package/dist/externalVersion.js +12 -11
  61. package/dist/locale/en-US.json +1 -0
  62. package/dist/locale/index.d.ts +2 -0
  63. package/dist/locale/zh-CN.json +1 -0
  64. package/dist/node_modules/ses/dist/ses.cjs +1 -1
  65. package/dist/node_modules/ses/package.json +1 -1
  66. package/dist/node_modules/zod/index.cjs +1 -1
  67. package/dist/node_modules/zod/package.json +1 -1
  68. package/dist/server/collections/flowsql.js +1 -0
  69. package/dist/server/flow-surfaces/action-scope.d.ts +39 -0
  70. package/dist/server/flow-surfaces/action-scope.js +156 -0
  71. package/dist/server/flow-surfaces/apply/compiler.d.ts +13 -0
  72. package/dist/server/flow-surfaces/apply/compiler.js +969 -0
  73. package/dist/server/flow-surfaces/apply/layout.d.ts +34 -0
  74. package/dist/server/flow-surfaces/apply/layout.js +175 -0
  75. package/dist/server/flow-surfaces/apply/matching.d.ts +16 -0
  76. package/dist/server/flow-surfaces/apply/matching.js +181 -0
  77. package/dist/server/flow-surfaces/approval/blueprint-service.d.ts +84 -0
  78. package/dist/server/flow-surfaces/approval/blueprint-service.js +589 -0
  79. package/dist/server/flow-surfaces/approval/blueprint.d.ts +21 -0
  80. package/dist/server/flow-surfaces/approval/blueprint.js +187 -0
  81. package/dist/server/flow-surfaces/approval/builder.d.ts +225 -0
  82. package/dist/server/flow-surfaces/approval/builder.js +384 -0
  83. package/dist/server/flow-surfaces/approval/catalog-specs.d.ts +33 -0
  84. package/dist/server/flow-surfaces/approval/catalog-specs.js +156 -0
  85. package/dist/server/flow-surfaces/approval/index.d.ts +14 -0
  86. package/dist/server/flow-surfaces/approval/index.js +40 -0
  87. package/dist/server/flow-surfaces/approval/runtime-config.d.ts +44 -0
  88. package/dist/server/flow-surfaces/approval/runtime-config.js +299 -0
  89. package/dist/server/flow-surfaces/approval/semantic-use.d.ts +23 -0
  90. package/dist/server/flow-surfaces/approval/semantic-use.js +155 -0
  91. package/dist/server/flow-surfaces/association-title-field.d.ts +20 -0
  92. package/dist/server/flow-surfaces/association-title-field.js +192 -0
  93. package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +14 -0
  94. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +1029 -0
  95. package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +13 -0
  96. package/dist/server/flow-surfaces/blueprint/compile-plan.js +308 -0
  97. package/dist/server/flow-surfaces/blueprint/compile-reaction.d.ts +11 -0
  98. package/dist/server/flow-surfaces/blueprint/compile-reaction.js +72 -0
  99. package/dist/server/flow-surfaces/blueprint/defaults.d.ts +26 -0
  100. package/dist/server/flow-surfaces/blueprint/defaults.js +133 -0
  101. package/dist/server/flow-surfaces/blueprint/index.d.ts +12 -0
  102. package/dist/server/flow-surfaces/blueprint/index.js +44 -0
  103. package/dist/server/flow-surfaces/blueprint/normalize-document.d.ts +10 -0
  104. package/dist/server/flow-surfaces/blueprint/normalize-document.js +416 -0
  105. package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +26 -0
  106. package/dist/server/flow-surfaces/blueprint/private-utils.js +182 -0
  107. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +193 -0
  108. package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
  109. package/dist/server/flow-surfaces/builder.d.ts +211 -0
  110. package/dist/server/flow-surfaces/builder.js +1097 -0
  111. package/dist/server/flow-surfaces/catalog-smart.d.ts +18 -0
  112. package/dist/server/flow-surfaces/catalog-smart.js +239 -0
  113. package/dist/server/flow-surfaces/catalog-smart.projector.d.ts +15 -0
  114. package/dist/server/flow-surfaces/catalog-smart.projector.js +157 -0
  115. package/dist/server/flow-surfaces/catalog-smart.types.d.ts +99 -0
  116. package/dist/server/flow-surfaces/catalog-smart.types.js +24 -0
  117. package/dist/server/flow-surfaces/catalog.d.ts +78 -0
  118. package/dist/server/flow-surfaces/catalog.js +3577 -0
  119. package/dist/server/flow-surfaces/chart-config.d.ts +121 -0
  120. package/dist/server/flow-surfaces/chart-config.js +1394 -0
  121. package/dist/server/flow-surfaces/compose-compiler.d.ts +108 -0
  122. package/dist/server/flow-surfaces/compose-compiler.js +167 -0
  123. package/dist/server/flow-surfaces/compose-runtime.d.ts +93 -0
  124. package/dist/server/flow-surfaces/compose-runtime.js +375 -0
  125. package/dist/server/flow-surfaces/configure-options.d.ts +23 -0
  126. package/dist/server/flow-surfaces/configure-options.js +860 -0
  127. package/dist/server/flow-surfaces/constants.d.ts +351 -0
  128. package/dist/server/flow-surfaces/constants.js +104 -0
  129. package/dist/server/flow-surfaces/context.d.ts +72 -0
  130. package/dist/server/flow-surfaces/context.js +556 -0
  131. package/dist/server/flow-surfaces/contract-guard.d.ts +19 -0
  132. package/dist/server/flow-surfaces/contract-guard.js +402 -0
  133. package/dist/server/flow-surfaces/core-field-default-bindings.d.ts +12 -0
  134. package/dist/server/flow-surfaces/core-field-default-bindings.js +157 -0
  135. package/dist/server/flow-surfaces/default-action-popup.d.ts +63 -0
  136. package/dist/server/flow-surfaces/default-action-popup.js +322 -0
  137. package/dist/server/flow-surfaces/default-block-actions.d.ts +32 -0
  138. package/dist/server/flow-surfaces/default-block-actions.js +209 -0
  139. package/dist/server/flow-surfaces/errors.d.ts +47 -0
  140. package/dist/server/flow-surfaces/errors.js +145 -0
  141. package/dist/server/flow-surfaces/executor.d.ts +23 -0
  142. package/dist/server/flow-surfaces/executor.js +132 -0
  143. package/dist/server/flow-surfaces/field-binding-registry.d.ts +23 -0
  144. package/dist/server/flow-surfaces/field-binding-registry.js +391 -0
  145. package/dist/server/flow-surfaces/field-semantics.d.ts +15 -0
  146. package/dist/server/flow-surfaces/field-semantics.js +83 -0
  147. package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
  148. package/dist/server/flow-surfaces/filter-group.js +94 -0
  149. package/dist/server/flow-surfaces/index.d.ts +11 -0
  150. package/dist/server/flow-surfaces/index.js +302 -0
  151. package/dist/server/flow-surfaces/locator.d.ts +28 -0
  152. package/dist/server/flow-surfaces/locator.js +240 -0
  153. package/dist/server/flow-surfaces/node-use-sets.d.ts +15 -0
  154. package/dist/server/flow-surfaces/node-use-sets.js +134 -0
  155. package/dist/server/flow-surfaces/payload-shape.d.ts +9 -0
  156. package/dist/server/flow-surfaces/payload-shape.js +61 -0
  157. package/dist/server/flow-surfaces/placement.d.ts +33 -0
  158. package/dist/server/flow-surfaces/placement.js +198 -0
  159. package/dist/server/flow-surfaces/planning/action-specs.d.ts +179 -0
  160. package/dist/server/flow-surfaces/planning/action-specs.js +190 -0
  161. package/dist/server/flow-surfaces/planning/compiler.d.ts +37 -0
  162. package/dist/server/flow-surfaces/planning/compiler.js +376 -0
  163. package/dist/server/flow-surfaces/planning/context.d.ts +30 -0
  164. package/dist/server/flow-surfaces/planning/context.js +139 -0
  165. package/dist/server/flow-surfaces/planning/created-keys.d.ts +34 -0
  166. package/dist/server/flow-surfaces/planning/created-keys.js +375 -0
  167. package/dist/server/flow-surfaces/planning/key-kind.d.ts +11 -0
  168. package/dist/server/flow-surfaces/planning/key-kind.js +88 -0
  169. package/dist/server/flow-surfaces/planning/key-persistence.d.ts +34 -0
  170. package/dist/server/flow-surfaces/planning/key-persistence.js +148 -0
  171. package/dist/server/flow-surfaces/planning/key-registry.d.ts +40 -0
  172. package/dist/server/flow-surfaces/planning/key-registry.js +206 -0
  173. package/dist/server/flow-surfaces/planning/runtime.d.ts +37 -0
  174. package/dist/server/flow-surfaces/planning/runtime.js +259 -0
  175. package/dist/server/flow-surfaces/planning/step-link.d.ts +14 -0
  176. package/dist/server/flow-surfaces/planning/step-link.js +104 -0
  177. package/dist/server/flow-surfaces/planning/types.d.ts +55 -0
  178. package/dist/server/flow-surfaces/planning/types.js +24 -0
  179. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +24 -0
  180. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +152 -0
  181. package/dist/server/flow-surfaces/reaction/errors.d.ts +20 -0
  182. package/dist/server/flow-surfaces/reaction/errors.js +69 -0
  183. package/dist/server/flow-surfaces/reaction/field-value.d.ts +34 -0
  184. package/dist/server/flow-surfaces/reaction/field-value.js +181 -0
  185. package/dist/server/flow-surfaces/reaction/fingerprint.d.ts +16 -0
  186. package/dist/server/flow-surfaces/reaction/fingerprint.js +71 -0
  187. package/dist/server/flow-surfaces/reaction/linkage.d.ts +136 -0
  188. package/dist/server/flow-surfaces/reaction/linkage.js +882 -0
  189. package/dist/server/flow-surfaces/reaction/meta.d.ts +11 -0
  190. package/dist/server/flow-surfaces/reaction/meta.js +451 -0
  191. package/dist/server/flow-surfaces/reaction/registry.d.ts +156 -0
  192. package/dist/server/flow-surfaces/reaction/registry.js +206 -0
  193. package/dist/server/flow-surfaces/reaction/resolver.d.ts +22 -0
  194. package/dist/server/flow-surfaces/reaction/resolver.js +202 -0
  195. package/dist/server/flow-surfaces/reaction/types.d.ts +241 -0
  196. package/dist/server/flow-surfaces/reaction/types.js +24 -0
  197. package/dist/server/flow-surfaces/reaction/utils.d.ts +17 -0
  198. package/dist/server/flow-surfaces/reaction/utils.js +67 -0
  199. package/dist/server/flow-surfaces/reaction/value-expr.d.ts +15 -0
  200. package/dist/server/flow-surfaces/reaction/value-expr.js +209 -0
  201. package/dist/server/flow-surfaces/reference-guards.d.ts +19 -0
  202. package/dist/server/flow-surfaces/reference-guards.js +103 -0
  203. package/dist/server/flow-surfaces/route-sync.d.ts +47 -0
  204. package/dist/server/flow-surfaces/route-sync.js +392 -0
  205. package/dist/server/flow-surfaces/service-helpers.d.ts +42 -0
  206. package/dist/server/flow-surfaces/service-helpers.js +310 -0
  207. package/dist/server/flow-surfaces/service-utils.d.ts +108 -0
  208. package/dist/server/flow-surfaces/service-utils.js +811 -0
  209. package/dist/server/flow-surfaces/service.d.ts +814 -0
  210. package/dist/server/flow-surfaces/service.js +14276 -0
  211. package/dist/server/flow-surfaces/support-matrix.d.ts +31 -0
  212. package/dist/server/flow-surfaces/support-matrix.js +271 -0
  213. package/dist/server/flow-surfaces/surface-context.d.ts +52 -0
  214. package/dist/server/flow-surfaces/surface-context.js +440 -0
  215. package/dist/server/flow-surfaces/template-compatibility.d.ts +42 -0
  216. package/dist/server/flow-surfaces/template-compatibility.js +189 -0
  217. package/dist/server/flow-surfaces/template-display.d.ts +20 -0
  218. package/dist/server/flow-surfaces/template-display.js +289 -0
  219. package/dist/server/flow-surfaces/template-service-utils.d.ts +62 -0
  220. package/dist/server/flow-surfaces/template-service-utils.js +281 -0
  221. package/dist/server/flow-surfaces/types.d.ts +288 -0
  222. package/dist/server/flow-surfaces/types.js +24 -0
  223. package/dist/server/index.d.ts +1 -0
  224. package/dist/server/index.js +7 -2
  225. package/dist/server/plugin.d.ts +0 -1
  226. package/dist/server/plugin.js +9 -34
  227. package/dist/server/repository.js +0 -5
  228. package/dist/server/variables/resolve.d.ts +21 -0
  229. package/dist/server/variables/resolve.js +79 -0
  230. package/dist/swagger/flow-surfaces.d.ts +5964 -0
  231. package/dist/swagger/flow-surfaces.examples.d.ts +1572 -0
  232. package/dist/swagger/flow-surfaces.examples.js +1805 -0
  233. package/dist/swagger/flow-surfaces.js +5322 -0
  234. package/dist/swagger/flow-surfaces.template-action-docs.d.ts +62 -0
  235. package/dist/swagger/flow-surfaces.template-action-docs.js +121 -0
  236. package/dist/swagger/flow-surfaces.template-schemas.d.ts +239 -0
  237. package/dist/swagger/flow-surfaces.template-schemas.js +255 -0
  238. package/dist/swagger/index.d.ts +5969 -0
  239. package/dist/swagger/index.js +50 -0
  240. package/package.json +3 -3
  241. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.d.ts +0 -0
  242. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.d.ts +0 -0
  243. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.d.ts +0 -0
  244. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.d.ts +0 -0
@@ -0,0 +1,3577 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var catalog_exports = {};
28
+ __export(catalog_exports, {
29
+ ACTION_CATALOG_BY_KEY: () => ACTION_CATALOG_BY_KEY,
30
+ ACTION_CATALOG_BY_USE: () => ACTION_CATALOG_BY_USE,
31
+ ACTION_KEY_BY_USE: () => ACTION_KEY_BY_USE,
32
+ ACTION_PUBLIC_KEYS: () => ACTION_PUBLIC_KEYS,
33
+ BLOCK_CATALOG_BY_KEY: () => BLOCK_CATALOG_BY_KEY,
34
+ BLOCK_CATALOG_BY_USE: () => BLOCK_CATALOG_BY_USE,
35
+ BLOCK_KEY_BY_USE: () => BLOCK_KEY_BY_USE,
36
+ READONLY_NODE_CONTRACT: () => READONLY_NODE_CONTRACT,
37
+ SERVICE_SUPPORTED_FLOW_SURFACE_BLOCK_KEYS: () => SERVICE_SUPPORTED_FLOW_SURFACE_BLOCK_KEYS,
38
+ actionCatalog: () => actionCatalog,
39
+ blockCatalog: () => blockCatalog,
40
+ filterAvailableCatalogItems: () => filterAvailableCatalogItems,
41
+ getAvailableActionCatalogItems: () => getAvailableActionCatalogItems,
42
+ getAvailableBlockCatalogItems: () => getAvailableBlockCatalogItems,
43
+ getEditableDomainsForUse: () => getEditableDomainsForUse,
44
+ getLayoutCapabilitiesForUse: () => getLayoutCapabilitiesForUse,
45
+ getNodeContract: () => getNodeContract,
46
+ getSettingsSchemaForUse: () => getSettingsSchemaForUse,
47
+ getSupportedFieldComponentUseSet: () => getSupportedFieldComponentUseSet,
48
+ isCatalogItemAvailable: () => isCatalogItemAvailable,
49
+ resolveSupportedActionCatalogItem: () => resolveSupportedActionCatalogItem,
50
+ resolveSupportedBlockCatalogItem: () => resolveSupportedBlockCatalogItem,
51
+ resolveSupportedFieldCapability: () => resolveSupportedFieldCapability
52
+ });
53
+ module.exports = __toCommonJS(catalog_exports);
54
+ var import_approval = require("./approval");
55
+ var import_action_scope = require("./action-scope");
56
+ var import_errors = require("./errors");
57
+ var import_field_semantics = require("./field-semantics");
58
+ var import_core_field_default_bindings = require("./core-field-default-bindings");
59
+ var import_field_binding_registry = require("./field-binding-registry");
60
+ var import_service_helpers = require("./service-helpers");
61
+ var import_support_matrix = require("./support-matrix");
62
+ const ANY_VALUE_SCHEMA = {};
63
+ const STRING_SCHEMA = { type: "string" };
64
+ const NULLABLE_STRING_SCHEMA = { type: "string", nullable: true };
65
+ const BOOLEAN_SCHEMA = { type: "boolean" };
66
+ const OPEN_VIEW_MODE_SCHEMA = { type: "string", enum: ["drawer", "dialog", "embed"] };
67
+ const OPEN_VIEW_SCENE_SCHEMA = {
68
+ type: "string",
69
+ enum: ["new", "one", "many", "select", "subForm", "bulkEditForm", "generic"]
70
+ };
71
+ const OBJECT_SCHEMA = { type: "object" };
72
+ const NUMBER_SCHEMA = { type: "number" };
73
+ const ARRAY_SCHEMA = { type: "array" };
74
+ const NULLABLE_NUMBER_OR_STRING_SCHEMA = {
75
+ oneOf: [NUMBER_SCHEMA, NULLABLE_STRING_SCHEMA]
76
+ };
77
+ const FILTER_CONDITION_SCHEMA = {
78
+ type: "object",
79
+ properties: {
80
+ path: STRING_SCHEMA,
81
+ operator: STRING_SCHEMA,
82
+ value: ANY_VALUE_SCHEMA
83
+ },
84
+ required: ["path", "operator"],
85
+ additionalProperties: true
86
+ };
87
+ const FILTER_GROUP_SCHEMA = {
88
+ type: "object",
89
+ properties: {
90
+ logic: {
91
+ type: "string",
92
+ enum: ["$and", "$or"]
93
+ },
94
+ items: {
95
+ type: "array",
96
+ items: {
97
+ oneOf: [FILTER_CONDITION_SCHEMA, ANY_VALUE_SCHEMA]
98
+ }
99
+ }
100
+ },
101
+ required: ["logic", "items"],
102
+ additionalProperties: false,
103
+ "x-flowSurfaceFormat": "filter-group"
104
+ };
105
+ const DEFAULT_DIRECT_EVENTS = ["beforeRender"];
106
+ const ACTION_DIRECT_EVENTS = ["click", "beforeRender"];
107
+ const ACTION_OBJECT_EVENTS = ["click"];
108
+ const GRID_LAYOUT_CAPABILITIES = { supported: true };
109
+ const RUN_JS_ALLOWED_PATHS = ["runJs.code", "runJs.version"];
110
+ const OPEN_VIEW_ALLOWED_PATHS = [
111
+ "openView.mode",
112
+ "openView.size",
113
+ "openView.pageModelClass",
114
+ "openView.scene",
115
+ "openView.dataSourceKey",
116
+ "openView.collectionName",
117
+ "openView.associationName",
118
+ "openView.sourceId",
119
+ "openView.filterByTk",
120
+ "openView.title",
121
+ "openView.uid",
122
+ "openView.subModelKey",
123
+ "openView.navigation",
124
+ "openView.template",
125
+ "openView.template.uid",
126
+ "openView.template.mode",
127
+ "openView.tryTemplate"
128
+ ];
129
+ const OPEN_VIEW_PATH_SCHEMAS = {
130
+ "openView.mode": OPEN_VIEW_MODE_SCHEMA,
131
+ "openView.size": STRING_SCHEMA,
132
+ "openView.pageModelClass": STRING_SCHEMA,
133
+ "openView.scene": OPEN_VIEW_SCENE_SCHEMA,
134
+ "openView.dataSourceKey": STRING_SCHEMA,
135
+ "openView.collectionName": STRING_SCHEMA,
136
+ "openView.associationName": NULLABLE_STRING_SCHEMA,
137
+ "openView.sourceId": STRING_SCHEMA,
138
+ "openView.filterByTk": STRING_SCHEMA,
139
+ "openView.title": STRING_SCHEMA,
140
+ "openView.uid": STRING_SCHEMA,
141
+ "openView.subModelKey": STRING_SCHEMA,
142
+ "openView.navigation": BOOLEAN_SCHEMA,
143
+ "openView.template": OBJECT_SCHEMA,
144
+ "openView.template.uid": STRING_SCHEMA,
145
+ "openView.template.mode": {
146
+ type: "string",
147
+ enum: ["reference", "copy"]
148
+ },
149
+ "openView.tryTemplate": BOOLEAN_SCHEMA
150
+ };
151
+ const CONFIRM_ALLOWED_PATHS = ["confirm.enable", "confirm.title", "confirm.content"];
152
+ const TABLE_COLUMN_ALLOWED_PATHS = ["title.title"];
153
+ const FILTER_FORM_ITEM_ALLOWED_PATHS = [
154
+ "init.defaultTargetUid",
155
+ "init.filterField.name",
156
+ "init.filterField.title",
157
+ "init.filterField.interface",
158
+ "init.filterField.type",
159
+ "initialValue.defaultValue"
160
+ ];
161
+ const ACTION_PROP_KEYS = ["title", "tooltip", "icon", "type", "htmlType", "position", "danger", "color"];
162
+ const FILTER_ACTION_PROP_KEYS = [...ACTION_PROP_KEYS, "filterableFieldNames", "defaultFilterValue", "filterValue"];
163
+ const FILTER_ACTION_PROP_PATH_SCHEMAS = {
164
+ filterableFieldNames: {
165
+ type: "array",
166
+ items: STRING_SCHEMA
167
+ },
168
+ defaultFilterValue: FILTER_GROUP_SCHEMA,
169
+ filterValue: FILTER_GROUP_SCHEMA
170
+ };
171
+ const ACTION_BUTTON_SETTINGS_GROUP = {
172
+ allowedPaths: [
173
+ "general.title",
174
+ "general.tooltip",
175
+ "general.icon",
176
+ "general.type",
177
+ "general.danger",
178
+ "general.color",
179
+ "linkageRules"
180
+ ],
181
+ mergeStrategy: "deep",
182
+ eventBindingSteps: ["general", "linkageRules"],
183
+ pathSchemas: {
184
+ "general.title": STRING_SCHEMA,
185
+ "general.tooltip": STRING_SCHEMA,
186
+ "general.icon": NULLABLE_STRING_SCHEMA,
187
+ "general.type": STRING_SCHEMA,
188
+ "general.danger": BOOLEAN_SCHEMA,
189
+ "general.color": STRING_SCHEMA,
190
+ linkageRules: ARRAY_SCHEMA
191
+ }
192
+ };
193
+ const RUN_JS_SETTINGS_GROUP = {
194
+ allowedPaths: RUN_JS_ALLOWED_PATHS,
195
+ mergeStrategy: "deep",
196
+ eventBindingSteps: ["runJs"],
197
+ pathSchemas: {
198
+ "runJs.code": STRING_SCHEMA,
199
+ "runJs.version": STRING_SCHEMA
200
+ }
201
+ };
202
+ const FIELD_SETTINGS_INIT_GROUP = {
203
+ allowedPaths: [
204
+ "init.dataSourceKey",
205
+ "init.collectionName",
206
+ "init.associationName",
207
+ "init.associationPathName",
208
+ "init.sourceId",
209
+ "init.filterByTk",
210
+ "init.fieldPath"
211
+ ],
212
+ mergeStrategy: "deep",
213
+ pathSchemas: {
214
+ "init.dataSourceKey": STRING_SCHEMA,
215
+ "init.collectionName": STRING_SCHEMA,
216
+ "init.associationName": STRING_SCHEMA,
217
+ "init.associationPathName": STRING_SCHEMA,
218
+ "init.fieldPath": STRING_SCHEMA
219
+ }
220
+ };
221
+ const RESOURCE_SETTINGS_GROUP = {
222
+ allowedPaths: [
223
+ "init.dataSourceKey",
224
+ "init.collectionName",
225
+ "init.associationName",
226
+ "init.associationPathName",
227
+ "init.sourceId",
228
+ "init.filterByTk"
229
+ ],
230
+ eventBindingSteps: [],
231
+ pathSchemas: {
232
+ "init.dataSourceKey": STRING_SCHEMA,
233
+ "init.collectionName": STRING_SCHEMA,
234
+ "init.associationName": STRING_SCHEMA,
235
+ "init.associationPathName": STRING_SCHEMA
236
+ }
237
+ };
238
+ const FORM_LAYOUT_ALLOWED_PATHS = [
239
+ "layout.layout",
240
+ "layout.labelAlign",
241
+ "layout.labelWidth",
242
+ "layout.labelWrap",
243
+ "layout.colon"
244
+ ];
245
+ const FORM_LAYOUT_PATH_SCHEMAS = {
246
+ "layout.layout": STRING_SCHEMA,
247
+ "layout.labelAlign": STRING_SCHEMA,
248
+ "layout.labelWidth": NUMBER_SCHEMA,
249
+ "layout.labelWrap": BOOLEAN_SCHEMA,
250
+ "layout.colon": BOOLEAN_SCHEMA
251
+ };
252
+ const FORM_MODEL_SETTINGS_GROUP = {
253
+ allowedPaths: [...FORM_LAYOUT_ALLOWED_PATHS, "assignRules.value"],
254
+ eventBindingSteps: ["layout", "assignRules"],
255
+ pathSchemas: {
256
+ ...FORM_LAYOUT_PATH_SCHEMAS,
257
+ "assignRules.value": ARRAY_SCHEMA
258
+ }
259
+ };
260
+ const EVENT_SETTINGS_GROUP = {
261
+ allowedPaths: ["linkageRules.value"],
262
+ eventBindingSteps: ["linkageRules"],
263
+ pathSchemas: {
264
+ "linkageRules.value": ARRAY_SCHEMA
265
+ }
266
+ };
267
+ const CREATE_FORM_SETTINGS_EVENT_ONLY_GROUP = {
268
+ allowedPaths: [],
269
+ eventBindingSteps: ["init", "refresh"]
270
+ };
271
+ const EDIT_FORM_SETTINGS_GROUP = {
272
+ allowedPaths: ["dataScope.filter"],
273
+ eventBindingSteps: ["init", "dataScope", "refresh"],
274
+ pathSchemas: {
275
+ "dataScope.filter": FILTER_GROUP_SCHEMA
276
+ }
277
+ };
278
+ const DETAILS_SETTINGS_GROUP = {
279
+ allowedPaths: [...FORM_LAYOUT_ALLOWED_PATHS, "dataScope.filter", "defaultSorting.sort", "linkageRules.value"],
280
+ eventBindingSteps: ["layout", "dataScope", "defaultSorting", "linkageRules"],
281
+ pathSchemas: {
282
+ ...FORM_LAYOUT_PATH_SCHEMAS,
283
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
284
+ "defaultSorting.sort": ARRAY_SCHEMA,
285
+ "linkageRules.value": ARRAY_SCHEMA
286
+ }
287
+ };
288
+ const FILTER_FORM_BLOCK_SETTINGS_GROUP = {
289
+ allowedPaths: [...FORM_LAYOUT_ALLOWED_PATHS, "defaultValues.value"],
290
+ eventBindingSteps: ["layout", "defaultValues"],
291
+ pathSchemas: {
292
+ ...FORM_LAYOUT_PATH_SCHEMAS,
293
+ "defaultValues.value": ARRAY_SCHEMA
294
+ }
295
+ };
296
+ const BLOCK_CARD_SETTINGS_GROUP = {
297
+ allowedPaths: ["titleDescription.title", "titleDescription.description", "linkageRules"],
298
+ clearable: true,
299
+ mergeStrategy: "deep",
300
+ eventBindingSteps: ["titleDescription", "linkageRules"],
301
+ pathSchemas: {
302
+ "titleDescription.title": STRING_SCHEMA,
303
+ "titleDescription.description": STRING_SCHEMA,
304
+ linkageRules: ARRAY_SCHEMA
305
+ }
306
+ };
307
+ const CALENDAR_SETTINGS_GROUP = {
308
+ allowedPaths: [
309
+ "titleField.titleField",
310
+ "colorField.colorFieldName",
311
+ "startDateField.start",
312
+ "endDateField.end",
313
+ "defaultView.defaultView",
314
+ "quickCreateEvent.enableQuickCreateEvent",
315
+ "showLunar.showLunar",
316
+ "weekStart.weekStart",
317
+ "dataScope.filter",
318
+ "linkageRules.value"
319
+ ],
320
+ clearable: true,
321
+ mergeStrategy: "deep",
322
+ eventBindingSteps: ["dataScope", "linkageRules"],
323
+ pathSchemas: {
324
+ "titleField.titleField": STRING_SCHEMA,
325
+ "colorField.colorFieldName": STRING_SCHEMA,
326
+ "startDateField.start": STRING_SCHEMA,
327
+ "endDateField.end": STRING_SCHEMA,
328
+ "defaultView.defaultView": STRING_SCHEMA,
329
+ "quickCreateEvent.enableQuickCreateEvent": BOOLEAN_SCHEMA,
330
+ "showLunar.showLunar": BOOLEAN_SCHEMA,
331
+ "weekStart.weekStart": NUMBER_SCHEMA,
332
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
333
+ "linkageRules.value": ARRAY_SCHEMA
334
+ }
335
+ };
336
+ const KANBAN_SETTINGS_GROUP = {
337
+ allowedPaths: [
338
+ "grouping.groupField",
339
+ "grouping.groupTitleField",
340
+ "grouping.groupColorField",
341
+ "grouping.groupOptions",
342
+ "styleVariant.styleVariant",
343
+ "defaultSorting.sort",
344
+ "dragEnabled.dragEnabled",
345
+ "dragSortBy.dragSortBy",
346
+ "quickCreate.quickCreateEnabled",
347
+ "popup.mode",
348
+ "popup.size",
349
+ "popup.popupTemplateUid",
350
+ "popup.pageModelClass",
351
+ "popup.uid",
352
+ "pageSize.pageSize",
353
+ "columnWidth.columnWidth",
354
+ "dataScope.filter"
355
+ ],
356
+ clearable: true,
357
+ mergeStrategy: "deep",
358
+ eventBindingSteps: ["defaultSorting", "dataScope"],
359
+ pathSchemas: {
360
+ "grouping.groupField": STRING_SCHEMA,
361
+ "grouping.groupTitleField": NULLABLE_STRING_SCHEMA,
362
+ "grouping.groupColorField": NULLABLE_STRING_SCHEMA,
363
+ "grouping.groupOptions": ARRAY_SCHEMA,
364
+ "styleVariant.styleVariant": STRING_SCHEMA,
365
+ "defaultSorting.sort": ARRAY_SCHEMA,
366
+ "dragEnabled.dragEnabled": BOOLEAN_SCHEMA,
367
+ "dragSortBy.dragSortBy": NULLABLE_STRING_SCHEMA,
368
+ "quickCreate.quickCreateEnabled": BOOLEAN_SCHEMA,
369
+ "popup.mode": STRING_SCHEMA,
370
+ "popup.size": STRING_SCHEMA,
371
+ "popup.popupTemplateUid": NULLABLE_STRING_SCHEMA,
372
+ "popup.pageModelClass": NULLABLE_STRING_SCHEMA,
373
+ "popup.uid": NULLABLE_STRING_SCHEMA,
374
+ "pageSize.pageSize": NUMBER_SCHEMA,
375
+ "columnWidth.columnWidth": NUMBER_SCHEMA,
376
+ "dataScope.filter": FILTER_GROUP_SCHEMA
377
+ }
378
+ };
379
+ const TABLE_SETTINGS_GROUP = {
380
+ allowedPaths: [
381
+ "quickEdit.editable",
382
+ "showRowNumbers.showIndex",
383
+ "pageSize.pageSize",
384
+ "dataScope.filter",
385
+ "defaultSorting.sort",
386
+ "treeTable.treeTable",
387
+ "defaultExpandAllRows.defaultExpandAllRows",
388
+ "tableDensity.size",
389
+ "dragSort.dragSort",
390
+ "dragSortBy.dragSortBy"
391
+ ],
392
+ eventBindingSteps: [
393
+ "quickEdit",
394
+ "showRowNumbers",
395
+ "pageSize",
396
+ "dataScope",
397
+ "defaultSorting",
398
+ "treeTable",
399
+ "defaultExpandAllRows",
400
+ "tableDensity",
401
+ "dragSort",
402
+ "dragSortBy"
403
+ ],
404
+ pathSchemas: {
405
+ "quickEdit.editable": BOOLEAN_SCHEMA,
406
+ "showRowNumbers.showIndex": BOOLEAN_SCHEMA,
407
+ "pageSize.pageSize": NUMBER_SCHEMA,
408
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
409
+ "defaultSorting.sort": ARRAY_SCHEMA,
410
+ "treeTable.treeTable": BOOLEAN_SCHEMA,
411
+ "defaultExpandAllRows.defaultExpandAllRows": BOOLEAN_SCHEMA,
412
+ "tableDensity.size": STRING_SCHEMA,
413
+ "dragSort.dragSort": BOOLEAN_SCHEMA,
414
+ "dragSortBy.dragSortBy": STRING_SCHEMA
415
+ }
416
+ };
417
+ const CORE_FLOW_SURFACE_OWNER_PLUGIN = "@nocobase/core/client";
418
+ const FLOW_SURFACE_BLOCK_OWNER_PLUGIN_BY_USE = new Map(
419
+ import_support_matrix.FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.map((entry) => [entry.modelUse, entry.ownerPlugin])
420
+ );
421
+ const JS_EDITABLE_FIELD_USE_SET = /* @__PURE__ */ new Set(["JSEditableFieldModel"]);
422
+ const JS_DISPLAY_FIELD_USE_SET = /* @__PURE__ */ new Set(["JSFieldModel"]);
423
+ const REGISTERED_EDITABLE_FIELD_USE_SET = (0, import_field_binding_registry.getRegisteredFieldUses)("editable");
424
+ const REGISTERED_DISPLAY_FIELD_USE_SET = (0, import_field_binding_registry.getRegisteredFieldUses)("display");
425
+ const REGISTERED_FILTER_FIELD_USE_SET = (0, import_field_binding_registry.getRegisteredFieldUses)("filter");
426
+ const EDITABLE_FIELD_USE_SET = /* @__PURE__ */ new Set([
427
+ ...JS_EDITABLE_FIELD_USE_SET,
428
+ "RecordSelectFieldModel",
429
+ "JsonFieldModel",
430
+ "TextareaFieldModel",
431
+ "IconFieldModel",
432
+ "RadioGroupFieldModel",
433
+ "SelectFieldModel",
434
+ "CheckboxGroupFieldModel",
435
+ "ColorFieldModel",
436
+ "CheckboxFieldModel",
437
+ "PasswordFieldModel",
438
+ "NumberFieldModel",
439
+ "PercentFieldModel",
440
+ "DateTimeNoTzFieldModel",
441
+ "DateOnlyFieldModel",
442
+ "DateTimeTzFieldModel",
443
+ "TimeFieldModel",
444
+ "CollectionSelectorFieldModel",
445
+ "RichTextFieldModel",
446
+ "InputFieldModel"
447
+ ]);
448
+ const DISPLAY_FIELD_USE_SET = /* @__PURE__ */ new Set([
449
+ ...JS_DISPLAY_FIELD_USE_SET,
450
+ "DisplaySubItemFieldModel",
451
+ "DisplaySubTableFieldModel",
452
+ "DisplayHtmlFieldModel",
453
+ "DisplayNumberFieldModel",
454
+ "DisplayJSONFieldModel",
455
+ "DisplayEnumFieldModel",
456
+ "DisplayIconFieldModel",
457
+ "DisplayCheckboxFieldModel",
458
+ "DisplayPasswordFieldModel",
459
+ "DisplayPercentFieldModel",
460
+ "DisplayDateTimeFieldModel",
461
+ "DisplayTextFieldModel",
462
+ "DisplayURLFieldModel",
463
+ "DisplayColorFieldModel",
464
+ "DisplayTimeFieldModel"
465
+ ]);
466
+ const FILTER_FIELD_USE_SET = /* @__PURE__ */ new Set([
467
+ "FilterFormRecordSelectFieldModel",
468
+ "DateOnlyFilterFieldModel",
469
+ "DateTimeNoTzFilterFieldModel",
470
+ "DateTimeTzFilterFieldModel",
471
+ "SelectFieldModel",
472
+ "NumberFieldModel",
473
+ "TimeFieldModel",
474
+ "PercentFieldModel",
475
+ "InputFieldModel"
476
+ ]);
477
+ const APPROVAL_DETAILS_FIELD_COMPONENT_WRAPPER_USE_SET = /* @__PURE__ */ new Set([
478
+ "ApprovalDetailsItemModel",
479
+ "ApplyTaskCardDetailsItemModel",
480
+ "ApprovalTaskCardDetailsItemModel"
481
+ ]);
482
+ const SINGLE_VALUE_ASSOCIATION_INTERFACES = /* @__PURE__ */ new Set(["m2o", "o2o", "oho", "obo", "updatedBy", "createdBy"]);
483
+ const KNOWN_FIELD_NODE_USES = /* @__PURE__ */ new Set([
484
+ ...EDITABLE_FIELD_USE_SET,
485
+ ...DISPLAY_FIELD_USE_SET,
486
+ ...FILTER_FIELD_USE_SET,
487
+ ...REGISTERED_EDITABLE_FIELD_USE_SET,
488
+ ...REGISTERED_DISPLAY_FIELD_USE_SET,
489
+ ...REGISTERED_FILTER_FIELD_USE_SET
490
+ ]);
491
+ function keyedDomain(allowedKeys, mergeStrategy = "deep", pathSchemas) {
492
+ return {
493
+ allowedKeys,
494
+ mergeStrategy,
495
+ pathSchemas,
496
+ schema: {
497
+ type: "object",
498
+ properties: Object.fromEntries(allowedKeys.map((key) => [key, (pathSchemas == null ? void 0 : pathSchemas[key]) || ANY_VALUE_SCHEMA])),
499
+ additionalProperties: false
500
+ }
501
+ };
502
+ }
503
+ function wildcardDomain(mergeStrategy = "deep") {
504
+ return {
505
+ allowedKeys: ["*"],
506
+ wildcard: true,
507
+ mergeStrategy,
508
+ schema: {
509
+ type: "object",
510
+ additionalProperties: true
511
+ }
512
+ };
513
+ }
514
+ function pathListToSchema(paths, pathSchemas) {
515
+ const root = {
516
+ type: "object",
517
+ properties: {},
518
+ additionalProperties: false
519
+ };
520
+ for (const path of paths) {
521
+ if (path === "*") {
522
+ root.additionalProperties = true;
523
+ continue;
524
+ }
525
+ const segments = path.split(".").filter(Boolean);
526
+ let cursor = root;
527
+ for (let index = 0; index < segments.length; index += 1) {
528
+ const segment = segments[index];
529
+ if (segment === "*") {
530
+ cursor.additionalProperties = true;
531
+ break;
532
+ }
533
+ cursor.properties ||= {};
534
+ if (index === segments.length - 1) {
535
+ const fullPath = segments.slice(0, index + 1).join(".");
536
+ cursor.properties[segment] = (pathSchemas == null ? void 0 : pathSchemas[fullPath]) || ANY_VALUE_SCHEMA;
537
+ continue;
538
+ }
539
+ cursor.properties[segment] ||= {
540
+ type: "object",
541
+ properties: {},
542
+ additionalProperties: false
543
+ };
544
+ cursor = cursor.properties[segment];
545
+ }
546
+ }
547
+ return root;
548
+ }
549
+ function groupedDomain(groups, mergeStrategy = "deep") {
550
+ const normalizedGroups = Object.fromEntries(
551
+ Object.entries(groups).map(([key, definition]) => [
552
+ key,
553
+ {
554
+ allowedPaths: definition.allowedPaths,
555
+ clearable: definition.clearable,
556
+ mergeStrategy: definition.mergeStrategy || mergeStrategy,
557
+ schema: definition.schema || pathListToSchema(definition.allowedPaths, definition.pathSchemas),
558
+ eventBindingSteps: definition.eventBindingSteps,
559
+ pathSchemas: definition.pathSchemas
560
+ }
561
+ ])
562
+ );
563
+ return {
564
+ allowedKeys: Object.keys(normalizedGroups),
565
+ mergeStrategy,
566
+ groups: normalizedGroups,
567
+ schema: {
568
+ type: "object",
569
+ properties: Object.fromEntries(
570
+ Object.entries(normalizedGroups).map(([key, definition]) => [key, definition.schema])
571
+ ),
572
+ additionalProperties: false
573
+ }
574
+ };
575
+ }
576
+ function buildSettingsSchema(contract) {
577
+ return Object.fromEntries(
578
+ Object.entries(contract.domains).map(([domain, definition]) => [
579
+ domain,
580
+ {
581
+ ...definition == null ? void 0 : definition.schema,
582
+ "x-allowedKeys": (definition == null ? void 0 : definition.allowedKeys) || [],
583
+ "x-wildcard": !!(definition == null ? void 0 : definition.wildcard),
584
+ "x-mergeStrategy": (definition == null ? void 0 : definition.mergeStrategy) || "deep",
585
+ "x-pathSchemas": definition == null ? void 0 : definition.pathSchemas,
586
+ "x-groups": (definition == null ? void 0 : definition.groups) ? Object.fromEntries(
587
+ Object.entries(definition.groups).map(([groupKey, group]) => [
588
+ groupKey,
589
+ {
590
+ allowedPaths: group.allowedPaths,
591
+ clearable: !!group.clearable,
592
+ mergeStrategy: group.mergeStrategy,
593
+ eventBindingSteps: group.eventBindingSteps,
594
+ pathSchemas: group.pathSchemas
595
+ }
596
+ ])
597
+ ) : void 0
598
+ }
599
+ ])
600
+ );
601
+ }
602
+ function createContract(options) {
603
+ const editableDomains = options.editableDomains || [];
604
+ const domains = {};
605
+ if (editableDomains.includes("props")) {
606
+ domains.props = keyedDomain(options.props || []);
607
+ }
608
+ if (editableDomains.includes("decoratorProps")) {
609
+ domains.decoratorProps = keyedDomain(options.decoratorProps || []);
610
+ }
611
+ if (editableDomains.includes("stepParams")) {
612
+ domains.stepParams = keyedDomain(options.stepParams || []);
613
+ }
614
+ if (editableDomains.includes("flowRegistry")) {
615
+ domains.flowRegistry = wildcardDomain();
616
+ }
617
+ return {
618
+ editableDomains,
619
+ domains,
620
+ eventCapabilities: options.eventCapabilities,
621
+ layoutCapabilities: options.layoutCapabilities,
622
+ eventBindings: options.eventBindings
623
+ };
624
+ }
625
+ const READONLY_NODE_CONTRACT = {
626
+ editableDomains: [],
627
+ domains: {}
628
+ };
629
+ const GRID_NODE_CONTRACT = createContract({
630
+ editableDomains: ["props", "flowRegistry"],
631
+ props: ["rows", "sizes", "rowOrder"],
632
+ flowRegistry: true,
633
+ layoutCapabilities: GRID_LAYOUT_CAPABILITIES,
634
+ eventCapabilities: {
635
+ direct: DEFAULT_DIRECT_EVENTS
636
+ }
637
+ });
638
+ GRID_NODE_CONTRACT.domains.props = keyedDomain(["rows", "sizes", "rowOrder"], "replace");
639
+ const FORM_GRID_NODE_CONTRACT = createContract({
640
+ editableDomains: ["props", "stepParams", "flowRegistry"],
641
+ props: ["rows", "sizes", "rowOrder"],
642
+ stepParams: ["formModelSettings", "eventSettings"],
643
+ flowRegistry: true,
644
+ layoutCapabilities: GRID_LAYOUT_CAPABILITIES,
645
+ eventCapabilities: {
646
+ direct: DEFAULT_DIRECT_EVENTS
647
+ },
648
+ eventBindings: {
649
+ formModelSettings: {
650
+ stepKeys: ["layout", "assignRules"]
651
+ },
652
+ eventSettings: {
653
+ stepKeys: ["linkageRules"]
654
+ }
655
+ }
656
+ });
657
+ FORM_GRID_NODE_CONTRACT.domains.props = keyedDomain(["rows", "sizes", "rowOrder"], "replace");
658
+ FORM_GRID_NODE_CONTRACT.domains.stepParams = groupedDomain({
659
+ formModelSettings: FORM_MODEL_SETTINGS_GROUP,
660
+ eventSettings: EVENT_SETTINGS_GROUP
661
+ });
662
+ const PAGE_NODE_CONTRACT = createContract({
663
+ editableDomains: ["props", "stepParams", "flowRegistry"],
664
+ props: ["title", "displayTitle", "enableTabs", "icon", "enableHeader"],
665
+ stepParams: ["pageSettings"],
666
+ flowRegistry: true,
667
+ eventCapabilities: {
668
+ direct: DEFAULT_DIRECT_EVENTS
669
+ },
670
+ eventBindings: {
671
+ pageSettings: {
672
+ stepKeys: ["general"]
673
+ }
674
+ }
675
+ });
676
+ PAGE_NODE_CONTRACT.domains.stepParams = groupedDomain({
677
+ pageSettings: {
678
+ allowedPaths: [
679
+ "general.title",
680
+ "general.documentTitle",
681
+ "general.displayTitle",
682
+ "general.enableTabs",
683
+ "general.icon",
684
+ "general.enableHeader"
685
+ ],
686
+ mergeStrategy: "deep",
687
+ eventBindingSteps: ["general"],
688
+ pathSchemas: {
689
+ "general.title": STRING_SCHEMA,
690
+ "general.documentTitle": STRING_SCHEMA,
691
+ "general.displayTitle": BOOLEAN_SCHEMA,
692
+ "general.enableTabs": BOOLEAN_SCHEMA,
693
+ "general.icon": STRING_SCHEMA,
694
+ "general.enableHeader": BOOLEAN_SCHEMA
695
+ }
696
+ }
697
+ });
698
+ const TRIGGER_CHILD_PAGE_NODE_CONTRACT = createContract({
699
+ editableDomains: ["props", "stepParams", "flowRegistry"],
700
+ props: ["title", "displayTitle", "enableTabs", "icon", "enableHeader"],
701
+ stepParams: ["pageSettings", "TriggerChildPageSettings"],
702
+ flowRegistry: true,
703
+ eventCapabilities: {
704
+ direct: DEFAULT_DIRECT_EVENTS
705
+ },
706
+ eventBindings: {
707
+ pageSettings: {
708
+ stepKeys: ["general"]
709
+ }
710
+ }
711
+ });
712
+ TRIGGER_CHILD_PAGE_NODE_CONTRACT.domains.stepParams = groupedDomain({
713
+ pageSettings: {
714
+ allowedPaths: [
715
+ "general.title",
716
+ "general.documentTitle",
717
+ "general.displayTitle",
718
+ "general.enableTabs",
719
+ "general.icon",
720
+ "general.enableHeader"
721
+ ],
722
+ mergeStrategy: "deep",
723
+ eventBindingSteps: ["general"],
724
+ pathSchemas: {
725
+ "general.title": STRING_SCHEMA,
726
+ "general.documentTitle": STRING_SCHEMA,
727
+ "general.displayTitle": BOOLEAN_SCHEMA,
728
+ "general.enableTabs": BOOLEAN_SCHEMA,
729
+ "general.icon": STRING_SCHEMA,
730
+ "general.enableHeader": BOOLEAN_SCHEMA
731
+ }
732
+ },
733
+ TriggerChildPageSettings: RESOURCE_SETTINGS_GROUP
734
+ });
735
+ const APPROVAL_CHILD_PAGE_NODE_CONTRACT = createContract({
736
+ editableDomains: ["props", "stepParams", "flowRegistry"],
737
+ props: ["title", "displayTitle", "enableTabs", "icon", "enableHeader"],
738
+ stepParams: ["pageSettings", "ApprovalChildPageSettings", "resourceSettings"],
739
+ flowRegistry: true,
740
+ eventCapabilities: {
741
+ direct: DEFAULT_DIRECT_EVENTS
742
+ },
743
+ eventBindings: {
744
+ pageSettings: {
745
+ stepKeys: ["general"]
746
+ }
747
+ }
748
+ });
749
+ APPROVAL_CHILD_PAGE_NODE_CONTRACT.domains.stepParams = groupedDomain({
750
+ pageSettings: {
751
+ allowedPaths: [
752
+ "general.title",
753
+ "general.documentTitle",
754
+ "general.displayTitle",
755
+ "general.enableTabs",
756
+ "general.icon",
757
+ "general.enableHeader"
758
+ ],
759
+ mergeStrategy: "deep",
760
+ eventBindingSteps: ["general"],
761
+ pathSchemas: {
762
+ "general.title": STRING_SCHEMA,
763
+ "general.documentTitle": STRING_SCHEMA,
764
+ "general.displayTitle": BOOLEAN_SCHEMA,
765
+ "general.enableTabs": BOOLEAN_SCHEMA,
766
+ "general.icon": STRING_SCHEMA,
767
+ "general.enableHeader": BOOLEAN_SCHEMA
768
+ }
769
+ },
770
+ ApprovalChildPageSettings: RESOURCE_SETTINGS_GROUP,
771
+ resourceSettings: RESOURCE_SETTINGS_GROUP
772
+ });
773
+ const TAB_NODE_CONTRACT = createContract({
774
+ editableDomains: ["props", "stepParams", "flowRegistry"],
775
+ props: ["title", "icon"],
776
+ stepParams: ["pageTabSettings"],
777
+ flowRegistry: true,
778
+ eventCapabilities: {
779
+ direct: DEFAULT_DIRECT_EVENTS
780
+ },
781
+ eventBindings: {
782
+ pageTabSettings: {
783
+ stepKeys: ["tab"]
784
+ }
785
+ }
786
+ });
787
+ TAB_NODE_CONTRACT.domains.stepParams = groupedDomain({
788
+ pageTabSettings: {
789
+ allowedPaths: ["tab.title", "tab.icon", "tab.documentTitle"],
790
+ mergeStrategy: "deep",
791
+ eventBindingSteps: ["tab"],
792
+ pathSchemas: {
793
+ "tab.title": STRING_SCHEMA,
794
+ "tab.icon": STRING_SCHEMA,
795
+ "tab.documentTitle": STRING_SCHEMA
796
+ }
797
+ }
798
+ });
799
+ const TABLE_BLOCK_CONTRACT = createContract({
800
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
801
+ props: ["height", "heightMode"],
802
+ decoratorProps: ["height", "heightMode"],
803
+ stepParams: ["resourceSettings", "tableSettings", "cardSettings"],
804
+ flowRegistry: true,
805
+ eventCapabilities: {
806
+ direct: ["beforeRender", "paginationChange"],
807
+ object: ["click"]
808
+ }
809
+ });
810
+ TABLE_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
811
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
812
+ tableSettings: TABLE_SETTINGS_GROUP,
813
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
814
+ });
815
+ const FORM_BLOCK_CONTRACT = createContract({
816
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
817
+ props: ["labelWidth", "labelWrap"],
818
+ decoratorProps: ["labelWidth", "labelWrap"],
819
+ stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "cardSettings"],
820
+ flowRegistry: true,
821
+ eventCapabilities: {
822
+ direct: DEFAULT_DIRECT_EVENTS,
823
+ object: ["submit"]
824
+ }
825
+ });
826
+ FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
827
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
828
+ formModelSettings: FORM_MODEL_SETTINGS_GROUP,
829
+ eventSettings: EVENT_SETTINGS_GROUP,
830
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
831
+ });
832
+ const CREATE_FORM_BLOCK_CONTRACT = createContract({
833
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
834
+ props: ["labelWidth", "labelWrap"],
835
+ decoratorProps: ["labelWidth", "labelWrap"],
836
+ stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "formSettings", "cardSettings"],
837
+ flowRegistry: true,
838
+ eventCapabilities: {
839
+ direct: DEFAULT_DIRECT_EVENTS,
840
+ object: ["submit"]
841
+ }
842
+ });
843
+ CREATE_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
844
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
845
+ formModelSettings: FORM_MODEL_SETTINGS_GROUP,
846
+ eventSettings: EVENT_SETTINGS_GROUP,
847
+ formSettings: CREATE_FORM_SETTINGS_EVENT_ONLY_GROUP,
848
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
849
+ });
850
+ const EDIT_FORM_BLOCK_CONTRACT = createContract({
851
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
852
+ props: ["labelWidth", "labelWrap"],
853
+ decoratorProps: ["labelWidth", "labelWrap"],
854
+ stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "formSettings", "cardSettings"],
855
+ flowRegistry: true,
856
+ eventCapabilities: {
857
+ direct: DEFAULT_DIRECT_EVENTS,
858
+ object: ["submit"]
859
+ }
860
+ });
861
+ EDIT_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
862
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
863
+ formModelSettings: FORM_MODEL_SETTINGS_GROUP,
864
+ eventSettings: EVENT_SETTINGS_GROUP,
865
+ formSettings: EDIT_FORM_SETTINGS_GROUP,
866
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
867
+ });
868
+ const DETAILS_BLOCK_CONTRACT = createContract({
869
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
870
+ props: ["labelWidth", "labelWrap"],
871
+ decoratorProps: ["labelWidth", "labelWrap"],
872
+ stepParams: ["resourceSettings", "detailsSettings", "cardSettings"],
873
+ flowRegistry: true,
874
+ eventCapabilities: {
875
+ direct: DEFAULT_DIRECT_EVENTS,
876
+ object: ["click"]
877
+ }
878
+ });
879
+ DETAILS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
880
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
881
+ detailsSettings: DETAILS_SETTINGS_GROUP,
882
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
883
+ });
884
+ const FILTER_FORM_BLOCK_CONTRACT = createContract({
885
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
886
+ props: ["title", "displayTitle", "labelWidth", "labelWrap"],
887
+ decoratorProps: ["labelWidth", "labelWrap"],
888
+ stepParams: ["resourceSettings", "formFilterBlockModelSettings"],
889
+ flowRegistry: true,
890
+ eventCapabilities: {
891
+ direct: DEFAULT_DIRECT_EVENTS,
892
+ object: ["submit"]
893
+ }
894
+ });
895
+ FILTER_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
896
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
897
+ formFilterBlockModelSettings: FILTER_FORM_BLOCK_SETTINGS_GROUP
898
+ });
899
+ const CALENDAR_BLOCK_CONTRACT = createContract({
900
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
901
+ props: [
902
+ "fieldNames",
903
+ "defaultView",
904
+ "enableQuickCreateEvent",
905
+ "showLunar",
906
+ "weekStart",
907
+ "quickCreatePopupSettings",
908
+ "eventPopupSettings"
909
+ ],
910
+ decoratorProps: ["height", "heightMode"],
911
+ stepParams: ["resourceSettings", "calendarSettings", "cardSettings"],
912
+ flowRegistry: true,
913
+ eventCapabilities: {
914
+ direct: DEFAULT_DIRECT_EVENTS,
915
+ object: ["click"]
916
+ }
917
+ });
918
+ CALENDAR_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
919
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
920
+ calendarSettings: CALENDAR_SETTINGS_GROUP,
921
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
922
+ });
923
+ const KANBAN_BLOCK_CONTRACT = createContract({
924
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
925
+ props: [
926
+ "groupField",
927
+ "groupTitleField",
928
+ "groupColorField",
929
+ "groupOptions",
930
+ "styleVariant",
931
+ "sortField",
932
+ "globalSort",
933
+ "dragEnabled",
934
+ "dragSortBy",
935
+ "quickCreateEnabled",
936
+ "popupMode",
937
+ "popupSize",
938
+ "popupTemplateUid",
939
+ "popupPageModelClass",
940
+ "popupTargetUid",
941
+ "pageSize",
942
+ "columnWidth"
943
+ ],
944
+ decoratorProps: ["height", "heightMode"],
945
+ stepParams: ["resourceSettings", "kanbanSettings", "cardSettings"],
946
+ flowRegistry: true,
947
+ eventCapabilities: {
948
+ direct: DEFAULT_DIRECT_EVENTS,
949
+ object: ["click"]
950
+ }
951
+ });
952
+ KANBAN_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
953
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
954
+ kanbanSettings: KANBAN_SETTINGS_GROUP,
955
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
956
+ });
957
+ const LIST_BLOCK_CONTRACT = createContract({
958
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
959
+ props: [],
960
+ decoratorProps: ["height", "heightMode"],
961
+ stepParams: ["resourceSettings", "listSettings", "cardSettings"],
962
+ flowRegistry: true,
963
+ eventCapabilities: {
964
+ direct: DEFAULT_DIRECT_EVENTS,
965
+ object: ["click"]
966
+ }
967
+ });
968
+ LIST_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
969
+ resourceSettings: {
970
+ allowedPaths: [
971
+ "init.dataSourceKey",
972
+ "init.collectionName",
973
+ "init.associationName",
974
+ "init.associationPathName",
975
+ "init.sourceId",
976
+ "init.filterByTk"
977
+ ],
978
+ eventBindingSteps: [],
979
+ pathSchemas: {
980
+ "init.dataSourceKey": STRING_SCHEMA,
981
+ "init.collectionName": STRING_SCHEMA,
982
+ "init.associationName": STRING_SCHEMA,
983
+ "init.associationPathName": STRING_SCHEMA
984
+ }
985
+ },
986
+ listSettings: {
987
+ allowedPaths: ["pageSize.pageSize", "dataScope.filter", "defaultSorting.*", "layout.*", "refreshData.*"],
988
+ eventBindingSteps: [],
989
+ pathSchemas: {
990
+ "pageSize.pageSize": NUMBER_SCHEMA,
991
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
992
+ "layout.layout": STRING_SCHEMA
993
+ }
994
+ },
995
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
996
+ });
997
+ const GRID_CARD_BLOCK_CONTRACT = createContract({
998
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
999
+ props: [],
1000
+ decoratorProps: ["height", "heightMode"],
1001
+ stepParams: ["resourceSettings", "GridCardSettings", "cardSettings"],
1002
+ flowRegistry: true,
1003
+ eventCapabilities: {
1004
+ direct: DEFAULT_DIRECT_EVENTS,
1005
+ object: ["click"]
1006
+ }
1007
+ });
1008
+ GRID_CARD_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1009
+ resourceSettings: {
1010
+ allowedPaths: [
1011
+ "init.dataSourceKey",
1012
+ "init.collectionName",
1013
+ "init.associationName",
1014
+ "init.associationPathName",
1015
+ "init.sourceId",
1016
+ "init.filterByTk"
1017
+ ],
1018
+ eventBindingSteps: [],
1019
+ pathSchemas: {
1020
+ "init.dataSourceKey": STRING_SCHEMA,
1021
+ "init.collectionName": STRING_SCHEMA,
1022
+ "init.associationName": STRING_SCHEMA,
1023
+ "init.associationPathName": STRING_SCHEMA
1024
+ }
1025
+ },
1026
+ GridCardSettings: {
1027
+ allowedPaths: [
1028
+ "columnCount.columnCount.xs",
1029
+ "columnCount.columnCount.sm",
1030
+ "columnCount.columnCount.md",
1031
+ "columnCount.columnCount.lg",
1032
+ "columnCount.columnCount.xl",
1033
+ "columnCount.columnCount.xxl",
1034
+ "rowCount.rowCount",
1035
+ "dataScope.filter",
1036
+ "defaultSorting.*",
1037
+ "layout.*"
1038
+ ],
1039
+ eventBindingSteps: [],
1040
+ pathSchemas: {
1041
+ "columnCount.columnCount.xs": NUMBER_SCHEMA,
1042
+ "columnCount.columnCount.sm": NUMBER_SCHEMA,
1043
+ "columnCount.columnCount.md": NUMBER_SCHEMA,
1044
+ "columnCount.columnCount.lg": NUMBER_SCHEMA,
1045
+ "columnCount.columnCount.xl": NUMBER_SCHEMA,
1046
+ "columnCount.columnCount.xxl": NUMBER_SCHEMA,
1047
+ "rowCount.rowCount": NUMBER_SCHEMA,
1048
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
1049
+ "layout.layout": STRING_SCHEMA
1050
+ }
1051
+ },
1052
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
1053
+ });
1054
+ const KANBAN_CARD_ITEM_CONTRACT = createContract({
1055
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1056
+ props: [
1057
+ "enableCardClick",
1058
+ "openMode",
1059
+ "popupSize",
1060
+ "popupTemplateUid",
1061
+ "pageModelClass",
1062
+ "popupTargetUid",
1063
+ "layout",
1064
+ "labelAlign",
1065
+ "labelWidth",
1066
+ "labelWrap",
1067
+ "colon"
1068
+ ],
1069
+ stepParams: ["cardSettings"],
1070
+ flowRegistry: true,
1071
+ eventCapabilities: {
1072
+ direct: DEFAULT_DIRECT_EVENTS,
1073
+ object: ["click"]
1074
+ }
1075
+ });
1076
+ KANBAN_CARD_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1077
+ cardSettings: {
1078
+ allowedPaths: [
1079
+ "click.enableCardClick",
1080
+ "popup.mode",
1081
+ "popup.size",
1082
+ "popup.popupTemplateUid",
1083
+ "popup.pageModelClass",
1084
+ "popup.uid",
1085
+ "layout.layout",
1086
+ "layout.labelAlign",
1087
+ "layout.labelWidth",
1088
+ "layout.labelWrap",
1089
+ "layout.colon"
1090
+ ],
1091
+ clearable: true,
1092
+ mergeStrategy: "deep",
1093
+ eventBindingSteps: ["click", "popup", "layout"],
1094
+ pathSchemas: {
1095
+ "click.enableCardClick": BOOLEAN_SCHEMA,
1096
+ "popup.mode": STRING_SCHEMA,
1097
+ "popup.size": STRING_SCHEMA,
1098
+ "popup.popupTemplateUid": NULLABLE_STRING_SCHEMA,
1099
+ "popup.pageModelClass": NULLABLE_STRING_SCHEMA,
1100
+ "popup.uid": NULLABLE_STRING_SCHEMA,
1101
+ "layout.layout": STRING_SCHEMA,
1102
+ "layout.labelAlign": STRING_SCHEMA,
1103
+ "layout.labelWidth": NULLABLE_NUMBER_OR_STRING_SCHEMA,
1104
+ "layout.labelWrap": BOOLEAN_SCHEMA,
1105
+ "layout.colon": BOOLEAN_SCHEMA
1106
+ }
1107
+ }
1108
+ });
1109
+ const MARKDOWN_BLOCK_CONTRACT = createContract({
1110
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1111
+ props: ["content", "value"],
1112
+ stepParams: ["markdownBlockSettings", "cardSettings"],
1113
+ flowRegistry: true,
1114
+ eventCapabilities: {
1115
+ direct: DEFAULT_DIRECT_EVENTS
1116
+ }
1117
+ });
1118
+ MARKDOWN_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1119
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
1120
+ markdownBlockSettings: {
1121
+ allowedPaths: ["editMarkdown.content"],
1122
+ clearable: true,
1123
+ eventBindingSteps: [],
1124
+ pathSchemas: {
1125
+ "editMarkdown.content": STRING_SCHEMA
1126
+ }
1127
+ }
1128
+ });
1129
+ const IFRAME_BLOCK_CONTRACT = createContract({
1130
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1131
+ props: ["url", "height", "heightMode", "mode", "html", "params", "allow", "htmlId"],
1132
+ stepParams: ["iframeBlockSettings", "cardSettings"],
1133
+ flowRegistry: true,
1134
+ eventCapabilities: {
1135
+ direct: DEFAULT_DIRECT_EVENTS
1136
+ }
1137
+ });
1138
+ IFRAME_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1139
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
1140
+ iframeBlockSettings: {
1141
+ allowedPaths: [
1142
+ "editIframe.mode",
1143
+ "editIframe.url",
1144
+ "editIframe.html",
1145
+ "editIframe.params",
1146
+ "editIframe.allow",
1147
+ "editIframe.htmlId",
1148
+ "editIframe.height"
1149
+ ],
1150
+ clearable: true,
1151
+ eventBindingSteps: [],
1152
+ pathSchemas: {
1153
+ "editIframe.mode": STRING_SCHEMA,
1154
+ "editIframe.url": STRING_SCHEMA,
1155
+ "editIframe.html": STRING_SCHEMA,
1156
+ "editIframe.params": ARRAY_SCHEMA,
1157
+ "editIframe.allow": STRING_SCHEMA,
1158
+ "editIframe.htmlId": STRING_SCHEMA,
1159
+ "editIframe.height": NUMBER_SCHEMA
1160
+ }
1161
+ }
1162
+ });
1163
+ const CHART_CARD_SETTINGS_GROUP = {
1164
+ allowedPaths: [
1165
+ "titleDescription.title",
1166
+ "titleDescription.description",
1167
+ "blockHeight.heightMode",
1168
+ "blockHeight.height",
1169
+ "linkageRules"
1170
+ ],
1171
+ clearable: true,
1172
+ mergeStrategy: "deep",
1173
+ eventBindingSteps: ["titleDescription", "blockHeight", "linkageRules"],
1174
+ pathSchemas: {
1175
+ "titleDescription.title": STRING_SCHEMA,
1176
+ "titleDescription.description": STRING_SCHEMA,
1177
+ "blockHeight.heightMode": STRING_SCHEMA,
1178
+ "blockHeight.height": NUMBER_SCHEMA,
1179
+ linkageRules: ARRAY_SCHEMA
1180
+ }
1181
+ };
1182
+ const CHART_BLOCK_CONTRACT = createContract({
1183
+ editableDomains: ["stepParams", "flowRegistry"],
1184
+ stepParams: ["cardSettings", "chartSettings"],
1185
+ flowRegistry: true,
1186
+ eventCapabilities: {
1187
+ direct: DEFAULT_DIRECT_EVENTS
1188
+ }
1189
+ });
1190
+ CHART_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1191
+ cardSettings: CHART_CARD_SETTINGS_GROUP,
1192
+ chartSettings: {
1193
+ allowedPaths: ["configure", "configure.*"],
1194
+ clearable: true,
1195
+ mergeStrategy: "replace",
1196
+ eventBindingSteps: [],
1197
+ pathSchemas: {
1198
+ configure: OBJECT_SCHEMA
1199
+ }
1200
+ }
1201
+ });
1202
+ const ACTION_PANEL_BLOCK_CONTRACT = createContract({
1203
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1204
+ props: ["layout", "ellipsis"],
1205
+ stepParams: ["actionPanelBlockSetting", "cardSettings"],
1206
+ flowRegistry: true,
1207
+ eventCapabilities: {
1208
+ direct: DEFAULT_DIRECT_EVENTS
1209
+ }
1210
+ });
1211
+ ACTION_PANEL_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1212
+ actionPanelBlockSetting: {
1213
+ allowedPaths: ["layout.layout", "ellipsis.ellipsis"],
1214
+ eventBindingSteps: [],
1215
+ pathSchemas: {
1216
+ "layout.layout": STRING_SCHEMA,
1217
+ "ellipsis.ellipsis": BOOLEAN_SCHEMA
1218
+ }
1219
+ },
1220
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
1221
+ });
1222
+ const JS_BLOCK_CONTRACT = createContract({
1223
+ editableDomains: ["decoratorProps", "stepParams", "flowRegistry"],
1224
+ decoratorProps: ["title", "description", "className"],
1225
+ stepParams: ["jsSettings"],
1226
+ flowRegistry: true,
1227
+ eventCapabilities: {
1228
+ direct: DEFAULT_DIRECT_EVENTS
1229
+ },
1230
+ eventBindings: {
1231
+ jsSettings: {
1232
+ stepKeys: ["runJs"]
1233
+ }
1234
+ }
1235
+ });
1236
+ JS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1237
+ jsSettings: RUN_JS_SETTINGS_GROUP
1238
+ });
1239
+ const MAP_BLOCK_CONTRACT = createContract({
1240
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1241
+ props: ["height", "heightMode", "mapField", "marker", "lineSort", "zoom"],
1242
+ decoratorProps: ["height", "heightMode"],
1243
+ stepParams: ["resourceSettings", "createMapBlock", "cardSettings"],
1244
+ flowRegistry: true,
1245
+ eventCapabilities: {
1246
+ direct: DEFAULT_DIRECT_EVENTS,
1247
+ object: ["click"]
1248
+ }
1249
+ });
1250
+ MAP_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1251
+ resourceSettings: {
1252
+ allowedPaths: [
1253
+ "init.dataSourceKey",
1254
+ "init.collectionName",
1255
+ "init.associationName",
1256
+ "init.associationPathName",
1257
+ "init.sourceId",
1258
+ "init.filterByTk"
1259
+ ],
1260
+ eventBindingSteps: [],
1261
+ pathSchemas: {
1262
+ "init.dataSourceKey": STRING_SCHEMA,
1263
+ "init.collectionName": STRING_SCHEMA,
1264
+ "init.associationName": STRING_SCHEMA,
1265
+ "init.associationPathName": STRING_SCHEMA
1266
+ }
1267
+ },
1268
+ createMapBlock: {
1269
+ allowedPaths: ["init.mapField", "init.marker", "addAppends.*", "dataScope.filter", "lineSort.sort", "mapZoom.zoom"],
1270
+ eventBindingSteps: [],
1271
+ pathSchemas: {
1272
+ "init.mapField": ARRAY_SCHEMA,
1273
+ "init.marker": STRING_SCHEMA,
1274
+ "dataScope.filter": FILTER_GROUP_SCHEMA,
1275
+ "lineSort.sort": ARRAY_SCHEMA,
1276
+ "mapZoom.zoom": NUMBER_SCHEMA
1277
+ }
1278
+ },
1279
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP
1280
+ });
1281
+ const COMMENTS_BLOCK_CONTRACT = createContract({
1282
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1283
+ props: [],
1284
+ stepParams: ["resourceSettings", "commentsSettings", "cardSettings"],
1285
+ flowRegistry: true,
1286
+ eventCapabilities: {
1287
+ direct: DEFAULT_DIRECT_EVENTS,
1288
+ object: ["click"]
1289
+ }
1290
+ });
1291
+ COMMENTS_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
1292
+ resourceSettings: {
1293
+ allowedPaths: [
1294
+ "init.dataSourceKey",
1295
+ "init.collectionName",
1296
+ "init.associationName",
1297
+ "init.associationPathName",
1298
+ "init.sourceId",
1299
+ "init.filterByTk"
1300
+ ],
1301
+ eventBindingSteps: [],
1302
+ pathSchemas: {
1303
+ "init.dataSourceKey": STRING_SCHEMA,
1304
+ "init.collectionName": STRING_SCHEMA,
1305
+ "init.associationName": STRING_SCHEMA,
1306
+ "init.associationPathName": STRING_SCHEMA
1307
+ }
1308
+ },
1309
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
1310
+ commentsSettings: {
1311
+ allowedPaths: ["pageSize.pageSize", "dataScope.filter"],
1312
+ clearable: true,
1313
+ eventBindingSteps: [],
1314
+ pathSchemas: {
1315
+ "pageSize.pageSize": NUMBER_SCHEMA,
1316
+ "dataScope.filter": FILTER_GROUP_SCHEMA
1317
+ }
1318
+ }
1319
+ });
1320
+ const ACTION_COLUMN_CONTRACT = createContract({
1321
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1322
+ props: ["title", "tooltip", "width", "fixed"],
1323
+ stepParams: ["tableColumnSettings"],
1324
+ flowRegistry: true,
1325
+ eventCapabilities: {
1326
+ direct: DEFAULT_DIRECT_EVENTS
1327
+ }
1328
+ });
1329
+ ACTION_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1330
+ tableColumnSettings: {
1331
+ allowedPaths: TABLE_COLUMN_ALLOWED_PATHS,
1332
+ mergeStrategy: "deep",
1333
+ pathSchemas: {
1334
+ "title.title": STRING_SCHEMA
1335
+ }
1336
+ }
1337
+ });
1338
+ const FORM_ITEM_CONTRACT = createContract({
1339
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1340
+ props: [
1341
+ "label",
1342
+ "showLabel",
1343
+ "tooltip",
1344
+ "extra",
1345
+ "initialValue",
1346
+ "titleField",
1347
+ "name",
1348
+ "rules",
1349
+ "aclDisabled",
1350
+ "aclCreateDisabled",
1351
+ "disabled",
1352
+ "required",
1353
+ "pattern",
1354
+ "multiple",
1355
+ "allowMultiple",
1356
+ "maxCount"
1357
+ ],
1358
+ decoratorProps: ["labelWidth", "labelWrap"],
1359
+ stepParams: ["fieldSettings", "editItemSettings"],
1360
+ flowRegistry: true,
1361
+ eventCapabilities: {
1362
+ direct: DEFAULT_DIRECT_EVENTS
1363
+ }
1364
+ });
1365
+ FORM_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1366
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1367
+ editItemSettings: {
1368
+ allowedPaths: ["model.use"],
1369
+ mergeStrategy: "deep",
1370
+ eventBindingSteps: ["model"],
1371
+ pathSchemas: {
1372
+ "model.use": STRING_SCHEMA
1373
+ }
1374
+ }
1375
+ });
1376
+ const DETAILS_ITEM_CONTRACT = createContract({
1377
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1378
+ props: ["label", "showLabel", "tooltip", "extra", "titleField", "pattern", "disabled"],
1379
+ decoratorProps: ["labelWidth", "labelWrap"],
1380
+ stepParams: ["fieldSettings", "detailItemSettings"],
1381
+ flowRegistry: true,
1382
+ eventCapabilities: {
1383
+ direct: DEFAULT_DIRECT_EVENTS
1384
+ }
1385
+ });
1386
+ DETAILS_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1387
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1388
+ detailItemSettings: {
1389
+ allowedPaths: ["model.use"],
1390
+ mergeStrategy: "deep",
1391
+ eventBindingSteps: ["model"],
1392
+ pathSchemas: {
1393
+ "model.use": STRING_SCHEMA
1394
+ }
1395
+ }
1396
+ });
1397
+ const FILTER_FORM_ITEM_CONTRACT = createContract({
1398
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1399
+ props: ["label", "showLabel", "tooltip", "extra", "initialValue", "name", "multiple", "allowMultiple", "maxCount"],
1400
+ decoratorProps: ["labelWidth", "labelWrap"],
1401
+ stepParams: ["fieldSettings", "filterFormItemSettings"],
1402
+ flowRegistry: true,
1403
+ eventCapabilities: {
1404
+ direct: DEFAULT_DIRECT_EVENTS
1405
+ }
1406
+ });
1407
+ FILTER_FORM_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1408
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1409
+ filterFormItemSettings: {
1410
+ allowedPaths: [...FILTER_FORM_ITEM_ALLOWED_PATHS, "model.use"],
1411
+ mergeStrategy: "deep",
1412
+ pathSchemas: {
1413
+ "init.defaultTargetUid": STRING_SCHEMA,
1414
+ "init.filterField.name": STRING_SCHEMA,
1415
+ "init.filterField.title": STRING_SCHEMA,
1416
+ "init.filterField.interface": STRING_SCHEMA,
1417
+ "init.filterField.type": STRING_SCHEMA,
1418
+ "model.use": STRING_SCHEMA
1419
+ }
1420
+ }
1421
+ });
1422
+ const TABLE_COLUMN_CONTRACT = createContract({
1423
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1424
+ props: ["title", "tooltip", "width", "fixed", "editable", "sorter", "dataIndex", "titleField"],
1425
+ stepParams: ["fieldSettings", "tableColumnSettings"],
1426
+ flowRegistry: true,
1427
+ eventCapabilities: {
1428
+ direct: DEFAULT_DIRECT_EVENTS
1429
+ }
1430
+ });
1431
+ TABLE_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1432
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1433
+ tableColumnSettings: {
1434
+ allowedPaths: [...TABLE_COLUMN_ALLOWED_PATHS, "model.use"],
1435
+ mergeStrategy: "deep",
1436
+ pathSchemas: {
1437
+ "title.title": STRING_SCHEMA,
1438
+ "model.use": STRING_SCHEMA
1439
+ }
1440
+ }
1441
+ });
1442
+ const JS_COLUMN_CONTRACT = createContract({
1443
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1444
+ props: ["title", "tooltip", "width", "fixed"],
1445
+ stepParams: ["tableColumnSettings", "jsSettings"],
1446
+ flowRegistry: true,
1447
+ eventCapabilities: {
1448
+ direct: DEFAULT_DIRECT_EVENTS
1449
+ },
1450
+ eventBindings: {
1451
+ jsSettings: {
1452
+ stepKeys: ["runJs"]
1453
+ }
1454
+ }
1455
+ });
1456
+ JS_COLUMN_CONTRACT.domains.stepParams = groupedDomain({
1457
+ tableColumnSettings: {
1458
+ allowedPaths: TABLE_COLUMN_ALLOWED_PATHS,
1459
+ mergeStrategy: "deep",
1460
+ pathSchemas: {
1461
+ "title.title": STRING_SCHEMA
1462
+ }
1463
+ },
1464
+ jsSettings: RUN_JS_SETTINGS_GROUP
1465
+ });
1466
+ const FIELD_NODE_CONTRACT = createContract({
1467
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1468
+ props: [
1469
+ "title",
1470
+ "icon",
1471
+ "titleField",
1472
+ "clickToOpen",
1473
+ "mode",
1474
+ "autoSize",
1475
+ "allowMultiple",
1476
+ "multiple",
1477
+ "quickCreate",
1478
+ "allowClear",
1479
+ "displayStyle",
1480
+ "options"
1481
+ ],
1482
+ decoratorProps: ["labelWidth", "labelWrap"],
1483
+ stepParams: ["fieldSettings", "displayFieldSettings", "popupSettings"],
1484
+ flowRegistry: true,
1485
+ eventCapabilities: {
1486
+ direct: ACTION_DIRECT_EVENTS,
1487
+ object: ACTION_OBJECT_EVENTS
1488
+ },
1489
+ eventBindings: {
1490
+ displayFieldSettings: {
1491
+ stepKeys: ["displayStyle", "clickToOpen"]
1492
+ },
1493
+ popupSettings: {
1494
+ stepKeys: ["openView"]
1495
+ }
1496
+ }
1497
+ });
1498
+ const JS_FIELD_NODE_CONTRACT = createContract({
1499
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1500
+ props: [
1501
+ "title",
1502
+ "icon",
1503
+ "titleField",
1504
+ "clickToOpen",
1505
+ "autoSize",
1506
+ "allowMultiple",
1507
+ "multiple",
1508
+ "quickCreate",
1509
+ "allowClear",
1510
+ "displayStyle",
1511
+ "options"
1512
+ ],
1513
+ decoratorProps: ["labelWidth", "labelWrap"],
1514
+ stepParams: ["fieldSettings", "displayFieldSettings", "popupSettings", "jsSettings"],
1515
+ flowRegistry: true,
1516
+ eventCapabilities: {
1517
+ direct: ACTION_DIRECT_EVENTS,
1518
+ object: ACTION_OBJECT_EVENTS
1519
+ },
1520
+ eventBindings: {
1521
+ displayFieldSettings: {
1522
+ stepKeys: ["displayStyle", "clickToOpen"]
1523
+ },
1524
+ popupSettings: {
1525
+ stepKeys: ["openView"]
1526
+ },
1527
+ jsSettings: {
1528
+ stepKeys: ["runJs"]
1529
+ }
1530
+ }
1531
+ });
1532
+ JS_FIELD_NODE_CONTRACT.domains.stepParams = groupedDomain({
1533
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1534
+ displayFieldSettings: {
1535
+ allowedPaths: ["displayStyle.displayStyle", "clickToOpen.clickToOpen"],
1536
+ clearable: true,
1537
+ mergeStrategy: "deep",
1538
+ eventBindingSteps: ["displayStyle", "clickToOpen"],
1539
+ pathSchemas: {
1540
+ "displayStyle.displayStyle": STRING_SCHEMA,
1541
+ "clickToOpen.clickToOpen": BOOLEAN_SCHEMA
1542
+ }
1543
+ },
1544
+ popupSettings: {
1545
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1546
+ clearable: true,
1547
+ mergeStrategy: "deep",
1548
+ eventBindingSteps: ["openView"],
1549
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1550
+ },
1551
+ jsSettings: RUN_JS_SETTINGS_GROUP
1552
+ });
1553
+ const JS_ITEM_CONTRACT = createContract({
1554
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1555
+ props: ["label", "showLabel", "tooltip", "extra"],
1556
+ decoratorProps: ["labelWidth", "labelWrap"],
1557
+ stepParams: ["jsSettings"],
1558
+ flowRegistry: true,
1559
+ eventCapabilities: {
1560
+ direct: DEFAULT_DIRECT_EVENTS
1561
+ },
1562
+ eventBindings: {
1563
+ jsSettings: {
1564
+ stepKeys: ["runJs"]
1565
+ }
1566
+ }
1567
+ });
1568
+ JS_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1569
+ jsSettings: RUN_JS_SETTINGS_GROUP
1570
+ });
1571
+ const DIVIDER_ITEM_CONTRACT = createContract({
1572
+ editableDomains: ["props", "stepParams"],
1573
+ props: ["label", "orientation", "dashed", "color", "borderColor"],
1574
+ stepParams: ["markdownItemSetting"],
1575
+ eventCapabilities: {
1576
+ direct: DEFAULT_DIRECT_EVENTS
1577
+ }
1578
+ });
1579
+ DIVIDER_ITEM_CONTRACT.domains.stepParams = groupedDomain({
1580
+ markdownItemSetting: {
1581
+ allowedPaths: ["title.label", "title.orientation", "title.dashed", "title.color", "title.borderColor"],
1582
+ mergeStrategy: "deep",
1583
+ eventBindingSteps: ["title"],
1584
+ pathSchemas: {
1585
+ "title.label": STRING_SCHEMA,
1586
+ "title.orientation": STRING_SCHEMA,
1587
+ "title.dashed": BOOLEAN_SCHEMA,
1588
+ "title.color": STRING_SCHEMA,
1589
+ "title.borderColor": STRING_SCHEMA
1590
+ }
1591
+ }
1592
+ });
1593
+ FIELD_NODE_CONTRACT.domains.stepParams = groupedDomain({
1594
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1595
+ displayFieldSettings: {
1596
+ allowedPaths: ["displayStyle.displayStyle", "clickToOpen.clickToOpen"],
1597
+ clearable: true,
1598
+ mergeStrategy: "deep",
1599
+ eventBindingSteps: ["displayStyle", "clickToOpen"],
1600
+ pathSchemas: {
1601
+ "displayStyle.displayStyle": STRING_SCHEMA,
1602
+ "clickToOpen.clickToOpen": BOOLEAN_SCHEMA
1603
+ }
1604
+ },
1605
+ popupSettings: {
1606
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1607
+ clearable: true,
1608
+ mergeStrategy: "deep",
1609
+ eventBindingSteps: ["openView"],
1610
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1611
+ }
1612
+ });
1613
+ const SUB_FORM_FIELD_NODE_CONTRACT = createContract({
1614
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1615
+ props: [
1616
+ "title",
1617
+ "icon",
1618
+ "titleField",
1619
+ "clickToOpen",
1620
+ "autoSize",
1621
+ "allowMultiple",
1622
+ "multiple",
1623
+ "quickCreate",
1624
+ "allowClear",
1625
+ "displayStyle",
1626
+ "options"
1627
+ ],
1628
+ decoratorProps: ["labelWidth", "labelWrap"],
1629
+ stepParams: ["fieldSettings", "displayFieldSettings", "popupSettings", "eventSettings"],
1630
+ flowRegistry: true,
1631
+ eventCapabilities: {
1632
+ direct: ACTION_DIRECT_EVENTS,
1633
+ object: ACTION_OBJECT_EVENTS
1634
+ },
1635
+ eventBindings: {
1636
+ displayFieldSettings: {
1637
+ stepKeys: ["displayStyle", "clickToOpen"]
1638
+ },
1639
+ popupSettings: {
1640
+ stepKeys: ["openView"]
1641
+ },
1642
+ eventSettings: {
1643
+ stepKeys: ["linkageRules"]
1644
+ }
1645
+ }
1646
+ });
1647
+ SUB_FORM_FIELD_NODE_CONTRACT.domains.stepParams = groupedDomain({
1648
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
1649
+ displayFieldSettings: {
1650
+ allowedPaths: ["displayStyle.displayStyle", "clickToOpen.clickToOpen"],
1651
+ clearable: true,
1652
+ mergeStrategy: "deep",
1653
+ eventBindingSteps: ["displayStyle", "clickToOpen"],
1654
+ pathSchemas: {
1655
+ "displayStyle.displayStyle": STRING_SCHEMA,
1656
+ "clickToOpen.clickToOpen": BOOLEAN_SCHEMA
1657
+ }
1658
+ },
1659
+ popupSettings: {
1660
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1661
+ clearable: true,
1662
+ mergeStrategy: "deep",
1663
+ eventBindingSteps: ["openView"],
1664
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1665
+ },
1666
+ eventSettings: EVENT_SETTINGS_GROUP
1667
+ });
1668
+ const POPUP_ACTION_CONTRACT = createContract({
1669
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1670
+ props: ACTION_PROP_KEYS,
1671
+ decoratorProps: ["labelWidth", "labelWrap"],
1672
+ stepParams: ["buttonSettings", "popupSettings"],
1673
+ flowRegistry: true,
1674
+ eventCapabilities: {
1675
+ direct: ACTION_DIRECT_EVENTS,
1676
+ object: ACTION_OBJECT_EVENTS
1677
+ },
1678
+ eventBindings: {
1679
+ buttonSettings: {
1680
+ stepKeys: ["general", "linkageRules"]
1681
+ },
1682
+ popupSettings: {
1683
+ stepKeys: ["openView"]
1684
+ }
1685
+ }
1686
+ });
1687
+ POPUP_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1688
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1689
+ popupSettings: {
1690
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1691
+ clearable: true,
1692
+ mergeStrategy: "deep",
1693
+ eventBindingSteps: ["openView"],
1694
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1695
+ }
1696
+ });
1697
+ const CALENDAR_POPUP_ACTION_CONTRACT = createContract({
1698
+ editableDomains: ["stepParams"],
1699
+ stepParams: ["popupSettings"],
1700
+ eventCapabilities: {
1701
+ direct: ACTION_DIRECT_EVENTS,
1702
+ object: ACTION_OBJECT_EVENTS
1703
+ },
1704
+ eventBindings: {
1705
+ popupSettings: {
1706
+ stepKeys: ["openView"]
1707
+ }
1708
+ }
1709
+ });
1710
+ CALENDAR_POPUP_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1711
+ popupSettings: {
1712
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1713
+ clearable: true,
1714
+ mergeStrategy: "deep",
1715
+ eventBindingSteps: ["openView"],
1716
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1717
+ }
1718
+ });
1719
+ const KANBAN_POPUP_ACTION_CONTRACT = createContract({
1720
+ editableDomains: ["stepParams"],
1721
+ stepParams: ["popupSettings"],
1722
+ eventCapabilities: {
1723
+ direct: ACTION_DIRECT_EVENTS,
1724
+ object: ACTION_OBJECT_EVENTS
1725
+ },
1726
+ eventBindings: {
1727
+ popupSettings: {
1728
+ stepKeys: ["openView"]
1729
+ }
1730
+ }
1731
+ });
1732
+ KANBAN_POPUP_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1733
+ popupSettings: {
1734
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
1735
+ clearable: true,
1736
+ mergeStrategy: "deep",
1737
+ eventBindingSteps: ["openView"],
1738
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
1739
+ }
1740
+ });
1741
+ const DELETE_ACTION_CONTRACT = createContract({
1742
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1743
+ props: ACTION_PROP_KEYS,
1744
+ decoratorProps: ["labelWidth", "labelWrap"],
1745
+ stepParams: ["buttonSettings", "deleteSettings"],
1746
+ flowRegistry: true,
1747
+ eventCapabilities: {
1748
+ direct: ACTION_DIRECT_EVENTS,
1749
+ object: ACTION_OBJECT_EVENTS
1750
+ },
1751
+ eventBindings: {
1752
+ buttonSettings: {
1753
+ stepKeys: ["general", "linkageRules"]
1754
+ },
1755
+ deleteSettings: {
1756
+ stepKeys: ["confirm"]
1757
+ }
1758
+ }
1759
+ });
1760
+ DELETE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1761
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1762
+ deleteSettings: {
1763
+ allowedPaths: CONFIRM_ALLOWED_PATHS,
1764
+ clearable: true,
1765
+ mergeStrategy: "deep",
1766
+ eventBindingSteps: ["confirm"],
1767
+ pathSchemas: {
1768
+ "confirm.enable": BOOLEAN_SCHEMA,
1769
+ "confirm.title": STRING_SCHEMA,
1770
+ "confirm.content": STRING_SCHEMA
1771
+ }
1772
+ }
1773
+ });
1774
+ const UPDATE_RECORD_ACTION_CONTRACT = createContract({
1775
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1776
+ props: ACTION_PROP_KEYS,
1777
+ decoratorProps: ["labelWidth", "labelWrap"],
1778
+ stepParams: ["buttonSettings", "assignSettings", "apply"],
1779
+ flowRegistry: true,
1780
+ eventCapabilities: {
1781
+ direct: ACTION_DIRECT_EVENTS,
1782
+ object: ACTION_OBJECT_EVENTS
1783
+ },
1784
+ eventBindings: {
1785
+ buttonSettings: {
1786
+ stepKeys: ["general", "linkageRules"]
1787
+ },
1788
+ assignSettings: {
1789
+ stepKeys: ["confirm", "assignFieldValues"]
1790
+ },
1791
+ apply: {
1792
+ stepKeys: ["apply"]
1793
+ }
1794
+ }
1795
+ });
1796
+ UPDATE_RECORD_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1797
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1798
+ assignSettings: {
1799
+ allowedPaths: [
1800
+ "confirm.enable",
1801
+ "confirm.title",
1802
+ "confirm.content",
1803
+ "assignFieldValues.assignedValues",
1804
+ "assignFieldValues.assignedValues.*"
1805
+ ],
1806
+ clearable: true,
1807
+ mergeStrategy: "deep",
1808
+ eventBindingSteps: ["confirm", "assignFieldValues"],
1809
+ pathSchemas: {
1810
+ "confirm.enable": BOOLEAN_SCHEMA,
1811
+ "confirm.title": STRING_SCHEMA,
1812
+ "confirm.content": STRING_SCHEMA,
1813
+ "assignFieldValues.assignedValues": OBJECT_SCHEMA
1814
+ }
1815
+ },
1816
+ apply: {
1817
+ allowedPaths: ["apply.assignedValues", "apply.assignedValues.*"],
1818
+ clearable: true,
1819
+ mergeStrategy: "deep",
1820
+ eventBindingSteps: ["apply"],
1821
+ pathSchemas: {
1822
+ "apply.assignedValues": OBJECT_SCHEMA
1823
+ }
1824
+ }
1825
+ });
1826
+ const SUBMIT_ACTION_CONTRACT = createContract({
1827
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1828
+ props: ACTION_PROP_KEYS,
1829
+ decoratorProps: ["labelWidth", "labelWrap"],
1830
+ stepParams: ["buttonSettings", "submitSettings"],
1831
+ flowRegistry: true,
1832
+ eventCapabilities: {
1833
+ direct: ACTION_DIRECT_EVENTS,
1834
+ object: ACTION_OBJECT_EVENTS
1835
+ },
1836
+ eventBindings: {
1837
+ buttonSettings: {
1838
+ stepKeys: ["general", "linkageRules"]
1839
+ },
1840
+ submitSettings: {
1841
+ stepKeys: ["confirm"]
1842
+ }
1843
+ }
1844
+ });
1845
+ const FILTER_FORM_SUBMIT_ACTION_CONTRACT = createContract({
1846
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1847
+ props: ACTION_PROP_KEYS,
1848
+ decoratorProps: ["labelWidth", "labelWrap"],
1849
+ stepParams: ["buttonSettings", "submitSettings"],
1850
+ flowRegistry: true,
1851
+ eventCapabilities: {
1852
+ direct: ACTION_DIRECT_EVENTS,
1853
+ object: ACTION_OBJECT_EVENTS
1854
+ },
1855
+ eventBindings: {
1856
+ buttonSettings: {
1857
+ stepKeys: ["general", "linkageRules"]
1858
+ },
1859
+ submitSettings: {
1860
+ stepKeys: ["doFilter"]
1861
+ }
1862
+ }
1863
+ });
1864
+ FILTER_FORM_SUBMIT_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1865
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1866
+ submitSettings: {
1867
+ allowedPaths: [],
1868
+ clearable: true,
1869
+ mergeStrategy: "deep",
1870
+ eventBindingSteps: ["doFilter"]
1871
+ }
1872
+ });
1873
+ SUBMIT_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1874
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1875
+ submitSettings: {
1876
+ allowedPaths: CONFIRM_ALLOWED_PATHS,
1877
+ clearable: true,
1878
+ mergeStrategy: "deep",
1879
+ eventBindingSteps: ["confirm"],
1880
+ pathSchemas: {
1881
+ "confirm.enable": BOOLEAN_SCHEMA,
1882
+ "confirm.title": STRING_SCHEMA,
1883
+ "confirm.content": STRING_SCHEMA
1884
+ }
1885
+ }
1886
+ });
1887
+ const BULK_EDIT_ACTION_CONTRACT = createContract({
1888
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1889
+ props: ACTION_PROP_KEYS,
1890
+ decoratorProps: ["labelWidth", "labelWrap"],
1891
+ stepParams: ["buttonSettings", "bulkEditSettings"],
1892
+ flowRegistry: true,
1893
+ eventCapabilities: {
1894
+ direct: ACTION_DIRECT_EVENTS,
1895
+ object: ACTION_OBJECT_EVENTS
1896
+ },
1897
+ eventBindings: {
1898
+ buttonSettings: {
1899
+ stepKeys: ["general", "linkageRules"]
1900
+ },
1901
+ bulkEditSettings: {
1902
+ stepKeys: ["editMode"]
1903
+ }
1904
+ }
1905
+ });
1906
+ BULK_EDIT_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1907
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1908
+ bulkEditSettings: {
1909
+ allowedPaths: ["editMode.value"],
1910
+ clearable: true,
1911
+ mergeStrategy: "deep",
1912
+ eventBindingSteps: ["editMode"],
1913
+ pathSchemas: {
1914
+ "editMode.value": STRING_SCHEMA
1915
+ }
1916
+ }
1917
+ });
1918
+ const BULK_UPDATE_ACTION_CONTRACT = createContract({
1919
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1920
+ props: ACTION_PROP_KEYS,
1921
+ decoratorProps: ["labelWidth", "labelWrap"],
1922
+ stepParams: ["buttonSettings", "assignSettings", "apply"],
1923
+ flowRegistry: true,
1924
+ eventCapabilities: {
1925
+ direct: ACTION_DIRECT_EVENTS,
1926
+ object: ACTION_OBJECT_EVENTS
1927
+ },
1928
+ eventBindings: {
1929
+ buttonSettings: {
1930
+ stepKeys: ["general", "linkageRules"]
1931
+ },
1932
+ assignSettings: {
1933
+ stepKeys: ["confirm", "updateMode", "assignFieldValues"]
1934
+ },
1935
+ apply: {
1936
+ stepKeys: ["apply"]
1937
+ }
1938
+ }
1939
+ });
1940
+ BULK_UPDATE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1941
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
1942
+ assignSettings: {
1943
+ allowedPaths: [
1944
+ "confirm.enable",
1945
+ "confirm.title",
1946
+ "confirm.content",
1947
+ "updateMode.value",
1948
+ "assignFieldValues.assignedValues",
1949
+ "assignFieldValues.assignedValues.*"
1950
+ ],
1951
+ clearable: true,
1952
+ mergeStrategy: "deep",
1953
+ eventBindingSteps: ["confirm", "updateMode", "assignFieldValues"],
1954
+ pathSchemas: {
1955
+ "confirm.enable": BOOLEAN_SCHEMA,
1956
+ "confirm.title": STRING_SCHEMA,
1957
+ "confirm.content": STRING_SCHEMA,
1958
+ "updateMode.value": STRING_SCHEMA,
1959
+ "assignFieldValues.assignedValues": OBJECT_SCHEMA
1960
+ }
1961
+ },
1962
+ apply: {
1963
+ allowedPaths: ["apply.assignedValues", "apply.assignedValues.*"],
1964
+ clearable: true,
1965
+ mergeStrategy: "deep",
1966
+ eventBindingSteps: ["apply"],
1967
+ pathSchemas: {
1968
+ "apply.assignedValues": OBJECT_SCHEMA
1969
+ }
1970
+ }
1971
+ });
1972
+ const SIMPLE_ACTION_CONTRACT = createContract({
1973
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
1974
+ props: ACTION_PROP_KEYS,
1975
+ decoratorProps: ["labelWidth", "labelWrap"],
1976
+ stepParams: ["buttonSettings"],
1977
+ flowRegistry: true,
1978
+ eventCapabilities: {
1979
+ direct: ACTION_DIRECT_EVENTS,
1980
+ object: ACTION_OBJECT_EVENTS
1981
+ },
1982
+ eventBindings: {
1983
+ buttonSettings: {
1984
+ stepKeys: ["general", "linkageRules"]
1985
+ }
1986
+ }
1987
+ });
1988
+ SIMPLE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
1989
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP
1990
+ });
1991
+ const CALENDAR_READONLY_ACTION_CONTRACT = createContract({
1992
+ editableDomains: ["props", "stepParams", "flowRegistry"],
1993
+ props: ["position"],
1994
+ stepParams: ["buttonSettings"],
1995
+ flowRegistry: true,
1996
+ eventCapabilities: {
1997
+ direct: ACTION_DIRECT_EVENTS,
1998
+ object: ACTION_OBJECT_EVENTS
1999
+ },
2000
+ eventBindings: {
2001
+ buttonSettings: {
2002
+ stepKeys: ["linkageRules"]
2003
+ }
2004
+ }
2005
+ });
2006
+ CALENDAR_READONLY_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2007
+ buttonSettings: {
2008
+ allowedPaths: ["linkageRules"],
2009
+ clearable: true,
2010
+ mergeStrategy: "deep",
2011
+ eventBindingSteps: ["linkageRules"],
2012
+ pathSchemas: {
2013
+ linkageRules: ARRAY_SCHEMA
2014
+ }
2015
+ }
2016
+ });
2017
+ const FILTER_ACTION_CONTRACT = createContract({
2018
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2019
+ props: FILTER_ACTION_PROP_KEYS,
2020
+ decoratorProps: ["labelWidth", "labelWrap"],
2021
+ stepParams: ["buttonSettings", "filterSettings"],
2022
+ flowRegistry: true,
2023
+ eventCapabilities: {
2024
+ direct: ACTION_DIRECT_EVENTS,
2025
+ object: ACTION_OBJECT_EVENTS
2026
+ },
2027
+ eventBindings: {
2028
+ buttonSettings: {
2029
+ stepKeys: ["general", "linkageRules"]
2030
+ },
2031
+ filterSettings: {
2032
+ stepKeys: ["filterableFieldNames", "defaultFilter"]
2033
+ }
2034
+ }
2035
+ });
2036
+ FILTER_ACTION_CONTRACT.domains.props = keyedDomain(FILTER_ACTION_PROP_KEYS, "deep", FILTER_ACTION_PROP_PATH_SCHEMAS);
2037
+ FILTER_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2038
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2039
+ filterSettings: {
2040
+ allowedPaths: ["filterableFieldNames.filterableFieldNames", "defaultFilter.defaultFilter"],
2041
+ clearable: true,
2042
+ mergeStrategy: "deep",
2043
+ eventBindingSteps: ["filterableFieldNames", "defaultFilter"],
2044
+ pathSchemas: {
2045
+ "filterableFieldNames.filterableFieldNames": {
2046
+ type: "array",
2047
+ items: STRING_SCHEMA
2048
+ },
2049
+ "defaultFilter.defaultFilter": FILTER_GROUP_SCHEMA
2050
+ }
2051
+ }
2052
+ });
2053
+ const FILTER_FORM_COLLAPSE_ACTION_CONTRACT = createContract({
2054
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2055
+ props: ACTION_PROP_KEYS,
2056
+ decoratorProps: ["labelWidth", "labelWrap"],
2057
+ stepParams: ["buttonSettings", "collapseSettings"],
2058
+ flowRegistry: true,
2059
+ eventCapabilities: {
2060
+ direct: ["collapseToggle"]
2061
+ },
2062
+ eventBindings: {
2063
+ buttonSettings: {
2064
+ stepKeys: ["general", "linkageRules"]
2065
+ },
2066
+ collapseSettings: {
2067
+ stepKeys: ["toggle", "defaultCollapsed"]
2068
+ }
2069
+ }
2070
+ });
2071
+ FILTER_FORM_COLLAPSE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2072
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2073
+ collapseSettings: {
2074
+ allowedPaths: ["toggle.collapsedRows", "defaultCollapsed.value"],
2075
+ clearable: true,
2076
+ mergeStrategy: "deep",
2077
+ eventBindingSteps: ["toggle", "defaultCollapsed"],
2078
+ pathSchemas: {
2079
+ "toggle.collapsedRows": NUMBER_SCHEMA,
2080
+ "defaultCollapsed.value": BOOLEAN_SCHEMA
2081
+ }
2082
+ }
2083
+ });
2084
+ const DUPLICATE_ACTION_CONTRACT = createContract({
2085
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2086
+ props: ACTION_PROP_KEYS,
2087
+ decoratorProps: ["labelWidth", "labelWrap"],
2088
+ stepParams: ["buttonSettings", "duplicateModeSettings", "duplicateSettings", "popupSettings"],
2089
+ flowRegistry: true,
2090
+ eventCapabilities: {
2091
+ direct: ACTION_DIRECT_EVENTS,
2092
+ object: ACTION_OBJECT_EVENTS
2093
+ },
2094
+ eventBindings: {
2095
+ buttonSettings: {
2096
+ stepKeys: ["general", "linkageRules"]
2097
+ },
2098
+ duplicateModeSettings: {
2099
+ stepKeys: ["duplicateMode"]
2100
+ },
2101
+ duplicateSettings: {
2102
+ stepKeys: ["confirm"]
2103
+ },
2104
+ popupSettings: {
2105
+ stepKeys: ["confirm", "openView"]
2106
+ }
2107
+ }
2108
+ });
2109
+ DUPLICATE_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2110
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2111
+ duplicateModeSettings: {
2112
+ allowedPaths: ["duplicateMode.duplicateMode", "duplicateMode.collection"],
2113
+ clearable: true,
2114
+ mergeStrategy: "deep",
2115
+ eventBindingSteps: ["duplicateMode"],
2116
+ pathSchemas: {
2117
+ "duplicateMode.duplicateMode": STRING_SCHEMA,
2118
+ "duplicateMode.collection": STRING_SCHEMA
2119
+ }
2120
+ },
2121
+ duplicateSettings: {
2122
+ allowedPaths: CONFIRM_ALLOWED_PATHS,
2123
+ clearable: true,
2124
+ mergeStrategy: "deep",
2125
+ eventBindingSteps: ["confirm"],
2126
+ pathSchemas: {
2127
+ "confirm.enable": BOOLEAN_SCHEMA,
2128
+ "confirm.title": STRING_SCHEMA,
2129
+ "confirm.content": STRING_SCHEMA
2130
+ }
2131
+ },
2132
+ popupSettings: {
2133
+ allowedPaths: [...CONFIRM_ALLOWED_PATHS, ...OPEN_VIEW_ALLOWED_PATHS],
2134
+ clearable: true,
2135
+ mergeStrategy: "deep",
2136
+ eventBindingSteps: ["confirm", "openView"],
2137
+ pathSchemas: {
2138
+ "confirm.enable": BOOLEAN_SCHEMA,
2139
+ "confirm.title": STRING_SCHEMA,
2140
+ "confirm.content": STRING_SCHEMA,
2141
+ ...OPEN_VIEW_PATH_SCHEMAS
2142
+ }
2143
+ }
2144
+ });
2145
+ const UPLOAD_ACTION_CONTRACT = createContract({
2146
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2147
+ props: ACTION_PROP_KEYS,
2148
+ decoratorProps: ["labelWidth", "labelWrap"],
2149
+ stepParams: ["buttonSettings", "selectExitRecordSettings"],
2150
+ flowRegistry: true,
2151
+ eventCapabilities: {
2152
+ direct: ACTION_DIRECT_EVENTS,
2153
+ object: ACTION_OBJECT_EVENTS
2154
+ },
2155
+ eventBindings: {
2156
+ buttonSettings: {
2157
+ stepKeys: ["general", "linkageRules"]
2158
+ },
2159
+ selectExitRecordSettings: {
2160
+ stepKeys: ["openView"]
2161
+ }
2162
+ }
2163
+ });
2164
+ UPLOAD_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2165
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2166
+ selectExitRecordSettings: {
2167
+ allowedPaths: ["openView.mode", "openView.size"],
2168
+ clearable: true,
2169
+ mergeStrategy: "deep",
2170
+ eventBindingSteps: ["openView"],
2171
+ pathSchemas: {
2172
+ "openView.mode": OPEN_VIEW_MODE_SCHEMA,
2173
+ "openView.size": STRING_SCHEMA
2174
+ }
2175
+ }
2176
+ });
2177
+ const MAIL_SEND_ACTION_CONTRACT = createContract({
2178
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2179
+ props: ACTION_PROP_KEYS,
2180
+ decoratorProps: ["labelWidth", "labelWrap"],
2181
+ stepParams: ["buttonSettings", "popupSettings", "sendEmailSettings"],
2182
+ flowRegistry: true,
2183
+ eventCapabilities: {
2184
+ direct: ACTION_DIRECT_EVENTS,
2185
+ object: ACTION_OBJECT_EVENTS
2186
+ },
2187
+ eventBindings: {
2188
+ buttonSettings: {
2189
+ stepKeys: ["general", "linkageRules"]
2190
+ },
2191
+ popupSettings: {
2192
+ stepKeys: ["openView"]
2193
+ },
2194
+ sendEmailSettings: {
2195
+ stepKeys: ["emailFieldNames", "defaultSelectAllRecords"]
2196
+ }
2197
+ }
2198
+ });
2199
+ MAIL_SEND_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2200
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2201
+ popupSettings: {
2202
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
2203
+ clearable: true,
2204
+ mergeStrategy: "deep",
2205
+ eventBindingSteps: ["openView"],
2206
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
2207
+ },
2208
+ sendEmailSettings: {
2209
+ allowedPaths: ["emailFieldNames.value", "defaultSelectAllRecords.value"],
2210
+ clearable: true,
2211
+ mergeStrategy: "deep",
2212
+ eventBindingSteps: ["emailFieldNames", "defaultSelectAllRecords"],
2213
+ pathSchemas: {
2214
+ "emailFieldNames.value": ARRAY_SCHEMA,
2215
+ "defaultSelectAllRecords.value": STRING_SCHEMA
2216
+ }
2217
+ }
2218
+ });
2219
+ const JS_ACTION_CONTRACT = createContract({
2220
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2221
+ props: ACTION_PROP_KEYS,
2222
+ decoratorProps: ["labelWidth", "labelWrap"],
2223
+ stepParams: ["buttonSettings", "clickSettings"],
2224
+ flowRegistry: true,
2225
+ eventCapabilities: {
2226
+ direct: ACTION_DIRECT_EVENTS,
2227
+ object: ACTION_OBJECT_EVENTS
2228
+ },
2229
+ eventBindings: {
2230
+ buttonSettings: {
2231
+ stepKeys: ["general", "linkageRules"]
2232
+ },
2233
+ clickSettings: {
2234
+ stepKeys: ["runJs"]
2235
+ }
2236
+ }
2237
+ });
2238
+ JS_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2239
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2240
+ clickSettings: RUN_JS_SETTINGS_GROUP
2241
+ });
2242
+ const APPROVAL_FORM_BLOCK_CONTRACT = createContract({
2243
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2244
+ props: ["labelWidth", "labelWrap"],
2245
+ decoratorProps: ["labelWidth", "labelWrap"],
2246
+ stepParams: ["resourceSettings", "formModelSettings", "eventSettings", "cardSettings", "patternSettings"],
2247
+ flowRegistry: true,
2248
+ eventCapabilities: {
2249
+ direct: DEFAULT_DIRECT_EVENTS,
2250
+ object: ["submit"]
2251
+ }
2252
+ });
2253
+ APPROVAL_FORM_BLOCK_CONTRACT.domains.stepParams = groupedDomain({
2254
+ resourceSettings: RESOURCE_SETTINGS_GROUP,
2255
+ formModelSettings: FORM_MODEL_SETTINGS_GROUP,
2256
+ eventSettings: EVENT_SETTINGS_GROUP,
2257
+ cardSettings: BLOCK_CARD_SETTINGS_GROUP,
2258
+ patternSettings: {
2259
+ allowedPaths: ["pattern.pattern"],
2260
+ mergeStrategy: "deep",
2261
+ eventBindingSteps: ["pattern"],
2262
+ pathSchemas: {
2263
+ "pattern.pattern": STRING_SCHEMA
2264
+ }
2265
+ }
2266
+ });
2267
+ const PATTERN_FORM_FIELD_NODE_CONTRACT = createContract({
2268
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2269
+ props: [
2270
+ "title",
2271
+ "icon",
2272
+ "titleField",
2273
+ "clickToOpen",
2274
+ "autoSize",
2275
+ "allowMultiple",
2276
+ "multiple",
2277
+ "quickCreate",
2278
+ "allowClear",
2279
+ "displayStyle",
2280
+ "options"
2281
+ ],
2282
+ decoratorProps: ["labelWidth", "labelWrap"],
2283
+ stepParams: ["fieldSettings", "fieldBinding", "displayFieldSettings", "popupSettings", "jsSettings"],
2284
+ flowRegistry: true,
2285
+ eventCapabilities: {
2286
+ direct: ACTION_DIRECT_EVENTS,
2287
+ object: ACTION_OBJECT_EVENTS
2288
+ },
2289
+ eventBindings: {
2290
+ displayFieldSettings: {
2291
+ stepKeys: ["displayStyle", "clickToOpen"]
2292
+ },
2293
+ popupSettings: {
2294
+ stepKeys: ["openView"]
2295
+ },
2296
+ jsSettings: {
2297
+ stepKeys: ["runJs"]
2298
+ },
2299
+ fieldBinding: {
2300
+ stepKeys: ["use"]
2301
+ }
2302
+ }
2303
+ });
2304
+ PATTERN_FORM_FIELD_NODE_CONTRACT.domains.stepParams = groupedDomain({
2305
+ fieldSettings: FIELD_SETTINGS_INIT_GROUP,
2306
+ fieldBinding: {
2307
+ allowedPaths: ["use"],
2308
+ mergeStrategy: "deep",
2309
+ eventBindingSteps: ["use"],
2310
+ pathSchemas: {
2311
+ use: STRING_SCHEMA
2312
+ }
2313
+ },
2314
+ displayFieldSettings: {
2315
+ allowedPaths: ["displayStyle.displayStyle", "clickToOpen.clickToOpen"],
2316
+ clearable: true,
2317
+ mergeStrategy: "deep",
2318
+ eventBindingSteps: ["displayStyle", "clickToOpen"],
2319
+ pathSchemas: {
2320
+ "displayStyle.displayStyle": STRING_SCHEMA,
2321
+ "clickToOpen.clickToOpen": BOOLEAN_SCHEMA
2322
+ }
2323
+ },
2324
+ popupSettings: {
2325
+ allowedPaths: OPEN_VIEW_ALLOWED_PATHS,
2326
+ clearable: true,
2327
+ mergeStrategy: "deep",
2328
+ eventBindingSteps: ["openView"],
2329
+ pathSchemas: OPEN_VIEW_PATH_SCHEMAS
2330
+ },
2331
+ jsSettings: RUN_JS_SETTINGS_GROUP
2332
+ });
2333
+ const APPROVAL_ACTION_CONTRACT = createContract({
2334
+ editableDomains: ["props", "decoratorProps", "stepParams", "flowRegistry"],
2335
+ props: ACTION_PROP_KEYS,
2336
+ decoratorProps: ["labelWidth", "labelWrap"],
2337
+ stepParams: ["buttonSettings", "clickSettings"],
2338
+ flowRegistry: true,
2339
+ eventCapabilities: {
2340
+ direct: ACTION_DIRECT_EVENTS,
2341
+ object: ACTION_OBJECT_EVENTS
2342
+ },
2343
+ eventBindings: {
2344
+ buttonSettings: {
2345
+ stepKeys: ["general", "linkageRules"]
2346
+ },
2347
+ clickSettings: {
2348
+ stepKeys: "*"
2349
+ }
2350
+ }
2351
+ });
2352
+ APPROVAL_ACTION_CONTRACT.domains.stepParams = groupedDomain({
2353
+ buttonSettings: ACTION_BUTTON_SETTINGS_GROUP,
2354
+ clickSettings: {
2355
+ allowedPaths: ["*"],
2356
+ clearable: true,
2357
+ mergeStrategy: "deep",
2358
+ eventBindingSteps: "*",
2359
+ schema: {
2360
+ type: "object",
2361
+ additionalProperties: true
2362
+ }
2363
+ }
2364
+ });
2365
+ const nodeContracts = /* @__PURE__ */ new Map();
2366
+ function registerNodeContract(use, contract) {
2367
+ nodeContracts.set(use, contract);
2368
+ }
2369
+ const NODE_CONTRACT_ENTRIES = [
2370
+ ["RootPageModel", PAGE_NODE_CONTRACT],
2371
+ ["ChildPageModel", PAGE_NODE_CONTRACT],
2372
+ ["TriggerChildPageModel", TRIGGER_CHILD_PAGE_NODE_CONTRACT],
2373
+ ["ApprovalChildPageModel", APPROVAL_CHILD_PAGE_NODE_CONTRACT],
2374
+ ["RootPageTabModel", TAB_NODE_CONTRACT],
2375
+ ["ChildPageTabModel", TAB_NODE_CONTRACT],
2376
+ ...import_approval.APPROVAL_TAB_MODEL_USES.map((use) => [use, TAB_NODE_CONTRACT]),
2377
+ ["BlockGridModel", GRID_NODE_CONTRACT],
2378
+ ["FormGridModel", FORM_GRID_NODE_CONTRACT],
2379
+ ["DetailsGridModel", GRID_NODE_CONTRACT],
2380
+ ["FilterFormGridModel", GRID_NODE_CONTRACT],
2381
+ ["AssignFormGridModel", FORM_GRID_NODE_CONTRACT],
2382
+ ...import_approval.APPROVAL_FORM_GRID_USES.map((use) => [use, FORM_GRID_NODE_CONTRACT]),
2383
+ ...import_approval.APPROVAL_DETAILS_GRID_USES.map((use) => [use, GRID_NODE_CONTRACT]),
2384
+ ["TriggerBlockGridModel", GRID_NODE_CONTRACT],
2385
+ ["ApprovalBlockGridModel", GRID_NODE_CONTRACT],
2386
+ ["TableBlockModel", TABLE_BLOCK_CONTRACT],
2387
+ ["CalendarBlockModel", CALENDAR_BLOCK_CONTRACT],
2388
+ ["KanbanBlockModel", KANBAN_BLOCK_CONTRACT],
2389
+ ["CreateFormModel", CREATE_FORM_BLOCK_CONTRACT],
2390
+ ["EditFormModel", EDIT_FORM_BLOCK_CONTRACT],
2391
+ ["FormBlockModel", FORM_BLOCK_CONTRACT],
2392
+ ["AssignFormModel", FORM_BLOCK_CONTRACT],
2393
+ ["DetailsBlockModel", DETAILS_BLOCK_CONTRACT],
2394
+ ["FilterFormBlockModel", FILTER_FORM_BLOCK_CONTRACT],
2395
+ ["ListBlockModel", LIST_BLOCK_CONTRACT],
2396
+ ["GridCardBlockModel", GRID_CARD_BLOCK_CONTRACT],
2397
+ ...import_approval.APPROVAL_FORM_BLOCK_USES.map((use) => [use, APPROVAL_FORM_BLOCK_CONTRACT]),
2398
+ ...import_approval.APPROVAL_DETAILS_BLOCK_USES.map((use) => [use, DETAILS_BLOCK_CONTRACT]),
2399
+ ["JSBlockModel", JS_BLOCK_CONTRACT],
2400
+ ["MarkdownBlockModel", MARKDOWN_BLOCK_CONTRACT],
2401
+ ["IframeBlockModel", IFRAME_BLOCK_CONTRACT],
2402
+ ["ChartBlockModel", CHART_BLOCK_CONTRACT],
2403
+ ["ActionPanelBlockModel", ACTION_PANEL_BLOCK_CONTRACT],
2404
+ ["MapBlockModel", MAP_BLOCK_CONTRACT],
2405
+ ["CommentsBlockModel", COMMENTS_BLOCK_CONTRACT],
2406
+ ["TableActionsColumnModel", ACTION_COLUMN_CONTRACT],
2407
+ ["FormItemModel", FORM_ITEM_CONTRACT],
2408
+ ["FormAssociationItemModel", DETAILS_ITEM_CONTRACT],
2409
+ ["DetailsItemModel", DETAILS_ITEM_CONTRACT],
2410
+ ["KanbanCardItemModel", KANBAN_CARD_ITEM_CONTRACT],
2411
+ ["FilterFormItemModel", FILTER_FORM_ITEM_CONTRACT],
2412
+ ["PatternFormItemModel", FORM_ITEM_CONTRACT],
2413
+ ["ApprovalDetailsItemModel", DETAILS_ITEM_CONTRACT],
2414
+ ["ApplyTaskCardDetailsItemModel", DETAILS_ITEM_CONTRACT],
2415
+ ["ApprovalTaskCardDetailsItemModel", DETAILS_ITEM_CONTRACT],
2416
+ ["SubFormFieldModel", SUB_FORM_FIELD_NODE_CONTRACT],
2417
+ ["SubFormListFieldModel", SUB_FORM_FIELD_NODE_CONTRACT],
2418
+ ["TableColumnModel", TABLE_COLUMN_CONTRACT],
2419
+ ["PatternFormFieldModel", PATTERN_FORM_FIELD_NODE_CONTRACT],
2420
+ ["JSColumnModel", JS_COLUMN_CONTRACT],
2421
+ ["JSItemModel", JS_ITEM_CONTRACT],
2422
+ ["DividerItemModel", DIVIDER_ITEM_CONTRACT],
2423
+ ["FormJSFieldItemModel", JS_ITEM_CONTRACT],
2424
+ ["AddNewActionModel", POPUP_ACTION_CONTRACT],
2425
+ ["ViewActionModel", POPUP_ACTION_CONTRACT],
2426
+ ["EditActionModel", POPUP_ACTION_CONTRACT],
2427
+ ["PopupCollectionActionModel", POPUP_ACTION_CONTRACT],
2428
+ ["CalendarQuickCreateActionModel", CALENDAR_POPUP_ACTION_CONTRACT],
2429
+ ["CalendarEventViewActionModel", CALENDAR_POPUP_ACTION_CONTRACT],
2430
+ ["KanbanQuickCreateActionModel", KANBAN_POPUP_ACTION_CONTRACT],
2431
+ ["KanbanCardViewActionModel", KANBAN_POPUP_ACTION_CONTRACT],
2432
+ ["AddChildActionModel", POPUP_ACTION_CONTRACT],
2433
+ ["DeleteActionModel", DELETE_ACTION_CONTRACT],
2434
+ ["BulkDeleteActionModel", DELETE_ACTION_CONTRACT],
2435
+ ["UpdateRecordActionModel", UPDATE_RECORD_ACTION_CONTRACT],
2436
+ ["BulkEditActionModel", BULK_EDIT_ACTION_CONTRACT],
2437
+ ["BulkUpdateActionModel", BULK_UPDATE_ACTION_CONTRACT],
2438
+ ["DuplicateActionModel", DUPLICATE_ACTION_CONTRACT],
2439
+ ["FormSubmitActionModel", SUBMIT_ACTION_CONTRACT],
2440
+ ["FilterFormSubmitActionModel", FILTER_FORM_SUBMIT_ACTION_CONTRACT],
2441
+ ["FilterFormResetActionModel", SIMPLE_ACTION_CONTRACT],
2442
+ ["FilterFormCollapseActionModel", FILTER_FORM_COLLAPSE_ACTION_CONTRACT],
2443
+ ["CalendarTodayActionModel", SIMPLE_ACTION_CONTRACT],
2444
+ ["CalendarNavActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2445
+ ["CalendarTitleActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2446
+ ["CalendarViewSelectActionModel", CALENDAR_READONLY_ACTION_CONTRACT],
2447
+ ["FilterActionModel", FILTER_ACTION_CONTRACT],
2448
+ ["RefreshActionModel", SIMPLE_ACTION_CONTRACT],
2449
+ ["LinkActionModel", SIMPLE_ACTION_CONTRACT],
2450
+ ["ExpandCollapseActionModel", SIMPLE_ACTION_CONTRACT],
2451
+ ["ExportActionModel", SIMPLE_ACTION_CONTRACT],
2452
+ ["ExportAttachmentActionModel", SIMPLE_ACTION_CONTRACT],
2453
+ ["ImportActionModel", SIMPLE_ACTION_CONTRACT],
2454
+ ["TemplatePrintCollectionActionModel", SIMPLE_ACTION_CONTRACT],
2455
+ ["TemplatePrintRecordActionModel", SIMPLE_ACTION_CONTRACT],
2456
+ ["CollectionTriggerWorkflowActionModel", SIMPLE_ACTION_CONTRACT],
2457
+ ["RecordTriggerWorkflowActionModel", SIMPLE_ACTION_CONTRACT],
2458
+ ["FormTriggerWorkflowActionModel", SIMPLE_ACTION_CONTRACT],
2459
+ ["WorkbenchTriggerWorkflowActionModel", SIMPLE_ACTION_CONTRACT],
2460
+ ["UploadActionModel", UPLOAD_ACTION_CONTRACT],
2461
+ ["MailSendActionModel", MAIL_SEND_ACTION_CONTRACT],
2462
+ ["JSCollectionActionModel", JS_ACTION_CONTRACT],
2463
+ ["JSRecordActionModel", JS_ACTION_CONTRACT],
2464
+ ["JSFormActionModel", JS_ACTION_CONTRACT],
2465
+ ["FilterFormJSActionModel", JS_ACTION_CONTRACT],
2466
+ ["JSItemActionModel", JS_ACTION_CONTRACT],
2467
+ ["JSActionModel", JS_ACTION_CONTRACT],
2468
+ ["ApplyFormSubmitModel", APPROVAL_ACTION_CONTRACT],
2469
+ ["ApplyFormSaveDraftModel", APPROVAL_ACTION_CONTRACT],
2470
+ ["ApplyFormWithdrawModel", APPROVAL_ACTION_CONTRACT],
2471
+ ["ProcessFormApproveModel", APPROVAL_ACTION_CONTRACT],
2472
+ ["ProcessFormRejectModel", APPROVAL_ACTION_CONTRACT],
2473
+ ["ProcessFormReturnModel", APPROVAL_ACTION_CONTRACT],
2474
+ ["ProcessFormDelegateModel", APPROVAL_ACTION_CONTRACT],
2475
+ ["ProcessFormAddAssigneeModel", APPROVAL_ACTION_CONTRACT]
2476
+ ];
2477
+ NODE_CONTRACT_ENTRIES.forEach(([use, contract]) => registerNodeContract(use, contract));
2478
+ KNOWN_FIELD_NODE_USES.forEach(
2479
+ (use) => registerNodeContract(
2480
+ use,
2481
+ JS_DISPLAY_FIELD_USE_SET.has(use) || JS_EDITABLE_FIELD_USE_SET.has(use) ? JS_FIELD_NODE_CONTRACT : FIELD_NODE_CONTRACT
2482
+ )
2483
+ );
2484
+ function makeCatalogItem(item) {
2485
+ const contract = getNodeContract(item.use);
2486
+ return {
2487
+ ...item,
2488
+ editableDomains: [...contract.editableDomains],
2489
+ settingsSchema: buildSettingsSchema(contract),
2490
+ settingsContract: contract.domains,
2491
+ eventCapabilities: contract.eventCapabilities,
2492
+ layoutCapabilities: contract.layoutCapabilities
2493
+ };
2494
+ }
2495
+ function normalizeFieldContainerUse(containerUse) {
2496
+ return (0, import_field_semantics.normalizeFieldContainerKind)(containerUse);
2497
+ }
2498
+ function getFieldWrapperUseForContainer(containerUse) {
2499
+ const approvalWrapperUse = (0, import_approval.getApprovalFieldWrapperUse)(containerUse);
2500
+ if (approvalWrapperUse) {
2501
+ return approvalWrapperUse;
2502
+ }
2503
+ switch (normalizeFieldContainerUse(containerUse)) {
2504
+ case "form":
2505
+ return "FormItemModel";
2506
+ case "details":
2507
+ return "DetailsItemModel";
2508
+ case "filter-form":
2509
+ return "FilterFormItemModel";
2510
+ case "table":
2511
+ return "TableColumnModel";
2512
+ default:
2513
+ return null;
2514
+ }
2515
+ }
2516
+ function inferEditableFieldUse(fieldInterface) {
2517
+ if (["m2m", "m2o", "o2o", "o2m", "oho", "obo", "updatedBy", "createdBy", "mbm"].includes(fieldInterface)) {
2518
+ return "RecordSelectFieldModel";
2519
+ }
2520
+ return (0, import_core_field_default_bindings.inferSharedFieldDefaultBindingUse)("editable", fieldInterface);
2521
+ }
2522
+ function inferDisplayFieldUse(fieldInterface) {
2523
+ if (["m2m", "o2m", "mbm"].includes(fieldInterface)) {
2524
+ return "DisplaySubTableFieldModel";
2525
+ }
2526
+ return (0, import_core_field_default_bindings.inferSharedFieldDefaultBindingUse)("display", fieldInterface);
2527
+ }
2528
+ function inferFilterFieldUse(fieldInterface) {
2529
+ if (["m2m", "m2o", "o2o", "o2m", "oho", "obo", "updatedBy", "createdBy", "mbm"].includes(fieldInterface)) {
2530
+ return "FilterFormRecordSelectFieldModel";
2531
+ }
2532
+ return (0, import_core_field_default_bindings.inferSharedFieldDefaultBindingUse)("filter", fieldInterface);
2533
+ }
2534
+ function getAllowedFieldUseSet(containerUse, enabledPackages) {
2535
+ switch (normalizeFieldContainerUse(containerUse)) {
2536
+ case "form":
2537
+ return /* @__PURE__ */ new Set([...EDITABLE_FIELD_USE_SET, ...(0, import_field_binding_registry.getRegisteredFieldUses)("editable", enabledPackages)]);
2538
+ case "details":
2539
+ case "table":
2540
+ return /* @__PURE__ */ new Set([...DISPLAY_FIELD_USE_SET, ...(0, import_field_binding_registry.getRegisteredFieldUses)("display", enabledPackages)]);
2541
+ case "filter-form":
2542
+ return /* @__PURE__ */ new Set([...FILTER_FIELD_USE_SET, ...(0, import_field_binding_registry.getRegisteredFieldUses)("filter", enabledPackages)]);
2543
+ default:
2544
+ return null;
2545
+ }
2546
+ }
2547
+ function canUseNestedApprovalAssociationFieldComponent(input) {
2548
+ var _a;
2549
+ const getCollection = input.getCollection || (() => null);
2550
+ const targetCollection = (0, import_service_helpers.resolveFieldTargetCollection)(input.field, input.dataSourceKey || "main", getCollection);
2551
+ if (!targetCollection) {
2552
+ return true;
2553
+ }
2554
+ return ((targetCollection == null ? void 0 : targetCollection.template) || ((_a = targetCollection == null ? void 0 : targetCollection.options) == null ? void 0 : _a.template)) !== "file";
2555
+ }
2556
+ function getSupportedFieldComponentUseSet(input) {
2557
+ const baseAllowedFieldUses = getAllowedFieldUseSet(input.containerUse, input.enabledPackages);
2558
+ const fieldInterface = String((0, import_service_helpers.getFieldInterface)(input.field) || "").trim();
2559
+ if (!baseAllowedFieldUses || !fieldInterface) {
2560
+ return baseAllowedFieldUses;
2561
+ }
2562
+ const wrapperUse = (0, import_approval.getApprovalFieldWrapperUse)(input.containerUse) || String(input.containerUse || "").trim();
2563
+ const inferredFieldUse = inferFieldUseByContainer(input.containerUse, input.field, {
2564
+ enabledPackages: input.enabledPackages,
2565
+ dataSourceKey: input.dataSourceKey,
2566
+ getCollection: input.getCollection
2567
+ });
2568
+ if (wrapperUse === "PatternFormItemModel") {
2569
+ if (SINGLE_VALUE_ASSOCIATION_INTERFACES.has(fieldInterface)) {
2570
+ return new Set(
2571
+ [
2572
+ "RecordSelectFieldModel",
2573
+ "RecordPickerFieldModel",
2574
+ canUseNestedApprovalAssociationFieldComponent(input) ? "SubFormFieldModel" : void 0,
2575
+ inferredFieldUse
2576
+ ].filter(Boolean)
2577
+ );
2578
+ }
2579
+ if (import_field_semantics.MULTI_VALUE_ASSOCIATION_INTERFACES.has(fieldInterface)) {
2580
+ return new Set(
2581
+ [
2582
+ "RecordSelectFieldModel",
2583
+ "RecordPickerFieldModel",
2584
+ canUseNestedApprovalAssociationFieldComponent(input) ? "SubFormListFieldModel" : void 0,
2585
+ canUseNestedApprovalAssociationFieldComponent(input) ? "PatternSubTableFieldModel" : void 0,
2586
+ inferredFieldUse
2587
+ ].filter(Boolean)
2588
+ );
2589
+ }
2590
+ }
2591
+ if (APPROVAL_DETAILS_FIELD_COMPONENT_WRAPPER_USE_SET.has(wrapperUse)) {
2592
+ if (SINGLE_VALUE_ASSOCIATION_INTERFACES.has(fieldInterface)) {
2593
+ return new Set(["DisplayTextFieldModel", "DisplaySubItemFieldModel", inferredFieldUse].filter(Boolean));
2594
+ }
2595
+ if (import_field_semantics.MULTI_VALUE_ASSOCIATION_INTERFACES.has(fieldInterface)) {
2596
+ return new Set(
2597
+ ["DisplayTextFieldModel", "DisplaySubListFieldModel", "DisplaySubTableFieldModel", inferredFieldUse].filter(
2598
+ Boolean
2599
+ )
2600
+ );
2601
+ }
2602
+ }
2603
+ return baseAllowedFieldUses;
2604
+ }
2605
+ function inferFieldUseByContainer(containerUse, field, options = {}) {
2606
+ var _a;
2607
+ const fieldInterface = (field == null ? void 0 : field.interface) || ((_a = field == null ? void 0 : field.options) == null ? void 0 : _a.interface);
2608
+ const registeredBinding = (0, import_field_binding_registry.resolveRegisteredFieldBinding)({
2609
+ containerUse,
2610
+ field,
2611
+ dataSourceKey: options.dataSourceKey,
2612
+ enabledPackages: options.enabledPackages,
2613
+ getCollection: options.getCollection
2614
+ });
2615
+ if (registeredBinding == null ? void 0 : registeredBinding.modelClassName) {
2616
+ return registeredBinding.modelClassName;
2617
+ }
2618
+ if ((0, import_field_semantics.shouldUseAssociationTitleTextDisplay)({
2619
+ containerUse,
2620
+ fieldInterface
2621
+ })) {
2622
+ return "DisplayTextFieldModel";
2623
+ }
2624
+ switch (normalizeFieldContainerUse(containerUse)) {
2625
+ case "filter-form":
2626
+ return inferFilterFieldUse(fieldInterface);
2627
+ case "form":
2628
+ return inferEditableFieldUse(fieldInterface);
2629
+ case "details":
2630
+ return inferDisplayFieldUse(fieldInterface);
2631
+ case "table":
2632
+ return inferDisplayFieldUse(fieldInterface);
2633
+ default:
2634
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field container '${containerUse}' is not supported`);
2635
+ }
2636
+ }
2637
+ function inferJsFieldUseByContainer(containerUse) {
2638
+ switch (normalizeFieldContainerUse(containerUse)) {
2639
+ case "form":
2640
+ return "JSEditableFieldModel";
2641
+ case "details":
2642
+ case "table":
2643
+ return "JSFieldModel";
2644
+ case "filter-form":
2645
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field renderer 'js' is not allowed under '${containerUse}'`);
2646
+ default:
2647
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field container '${containerUse}' is not supported`);
2648
+ }
2649
+ }
2650
+ function resolveStandaloneFieldUse(input) {
2651
+ const requestedType = String(input.requestedType || "").trim();
2652
+ if (!requestedType) {
2653
+ return void 0;
2654
+ }
2655
+ if (requestedType === "jsColumn") {
2656
+ if (normalizeFieldContainerUse(input.containerUse) !== "table") {
2657
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field type 'jsColumn' is only allowed under table containers`);
2658
+ }
2659
+ return "JSColumnModel";
2660
+ }
2661
+ if (requestedType === "jsItem") {
2662
+ if (normalizeFieldContainerUse(input.containerUse) !== "form") {
2663
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field type 'jsItem' is only allowed under form containers`);
2664
+ }
2665
+ return "JSItemModel";
2666
+ }
2667
+ if (requestedType === "divider") {
2668
+ const containerKind = normalizeFieldContainerUse(input.containerUse);
2669
+ if (containerKind !== "form" && containerKind !== "details") {
2670
+ throw new import_errors.FlowSurfaceBadRequestError(
2671
+ `flowSurfaces field type 'divider' is only allowed under form or details containers`
2672
+ );
2673
+ }
2674
+ return "DividerItemModel";
2675
+ }
2676
+ throw new import_errors.FlowSurfaceBadRequestError(
2677
+ `flowSurfaces field type '${requestedType}' is not a supported public capability`
2678
+ );
2679
+ }
2680
+ function resolveSupportedFieldCapability(input) {
2681
+ const requestedRenderer = typeof input.requestedRenderer === "undefined" ? void 0 : String(input.requestedRenderer || "").trim();
2682
+ if (typeof requestedRenderer !== "undefined" && requestedRenderer !== "js") {
2683
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field renderer '${requestedRenderer}' is not supported`);
2684
+ }
2685
+ const standaloneUse = resolveStandaloneFieldUse({
2686
+ requestedType: input.requestedType,
2687
+ containerUse: input.containerUse
2688
+ });
2689
+ if (standaloneUse) {
2690
+ if (input.requestedWrapperUse && input.requestedWrapperUse !== standaloneUse) {
2691
+ throw new import_errors.FlowSurfaceBadRequestError(
2692
+ `flowSurfaces field wrapper '${input.requestedWrapperUse}' is not allowed for field type '${input.requestedType}', expected '${standaloneUse}'`
2693
+ );
2694
+ }
2695
+ if (input.requestedFieldUse && input.requestedFieldUse !== standaloneUse) {
2696
+ throw new import_errors.FlowSurfaceBadRequestError(
2697
+ `flowSurfaces fieldUse '${input.requestedFieldUse}' does not match field type '${input.requestedType}', expected '${standaloneUse}'`
2698
+ );
2699
+ }
2700
+ return {
2701
+ wrapperUse: void 0,
2702
+ fieldUse: void 0,
2703
+ inferredFieldUse: void 0,
2704
+ standaloneUse,
2705
+ renderer: void 0
2706
+ };
2707
+ }
2708
+ const wrapperUse = getFieldWrapperUseForContainer(input.containerUse);
2709
+ if (!wrapperUse) {
2710
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field container '${input.containerUse}' is not supported`);
2711
+ }
2712
+ if (input.requestedWrapperUse && input.requestedWrapperUse !== wrapperUse) {
2713
+ throw new import_errors.FlowSurfaceBadRequestError(
2714
+ `flowSurfaces field wrapper '${input.requestedWrapperUse}' is not allowed under '${input.containerUse}', expected '${wrapperUse}'`
2715
+ );
2716
+ }
2717
+ let inferredFieldUse;
2718
+ if (requestedRenderer === "js") {
2719
+ inferredFieldUse = inferJsFieldUseByContainer(input.containerUse);
2720
+ } else if (input.field) {
2721
+ inferredFieldUse = inferFieldUseByContainer(input.containerUse, input.field, {
2722
+ enabledPackages: input.enabledPackages,
2723
+ dataSourceKey: input.dataSourceKey,
2724
+ getCollection: input.getCollection
2725
+ });
2726
+ }
2727
+ const fieldUse = input.requestedFieldUse || inferredFieldUse;
2728
+ if (!fieldUse) {
2729
+ if (input.allowUnresolvedFieldUse) {
2730
+ return {
2731
+ wrapperUse,
2732
+ fieldUse: void 0,
2733
+ inferredFieldUse,
2734
+ standaloneUse: void 0,
2735
+ renderer: requestedRenderer
2736
+ };
2737
+ }
2738
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces field '${input.containerUse}' requires a supported fieldUse`);
2739
+ }
2740
+ if (input.requestedFieldUse && inferredFieldUse && input.requestedFieldUse !== inferredFieldUse && KNOWN_FIELD_NODE_USES.has(input.requestedFieldUse)) {
2741
+ throw new import_errors.FlowSurfaceBadRequestError(
2742
+ `flowSurfaces fieldUse '${input.requestedFieldUse}' does not match inferred fieldUse '${inferredFieldUse}' under '${input.containerUse}'`
2743
+ );
2744
+ }
2745
+ const allowedFieldUses = getAllowedFieldUseSet(input.containerUse, input.enabledPackages);
2746
+ if (!(allowedFieldUses == null ? void 0 : allowedFieldUses.has(fieldUse))) {
2747
+ throw new import_errors.FlowSurfaceBadRequestError(
2748
+ `flowSurfaces fieldUse '${fieldUse}' is not allowed under '${input.containerUse}'`
2749
+ );
2750
+ }
2751
+ return {
2752
+ wrapperUse,
2753
+ fieldUse,
2754
+ inferredFieldUse,
2755
+ standaloneUse: void 0,
2756
+ renderer: requestedRenderer
2757
+ };
2758
+ }
2759
+ function isActionAllowedInContainer(item, containerUse) {
2760
+ if (!containerUse) {
2761
+ return true;
2762
+ }
2763
+ return Array.isArray(item.allowedContainerUses) && item.allowedContainerUses.includes(containerUse);
2764
+ }
2765
+ function getContainerScopedActionCatalogItems(items, containerUse, options = {
2766
+ context: "resolveAction"
2767
+ }) {
2768
+ if (!containerUse) {
2769
+ return items;
2770
+ }
2771
+ const containerScope = (0, import_action_scope.getActionContainerScope)(containerUse);
2772
+ if (!containerScope) {
2773
+ if (options.allowUnknownContainer) {
2774
+ return [];
2775
+ }
2776
+ (0, import_action_scope.assertKnownActionContainerUse)({
2777
+ containerUse,
2778
+ context: options.context
2779
+ });
2780
+ return [];
2781
+ }
2782
+ return items.filter((item) => item.scope === containerScope && isActionAllowedInContainer(item, containerUse));
2783
+ }
2784
+ function toPublicActionCatalogItem(item) {
2785
+ return item;
2786
+ }
2787
+ function dedupeActionCatalogItems(items, dedupeBy) {
2788
+ const seen = /* @__PURE__ */ new Set();
2789
+ return items.filter((item) => {
2790
+ const key = dedupeBy(item);
2791
+ if (seen.has(key)) {
2792
+ return false;
2793
+ }
2794
+ seen.add(key);
2795
+ return true;
2796
+ });
2797
+ }
2798
+ function getAvailableActionCatalogItems(containerUse, scope, enabledPackages) {
2799
+ const visible = getContainerScopedActionCatalogItems(actionCatalog, containerUse, {
2800
+ allowUnknownContainer: true,
2801
+ context: "catalog"
2802
+ });
2803
+ const scoped = scope ? visible.filter((item) => item.scope === scope) : visible;
2804
+ const normalized = scoped.map((item) => toPublicActionCatalogItem(item));
2805
+ return dedupeActionCatalogItems(
2806
+ filterAvailableCatalogItems(normalized, enabledPackages),
2807
+ containerUse ? (item) => `${item.key}:${item.use}` : (item) => `${item.key}:${item.scope || ""}:${item.use}`
2808
+ );
2809
+ }
2810
+ const COLLECTION_RESOURCE_REQUIRED = /* @__PURE__ */ new Set([
2811
+ "TableBlockModel",
2812
+ "CalendarBlockModel",
2813
+ "KanbanBlockModel",
2814
+ "CreateFormModel",
2815
+ "EditFormModel",
2816
+ "FormBlockModel",
2817
+ "DetailsBlockModel",
2818
+ "ListBlockModel",
2819
+ "GridCardBlockModel",
2820
+ "MapBlockModel",
2821
+ "CommentsBlockModel",
2822
+ ...import_approval.APPROVAL_FORM_BLOCK_USES,
2823
+ ...import_approval.APPROVAL_DETAILS_BLOCK_USES
2824
+ ]);
2825
+ const PUBLIC_BLOCK_SUPPORT_MATRIX = import_support_matrix.FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.filter((entry) => entry.topLevelAddable);
2826
+ const baseBlockCatalog = PUBLIC_BLOCK_SUPPORT_MATRIX.map(
2827
+ (entry) => makeCatalogItem({
2828
+ key: entry.key,
2829
+ label: entry.label,
2830
+ kind: "block",
2831
+ use: entry.modelUse,
2832
+ requiredInitParams: COLLECTION_RESOURCE_REQUIRED.has(entry.modelUse) ? ["dataSourceKey", "collectionName"] : void 0,
2833
+ createSupported: entry.createSupported
2834
+ })
2835
+ );
2836
+ const approvalBlockCatalog = import_approval.APPROVAL_BLOCK_CATALOG_SPECS.map(
2837
+ (entry) => makeCatalogItem({
2838
+ key: entry.key,
2839
+ label: entry.label,
2840
+ kind: "block",
2841
+ use: entry.use,
2842
+ requiredInitParams: entry.requiredInitParams,
2843
+ allowedContainerUses: entry.allowedContainerUses,
2844
+ createSupported: entry.createSupported
2845
+ })
2846
+ );
2847
+ const blockCatalog = [...baseBlockCatalog, ...approvalBlockCatalog];
2848
+ const COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES = [
2849
+ ...import_action_scope.COLLECTION_BLOCK_ACTION_CONTAINER_USES,
2850
+ ...import_action_scope.KANBAN_BLOCK_ACTION_CONTAINER_USES
2851
+ ];
2852
+ const APPROVAL_PAGE_LIKE_BLOCK_CONTAINER_USE_SET = /* @__PURE__ */ new Set([...import_approval.APPROVAL_BLOCK_GRID_USES]);
2853
+ const APPROVAL_PAGE_LIKE_GENERIC_BLOCK_KEY_SET = /* @__PURE__ */ new Set(["markdown", "jsBlock"]);
2854
+ const APPROVAL_EXCLUSIVE_BLOCK_CONTAINER_USE_SET = /* @__PURE__ */ new Set([...import_approval.APPROVAL_TASK_CARD_GRID_USES]);
2855
+ function isApprovalPageLikeBlockContainerUse(containerUse) {
2856
+ return APPROVAL_PAGE_LIKE_BLOCK_CONTAINER_USE_SET.has(String(containerUse || "").trim());
2857
+ }
2858
+ function isApprovalExclusiveBlockContainerUse(containerUse) {
2859
+ return APPROVAL_EXCLUSIVE_BLOCK_CONTAINER_USE_SET.has(String(containerUse || "").trim());
2860
+ }
2861
+ function isBlockAllowedInContainer(item, containerUse) {
2862
+ var _a, _b, _c;
2863
+ const normalizedContainerUse = String(containerUse || "").trim();
2864
+ if (isApprovalExclusiveBlockContainerUse(normalizedContainerUse) && !((_a = item.allowedContainerUses) == null ? void 0 : _a.length)) {
2865
+ return false;
2866
+ }
2867
+ if (isApprovalPageLikeBlockContainerUse(normalizedContainerUse)) {
2868
+ if (!((_b = item.allowedContainerUses) == null ? void 0 : _b.length)) {
2869
+ return APPROVAL_PAGE_LIKE_GENERIC_BLOCK_KEY_SET.has(item.key);
2870
+ }
2871
+ return item.allowedContainerUses.includes(normalizedContainerUse);
2872
+ }
2873
+ if (!((_c = item.allowedContainerUses) == null ? void 0 : _c.length)) {
2874
+ return true;
2875
+ }
2876
+ if (!normalizedContainerUse) {
2877
+ return false;
2878
+ }
2879
+ return item.allowedContainerUses.includes(normalizedContainerUse);
2880
+ }
2881
+ function getAvailableBlockCatalogItems(containerUse, enabledPackages) {
2882
+ return filterAvailableCatalogItems(blockCatalog, enabledPackages).filter(
2883
+ (item) => isBlockAllowedInContainer(item, containerUse)
2884
+ );
2885
+ }
2886
+ const actionRegistry = [
2887
+ {
2888
+ publicKey: "filter",
2889
+ label: "Filter",
2890
+ scope: "block",
2891
+ scene: "collection",
2892
+ use: "FilterActionModel",
2893
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2894
+ allowedContainerUses: COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES,
2895
+ createSupported: true
2896
+ },
2897
+ {
2898
+ publicKey: "addNew",
2899
+ label: "Add new",
2900
+ scope: "block",
2901
+ scene: "collection",
2902
+ use: "AddNewActionModel",
2903
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2904
+ allowedContainerUses: COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES,
2905
+ createSupported: true
2906
+ },
2907
+ {
2908
+ publicKey: "popup",
2909
+ label: "Popup",
2910
+ scope: "block",
2911
+ scene: "collection",
2912
+ use: "PopupCollectionActionModel",
2913
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2914
+ allowedContainerUses: COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES,
2915
+ createSupported: true
2916
+ },
2917
+ {
2918
+ publicKey: "refresh",
2919
+ label: "Refresh",
2920
+ scope: "block",
2921
+ scene: "collection",
2922
+ use: "RefreshActionModel",
2923
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2924
+ allowedContainerUses: COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES,
2925
+ createSupported: true
2926
+ },
2927
+ {
2928
+ publicKey: "today",
2929
+ label: "Today",
2930
+ scope: "block",
2931
+ scene: "collection",
2932
+ use: "CalendarTodayActionModel",
2933
+ ownerPlugin: "@nocobase/plugin-calendar",
2934
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2935
+ createSupported: true
2936
+ },
2937
+ {
2938
+ publicKey: "turnPages",
2939
+ label: "Turn pages",
2940
+ scope: "block",
2941
+ scene: "collection",
2942
+ use: "CalendarNavActionModel",
2943
+ ownerPlugin: "@nocobase/plugin-calendar",
2944
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2945
+ createSupported: true
2946
+ },
2947
+ {
2948
+ publicKey: "title",
2949
+ label: "Title",
2950
+ scope: "block",
2951
+ scene: "collection",
2952
+ use: "CalendarTitleActionModel",
2953
+ ownerPlugin: "@nocobase/plugin-calendar",
2954
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2955
+ createSupported: true
2956
+ },
2957
+ {
2958
+ publicKey: "selectView",
2959
+ label: "Select view",
2960
+ scope: "block",
2961
+ scene: "collection",
2962
+ use: "CalendarViewSelectActionModel",
2963
+ ownerPlugin: "@nocobase/plugin-calendar",
2964
+ allowedContainerUses: import_action_scope.CALENDAR_BLOCK_ACTION_CONTAINER_USES,
2965
+ createSupported: true
2966
+ },
2967
+ {
2968
+ publicKey: "expandCollapse",
2969
+ label: "Expand/Collapse",
2970
+ scope: "block",
2971
+ scene: "collection",
2972
+ use: "ExpandCollapseActionModel",
2973
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2974
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
2975
+ createSupported: true
2976
+ },
2977
+ {
2978
+ publicKey: "bulkDelete",
2979
+ label: "Bulk delete",
2980
+ scope: "block",
2981
+ scene: "collection",
2982
+ use: "BulkDeleteActionModel",
2983
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
2984
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
2985
+ createSupported: true
2986
+ },
2987
+ {
2988
+ publicKey: "bulkEdit",
2989
+ label: "Bulk edit",
2990
+ scope: "block",
2991
+ scene: "collection",
2992
+ use: "BulkEditActionModel",
2993
+ ownerPlugin: "@nocobase/plugin-action-bulk-edit",
2994
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
2995
+ createSupported: true
2996
+ },
2997
+ {
2998
+ publicKey: "bulkUpdate",
2999
+ label: "Bulk update",
3000
+ scope: "block",
3001
+ scene: "collection",
3002
+ use: "BulkUpdateActionModel",
3003
+ ownerPlugin: "@nocobase/plugin-action-bulk-update",
3004
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3005
+ createSupported: true
3006
+ },
3007
+ {
3008
+ publicKey: "export",
3009
+ label: "Export",
3010
+ scope: "block",
3011
+ scene: "collection",
3012
+ use: "ExportActionModel",
3013
+ ownerPlugin: "@nocobase/plugin-action-export",
3014
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3015
+ createSupported: true
3016
+ },
3017
+ {
3018
+ publicKey: "exportAttachments",
3019
+ label: "Export attachments",
3020
+ scope: "block",
3021
+ scene: "collection",
3022
+ use: "ExportAttachmentActionModel",
3023
+ ownerPlugin: "@nocobase/plugin-action-export",
3024
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3025
+ createSupported: true
3026
+ },
3027
+ {
3028
+ publicKey: "import",
3029
+ label: "Import",
3030
+ scope: "block",
3031
+ scene: "collection",
3032
+ use: "ImportActionModel",
3033
+ ownerPlugin: "@nocobase/plugin-action-import",
3034
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3035
+ createSupported: true
3036
+ },
3037
+ {
3038
+ publicKey: "link",
3039
+ label: "Link",
3040
+ scope: "block",
3041
+ scene: "collection",
3042
+ use: "LinkActionModel",
3043
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3044
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3045
+ createSupported: true
3046
+ },
3047
+ {
3048
+ publicKey: "upload",
3049
+ label: "Upload",
3050
+ scope: "block",
3051
+ scene: "collection",
3052
+ use: "UploadActionModel",
3053
+ ownerPlugin: "@nocobase/plugin-file-manager",
3054
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3055
+ createSupported: true
3056
+ },
3057
+ {
3058
+ publicKey: "js",
3059
+ label: "JS action",
3060
+ scope: "block",
3061
+ scene: "collection",
3062
+ use: "JSCollectionActionModel",
3063
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3064
+ allowedContainerUses: COLLECTION_BLOCK_AND_KANBAN_ACTION_CONTAINER_USES,
3065
+ createSupported: true
3066
+ },
3067
+ {
3068
+ publicKey: "composeEmail",
3069
+ label: "Compose email",
3070
+ scope: "block",
3071
+ scene: "collection",
3072
+ use: "MailSendActionModel",
3073
+ ownerPlugin: "@nocobase/plugin-email-manager",
3074
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3075
+ createSupported: true
3076
+ },
3077
+ {
3078
+ publicKey: "templatePrint",
3079
+ label: "Template print",
3080
+ scope: "block",
3081
+ scene: "collection",
3082
+ use: "TemplatePrintCollectionActionModel",
3083
+ ownerPlugin: "@nocobase/plugin-action-template-print",
3084
+ allowedContainerUses: import_action_scope.TABLE_BLOCK_ACTION_CONTAINER_USES,
3085
+ createSupported: true
3086
+ },
3087
+ {
3088
+ publicKey: "triggerWorkflow",
3089
+ label: "Trigger workflow",
3090
+ scope: "block",
3091
+ scene: "collection",
3092
+ use: "CollectionTriggerWorkflowActionModel",
3093
+ ownerPlugin: "@nocobase/plugin-workflow-custom-action-trigger",
3094
+ allowedContainerUses: import_action_scope.COLLECTION_BLOCK_ACTION_CONTAINER_USES,
3095
+ createSupported: true
3096
+ },
3097
+ {
3098
+ publicKey: "duplicate",
3099
+ label: "Duplicate",
3100
+ scope: "record",
3101
+ scene: "record",
3102
+ use: "DuplicateActionModel",
3103
+ ownerPlugin: "@nocobase/plugin-action-duplicate",
3104
+ allowedContainerUses: import_action_scope.TABLE_ROW_ACTION_CONTAINER_USES,
3105
+ createSupported: true
3106
+ },
3107
+ {
3108
+ publicKey: "addChild",
3109
+ label: "Add child",
3110
+ scope: "record",
3111
+ scene: "record",
3112
+ use: "AddChildActionModel",
3113
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3114
+ allowedContainerUses: import_action_scope.TABLE_ROW_ACTION_CONTAINER_USES,
3115
+ createSupported: true
3116
+ },
3117
+ {
3118
+ publicKey: "view",
3119
+ label: "View",
3120
+ scope: "record",
3121
+ scene: "record",
3122
+ use: "ViewActionModel",
3123
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3124
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3125
+ createSupported: true
3126
+ },
3127
+ {
3128
+ publicKey: "edit",
3129
+ label: "Edit",
3130
+ scope: "record",
3131
+ scene: "record",
3132
+ use: "EditActionModel",
3133
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3134
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3135
+ createSupported: true
3136
+ },
3137
+ {
3138
+ publicKey: "popup",
3139
+ label: "Popup",
3140
+ scope: "record",
3141
+ scene: "record",
3142
+ use: "PopupCollectionActionModel",
3143
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3144
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3145
+ createSupported: true
3146
+ },
3147
+ {
3148
+ publicKey: "composeEmail",
3149
+ label: "Compose email",
3150
+ scope: "record",
3151
+ scene: "record",
3152
+ use: "MailSendActionModel",
3153
+ ownerPlugin: "@nocobase/plugin-email-manager",
3154
+ allowedContainerUses: [...import_action_scope.TABLE_ROW_ACTION_CONTAINER_USES, ...import_action_scope.DETAILS_ACTION_CONTAINER_USES],
3155
+ createSupported: true
3156
+ },
3157
+ {
3158
+ publicKey: "delete",
3159
+ label: "Delete",
3160
+ scope: "record",
3161
+ scene: "record",
3162
+ use: "DeleteActionModel",
3163
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3164
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3165
+ createSupported: true
3166
+ },
3167
+ {
3168
+ publicKey: "updateRecord",
3169
+ label: "Update record",
3170
+ scope: "record",
3171
+ scene: "record",
3172
+ use: "UpdateRecordActionModel",
3173
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3174
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3175
+ createSupported: true
3176
+ },
3177
+ {
3178
+ publicKey: "js",
3179
+ label: "JS action",
3180
+ scope: "record",
3181
+ scene: "record",
3182
+ use: "JSRecordActionModel",
3183
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3184
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3185
+ createSupported: true
3186
+ },
3187
+ {
3188
+ publicKey: "templatePrint",
3189
+ label: "Template print",
3190
+ scope: "record",
3191
+ scene: "record",
3192
+ use: "TemplatePrintRecordActionModel",
3193
+ ownerPlugin: "@nocobase/plugin-action-template-print",
3194
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3195
+ createSupported: true
3196
+ },
3197
+ {
3198
+ publicKey: "triggerWorkflow",
3199
+ label: "Trigger workflow",
3200
+ scope: "record",
3201
+ scene: "record",
3202
+ use: "RecordTriggerWorkflowActionModel",
3203
+ ownerPlugin: "@nocobase/plugin-workflow-custom-action-trigger",
3204
+ allowedContainerUses: import_action_scope.RECORD_ACTION_CONTAINER_USES,
3205
+ createSupported: true
3206
+ },
3207
+ {
3208
+ publicKey: "submit",
3209
+ label: "Submit",
3210
+ scope: "form",
3211
+ scene: "form",
3212
+ use: "FormSubmitActionModel",
3213
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3214
+ allowedContainerUses: import_action_scope.FORM_ACTION_CONTAINER_USES,
3215
+ createSupported: true
3216
+ },
3217
+ {
3218
+ publicKey: "js",
3219
+ label: "JS action",
3220
+ scope: "form",
3221
+ scene: "form",
3222
+ use: "JSFormActionModel",
3223
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3224
+ allowedContainerUses: import_action_scope.FORM_ACTION_CONTAINER_USES,
3225
+ createSupported: true
3226
+ },
3227
+ {
3228
+ publicKey: "jsItem",
3229
+ label: "JS item",
3230
+ scope: "form",
3231
+ scene: "form",
3232
+ use: "JSItemActionModel",
3233
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3234
+ allowedContainerUses: import_action_scope.FORM_ACTION_CONTAINER_USES,
3235
+ createSupported: true
3236
+ },
3237
+ {
3238
+ publicKey: "triggerWorkflow",
3239
+ label: "Trigger workflow",
3240
+ scope: "form",
3241
+ scene: "form",
3242
+ use: "FormTriggerWorkflowActionModel",
3243
+ ownerPlugin: "@nocobase/plugin-workflow-custom-action-trigger",
3244
+ allowedContainerUses: import_action_scope.FORM_ACTION_CONTAINER_USES,
3245
+ createSupported: true
3246
+ },
3247
+ {
3248
+ publicKey: "submit",
3249
+ label: "Submit",
3250
+ scope: "filterForm",
3251
+ scene: "form",
3252
+ use: "FilterFormSubmitActionModel",
3253
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3254
+ allowedContainerUses: import_action_scope.FILTER_FORM_ACTION_CONTAINER_USES,
3255
+ createSupported: true
3256
+ },
3257
+ {
3258
+ publicKey: "reset",
3259
+ label: "Reset",
3260
+ scope: "filterForm",
3261
+ scene: "form",
3262
+ use: "FilterFormResetActionModel",
3263
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3264
+ allowedContainerUses: import_action_scope.FILTER_FORM_ACTION_CONTAINER_USES,
3265
+ createSupported: true
3266
+ },
3267
+ {
3268
+ publicKey: "collapse",
3269
+ label: "Collapse",
3270
+ scope: "filterForm",
3271
+ scene: "form",
3272
+ use: "FilterFormCollapseActionModel",
3273
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3274
+ allowedContainerUses: import_action_scope.FILTER_FORM_ACTION_CONTAINER_USES,
3275
+ createSupported: true
3276
+ },
3277
+ {
3278
+ publicKey: "js",
3279
+ label: "JS action",
3280
+ scope: "filterForm",
3281
+ scene: "form",
3282
+ use: "FilterFormJSActionModel",
3283
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3284
+ allowedContainerUses: import_action_scope.FILTER_FORM_ACTION_CONTAINER_USES,
3285
+ createSupported: true
3286
+ },
3287
+ {
3288
+ publicKey: "js",
3289
+ label: "JS action",
3290
+ scope: "actionPanel",
3291
+ scene: "all",
3292
+ use: "JSActionModel",
3293
+ ownerPlugin: CORE_FLOW_SURFACE_OWNER_PLUGIN,
3294
+ allowedContainerUses: import_action_scope.ACTION_PANEL_ACTION_CONTAINER_USES,
3295
+ createSupported: true
3296
+ },
3297
+ {
3298
+ publicKey: "triggerWorkflow",
3299
+ label: "Trigger workflow",
3300
+ scope: "actionPanel",
3301
+ scene: "all",
3302
+ use: "WorkbenchTriggerWorkflowActionModel",
3303
+ ownerPlugin: "@nocobase/plugin-workflow-custom-action-trigger",
3304
+ allowedContainerUses: import_action_scope.ACTION_PANEL_ACTION_CONTAINER_USES,
3305
+ createSupported: true
3306
+ },
3307
+ ...import_approval.APPROVAL_ACTION_CATALOG_SPECS.map((item) => ({
3308
+ publicKey: item.publicKey,
3309
+ label: item.label,
3310
+ scope: item.scope,
3311
+ scene: item.scene,
3312
+ use: item.use,
3313
+ ownerPlugin: import_approval.APPROVAL_FLOW_SURFACE_OWNER_PLUGIN,
3314
+ allowedContainerUses: item.allowedContainerUses,
3315
+ createSupported: item.createSupported
3316
+ }))
3317
+ ];
3318
+ const FLOW_SURFACE_ACTION_OWNER_PLUGIN_BY_USE = actionRegistry.reduce((map, item) => {
3319
+ if (!map.has(item.use)) {
3320
+ map.set(item.use, item.ownerPlugin);
3321
+ }
3322
+ return map;
3323
+ }, /* @__PURE__ */ new Map());
3324
+ function throwCatalogInvariant(message) {
3325
+ throw new import_errors.FlowSurfaceInternalError(message, "FLOW_SURFACE_INTERNAL_INVARIANT");
3326
+ }
3327
+ function validateActionRegistryItem(item) {
3328
+ if (!item.ownerPlugin.trim()) {
3329
+ throwCatalogInvariant(`flowSurfaces action registry '${item.publicKey}' must declare ownerPlugin`);
3330
+ }
3331
+ if (!item.allowedContainerUses.length) {
3332
+ throwCatalogInvariant(`flowSurfaces action registry '${item.publicKey}' must declare allowedContainerUses`);
3333
+ }
3334
+ if (!nodeContracts.has(item.use)) {
3335
+ throwCatalogInvariant(`flowSurfaces action registry '${item.publicKey}' references unsupported use '${item.use}'`);
3336
+ }
3337
+ item.allowedContainerUses.forEach(
3338
+ (containerUse) => (0, import_action_scope.assertActionScopeMatchesContainer)({
3339
+ actionScope: item.scope,
3340
+ containerUse,
3341
+ context: `action registry '${item.publicKey}'`
3342
+ })
3343
+ );
3344
+ }
3345
+ actionRegistry.forEach((item) => validateActionRegistryItem(item));
3346
+ function makeActionCatalogItem(item) {
3347
+ return makeCatalogItem({
3348
+ key: item.publicKey,
3349
+ label: item.label,
3350
+ kind: "action",
3351
+ scope: item.scope,
3352
+ scene: item.scene,
3353
+ use: item.use,
3354
+ allowedContainerUses: item.allowedContainerUses,
3355
+ createSupported: item.createSupported
3356
+ });
3357
+ }
3358
+ const actionCatalog = actionRegistry.map((item) => makeActionCatalogItem(item));
3359
+ const ACTION_PUBLIC_KEYS = dedupeActionCatalogItems(actionCatalog, (item) => item.key).map((item) => item.key);
3360
+ const SERVICE_SUPPORTED_FLOW_SURFACE_BLOCK_KEYS = PUBLIC_BLOCK_SUPPORT_MATRIX.filter(
3361
+ (entry) => entry.createSupported
3362
+ ).map((entry) => entry.key);
3363
+ const BLOCK_CATALOG_BY_KEY = new Map(blockCatalog.map((item) => [item.key, item]));
3364
+ const BLOCK_CATALOG_BY_USE = new Map(blockCatalog.map((item) => [item.use, item]));
3365
+ const ACTION_CATALOG_BY_KEY = actionCatalog.reduce((map, item) => {
3366
+ const entries = map.get(item.key) || [];
3367
+ entries.push(item);
3368
+ map.set(item.key, entries);
3369
+ return map;
3370
+ }, /* @__PURE__ */ new Map());
3371
+ const ACTION_CATALOG_BY_USE = actionCatalog.reduce((map, item) => {
3372
+ const entries = map.get(item.use) || [];
3373
+ entries.push(item);
3374
+ map.set(item.use, entries);
3375
+ return map;
3376
+ }, /* @__PURE__ */ new Map());
3377
+ const BLOCK_KEY_BY_USE = new Map(import_support_matrix.FLOW_SURFACE_BLOCK_SUPPORT_MATRIX.map((item) => [item.modelUse, item.key]));
3378
+ const ACTION_KEY_BY_USE = new Map(actionCatalog.map((item) => [item.use, toPublicActionCatalogItem(item).key]));
3379
+ function getCatalogItemOwnerPlugin(item) {
3380
+ if (item.kind === "block") {
3381
+ return import_approval.APPROVAL_BLOCK_OWNER_PLUGIN_BY_USE.get(item.use) || FLOW_SURFACE_BLOCK_OWNER_PLUGIN_BY_USE.get(item.use);
3382
+ }
3383
+ if (item.kind === "action") {
3384
+ return import_approval.APPROVAL_ACTION_OWNER_PLUGIN_BY_USE.get(item.use) || FLOW_SURFACE_ACTION_OWNER_PLUGIN_BY_USE.get(item.use);
3385
+ }
3386
+ return void 0;
3387
+ }
3388
+ function isAlwaysAvailableCatalogOwnerPlugin(ownerPlugin) {
3389
+ return !ownerPlugin || ownerPlugin === CORE_FLOW_SURFACE_OWNER_PLUGIN;
3390
+ }
3391
+ function throwUnavailableCatalogItem(item, options) {
3392
+ const requested = String(options.requestedType || "").trim() || String(options.requestedUse || "").trim() || String(item.key || "").trim() || String(item.use || "").trim();
3393
+ const ownerPlugin = getCatalogItemOwnerPlugin(item);
3394
+ const reason = ownerPlugin && !isAlwaysAvailableCatalogOwnerPlugin(ownerPlugin) ? ` because plugin '${ownerPlugin}' is not enabled` : "";
3395
+ throw new import_errors.FlowSurfaceBadRequestError(
3396
+ `flowSurfaces ${options.context} ${item.kind} '${requested}' is not available in the current app instance${reason}`
3397
+ );
3398
+ }
3399
+ function isCatalogItemAvailable(item, enabledPackages) {
3400
+ if (!enabledPackages) {
3401
+ return true;
3402
+ }
3403
+ const ownerPlugin = getCatalogItemOwnerPlugin(item);
3404
+ return isAlwaysAvailableCatalogOwnerPlugin(ownerPlugin) || (ownerPlugin ? enabledPackages.has(ownerPlugin) : false);
3405
+ }
3406
+ function filterAvailableCatalogItems(items, enabledPackages) {
3407
+ if (!enabledPackages) {
3408
+ return [...items];
3409
+ }
3410
+ return items.filter((item) => isCatalogItemAvailable(item, enabledPackages));
3411
+ }
3412
+ function normalizeActionCatalogKey(type) {
3413
+ return String(type || "").trim();
3414
+ }
3415
+ function resolveSupportedBlockCatalogItem(input, options = {}) {
3416
+ const item = (input.type ? BLOCK_CATALOG_BY_KEY.get(String(input.type).trim()) : void 0) || (input.use ? BLOCK_CATALOG_BY_USE.get(String(input.use).trim()) : void 0);
3417
+ if (!item) {
3418
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces addBlock only supports registered block types/uses`);
3419
+ }
3420
+ if (!isCatalogItemAvailable(item, options.enabledPackages)) {
3421
+ throwUnavailableCatalogItem(item, {
3422
+ context: options.context || "addBlock",
3423
+ requestedType: input.type,
3424
+ requestedUse: input.use
3425
+ });
3426
+ }
3427
+ if (!options.skipContainerValidation && !isBlockAllowedInContainer(item, input.containerUse)) {
3428
+ throw new import_errors.FlowSurfaceBadRequestError(
3429
+ `flowSurfaces addBlock '${input.type || input.use || item.key}' is not allowed under '${input.containerUse || "unknown"}'`
3430
+ );
3431
+ }
3432
+ if (options.requireCreateSupported && item.createSupported === false) {
3433
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces addBlock does not support creating '${item.key}' yet`);
3434
+ }
3435
+ return item;
3436
+ }
3437
+ function resolveSupportedActionCatalogItem(input, options = {}) {
3438
+ const requestedType = String(input.type || "").trim();
3439
+ const normalizedUse = String(input.use || "").trim();
3440
+ let item;
3441
+ if (input.containerUse) {
3442
+ (0, import_action_scope.assertKnownActionContainerUse)({
3443
+ containerUse: input.containerUse,
3444
+ context: "resolveAction"
3445
+ });
3446
+ }
3447
+ if (normalizedUse) {
3448
+ const useCandidates = ACTION_CATALOG_BY_USE.get(normalizedUse) || [];
3449
+ const availableUseCandidates = filterAvailableCatalogItems(useCandidates, options.enabledPackages);
3450
+ const matchedAll = getContainerScopedActionCatalogItems(useCandidates, input.containerUse);
3451
+ const matched = getContainerScopedActionCatalogItems(availableUseCandidates, input.containerUse);
3452
+ if (useCandidates.length && input.containerUse && !matchedAll.length) {
3453
+ throw new import_errors.FlowSurfaceBadRequestError(
3454
+ `flowSurfaces addAction '${normalizedUse}' is not allowed under '${input.containerUse}'`
3455
+ );
3456
+ }
3457
+ if ((matchedAll.length || useCandidates.length) && !matched.length && !availableUseCandidates.length) {
3458
+ throwUnavailableCatalogItem(useCandidates[0], {
3459
+ context: options.context || "addAction",
3460
+ requestedUse: normalizedUse
3461
+ });
3462
+ }
3463
+ if (matchedAll.length && !matched.length) {
3464
+ throwUnavailableCatalogItem(matchedAll[0], {
3465
+ context: options.context || "addAction",
3466
+ requestedUse: normalizedUse
3467
+ });
3468
+ }
3469
+ if (matched.length > 1 && !input.containerUse) {
3470
+ throw new import_errors.FlowSurfaceBadRequestError(
3471
+ `flowSurfaces addAction use '${normalizedUse}' requires containerUse to resolve a public action capability`
3472
+ );
3473
+ }
3474
+ item = matched[0];
3475
+ }
3476
+ if (!item && requestedType) {
3477
+ const normalizedType = normalizeActionCatalogKey(input.type);
3478
+ const candidates = (normalizedType ? ACTION_CATALOG_BY_KEY.get(normalizedType) : void 0) || [];
3479
+ const availableCandidates = filterAvailableCatalogItems(candidates, options.enabledPackages);
3480
+ const matchedAll = getContainerScopedActionCatalogItems(candidates, input.containerUse);
3481
+ const matched = getContainerScopedActionCatalogItems(availableCandidates, input.containerUse);
3482
+ if (candidates.length && input.containerUse && !matchedAll.length) {
3483
+ throw new import_errors.FlowSurfaceBadRequestError(
3484
+ `flowSurfaces addAction '${requestedType}' is not allowed under '${input.containerUse}'`
3485
+ );
3486
+ }
3487
+ if ((matchedAll.length || candidates.length) && !matched.length && !availableCandidates.length) {
3488
+ throwUnavailableCatalogItem(candidates[0], {
3489
+ context: options.context || "addAction",
3490
+ requestedType
3491
+ });
3492
+ }
3493
+ if (matchedAll.length && !matched.length) {
3494
+ throwUnavailableCatalogItem(matchedAll[0], {
3495
+ context: options.context || "addAction",
3496
+ requestedType
3497
+ });
3498
+ }
3499
+ if (matched.length > 1 && !input.containerUse) {
3500
+ throw new import_errors.FlowSurfaceBadRequestError(
3501
+ `flowSurfaces addAction type '${requestedType}' requires containerUse to resolve a public action capability`
3502
+ );
3503
+ }
3504
+ item = matched[0];
3505
+ }
3506
+ if (!item) {
3507
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces addAction only supports registered action types/uses`);
3508
+ }
3509
+ if (!isCatalogItemAvailable(item, options.enabledPackages)) {
3510
+ throwUnavailableCatalogItem(item, {
3511
+ context: options.context || "addAction",
3512
+ requestedType: input.type,
3513
+ requestedUse: input.use
3514
+ });
3515
+ }
3516
+ if (requestedType) {
3517
+ const publicKey = toPublicActionCatalogItem(item).key;
3518
+ if (requestedType !== publicKey) {
3519
+ throw new import_errors.FlowSurfaceBadRequestError(
3520
+ `flowSurfaces addAction only supports public action type '${publicKey}' under '${input.containerUse || "unknown"}'`
3521
+ );
3522
+ }
3523
+ }
3524
+ if (input.containerUse && !isActionAllowedInContainer(item, input.containerUse)) {
3525
+ throw new import_errors.FlowSurfaceBadRequestError(
3526
+ `flowSurfaces addAction '${toPublicActionCatalogItem(item).key}' is not allowed under '${input.containerUse}'`
3527
+ );
3528
+ }
3529
+ if (options.requireCreateSupported && item.createSupported === false) {
3530
+ throw new import_errors.FlowSurfaceBadRequestError(`flowSurfaces addAction does not support creating '${item.key}' yet`);
3531
+ }
3532
+ return item;
3533
+ }
3534
+ function getNodeContract(use) {
3535
+ if (use) {
3536
+ const contract = nodeContracts.get(use) || nodeContracts.get((0, import_approval.normalizeApprovalSemanticUse)(use));
3537
+ if (contract) {
3538
+ return contract;
3539
+ }
3540
+ }
3541
+ return READONLY_NODE_CONTRACT;
3542
+ }
3543
+ function getEditableDomainsForUse(use) {
3544
+ return [...getNodeContract(use).editableDomains];
3545
+ }
3546
+ function getSettingsSchemaForUse(use) {
3547
+ return buildSettingsSchema(getNodeContract(use));
3548
+ }
3549
+ function getLayoutCapabilitiesForUse(use) {
3550
+ return getNodeContract(use).layoutCapabilities;
3551
+ }
3552
+ // Annotate the CommonJS export names for ESM import in node:
3553
+ 0 && (module.exports = {
3554
+ ACTION_CATALOG_BY_KEY,
3555
+ ACTION_CATALOG_BY_USE,
3556
+ ACTION_KEY_BY_USE,
3557
+ ACTION_PUBLIC_KEYS,
3558
+ BLOCK_CATALOG_BY_KEY,
3559
+ BLOCK_CATALOG_BY_USE,
3560
+ BLOCK_KEY_BY_USE,
3561
+ READONLY_NODE_CONTRACT,
3562
+ SERVICE_SUPPORTED_FLOW_SURFACE_BLOCK_KEYS,
3563
+ actionCatalog,
3564
+ blockCatalog,
3565
+ filterAvailableCatalogItems,
3566
+ getAvailableActionCatalogItems,
3567
+ getAvailableBlockCatalogItems,
3568
+ getEditableDomainsForUse,
3569
+ getLayoutCapabilitiesForUse,
3570
+ getNodeContract,
3571
+ getSettingsSchemaForUse,
3572
+ getSupportedFieldComponentUseSet,
3573
+ isCatalogItemAvailable,
3574
+ resolveSupportedActionCatalogItem,
3575
+ resolveSupportedBlockCatalogItem,
3576
+ resolveSupportedFieldCapability
3577
+ });