@nocobase/plugin-flow-engine 2.1.0-alpha.3 → 2.1.0-alpha.31

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