@nocobase/plugin-flow-engine 2.1.0-beta.15 → 2.1.0-beta.17

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