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