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

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