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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/LICENSE +201 -661
  2. package/README.md +79 -9
  3. package/dist/ai/ai-employees/nathan/index.d.ts +10 -0
  4. package/dist/ai/ai-employees/nathan/index.js +41 -0
  5. package/dist/ai/ai-employees/nathan/prompt.md +132 -0
  6. package/dist/ai/ai-employees/nathan/skills/frontend-developer/SKILLS.md +69 -0
  7. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.js +2 -2
  8. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.js +2 -2
  9. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.js +2 -2
  10. package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.js +2 -2
  11. package/dist/ai/docs/runjs/context/block-model.md +35 -35
  12. package/dist/ai/docs/runjs/context/collection-field.md +53 -51
  13. package/dist/ai/docs/runjs/context/collection.md +39 -39
  14. package/dist/ai/docs/runjs/context/data-source-manager.md +40 -30
  15. package/dist/ai/docs/runjs/context/data-source.md +52 -44
  16. package/dist/ai/docs/runjs/context/element.md +44 -38
  17. package/dist/ai/docs/runjs/context/exit-all.md +37 -35
  18. package/dist/ai/docs/runjs/context/exit.md +38 -35
  19. package/dist/ai/docs/runjs/context/filter-manager.md +36 -30
  20. package/dist/ai/docs/runjs/context/form.md +57 -57
  21. package/dist/ai/docs/runjs/context/get-model.md +22 -21
  22. package/dist/ai/docs/runjs/context/get-value.md +20 -19
  23. package/dist/ai/docs/runjs/context/get-var.md +61 -55
  24. package/dist/ai/docs/runjs/context/i18n.md +17 -14
  25. package/dist/ai/docs/runjs/context/import-async.md +333 -45
  26. package/dist/ai/docs/runjs/context/init-resource.md +20 -20
  27. package/dist/ai/docs/runjs/context/libs.md +31 -31
  28. package/dist/ai/docs/runjs/context/location.md +34 -31
  29. package/dist/ai/docs/runjs/context/logger.md +41 -40
  30. package/dist/ai/docs/runjs/context/make-resource.md +27 -26
  31. package/dist/ai/docs/runjs/context/message.md +42 -41
  32. package/dist/ai/docs/runjs/context/modal.md +44 -44
  33. package/dist/ai/docs/runjs/context/model.md +36 -33
  34. package/dist/ai/docs/runjs/context/notification.md +41 -40
  35. package/dist/ai/docs/runjs/context/off.md +14 -14
  36. package/dist/ai/docs/runjs/context/on.md +30 -29
  37. package/dist/ai/docs/runjs/context/open-view.md +40 -40
  38. package/dist/ai/docs/runjs/context/render.md +37 -32
  39. package/dist/ai/docs/runjs/context/request.md +46 -45
  40. package/dist/ai/docs/runjs/context/require-async.md +28 -25
  41. package/dist/ai/docs/runjs/context/resource.md +34 -34
  42. package/dist/ai/docs/runjs/context/route.md +36 -34
  43. package/dist/ai/docs/runjs/context/router.md +43 -31
  44. package/dist/ai/docs/runjs/context/set-value.md +18 -17
  45. package/dist/ai/docs/runjs/context/sql.md +7 -15
  46. package/dist/ai/docs/runjs/context/t.md +20 -17
  47. package/dist/ai/docs/runjs/context/view.md +49 -46
  48. package/dist/ai/docs/runjs/document.md +1 -0
  49. package/dist/ai/docs/runjs/import-modules.md +32 -32
  50. package/dist/ai/docs/runjs/index.md +13 -13
  51. package/dist/ai/docs/runjs/jsx.md +19 -19
  52. package/dist/ai/docs/runjs/model/form-block-model.md +1 -3
  53. package/dist/ai/docs/runjs/render.md +15 -15
  54. package/dist/ai/docs/runjs/resource/api-resource.md +53 -53
  55. package/dist/ai/docs/runjs/resource/multi-record-resource.md +64 -64
  56. package/dist/ai/docs/runjs/resource/single-record-resource.md +55 -55
  57. package/dist/ai/docs/runjs/resource/sql-resource.md +57 -57
  58. package/dist/ai/docs/runjs/window.md +5 -5
  59. package/dist/client/index.js +1 -1
  60. package/dist/externalVersion.js +11 -11
  61. package/dist/locale/en-US.json +1 -0
  62. package/dist/locale/index.d.ts +2 -0
  63. package/dist/locale/zh-CN.json +1 -0
  64. package/dist/node_modules/ses/package.json +1 -1
  65. package/dist/node_modules/zod/package.json +1 -1
  66. package/dist/server/collections/flowsql.js +1 -0
  67. package/dist/server/flow-surfaces/action-scope.d.ts +37 -0
  68. package/dist/server/flow-surfaces/action-scope.js +148 -0
  69. package/dist/server/flow-surfaces/apply/compiler.d.ts +13 -0
  70. package/dist/server/flow-surfaces/apply/compiler.js +969 -0
  71. package/dist/server/flow-surfaces/apply/layout.d.ts +34 -0
  72. package/dist/server/flow-surfaces/apply/layout.js +175 -0
  73. package/dist/server/flow-surfaces/apply/matching.d.ts +16 -0
  74. package/dist/server/flow-surfaces/apply/matching.js +181 -0
  75. package/dist/server/flow-surfaces/approval/blueprint-service.d.ts +84 -0
  76. package/dist/server/flow-surfaces/approval/blueprint-service.js +589 -0
  77. package/dist/server/flow-surfaces/approval/blueprint.d.ts +21 -0
  78. package/dist/server/flow-surfaces/approval/blueprint.js +187 -0
  79. package/dist/server/flow-surfaces/approval/builder.d.ts +225 -0
  80. package/dist/server/flow-surfaces/approval/builder.js +384 -0
  81. package/dist/server/flow-surfaces/approval/catalog-specs.d.ts +33 -0
  82. package/dist/server/flow-surfaces/approval/catalog-specs.js +156 -0
  83. package/dist/server/flow-surfaces/approval/index.d.ts +14 -0
  84. package/dist/server/flow-surfaces/approval/index.js +40 -0
  85. package/dist/server/flow-surfaces/approval/runtime-config.d.ts +44 -0
  86. package/dist/server/flow-surfaces/approval/runtime-config.js +299 -0
  87. package/dist/server/flow-surfaces/approval/semantic-use.d.ts +23 -0
  88. package/dist/server/flow-surfaces/approval/semantic-use.js +155 -0
  89. package/dist/server/flow-surfaces/association-title-field.d.ts +20 -0
  90. package/dist/server/flow-surfaces/association-title-field.js +158 -0
  91. package/dist/server/flow-surfaces/blueprint/compile-blocks.d.ts +14 -0
  92. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +844 -0
  93. package/dist/server/flow-surfaces/blueprint/compile-plan.d.ts +13 -0
  94. package/dist/server/flow-surfaces/blueprint/compile-plan.js +308 -0
  95. package/dist/server/flow-surfaces/blueprint/compile-reaction.d.ts +11 -0
  96. package/dist/server/flow-surfaces/blueprint/compile-reaction.js +72 -0
  97. package/dist/server/flow-surfaces/blueprint/index.d.ts +12 -0
  98. package/dist/server/flow-surfaces/blueprint/index.js +44 -0
  99. package/dist/server/flow-surfaces/blueprint/normalize-document.d.ts +10 -0
  100. package/dist/server/flow-surfaces/blueprint/normalize-document.js +296 -0
  101. package/dist/server/flow-surfaces/blueprint/private-utils.d.ts +26 -0
  102. package/dist/server/flow-surfaces/blueprint/private-utils.js +182 -0
  103. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +161 -0
  104. package/dist/server/flow-surfaces/blueprint/public-types.js +24 -0
  105. package/dist/server/flow-surfaces/builder.d.ts +211 -0
  106. package/dist/server/flow-surfaces/builder.js +931 -0
  107. package/dist/server/flow-surfaces/catalog-smart.d.ts +18 -0
  108. package/dist/server/flow-surfaces/catalog-smart.js +239 -0
  109. package/dist/server/flow-surfaces/catalog-smart.projector.d.ts +15 -0
  110. package/dist/server/flow-surfaces/catalog-smart.projector.js +157 -0
  111. package/dist/server/flow-surfaces/catalog-smart.types.d.ts +99 -0
  112. package/dist/server/flow-surfaces/catalog-smart.types.js +24 -0
  113. package/dist/server/flow-surfaces/catalog.d.ts +78 -0
  114. package/dist/server/flow-surfaces/catalog.js +3254 -0
  115. package/dist/server/flow-surfaces/chart-config.d.ts +121 -0
  116. package/dist/server/flow-surfaces/chart-config.js +1394 -0
  117. package/dist/server/flow-surfaces/compose-compiler.d.ts +106 -0
  118. package/dist/server/flow-surfaces/compose-compiler.js +163 -0
  119. package/dist/server/flow-surfaces/compose-runtime.d.ts +93 -0
  120. package/dist/server/flow-surfaces/compose-runtime.js +375 -0
  121. package/dist/server/flow-surfaces/configure-options.d.ts +23 -0
  122. package/dist/server/flow-surfaces/configure-options.js +751 -0
  123. package/dist/server/flow-surfaces/constants.d.ts +351 -0
  124. package/dist/server/flow-surfaces/constants.js +104 -0
  125. package/dist/server/flow-surfaces/context.d.ts +72 -0
  126. package/dist/server/flow-surfaces/context.js +556 -0
  127. package/dist/server/flow-surfaces/contract-guard.d.ts +19 -0
  128. package/dist/server/flow-surfaces/contract-guard.js +411 -0
  129. package/dist/server/flow-surfaces/default-action-popup.d.ts +53 -0
  130. package/dist/server/flow-surfaces/default-action-popup.js +262 -0
  131. package/dist/server/flow-surfaces/default-block-actions.d.ts +32 -0
  132. package/dist/server/flow-surfaces/default-block-actions.js +178 -0
  133. package/dist/server/flow-surfaces/errors.d.ts +47 -0
  134. package/dist/server/flow-surfaces/errors.js +145 -0
  135. package/dist/server/flow-surfaces/executor.d.ts +23 -0
  136. package/dist/server/flow-surfaces/executor.js +132 -0
  137. package/dist/server/flow-surfaces/field-binding-registry.d.ts +23 -0
  138. package/dist/server/flow-surfaces/field-binding-registry.js +391 -0
  139. package/dist/server/flow-surfaces/field-semantics.d.ts +15 -0
  140. package/dist/server/flow-surfaces/field-semantics.js +81 -0
  141. package/dist/server/flow-surfaces/index.d.ts +11 -0
  142. package/dist/server/flow-surfaces/index.js +175 -0
  143. package/dist/server/flow-surfaces/locator.d.ts +28 -0
  144. package/dist/server/flow-surfaces/locator.js +240 -0
  145. package/dist/server/flow-surfaces/node-use-sets.d.ts +15 -0
  146. package/dist/server/flow-surfaces/node-use-sets.js +126 -0
  147. package/dist/server/flow-surfaces/payload-shape.d.ts +9 -0
  148. package/dist/server/flow-surfaces/payload-shape.js +61 -0
  149. package/dist/server/flow-surfaces/placement.d.ts +33 -0
  150. package/dist/server/flow-surfaces/placement.js +192 -0
  151. package/dist/server/flow-surfaces/planning/action-specs.d.ts +179 -0
  152. package/dist/server/flow-surfaces/planning/action-specs.js +190 -0
  153. package/dist/server/flow-surfaces/planning/compiler.d.ts +37 -0
  154. package/dist/server/flow-surfaces/planning/compiler.js +376 -0
  155. package/dist/server/flow-surfaces/planning/context.d.ts +30 -0
  156. package/dist/server/flow-surfaces/planning/context.js +139 -0
  157. package/dist/server/flow-surfaces/planning/created-keys.d.ts +34 -0
  158. package/dist/server/flow-surfaces/planning/created-keys.js +375 -0
  159. package/dist/server/flow-surfaces/planning/key-kind.d.ts +11 -0
  160. package/dist/server/flow-surfaces/planning/key-kind.js +88 -0
  161. package/dist/server/flow-surfaces/planning/key-persistence.d.ts +34 -0
  162. package/dist/server/flow-surfaces/planning/key-persistence.js +148 -0
  163. package/dist/server/flow-surfaces/planning/key-registry.d.ts +40 -0
  164. package/dist/server/flow-surfaces/planning/key-registry.js +206 -0
  165. package/dist/server/flow-surfaces/planning/runtime.d.ts +37 -0
  166. package/dist/server/flow-surfaces/planning/runtime.js +259 -0
  167. package/dist/server/flow-surfaces/planning/step-link.d.ts +14 -0
  168. package/dist/server/flow-surfaces/planning/step-link.js +104 -0
  169. package/dist/server/flow-surfaces/planning/types.d.ts +55 -0
  170. package/dist/server/flow-surfaces/planning/types.js +24 -0
  171. package/dist/server/flow-surfaces/reaction/errors.d.ts +20 -0
  172. package/dist/server/flow-surfaces/reaction/errors.js +69 -0
  173. package/dist/server/flow-surfaces/reaction/field-value.d.ts +34 -0
  174. package/dist/server/flow-surfaces/reaction/field-value.js +181 -0
  175. package/dist/server/flow-surfaces/reaction/fingerprint.d.ts +16 -0
  176. package/dist/server/flow-surfaces/reaction/fingerprint.js +71 -0
  177. package/dist/server/flow-surfaces/reaction/linkage.d.ts +136 -0
  178. package/dist/server/flow-surfaces/reaction/linkage.js +882 -0
  179. package/dist/server/flow-surfaces/reaction/meta.d.ts +11 -0
  180. package/dist/server/flow-surfaces/reaction/meta.js +451 -0
  181. package/dist/server/flow-surfaces/reaction/registry.d.ts +149 -0
  182. package/dist/server/flow-surfaces/reaction/registry.js +199 -0
  183. package/dist/server/flow-surfaces/reaction/resolver.d.ts +22 -0
  184. package/dist/server/flow-surfaces/reaction/resolver.js +202 -0
  185. package/dist/server/flow-surfaces/reaction/types.d.ts +241 -0
  186. package/dist/server/flow-surfaces/reaction/types.js +24 -0
  187. package/dist/server/flow-surfaces/reaction/utils.d.ts +17 -0
  188. package/dist/server/flow-surfaces/reaction/utils.js +67 -0
  189. package/dist/server/flow-surfaces/reaction/value-expr.d.ts +15 -0
  190. package/dist/server/flow-surfaces/reaction/value-expr.js +209 -0
  191. package/dist/server/flow-surfaces/reference-guards.d.ts +19 -0
  192. package/dist/server/flow-surfaces/reference-guards.js +103 -0
  193. package/dist/server/flow-surfaces/route-sync.d.ts +47 -0
  194. package/dist/server/flow-surfaces/route-sync.js +392 -0
  195. package/dist/server/flow-surfaces/service-helpers.d.ts +42 -0
  196. package/dist/server/flow-surfaces/service-helpers.js +377 -0
  197. package/dist/server/flow-surfaces/service-utils.d.ts +101 -0
  198. package/dist/server/flow-surfaces/service-utils.js +762 -0
  199. package/dist/server/flow-surfaces/service.d.ts +703 -0
  200. package/dist/server/flow-surfaces/service.js +11376 -0
  201. package/dist/server/flow-surfaces/support-matrix.d.ts +28 -0
  202. package/dist/server/flow-surfaces/support-matrix.js +246 -0
  203. package/dist/server/flow-surfaces/surface-context.d.ts +52 -0
  204. package/dist/server/flow-surfaces/surface-context.js +436 -0
  205. package/dist/server/flow-surfaces/template-compatibility.d.ts +42 -0
  206. package/dist/server/flow-surfaces/template-compatibility.js +189 -0
  207. package/dist/server/flow-surfaces/template-service-utils.d.ts +62 -0
  208. package/dist/server/flow-surfaces/template-service-utils.js +281 -0
  209. package/dist/server/flow-surfaces/types.d.ts +287 -0
  210. package/dist/server/flow-surfaces/types.js +24 -0
  211. package/dist/server/index.d.ts +1 -0
  212. package/dist/server/index.js +7 -2
  213. package/dist/server/plugin.d.ts +0 -1
  214. package/dist/server/plugin.js +9 -34
  215. package/dist/server/repository.js +0 -5
  216. package/dist/server/variables/resolve.d.ts +21 -0
  217. package/dist/server/variables/resolve.js +79 -0
  218. package/dist/swagger/flow-surfaces.d.ts +5804 -0
  219. package/dist/swagger/flow-surfaces.examples.d.ts +1427 -0
  220. package/dist/swagger/flow-surfaces.examples.js +1607 -0
  221. package/dist/swagger/flow-surfaces.js +5195 -0
  222. package/dist/swagger/flow-surfaces.template-action-docs.d.ts +62 -0
  223. package/dist/swagger/flow-surfaces.template-action-docs.js +121 -0
  224. package/dist/swagger/flow-surfaces.template-schemas.d.ts +239 -0
  225. package/dist/swagger/flow-surfaces.template-schemas.js +255 -0
  226. package/dist/swagger/index.d.ts +5809 -0
  227. package/dist/swagger/index.js +50 -0
  228. package/package.json +3 -3
  229. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextApis.d.ts +0 -0
  230. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextEnvs.d.ts +0 -0
  231. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/getContextVars.d.ts +0 -0
  232. /package/dist/ai/{tools → ai-employees/nathan/skills/frontend-developer/tools}/lintAndTestJS.d.ts +0 -0
@@ -0,0 +1,1607 @@
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 flow_surfaces_examples_exports = {};
28
+ __export(flow_surfaces_examples_exports, {
29
+ flowSurfaceExamples: () => flowSurfaceExamples
30
+ });
31
+ module.exports = __toCommonJS(flow_surfaces_examples_exports);
32
+ const flowSurfaceExamples = {
33
+ catalog: {
34
+ target: {
35
+ uid: "table-block-uid"
36
+ }
37
+ },
38
+ context: {
39
+ target: {
40
+ uid: "details-block-uid"
41
+ },
42
+ path: "record",
43
+ maxDepth: 3
44
+ },
45
+ getReactionMeta: {
46
+ target: {
47
+ uid: "employees-form-uid"
48
+ }
49
+ },
50
+ describeSurface: {
51
+ locator: {
52
+ pageSchemaUid: "employees-page-schema"
53
+ },
54
+ bindKeys: [
55
+ {
56
+ key: "employeesTable",
57
+ locator: {
58
+ uid: "employees-table-uid"
59
+ },
60
+ expectedKind: "block"
61
+ }
62
+ ]
63
+ },
64
+ applyBlueprint: {
65
+ version: "1",
66
+ mode: "create",
67
+ navigation: {
68
+ group: {
69
+ title: "Workspace"
70
+ },
71
+ item: {
72
+ title: "Employees"
73
+ }
74
+ },
75
+ page: {
76
+ title: "Employees",
77
+ documentTitle: "Employees workspace",
78
+ enableHeader: true,
79
+ displayTitle: true
80
+ },
81
+ tabs: [
82
+ {
83
+ key: "main",
84
+ title: "Overview",
85
+ blocks: [
86
+ {
87
+ key: "employeeForm",
88
+ type: "createForm",
89
+ collection: "employees",
90
+ fields: [
91
+ { key: "nicknameField", field: "nickname" },
92
+ { key: "statusField", field: "status" },
93
+ "amount",
94
+ "taxRate",
95
+ "subtotal",
96
+ "total"
97
+ ],
98
+ fieldsLayout: {
99
+ rows: [
100
+ ["nicknameField"],
101
+ [
102
+ { key: "statusField", span: 12 },
103
+ { key: "amount", span: 12 }
104
+ ],
105
+ ["taxRate"],
106
+ ["subtotal"],
107
+ ["total"]
108
+ ]
109
+ },
110
+ actions: ["submit"]
111
+ },
112
+ {
113
+ key: "employeesTable",
114
+ type: "table",
115
+ collection: "employees",
116
+ fields: ["nickname", "status", "total"],
117
+ actions: [
118
+ {
119
+ key: "refreshAction",
120
+ type: "refresh"
121
+ }
122
+ ]
123
+ }
124
+ ],
125
+ layout: {
126
+ rows: [["main.employeeForm"], ["main.employeesTable"]]
127
+ }
128
+ }
129
+ ],
130
+ reaction: {
131
+ items: [
132
+ {
133
+ type: "setFieldValueRules",
134
+ target: "main.employeeForm",
135
+ rules: [
136
+ {
137
+ key: "defaultStatus",
138
+ targetPath: "status",
139
+ mode: "default",
140
+ value: {
141
+ source: "literal",
142
+ value: "draft"
143
+ }
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ type: "setBlockLinkageRules",
149
+ target: "main.employeesTable",
150
+ rules: [
151
+ {
152
+ key: "hideTable",
153
+ when: {
154
+ logic: "$and",
155
+ items: [
156
+ {
157
+ path: "params.query.hideTable",
158
+ operator: "$isTruly"
159
+ }
160
+ ]
161
+ },
162
+ then: [{ type: "setBlockState", state: "hidden" }]
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ type: "setFieldLinkageRules",
168
+ target: "main.employeeForm",
169
+ rules: [
170
+ {
171
+ key: "recomputeTotals",
172
+ when: {
173
+ logic: "$and",
174
+ items: [
175
+ {
176
+ path: "formValues.amount",
177
+ operator: "$notEmpty"
178
+ }
179
+ ]
180
+ },
181
+ then: [
182
+ {
183
+ type: "assignField",
184
+ items: [
185
+ {
186
+ targetPath: "subtotal",
187
+ value: {
188
+ source: "runjs",
189
+ version: "v2",
190
+ code: "const amount = Number(ctx.formValues?.amount || 0); return amount;"
191
+ }
192
+ },
193
+ {
194
+ targetPath: "total",
195
+ value: {
196
+ source: "runjs",
197
+ version: "v2",
198
+ code: "const amount = Number(ctx.formValues?.amount || 0); const taxRate = Number(ctx.formValues?.taxRate || 0); return amount + amount * taxRate;"
199
+ }
200
+ }
201
+ ]
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ type: "setActionLinkageRules",
209
+ target: "main.employeesTable.refreshAction",
210
+ rules: [
211
+ {
212
+ key: "disableRefresh",
213
+ when: {
214
+ logic: "$and",
215
+ items: [
216
+ {
217
+ path: "params.query.readonly",
218
+ operator: "$isTruly"
219
+ }
220
+ ]
221
+ },
222
+ then: [{ type: "setActionState", state: "disabled" }]
223
+ }
224
+ ]
225
+ }
226
+ ]
227
+ }
228
+ },
229
+ applyBlueprintReplace: {
230
+ version: "1",
231
+ mode: "replace",
232
+ target: {
233
+ pageSchemaUid: "employees-page-schema"
234
+ },
235
+ page: {
236
+ title: "Employees workspace",
237
+ documentTitle: "Employees replace flow",
238
+ displayTitle: false,
239
+ enableTabs: true
240
+ },
241
+ tabs: [
242
+ {
243
+ title: "Overview",
244
+ blocks: [
245
+ {
246
+ key: "employeesTable",
247
+ type: "table",
248
+ collection: "employees",
249
+ fields: ["nickname", "status", "total"]
250
+ }
251
+ ]
252
+ }
253
+ ]
254
+ },
255
+ applyApprovalBlueprintInitiator: {
256
+ version: "1",
257
+ surface: "initiator",
258
+ workflowId: 101,
259
+ blocks: [
260
+ {
261
+ key: "initiatorForm",
262
+ type: "approvalInitiator",
263
+ resource: {
264
+ dataSourceKey: "main",
265
+ collectionName: "employees"
266
+ },
267
+ fields: ["nickname", "status"],
268
+ actions: ["approvalSaveDraft", "approvalWithdraw"]
269
+ }
270
+ ],
271
+ layout: {
272
+ rows: [["initiatorForm"]]
273
+ }
274
+ },
275
+ applyApprovalBlueprintApprover: {
276
+ version: "1",
277
+ surface: "approver",
278
+ nodeId: 201,
279
+ blocks: [
280
+ {
281
+ key: "processForm",
282
+ type: "approvalApprover",
283
+ resource: {
284
+ dataSourceKey: "main",
285
+ collectionName: "employees"
286
+ },
287
+ fields: ["nickname"],
288
+ actions: [
289
+ "approvalApprove",
290
+ "approvalReject",
291
+ {
292
+ type: "approvalReturn",
293
+ settings: {
294
+ approvalReturn: {
295
+ type: "count",
296
+ count: 1
297
+ }
298
+ }
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ key: "approvalInfo",
304
+ type: "approvalInformation",
305
+ resource: {
306
+ dataSourceKey: "main",
307
+ collectionName: "employees"
308
+ },
309
+ fields: ["status"]
310
+ }
311
+ ],
312
+ layout: {
313
+ rows: [["processForm"], ["approvalInfo"]]
314
+ }
315
+ },
316
+ applyApprovalBlueprintTaskCard: {
317
+ version: "1",
318
+ surface: "taskCard",
319
+ nodeId: 201,
320
+ fields: [
321
+ {
322
+ key: "nickname",
323
+ fieldPath: "nickname"
324
+ },
325
+ {
326
+ key: "status",
327
+ fieldPath: "status"
328
+ }
329
+ ],
330
+ layout: {
331
+ rows: [["nickname", "status"]]
332
+ }
333
+ },
334
+ setFieldValueRules: {
335
+ target: {
336
+ uid: "employees-form-uid"
337
+ },
338
+ rules: [
339
+ {
340
+ key: "defaultStatus",
341
+ targetPath: "status",
342
+ mode: "default",
343
+ value: {
344
+ source: "literal",
345
+ value: "draft"
346
+ }
347
+ }
348
+ ],
349
+ expectedFingerprint: "field-value-fp-1"
350
+ },
351
+ setBlockLinkageRules: {
352
+ target: {
353
+ uid: "employees-table-uid"
354
+ },
355
+ rules: [
356
+ {
357
+ key: "hideTable",
358
+ when: {
359
+ logic: "$and",
360
+ items: [
361
+ {
362
+ path: "params.query.hideTable",
363
+ operator: "$isTruly"
364
+ }
365
+ ]
366
+ },
367
+ then: [{ type: "setBlockState", state: "hidden" }]
368
+ }
369
+ ],
370
+ expectedFingerprint: "block-linkage-fp-1"
371
+ },
372
+ setFieldLinkageRules: {
373
+ target: {
374
+ uid: "employees-form-uid"
375
+ },
376
+ rules: [
377
+ {
378
+ key: "recomputeTotals",
379
+ when: {
380
+ logic: "$and",
381
+ items: [
382
+ {
383
+ path: "formValues.amount",
384
+ operator: "$notEmpty"
385
+ }
386
+ ]
387
+ },
388
+ then: [
389
+ {
390
+ type: "assignField",
391
+ items: [
392
+ {
393
+ targetPath: "subtotal",
394
+ value: {
395
+ source: "runjs",
396
+ version: "v2",
397
+ code: "const amount = Number(ctx.formValues?.amount || 0); return amount;"
398
+ }
399
+ },
400
+ {
401
+ targetPath: "total",
402
+ value: {
403
+ source: "runjs",
404
+ version: "v2",
405
+ code: "const amount = Number(ctx.formValues?.amount || 0); const taxRate = Number(ctx.formValues?.taxRate || 0); return amount + amount * taxRate;"
406
+ }
407
+ }
408
+ ]
409
+ }
410
+ ]
411
+ }
412
+ ],
413
+ expectedFingerprint: "field-linkage-fp-1"
414
+ },
415
+ setActionLinkageRules: {
416
+ target: {
417
+ uid: "refresh-action-uid"
418
+ },
419
+ expectedFingerprint: "action-linkage-fp-1",
420
+ rules: [
421
+ {
422
+ key: "disableRefresh",
423
+ when: {
424
+ logic: "$and",
425
+ items: [
426
+ {
427
+ path: "params.query.readonly",
428
+ operator: "$isTruly"
429
+ }
430
+ ]
431
+ },
432
+ then: [{ type: "setActionState", state: "disabled" }]
433
+ }
434
+ ]
435
+ },
436
+ compose: {
437
+ target: {
438
+ uid: "page-grid-uid"
439
+ },
440
+ mode: "append",
441
+ blocks: [
442
+ {
443
+ key: "filter",
444
+ type: "filterForm",
445
+ resource: {
446
+ dataSourceKey: "main",
447
+ collectionName: "users"
448
+ },
449
+ fields: [
450
+ {
451
+ fieldPath: "username",
452
+ target: "table"
453
+ },
454
+ {
455
+ fieldPath: "nickname",
456
+ target: "table"
457
+ }
458
+ ],
459
+ fieldsLayout: {
460
+ rows: [
461
+ [
462
+ { key: "nickname", span: 12 },
463
+ { key: "username", span: 12 }
464
+ ]
465
+ ]
466
+ },
467
+ actions: ["submit", "reset", "collapse"]
468
+ },
469
+ {
470
+ key: "table",
471
+ type: "table",
472
+ resource: {
473
+ dataSourceKey: "main",
474
+ collectionName: "users"
475
+ },
476
+ fields: ["username", "nickname", { fieldPath: "roles.title" }],
477
+ actions: ["filter", "addNew", "refresh", "bulkDelete", "link"],
478
+ recordActions: [
479
+ "view",
480
+ "edit",
481
+ {
482
+ type: "popup",
483
+ popup: {
484
+ mode: "replace",
485
+ blocks: [
486
+ {
487
+ key: "details",
488
+ type: "details",
489
+ resource: {
490
+ dataSourceKey: "main",
491
+ collectionName: "users"
492
+ },
493
+ fields: ["username", "nickname"]
494
+ }
495
+ ]
496
+ }
497
+ },
498
+ "updateRecord",
499
+ "delete"
500
+ ]
501
+ }
502
+ ],
503
+ layout: {
504
+ rows: [
505
+ [
506
+ {
507
+ key: "filter",
508
+ span: 3
509
+ },
510
+ {
511
+ key: "table",
512
+ span: 7
513
+ }
514
+ ]
515
+ ]
516
+ }
517
+ },
518
+ composeStatic: {
519
+ target: {
520
+ uid: "page-grid-uid"
521
+ },
522
+ blocks: [
523
+ {
524
+ key: "markdown",
525
+ type: "markdown",
526
+ settings: {
527
+ content: "# Team handbook"
528
+ }
529
+ },
530
+ {
531
+ key: "iframe",
532
+ type: "iframe",
533
+ settings: {
534
+ mode: "url",
535
+ url: "https://example.com/embed",
536
+ height: 360
537
+ }
538
+ },
539
+ {
540
+ key: "panel",
541
+ type: "actionPanel",
542
+ settings: {
543
+ layout: "list",
544
+ ellipsis: false
545
+ }
546
+ }
547
+ ],
548
+ layout: {
549
+ rows: [["markdown", "iframe"], ["panel"]]
550
+ }
551
+ },
552
+ composeListRich: {
553
+ target: {
554
+ uid: "page-grid-uid"
555
+ },
556
+ blocks: [
557
+ {
558
+ key: "employeesList",
559
+ type: "list",
560
+ resource: {
561
+ dataSourceKey: "main",
562
+ collectionName: "employees"
563
+ },
564
+ fields: [
565
+ "nickname",
566
+ {
567
+ fieldPath: "department.name"
568
+ }
569
+ ],
570
+ actions: ["addNew", "refresh"],
571
+ recordActions: [
572
+ "view",
573
+ "edit",
574
+ {
575
+ type: "popup",
576
+ popup: {
577
+ mode: "replace",
578
+ blocks: [
579
+ {
580
+ key: "details",
581
+ type: "details",
582
+ resource: {
583
+ dataSourceKey: "main",
584
+ collectionName: "employees"
585
+ },
586
+ fields: ["nickname"]
587
+ }
588
+ ]
589
+ }
590
+ },
591
+ "delete"
592
+ ],
593
+ settings: {
594
+ pageSize: 20,
595
+ layout: "vertical"
596
+ }
597
+ }
598
+ ]
599
+ },
600
+ composeGridCardRich: {
601
+ target: {
602
+ uid: "page-grid-uid"
603
+ },
604
+ blocks: [
605
+ {
606
+ key: "employeeCards",
607
+ type: "gridCard",
608
+ resource: {
609
+ dataSourceKey: "main",
610
+ collectionName: "employees"
611
+ },
612
+ fields: [
613
+ "nickname",
614
+ {
615
+ fieldPath: "department.name"
616
+ }
617
+ ],
618
+ actions: ["addNew", "refresh"],
619
+ recordActions: ["view", "edit", "updateRecord", "delete"],
620
+ settings: {
621
+ columns: 3,
622
+ rowCount: 2,
623
+ layout: "vertical"
624
+ }
625
+ }
626
+ ]
627
+ },
628
+ composeJsBlock: {
629
+ target: {
630
+ uid: "page-grid-uid"
631
+ },
632
+ blocks: [
633
+ {
634
+ key: "customHero",
635
+ type: "jsBlock",
636
+ settings: {
637
+ title: "Custom hero",
638
+ description: "Rendered by JS block runtime",
639
+ className: "hero-shell",
640
+ version: "1.0.0",
641
+ code: "ctx.render('<div>Hello from JS block</div>');"
642
+ }
643
+ }
644
+ ]
645
+ },
646
+ configure: {
647
+ target: {
648
+ uid: "details-field-uid"
649
+ },
650
+ changes: {
651
+ clickToOpen: true,
652
+ openView: {
653
+ dataSourceKey: "main",
654
+ collectionName: "departments",
655
+ associationName: "users.department",
656
+ mode: "drawer"
657
+ }
658
+ }
659
+ },
660
+ configureAssociationPopup: {
661
+ target: {
662
+ uid: "roles-field-wrapper-uid"
663
+ },
664
+ changes: {
665
+ clickToOpen: true,
666
+ openView: {
667
+ dataSourceKey: "main",
668
+ collectionName: "roles",
669
+ associationName: "users.roles",
670
+ mode: "drawer"
671
+ }
672
+ }
673
+ },
674
+ configureBlock: {
675
+ target: {
676
+ uid: "list-block-uid"
677
+ },
678
+ changes: {
679
+ pageSize: 50,
680
+ dataScope: {
681
+ logic: "$and",
682
+ items: [
683
+ {
684
+ path: "nickname",
685
+ operator: "$eq",
686
+ value: "beta"
687
+ }
688
+ ]
689
+ },
690
+ sorting: [
691
+ {
692
+ field: "username",
693
+ direction: "asc"
694
+ }
695
+ ],
696
+ layout: "vertical"
697
+ }
698
+ },
699
+ createMenu: {
700
+ title: "Employees",
701
+ type: "item",
702
+ parentMenuRouteId: 1001
703
+ },
704
+ updateMenu: {
705
+ menuRouteId: 1002,
706
+ title: "Employees Center",
707
+ parentMenuRouteId: null
708
+ },
709
+ configureAction: {
710
+ target: {
711
+ uid: "update-record-action-uid"
712
+ },
713
+ changes: {
714
+ title: "Quick update",
715
+ type: "primary",
716
+ color: "gold",
717
+ htmlType: "button",
718
+ position: "end",
719
+ confirm: {
720
+ enable: true,
721
+ title: "Confirm update",
722
+ content: "Apply assigned values?"
723
+ },
724
+ assignValues: {
725
+ status: "active"
726
+ }
727
+ }
728
+ },
729
+ configureJsBlock: {
730
+ target: {
731
+ uid: "js-block-uid"
732
+ },
733
+ changes: {
734
+ title: "Users hero",
735
+ description: "Rendered from FlowSurfaces configure",
736
+ className: "users-hero",
737
+ version: "1.0.1",
738
+ code: "ctx.render('<div>Users hero</div>');"
739
+ }
740
+ },
741
+ configureJsAction: {
742
+ target: {
743
+ uid: "js-action-uid"
744
+ },
745
+ changes: {
746
+ title: "Run diagnostics",
747
+ type: "primary",
748
+ version: "1.0.1",
749
+ code: `await ctx.runjs('console.log("diagnostics")');`
750
+ }
751
+ },
752
+ configureJsItemAction: {
753
+ target: {
754
+ uid: "js-item-action-uid"
755
+ },
756
+ changes: {
757
+ title: "Run item diagnostics",
758
+ type: "default",
759
+ version: "1.0.1",
760
+ code: `await ctx.runjs('console.log("item diagnostics")');`
761
+ }
762
+ },
763
+ configureJsField: {
764
+ target: {
765
+ uid: "js-field-wrapper-uid"
766
+ },
767
+ changes: {
768
+ label: "Custom renderer",
769
+ version: "1.0.1",
770
+ code: "ctx.render(String(ctx.record?.nickname?.toUpperCase?.() || ''));"
771
+ }
772
+ },
773
+ configureJsColumn: {
774
+ target: {
775
+ uid: "js-column-uid"
776
+ },
777
+ changes: {
778
+ title: "JS column",
779
+ width: 240,
780
+ fixed: "left",
781
+ version: "1.0.1",
782
+ code: "ctx.render(String(ctx.record?.username || ''));"
783
+ }
784
+ },
785
+ configureJsItem: {
786
+ target: {
787
+ uid: "js-item-uid"
788
+ },
789
+ changes: {
790
+ label: "JS item",
791
+ showLabel: true,
792
+ labelWidth: 120,
793
+ version: "1.0.1",
794
+ code: "ctx.render(String(ctx.record?.nickname || ''));"
795
+ }
796
+ },
797
+ configurePage: {
798
+ target: {
799
+ uid: "employees-page-uid"
800
+ },
801
+ changes: {
802
+ icon: "UserOutlined",
803
+ enableHeader: false
804
+ }
805
+ },
806
+ configureTableAdvanced: {
807
+ target: {
808
+ uid: "tree-table-block-uid"
809
+ },
810
+ changes: {
811
+ quickEdit: true,
812
+ treeTable: true,
813
+ defaultExpandAllRows: true,
814
+ dragSort: true,
815
+ dragSortBy: "sort"
816
+ }
817
+ },
818
+ configureEditForm: {
819
+ target: {
820
+ uid: "edit-form-block-uid"
821
+ },
822
+ changes: {
823
+ colon: false,
824
+ dataScope: {
825
+ logic: "$and",
826
+ items: [
827
+ {
828
+ path: "status",
829
+ operator: "$eq",
830
+ value: "draft"
831
+ }
832
+ ]
833
+ }
834
+ }
835
+ },
836
+ configureDetailsCompatibility: {
837
+ target: {
838
+ uid: "details-block-uid"
839
+ },
840
+ changes: {
841
+ colon: true,
842
+ linkageRules: [
843
+ {
844
+ when: {
845
+ path: "status",
846
+ operator: "$eq",
847
+ value: "archived"
848
+ },
849
+ set: {
850
+ hidden: true
851
+ }
852
+ }
853
+ ]
854
+ }
855
+ },
856
+ composePopupCurrentRecord: {
857
+ target: {
858
+ uid: "view-action-uid"
859
+ },
860
+ mode: "replace",
861
+ blocks: [
862
+ {
863
+ key: "details",
864
+ type: "details",
865
+ resource: {
866
+ binding: "currentRecord"
867
+ },
868
+ fields: ["nickname", "department.title"]
869
+ }
870
+ ]
871
+ },
872
+ composePopupAssociatedRecords: {
873
+ target: {
874
+ uid: "association-popup-action-uid"
875
+ },
876
+ mode: "replace",
877
+ blocks: [
878
+ {
879
+ key: "employees",
880
+ type: "table",
881
+ resource: {
882
+ binding: "associatedRecords",
883
+ associationField: "employee"
884
+ },
885
+ fields: ["nickname", "status"],
886
+ actions: ["refresh"],
887
+ recordActions: ["view", "edit"]
888
+ }
889
+ ]
890
+ },
891
+ configureActionModesCompatibility: {
892
+ target: {
893
+ uid: "compose-email-action-uid"
894
+ },
895
+ changes: {
896
+ linkageRules: [
897
+ {
898
+ when: {
899
+ path: "status",
900
+ operator: "$eq",
901
+ value: "draft"
902
+ },
903
+ set: {
904
+ disabled: true
905
+ }
906
+ }
907
+ ],
908
+ editMode: "drawer",
909
+ updateMode: "overwrite",
910
+ duplicateMode: "popup",
911
+ collapsedRows: 2,
912
+ defaultCollapsed: true,
913
+ emailFieldNames: ["email", "backupEmail"],
914
+ defaultSelectAllRecords: true
915
+ }
916
+ },
917
+ createPage: {
918
+ menuRouteId: 1002,
919
+ title: "Employees",
920
+ tabTitle: "Overview",
921
+ enableTabs: true,
922
+ displayTitle: true,
923
+ documentTitle: "Employees workspace",
924
+ tabDocumentTitle: "Employees overview"
925
+ },
926
+ addTab: {
927
+ target: {
928
+ uid: "employees-page-uid"
929
+ },
930
+ title: "Details",
931
+ icon: "TableOutlined",
932
+ documentTitle: "Employee details tab"
933
+ },
934
+ updateTab: {
935
+ target: {
936
+ uid: "details-tab-schema"
937
+ },
938
+ title: "Details",
939
+ icon: "TableOutlined",
940
+ documentTitle: "Employee details tab",
941
+ flowRegistry: {
942
+ beforeRenderApply: {
943
+ key: "beforeRenderApply",
944
+ on: "beforeRender",
945
+ steps: {}
946
+ }
947
+ }
948
+ },
949
+ addPopupTab: {
950
+ target: {
951
+ uid: "view-action-popup-page-uid"
952
+ },
953
+ title: "Popup details",
954
+ icon: "TableOutlined",
955
+ documentTitle: "Popup details tab"
956
+ },
957
+ updatePopupTab: {
958
+ target: {
959
+ uid: "popup-secondary-tab-uid"
960
+ },
961
+ title: "Popup details updated",
962
+ icon: "AppstoreOutlined",
963
+ documentTitle: "Popup details updated tab",
964
+ flowRegistry: {
965
+ beforeRenderApply: {
966
+ key: "beforeRenderApply",
967
+ on: "beforeRender",
968
+ steps: {}
969
+ }
970
+ }
971
+ },
972
+ movePopupTab: {
973
+ sourceUid: "popup-secondary-tab-uid",
974
+ targetUid: "popup-primary-tab-uid",
975
+ position: "before"
976
+ },
977
+ removePopupTab: {
978
+ target: {
979
+ uid: "popup-secondary-tab-uid"
980
+ }
981
+ },
982
+ addBlock: {
983
+ target: {
984
+ uid: "view-action-uid"
985
+ },
986
+ type: "details",
987
+ resource: {
988
+ binding: "currentRecord"
989
+ }
990
+ },
991
+ addPopupAssociatedBlock: {
992
+ target: {
993
+ uid: "association-popup-action-uid"
994
+ },
995
+ type: "table",
996
+ resource: {
997
+ binding: "associatedRecords",
998
+ associationField: "employee"
999
+ }
1000
+ },
1001
+ addPopupOtherRecordsBlock: {
1002
+ target: {
1003
+ uid: "popup-action-uid"
1004
+ },
1005
+ type: "table",
1006
+ resource: {
1007
+ binding: "otherRecords",
1008
+ dataSourceKey: "main",
1009
+ collectionName: "departments"
1010
+ }
1011
+ },
1012
+ addJsBlock: {
1013
+ target: {
1014
+ uid: "page-grid-uid"
1015
+ },
1016
+ type: "jsBlock",
1017
+ settings: {
1018
+ title: "Users banner",
1019
+ description: "Custom JS rendered banner",
1020
+ version: "1.0.0",
1021
+ code: "ctx.render('<div>Users banner</div>');"
1022
+ }
1023
+ },
1024
+ addField: {
1025
+ target: {
1026
+ uid: "create-form-block-uid"
1027
+ },
1028
+ fieldPath: "nickname",
1029
+ renderer: "js",
1030
+ settings: {
1031
+ label: "Nickname (JS)",
1032
+ code: "ctx.render(String(ctx.value?.toUpperCase?.() || ctx.value || ''));",
1033
+ version: "1.0.0"
1034
+ }
1035
+ },
1036
+ addAssociationField: {
1037
+ target: {
1038
+ uid: "table-block-uid"
1039
+ },
1040
+ fieldPath: "title",
1041
+ associationPathName: "department",
1042
+ settings: {
1043
+ title: "Department title",
1044
+ width: 240
1045
+ },
1046
+ popup: {
1047
+ mode: "replace",
1048
+ blocks: [
1049
+ {
1050
+ key: "departmentDetails",
1051
+ type: "details",
1052
+ resource: {
1053
+ binding: "currentRecord"
1054
+ },
1055
+ fields: ["title", "manager.nickname"]
1056
+ }
1057
+ ]
1058
+ }
1059
+ },
1060
+ addJsColumn: {
1061
+ target: {
1062
+ uid: "table-block-uid"
1063
+ },
1064
+ type: "jsColumn",
1065
+ settings: {
1066
+ title: "Runtime column",
1067
+ width: 240,
1068
+ version: "1.0.0",
1069
+ code: "ctx.render(String(ctx.record?.nickname || ''));"
1070
+ }
1071
+ },
1072
+ addJsItem: {
1073
+ target: {
1074
+ uid: "create-form-grid-uid"
1075
+ },
1076
+ type: "jsItem",
1077
+ settings: {
1078
+ label: "Runtime item",
1079
+ showLabel: true,
1080
+ version: "1.0.0",
1081
+ code: "ctx.render(String(ctx.record?.nickname || ''));"
1082
+ }
1083
+ },
1084
+ addFieldPopupTemplate: {
1085
+ target: {
1086
+ uid: "details-block-uid"
1087
+ },
1088
+ fieldPath: "nickname",
1089
+ popup: {
1090
+ template: {
1091
+ uid: "employee-popup-template",
1092
+ mode: "reference"
1093
+ }
1094
+ }
1095
+ },
1096
+ addFieldAutoPopupTemplate: {
1097
+ target: {
1098
+ uid: "details-block-uid"
1099
+ },
1100
+ fieldPath: "department.title",
1101
+ popup: {
1102
+ tryTemplate: true
1103
+ }
1104
+ },
1105
+ addFieldDefaultEditPopup: {
1106
+ target: {
1107
+ uid: "details-block-uid"
1108
+ },
1109
+ fieldPath: "department.title",
1110
+ popup: {
1111
+ defaultType: "edit"
1112
+ }
1113
+ },
1114
+ addFieldSavePopupTemplate: {
1115
+ target: {
1116
+ uid: "details-block-uid"
1117
+ },
1118
+ fieldPath: "nickname",
1119
+ popup: {
1120
+ blocks: [
1121
+ {
1122
+ key: "employee-popup-details",
1123
+ type: "details",
1124
+ resource: {
1125
+ binding: "currentRecord"
1126
+ },
1127
+ fields: ["nickname"]
1128
+ }
1129
+ ],
1130
+ saveAsTemplate: {
1131
+ name: "employee-popup-template",
1132
+ description: "Save this explicit field popup as a reusable popup template."
1133
+ }
1134
+ }
1135
+ },
1136
+ addAction: {
1137
+ target: {
1138
+ uid: "filter-form-block-uid"
1139
+ },
1140
+ type: "submit",
1141
+ settings: {
1142
+ title: "Apply filters",
1143
+ confirm: false
1144
+ }
1145
+ },
1146
+ addLinkAction: {
1147
+ target: {
1148
+ uid: "table-block-uid"
1149
+ },
1150
+ type: "link",
1151
+ settings: {
1152
+ title: "Open docs"
1153
+ }
1154
+ },
1155
+ addAutoPopupAction: {
1156
+ target: {
1157
+ uid: "table-block-uid"
1158
+ },
1159
+ type: "popup",
1160
+ popup: {
1161
+ tryTemplate: true
1162
+ }
1163
+ },
1164
+ addSavePopupAction: {
1165
+ target: {
1166
+ uid: "table-block-uid"
1167
+ },
1168
+ type: "popup",
1169
+ popup: {
1170
+ blocks: [
1171
+ {
1172
+ key: "employee-popup-table",
1173
+ type: "table",
1174
+ resource: {
1175
+ binding: "currentCollection"
1176
+ },
1177
+ fields: ["username", "nickname"]
1178
+ }
1179
+ ],
1180
+ saveAsTemplate: {
1181
+ name: "employee-popup-template",
1182
+ description: "Save this explicit action popup as a reusable popup template."
1183
+ }
1184
+ }
1185
+ },
1186
+ addJsAction: {
1187
+ target: {
1188
+ uid: "action-panel-uid"
1189
+ },
1190
+ type: "js",
1191
+ settings: {
1192
+ title: "Run JS",
1193
+ type: "primary",
1194
+ version: "1.0.0",
1195
+ code: `await ctx.runjs('console.log("hello")');`
1196
+ }
1197
+ },
1198
+ addJsItemAction: {
1199
+ target: {
1200
+ uid: "create-form-uid"
1201
+ },
1202
+ type: "jsItem",
1203
+ settings: {
1204
+ title: "Run item JS",
1205
+ type: "default",
1206
+ version: "1.0.0",
1207
+ code: `await ctx.runjs('console.log("item")');`
1208
+ }
1209
+ },
1210
+ addRecordAction: {
1211
+ target: {
1212
+ uid: "table-block-uid"
1213
+ },
1214
+ type: "view",
1215
+ settings: {
1216
+ title: "View user",
1217
+ openView: {
1218
+ dataSourceKey: "main",
1219
+ collectionName: "users",
1220
+ mode: "drawer"
1221
+ }
1222
+ },
1223
+ popup: {
1224
+ mode: "replace",
1225
+ blocks: [
1226
+ {
1227
+ key: "details",
1228
+ type: "details",
1229
+ resource: {
1230
+ dataSourceKey: "main",
1231
+ collectionName: "users"
1232
+ },
1233
+ fields: ["username", "nickname"]
1234
+ }
1235
+ ]
1236
+ }
1237
+ },
1238
+ addRecordAutoPopupTemplate: {
1239
+ target: {
1240
+ uid: "table-block-uid"
1241
+ },
1242
+ type: "view",
1243
+ popup: {
1244
+ tryTemplate: true
1245
+ }
1246
+ },
1247
+ addRecordSavePopupTemplate: {
1248
+ target: {
1249
+ uid: "table-block-uid"
1250
+ },
1251
+ type: "view",
1252
+ popup: {
1253
+ blocks: [
1254
+ {
1255
+ key: "employee-record-popup-details",
1256
+ type: "details",
1257
+ resource: {
1258
+ binding: "currentRecord"
1259
+ },
1260
+ fields: ["username", "nickname"]
1261
+ }
1262
+ ],
1263
+ saveAsTemplate: {
1264
+ name: "employee-popup-template",
1265
+ description: "Save this explicit record-action popup as a reusable popup template."
1266
+ }
1267
+ }
1268
+ },
1269
+ addRecordAddChildAction: {
1270
+ target: {
1271
+ uid: "tree-table-block-uid"
1272
+ },
1273
+ type: "addChild",
1274
+ settings: {
1275
+ title: "Add child category",
1276
+ openView: {
1277
+ dataSourceKey: "main",
1278
+ collectionName: "categories",
1279
+ mode: "drawer"
1280
+ }
1281
+ }
1282
+ },
1283
+ addRecordJsAction: {
1284
+ target: {
1285
+ uid: "details-block-uid"
1286
+ },
1287
+ type: "js",
1288
+ settings: {
1289
+ title: "Inspect record",
1290
+ type: "default",
1291
+ version: "1.0.0",
1292
+ code: "return currentRecord?.id;"
1293
+ }
1294
+ },
1295
+ addBlocks: {
1296
+ target: {
1297
+ uid: "page-grid-uid"
1298
+ },
1299
+ blocks: [
1300
+ {
1301
+ key: "usersTable",
1302
+ type: "table",
1303
+ resourceInit: {
1304
+ dataSourceKey: "main",
1305
+ collectionName: "users"
1306
+ },
1307
+ settings: {
1308
+ title: "Users table",
1309
+ pageSize: 50
1310
+ }
1311
+ },
1312
+ {
1313
+ key: "teamNotes",
1314
+ type: "markdown",
1315
+ settings: {
1316
+ content: "# Team notes"
1317
+ }
1318
+ }
1319
+ ]
1320
+ },
1321
+ addFields: {
1322
+ target: {
1323
+ uid: "table-block-uid"
1324
+ },
1325
+ fields: [
1326
+ {
1327
+ key: "username",
1328
+ fieldPath: "username",
1329
+ settings: {
1330
+ title: "User name",
1331
+ width: 220
1332
+ },
1333
+ popup: {
1334
+ mode: "replace",
1335
+ blocks: [
1336
+ {
1337
+ key: "details",
1338
+ type: "details",
1339
+ resource: {
1340
+ binding: "currentRecord"
1341
+ },
1342
+ fields: ["username", "nickname"]
1343
+ }
1344
+ ]
1345
+ }
1346
+ },
1347
+ {
1348
+ key: "nickname",
1349
+ fieldPath: "nickname",
1350
+ renderer: "js",
1351
+ settings: {
1352
+ label: "Nickname (JS)",
1353
+ code: "return value;",
1354
+ version: "1.0.0"
1355
+ }
1356
+ }
1357
+ ]
1358
+ },
1359
+ addActions: {
1360
+ target: {
1361
+ uid: "filter-form-block-uid"
1362
+ },
1363
+ actions: [
1364
+ {
1365
+ key: "submit",
1366
+ type: "submit",
1367
+ settings: {
1368
+ title: "Search",
1369
+ confirm: false
1370
+ }
1371
+ },
1372
+ {
1373
+ key: "reset",
1374
+ type: "reset",
1375
+ settings: {
1376
+ title: "Reset filters"
1377
+ }
1378
+ }
1379
+ ]
1380
+ },
1381
+ addRecordActions: {
1382
+ target: {
1383
+ uid: "table-block-uid"
1384
+ },
1385
+ recordActions: [
1386
+ {
1387
+ key: "view",
1388
+ type: "view",
1389
+ settings: {
1390
+ title: "View user",
1391
+ openView: {
1392
+ dataSourceKey: "main",
1393
+ collectionName: "users",
1394
+ mode: "drawer"
1395
+ }
1396
+ },
1397
+ popup: {
1398
+ mode: "replace",
1399
+ blocks: [
1400
+ {
1401
+ key: "details",
1402
+ type: "details",
1403
+ resource: {
1404
+ dataSourceKey: "main",
1405
+ collectionName: "users"
1406
+ },
1407
+ fields: ["username"]
1408
+ }
1409
+ ]
1410
+ }
1411
+ },
1412
+ {
1413
+ key: "edit",
1414
+ type: "edit",
1415
+ settings: {
1416
+ title: "Edit user"
1417
+ }
1418
+ },
1419
+ {
1420
+ key: "delete",
1421
+ type: "delete",
1422
+ settings: {
1423
+ title: "Delete user"
1424
+ }
1425
+ }
1426
+ ]
1427
+ },
1428
+ addRecordAddChildActions: {
1429
+ target: {
1430
+ uid: "tree-table-block-uid"
1431
+ },
1432
+ recordActions: [
1433
+ {
1434
+ key: "addChild",
1435
+ type: "addChild",
1436
+ settings: {
1437
+ title: "Add child category",
1438
+ openView: {
1439
+ dataSourceKey: "main",
1440
+ collectionName: "categories",
1441
+ mode: "drawer"
1442
+ }
1443
+ }
1444
+ }
1445
+ ]
1446
+ },
1447
+ updateSettings: {
1448
+ target: {
1449
+ uid: "table-block-uid"
1450
+ },
1451
+ stepParams: {
1452
+ tableSettings: {
1453
+ pageSize: {
1454
+ pageSize: 50
1455
+ },
1456
+ tableDensity: {
1457
+ size: "middle"
1458
+ }
1459
+ }
1460
+ },
1461
+ flowRegistry: {
1462
+ beforeRenderApply: {
1463
+ key: "beforeRenderApply",
1464
+ on: "beforeRender",
1465
+ steps: {}
1466
+ }
1467
+ }
1468
+ },
1469
+ setEventFlows: {
1470
+ target: {
1471
+ uid: "view-action-uid"
1472
+ },
1473
+ flowRegistry: {
1474
+ popupSettings: {
1475
+ key: "popupSettings",
1476
+ on: "click",
1477
+ steps: {
1478
+ openView: {
1479
+ params: {
1480
+ title: "Employee details",
1481
+ size: "large"
1482
+ }
1483
+ }
1484
+ }
1485
+ }
1486
+ }
1487
+ },
1488
+ setLayout: {
1489
+ target: {
1490
+ uid: "page-grid-uid"
1491
+ },
1492
+ rows: {
1493
+ row1: [["block-a"], ["block-b"]]
1494
+ },
1495
+ sizes: {
1496
+ row1: [12, 12]
1497
+ },
1498
+ rowOrder: ["row1"]
1499
+ },
1500
+ moveNode: {
1501
+ sourceUid: "block-b",
1502
+ targetUid: "block-a",
1503
+ position: "before"
1504
+ },
1505
+ removeNode: {
1506
+ target: {
1507
+ uid: "obsolete-block-uid"
1508
+ }
1509
+ },
1510
+ mutate: {
1511
+ atomic: true,
1512
+ ops: [
1513
+ {
1514
+ opId: "menu",
1515
+ type: "createMenu",
1516
+ values: {
1517
+ title: "Employees",
1518
+ type: "item"
1519
+ }
1520
+ },
1521
+ {
1522
+ opId: "page",
1523
+ type: "createPage",
1524
+ values: {
1525
+ menuRouteId: {
1526
+ step: "menu",
1527
+ path: "routeId"
1528
+ },
1529
+ tabTitle: "Overview"
1530
+ }
1531
+ },
1532
+ {
1533
+ opId: "table",
1534
+ type: "addBlock",
1535
+ values: {
1536
+ target: {
1537
+ uid: {
1538
+ step: "page",
1539
+ path: "tabSchemaUid"
1540
+ }
1541
+ },
1542
+ type: "table",
1543
+ resourceInit: {
1544
+ dataSourceKey: "main",
1545
+ collectionName: "employees"
1546
+ }
1547
+ }
1548
+ },
1549
+ {
1550
+ type: "addField",
1551
+ values: {
1552
+ target: {
1553
+ uid: {
1554
+ step: "table",
1555
+ path: "uid"
1556
+ }
1557
+ },
1558
+ fieldPath: "nickname"
1559
+ }
1560
+ }
1561
+ ]
1562
+ },
1563
+ apply: {
1564
+ target: {
1565
+ uid: "page-grid-uid"
1566
+ },
1567
+ mode: "replace",
1568
+ spec: {
1569
+ popup: {
1570
+ tryTemplate: true
1571
+ },
1572
+ subModels: {
1573
+ items: [
1574
+ {
1575
+ clientKey: "table-a",
1576
+ use: "TableBlockModel",
1577
+ stepParams: {
1578
+ resourceSettings: {
1579
+ init: {
1580
+ dataSourceKey: "main",
1581
+ collectionName: "employees"
1582
+ }
1583
+ }
1584
+ }
1585
+ },
1586
+ {
1587
+ clientKey: "markdown-a",
1588
+ use: "MarkdownBlockModel",
1589
+ props: {
1590
+ content: "Employee handbook"
1591
+ }
1592
+ }
1593
+ ]
1594
+ }
1595
+ }
1596
+ },
1597
+ getPopupQuery: {
1598
+ uid: "view-action-uid"
1599
+ },
1600
+ getPageQuery: {
1601
+ pageSchemaUid: "employees-page-schema"
1602
+ }
1603
+ };
1604
+ // Annotate the CommonJS export names for ESM import in node:
1605
+ 0 && (module.exports = {
1606
+ flowSurfaceExamples
1607
+ });