@nocobase/plugin-workflow 0.10.1-alpha.1 → 0.11.0-alpha.1

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 (260) hide show
  1. package/client.d.ts +2 -3
  2. package/client.js +1 -30
  3. package/lib/client/AddButton.js +1 -8
  4. package/lib/client/Branch.js +8 -8
  5. package/lib/client/CanvasContent.js +8 -8
  6. package/lib/client/ExecutionCanvas.js +20 -27
  7. package/lib/client/ExecutionPage.js +1 -8
  8. package/lib/client/WorkflowCanvas.js +3 -10
  9. package/lib/client/WorkflowPage.js +1 -8
  10. package/lib/client/WorkflowProvider.js +3 -42
  11. package/lib/client/components/CollectionFieldset.d.ts +1 -1
  12. package/lib/client/components/CollectionFieldset.js +8 -15
  13. package/lib/client/components/Duration.js +5 -5
  14. package/lib/client/components/DynamicExpression.d.ts +3 -3
  15. package/lib/client/components/FieldsSelect.d.ts +1 -1
  16. package/lib/client/components/FieldsSelect.js +6 -6
  17. package/lib/client/components/NodeDescription.js +11 -11
  18. package/lib/client/components/RadioWithTooltip.js +13 -20
  19. package/lib/client/components/ValueBlock.js +14 -21
  20. package/lib/client/components/renderEngineReference.js +1 -8
  21. package/lib/client/index.d.ts +12 -4
  22. package/lib/client/index.js +78 -15
  23. package/lib/client/nodes/aggregate.d.ts +2 -2
  24. package/lib/client/nodes/aggregate.js +1 -1
  25. package/lib/client/nodes/calculation.d.ts +1 -1
  26. package/lib/client/nodes/calculation.js +16 -23
  27. package/lib/client/nodes/condition.d.ts +1 -3
  28. package/lib/client/nodes/condition.js +13 -20
  29. package/lib/client/nodes/create.d.ts +4 -3
  30. package/lib/client/nodes/destroy.d.ts +1 -1
  31. package/lib/client/nodes/index.d.ts +2 -2
  32. package/lib/client/nodes/index.js +79 -86
  33. package/lib/client/nodes/loop.d.ts +1 -1
  34. package/lib/client/nodes/loop.js +35 -34
  35. package/lib/client/nodes/manual/ModeConfig.js +23 -30
  36. package/lib/client/nodes/manual/SchemaConfig.d.ts +3 -3
  37. package/lib/client/nodes/manual/SchemaConfig.js +18 -17
  38. package/lib/client/nodes/manual/WorkflowTodo.js +61 -69
  39. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -5
  40. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +6 -5
  41. package/lib/client/nodes/manual/forms/custom.js +11 -18
  42. package/lib/client/nodes/parallel.js +20 -20
  43. package/lib/client/nodes/query.d.ts +3 -2
  44. package/lib/client/nodes/request.d.ts +2 -2
  45. package/lib/client/nodes/request.js +7 -7
  46. package/lib/client/nodes/update.d.ts +2 -2
  47. package/lib/client/nodes/update.js +1 -1
  48. package/lib/client/schemas/collection.d.ts +1 -1
  49. package/lib/client/schemas/collection.js +3 -10
  50. package/lib/client/style.js +18 -18
  51. package/lib/client/triggers/collection.d.ts +4 -3
  52. package/lib/client/triggers/collection.js +1 -1
  53. package/lib/client/triggers/index.d.ts +2 -2
  54. package/lib/client/triggers/index.js +45 -52
  55. package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -1
  56. package/lib/client/triggers/schedule/EndsByField.js +11 -11
  57. package/lib/client/triggers/schedule/OnField.js +11 -11
  58. package/lib/client/triggers/schedule/RepeatField.js +4 -4
  59. package/lib/client/triggers/schedule/ScheduleConfig.js +17 -24
  60. package/lib/client/triggers/schedule/index.d.ts +2 -1
  61. package/lib/client/triggers/schedule/index.js +2 -2
  62. package/lib/client/variable.d.ts +2 -2
  63. package/lib/client/variable.js +5 -5
  64. package/lib/server/Plugin.d.ts +2 -3
  65. package/lib/server/Plugin.js +8 -9
  66. package/lib/server/Processor.d.ts +2 -4
  67. package/lib/server/actions/nodes.js +7 -7
  68. package/lib/server/fields/expression-field.d.ts +1 -2
  69. package/lib/server/fields/expression-field.js +1 -8
  70. package/lib/server/functions/index.d.ts +2 -3
  71. package/lib/server/index.d.ts +1 -0
  72. package/lib/server/index.js +12 -0
  73. package/lib/server/instructions/aggregate.d.ts +1 -1
  74. package/lib/server/instructions/aggregate.js +5 -5
  75. package/lib/server/instructions/condition.d.ts +2 -1
  76. package/lib/server/instructions/create.d.ts +1 -1
  77. package/lib/server/instructions/delay.d.ts +3 -3
  78. package/lib/server/instructions/delay.js +66 -64
  79. package/lib/server/instructions/destroy.d.ts +1 -1
  80. package/lib/server/instructions/index.d.ts +5 -5
  81. package/lib/server/instructions/loop.d.ts +1 -2
  82. package/lib/server/instructions/manual/actions.js +1 -1
  83. package/lib/server/instructions/manual/forms/index.d.ts +1 -1
  84. package/lib/server/instructions/manual/index.d.ts +1 -1
  85. package/lib/server/instructions/parallel.d.ts +1 -2
  86. package/lib/server/instructions/query.d.ts +1 -1
  87. package/lib/server/instructions/request.d.ts +2 -2
  88. package/lib/server/instructions/request.js +1 -0
  89. package/lib/server/instructions/update.d.ts +1 -1
  90. package/lib/server/migrations/20230221071831-calculation-expression.js +1 -1
  91. package/lib/server/migrations/20230221121203-condition-calculation.js +1 -1
  92. package/lib/server/migrations/20230221162902-jsonb-to-json.js +7 -7
  93. package/lib/server/migrations/20230411034722-manual-multi-form.js +1 -8
  94. package/lib/server/triggers/collection.d.ts +1 -1
  95. package/lib/server/triggers/collection.js +2 -2
  96. package/lib/server/triggers/index.d.ts +1 -1
  97. package/lib/server/triggers/schedule.d.ts +1 -1
  98. package/lib/server/triggers/schedule.js +18 -18
  99. package/lib/server/{models → types}/Execution.d.ts +2 -3
  100. package/lib/server/{models → types}/FlowNode.d.ts +1 -2
  101. package/lib/server/{models → types}/Job.d.ts +1 -2
  102. package/lib/server/{models → types}/Workflow.d.ts +1 -2
  103. package/lib/server/types/index.d.ts +4 -0
  104. package/lib/server/types/index.js +5 -0
  105. package/package.json +40 -20
  106. package/server.d.ts +2 -3
  107. package/server.js +1 -30
  108. package/src/client/AddButton.tsx +99 -0
  109. package/src/client/Branch.tsx +35 -0
  110. package/src/client/CanvasContent.tsx +23 -0
  111. package/src/client/ExecutionCanvas.tsx +168 -0
  112. package/src/client/ExecutionLink.tsx +16 -0
  113. package/src/client/ExecutionPage.tsx +44 -0
  114. package/src/client/ExecutionResourceProvider.tsx +21 -0
  115. package/src/client/FlowContext.ts +7 -0
  116. package/src/client/WorkflowCanvas.tsx +220 -0
  117. package/src/client/WorkflowLink.tsx +16 -0
  118. package/src/client/WorkflowPage.tsx +51 -0
  119. package/src/client/WorkflowProvider.tsx +84 -0
  120. package/src/client/components/CollectionBlockInitializer.tsx +71 -0
  121. package/src/client/components/CollectionFieldset.tsx +158 -0
  122. package/src/client/components/Duration.tsx +45 -0
  123. package/src/client/components/DynamicExpression.tsx +53 -0
  124. package/src/client/components/FieldsSelect.tsx +28 -0
  125. package/src/client/components/FilterDynamicComponent.tsx +15 -0
  126. package/src/client/components/NodeDescription.tsx +44 -0
  127. package/src/client/components/NullRender.tsx +3 -0
  128. package/src/client/components/OpenDrawer.tsx +24 -0
  129. package/src/client/components/RadioWithTooltip.tsx +38 -0
  130. package/src/client/components/ValueBlock.tsx +67 -0
  131. package/src/client/components/renderEngineReference.tsx +30 -0
  132. package/src/client/constants.tsx +91 -0
  133. package/src/client/index.tsx +51 -0
  134. package/src/client/interfaces/expression.tsx +25 -0
  135. package/src/client/locale/en-US.ts +136 -0
  136. package/src/client/locale/es-ES.ts +129 -0
  137. package/src/client/locale/index.ts +18 -0
  138. package/src/client/locale/ja-JP.ts +90 -0
  139. package/src/client/locale/pt-BR.ts +136 -0
  140. package/src/client/locale/ru-RU.ts +90 -0
  141. package/src/client/locale/tr-TR.ts +90 -0
  142. package/src/client/locale/zh-CN.ts +242 -0
  143. package/src/client/nodes/aggregate.tsx +327 -0
  144. package/src/client/nodes/calculation.tsx +217 -0
  145. package/src/client/nodes/condition.tsx +490 -0
  146. package/src/client/nodes/create.tsx +86 -0
  147. package/src/client/nodes/delay.tsx +37 -0
  148. package/src/client/nodes/destroy.tsx +34 -0
  149. package/src/client/nodes/index.tsx +489 -0
  150. package/src/client/nodes/loop.tsx +159 -0
  151. package/src/client/nodes/manual/AssigneesSelect.tsx +33 -0
  152. package/src/client/nodes/manual/DetailsBlockProvider.tsx +80 -0
  153. package/src/client/nodes/manual/FormBlockInitializer.tsx +68 -0
  154. package/src/client/nodes/manual/FormBlockProvider.tsx +75 -0
  155. package/src/client/nodes/manual/ModeConfig.tsx +84 -0
  156. package/src/client/nodes/manual/SchemaConfig.tsx +365 -0
  157. package/src/client/nodes/manual/WorkflowTodo.tsx +611 -0
  158. package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
  159. package/src/client/nodes/manual/forms/create.tsx +88 -0
  160. package/src/client/nodes/manual/forms/custom.tsx +388 -0
  161. package/src/client/nodes/manual/forms/update.tsx +130 -0
  162. package/src/client/nodes/manual/index.tsx +162 -0
  163. package/src/client/nodes/manual/utils.ts +28 -0
  164. package/src/client/nodes/parallel.tsx +137 -0
  165. package/src/client/nodes/query.tsx +89 -0
  166. package/src/client/nodes/request.tsx +185 -0
  167. package/src/client/nodes/update.tsx +99 -0
  168. package/src/client/schemas/collection.ts +75 -0
  169. package/src/client/schemas/executions.tsx +169 -0
  170. package/src/client/schemas/workflows.ts +364 -0
  171. package/src/client/style.tsx +312 -0
  172. package/src/client/triggers/collection.tsx +186 -0
  173. package/src/client/triggers/index.tsx +307 -0
  174. package/src/client/triggers/schedule/DateFieldsSelect.tsx +28 -0
  175. package/src/client/triggers/schedule/EndsByField.tsx +40 -0
  176. package/src/client/triggers/schedule/OnField.tsx +50 -0
  177. package/src/client/triggers/schedule/RepeatField.tsx +116 -0
  178. package/src/client/triggers/schedule/ScheduleConfig.tsx +225 -0
  179. package/src/client/triggers/schedule/constants.ts +4 -0
  180. package/src/client/triggers/schedule/index.tsx +72 -0
  181. package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +79 -0
  182. package/src/client/utils.ts +36 -0
  183. package/src/client/variable.tsx +296 -0
  184. package/src/index.ts +1 -0
  185. package/src/server/Plugin.ts +351 -0
  186. package/src/server/Processor.ts +354 -0
  187. package/src/server/__tests__/Plugin.test.ts +398 -0
  188. package/src/server/__tests__/Processor.test.ts +474 -0
  189. package/src/server/__tests__/actions/workflows.test.ts +419 -0
  190. package/src/server/__tests__/collections/categories.ts +23 -0
  191. package/src/server/__tests__/collections/comments.ts +24 -0
  192. package/src/server/__tests__/collections/posts.ts +42 -0
  193. package/src/server/__tests__/collections/replies.ts +9 -0
  194. package/src/server/__tests__/collections/tags.ts +15 -0
  195. package/src/server/__tests__/index.ts +89 -0
  196. package/src/server/__tests__/instructions/aggregate.test.ts +294 -0
  197. package/src/server/__tests__/instructions/calculation.test.ts +265 -0
  198. package/src/server/__tests__/instructions/condition.test.ts +335 -0
  199. package/src/server/__tests__/instructions/create.test.ts +129 -0
  200. package/src/server/__tests__/instructions/delay.test.ts +182 -0
  201. package/src/server/__tests__/instructions/destroy.test.ts +58 -0
  202. package/src/server/__tests__/instructions/loop.test.ts +331 -0
  203. package/src/server/__tests__/instructions/manual.test.ts +854 -0
  204. package/src/server/__tests__/instructions/parallel.test.ts +445 -0
  205. package/src/server/__tests__/instructions/query.test.ts +359 -0
  206. package/src/server/__tests__/instructions/request.test.ts +217 -0
  207. package/src/server/__tests__/instructions/update.test.ts +189 -0
  208. package/src/server/__tests__/triggers/collection.test.ts +298 -0
  209. package/src/server/__tests__/triggers/schedule.test.ts +369 -0
  210. package/src/server/actions/index.ts +25 -0
  211. package/src/server/actions/nodes.ts +214 -0
  212. package/src/server/actions/workflows.ts +178 -0
  213. package/src/server/collections/executions.ts +35 -0
  214. package/src/server/collections/flow_nodes.ts +54 -0
  215. package/src/server/collections/jobs.ts +31 -0
  216. package/src/server/collections/workflows.ts +88 -0
  217. package/src/server/constants.ts +26 -0
  218. package/src/server/fields/expression-field.ts +11 -0
  219. package/src/server/fields/index.ts +7 -0
  220. package/src/server/functions/index.ts +16 -0
  221. package/src/server/index.ts +6 -0
  222. package/src/server/instructions/aggregate.ts +42 -0
  223. package/src/server/instructions/calculation.ts +41 -0
  224. package/src/server/instructions/condition.ts +172 -0
  225. package/src/server/instructions/create.ts +37 -0
  226. package/src/server/instructions/delay.ts +105 -0
  227. package/src/server/instructions/destroy.ts +23 -0
  228. package/src/server/instructions/index.ts +63 -0
  229. package/src/server/instructions/loop.ts +99 -0
  230. package/src/server/instructions/manual/actions.ts +79 -0
  231. package/src/server/instructions/manual/collecions/jobs.ts +17 -0
  232. package/src/server/instructions/manual/collecions/users.ts +15 -0
  233. package/src/server/instructions/manual/collecions/users_jobs.ts +50 -0
  234. package/src/server/instructions/manual/forms/create.ts +22 -0
  235. package/src/server/instructions/manual/forms/index.ts +12 -0
  236. package/src/server/instructions/manual/forms/update.ts +22 -0
  237. package/src/server/instructions/manual/index.ts +184 -0
  238. package/src/server/instructions/parallel.ts +121 -0
  239. package/src/server/instructions/query.ts +31 -0
  240. package/src/server/instructions/request.ts +87 -0
  241. package/src/server/instructions/update.ts +24 -0
  242. package/src/server/migrations/20221129153547-calculation-variables.ts +64 -0
  243. package/src/server/migrations/20230221032941-change-request-body-type.ts +76 -0
  244. package/src/server/migrations/20230221071831-calculation-expression.ts +102 -0
  245. package/src/server/migrations/20230221121203-condition-calculation.ts +82 -0
  246. package/src/server/migrations/20230221162902-jsonb-to-json.ts +51 -0
  247. package/src/server/migrations/20230411034722-manual-multi-form.ts +282 -0
  248. package/src/server/migrations/20230612021134-manual-collection-block.ts +138 -0
  249. package/src/server/triggers/collection.ts +142 -0
  250. package/src/server/triggers/index.ts +22 -0
  251. package/src/server/triggers/schedule.ts +567 -0
  252. package/src/server/types/Execution.ts +26 -0
  253. package/src/server/types/FlowNode.ts +21 -0
  254. package/src/server/types/Job.ts +18 -0
  255. package/src/server/types/Workflow.ts +36 -0
  256. package/src/server/types/index.ts +4 -0
  257. /package/lib/server/{models → types}/Execution.js +0 -0
  258. /package/lib/server/{models → types}/FlowNode.js +0 -0
  259. /package/lib/server/{models → types}/Job.js +0 -0
  260. /package/lib/server/{models → types}/Workflow.js +0 -0
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- function _react() {
8
- const data = _interopRequireDefault(require("react"));
9
- _react = function _react() {
7
+ function _antdV() {
8
+ const data = require("@formily/antd-v5");
9
+ _antdV = function _antdV() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _antd() {
15
- const data = require("@formily/antd");
16
- _antd = function _antd() {
14
+ function _react() {
15
+ const data = _interopRequireDefault(require("react"));
16
+ _react = function _react() {
17
17
  return data;
18
18
  };
19
19
  return data;
@@ -213,7 +213,7 @@ var _default = {
213
213
  useWorkflowVariableOptions: _variable.useWorkflowVariableOptions
214
214
  },
215
215
  components: {
216
- ArrayItems: _antd().ArrayItems,
216
+ ArrayItems: _antdV().ArrayItems,
217
217
  RequestBody(props) {
218
218
  const scope = (0, _variable.useWorkflowVariableOptions)();
219
219
  return _react().default.createElement(_client().Variable.JSON, _objectSpread({
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  'x-decorator': string;
20
20
  'x-component': string;
21
21
  'x-component-props': {
22
- dropdownMatchSelectWidth: boolean;
22
+ popupMatchSelectWidth: boolean;
23
23
  };
24
24
  };
25
25
  params: {
@@ -76,7 +76,7 @@ declare const _default: {
76
76
  };
77
77
  components: {
78
78
  FilterDynamicComponent: typeof FilterDynamicComponent;
79
- CollectionFieldset: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
79
+ CollectionFieldset: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
80
80
  IndividualHooksRadioWithTooltip: typeof IndividualHooksRadioWithTooltip;
81
81
  };
82
82
  };
@@ -100,7 +100,7 @@ var _default = {
100
100
  filter: _objectSpread(_objectSpread({}, _collection.filter), {}, {
101
101
  title: `{{t("Only update records matching conditions", { ns: "${_locale.NAMESPACE}" })}}`,
102
102
  ['x-validator'](value) {
103
- return (0, _utils.isValidFilter)(value) ? '' : `{{t("Please add at least one condition", { ns: "${_locale.NAMESPACE}" })}}`;
103
+ return (0, _utils.isValidFilter)(value) ? '' : (0, _locale.lang)('Please add at least one condition');
104
104
  }
105
105
  }),
106
106
  values: _objectSpread(_objectSpread({}, _collection.values), {}, {
@@ -6,7 +6,7 @@ export declare const collection: {
6
6
  'x-decorator': string;
7
7
  'x-component': string;
8
8
  'x-component-props': {
9
- dropdownMatchSelectWidth: boolean;
9
+ popupMatchSelectWidth: boolean;
10
10
  };
11
11
  };
12
12
  export declare const values: {
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.values = exports.filter = exports.collection = exports.appends = void 0;
7
- function _css() {
8
- const data = require("@emotion/css");
9
- _css = function _css() {
10
- return data;
11
- };
12
- return data;
13
- }
14
7
  function _react() {
15
8
  const data = require("@formily/react");
16
9
  _react = function _react() {
@@ -34,7 +27,7 @@ const collection = {
34
27
  'x-decorator': 'FormItem',
35
28
  'x-component': 'CollectionSelect',
36
29
  'x-component-props': {
37
- dropdownMatchSelectWidth: false
30
+ popupMatchSelectWidth: false
38
31
  }
39
32
  };
40
33
  exports.collection = collection;
@@ -44,7 +37,7 @@ const values = {
44
37
  'x-decorator': 'FormItem',
45
38
  'x-decorator-props': {
46
39
  labelAlign: 'left',
47
- className: (0, _css().css)`
40
+ className: (0, _client().css)`
48
41
  flex-direction: column;
49
42
  `
50
43
  },
@@ -64,7 +57,7 @@ const filter = {
64
57
  const options = (0, _client().useCollectionFilterOptions)(values === null || values === void 0 ? void 0 : values.collection);
65
58
  return {
66
59
  options,
67
- className: (0, _css().css)`
60
+ className: (0, _client().css)`
68
61
  position: relative;
69
62
  width: 100%;
70
63
  `
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.workflowVersionDropdownClass = exports.workflowPageClass = exports.nodeTitleClass = exports.nodeSubtreeClass = exports.nodeMetaClass = exports.nodeJobButtonClass = exports.nodeHeaderClass = exports.nodeClass = exports.nodeCardClass = exports.nodeBlockClass = exports.branchClass = exports.branchBlockClass = exports.addButtonClass = void 0;
7
- function _css() {
8
- const data = require("@emotion/css");
9
- _css = function _css() {
7
+ function _client() {
8
+ const data = require("@nocobase/client");
9
+ _client = function _client() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- const workflowPageClass = (0, _css().css)`
14
+ const workflowPageClass = (0, _client().css)`
15
15
  flex-grow: 1;
16
16
  overflow: hidden;
17
17
  display: flex;
@@ -64,7 +64,7 @@ const workflowPageClass = (0, _css().css)`
64
64
  }
65
65
  `;
66
66
  exports.workflowPageClass = workflowPageClass;
67
- const workflowVersionDropdownClass = (0, _css().css)`
67
+ const workflowVersionDropdownClass = (0, _client().css)`
68
68
  .ant-dropdown-menu-item {
69
69
  .ant-dropdown-menu-title-content {
70
70
  text-align: right;
@@ -94,7 +94,7 @@ const workflowVersionDropdownClass = (0, _css().css)`
94
94
  }
95
95
  `;
96
96
  exports.workflowVersionDropdownClass = workflowVersionDropdownClass;
97
- const branchBlockClass = (0, _css().css)`
97
+ const branchBlockClass = (0, _client().css)`
98
98
  display: flex;
99
99
  position: relative;
100
100
 
@@ -105,11 +105,11 @@ const branchBlockClass = (0, _css().css)`
105
105
  bottom: 0;
106
106
  left: calc(50% - 0.5px);
107
107
  width: 1px;
108
- background-color: #f0f2f5;
108
+ background-color: var(--nb-box-bg);
109
109
  }
110
110
  `;
111
111
  exports.branchBlockClass = branchBlockClass;
112
- const branchClass = (0, _css().css)`
112
+ const branchClass = (0, _client().css)`
113
113
  display: flex;
114
114
  flex-direction: column;
115
115
  align-items: center;
@@ -170,7 +170,7 @@ const branchClass = (0, _css().css)`
170
170
  }
171
171
  `;
172
172
  exports.branchClass = branchClass;
173
- const nodeBlockClass = (0, _css().css)`
173
+ const nodeBlockClass = (0, _client().css)`
174
174
  flex-grow: 1;
175
175
  flex-shrink: 0;
176
176
  display: flex;
@@ -179,14 +179,14 @@ const nodeBlockClass = (0, _css().css)`
179
179
  position: relative;
180
180
  `;
181
181
  exports.nodeBlockClass = nodeBlockClass;
182
- const nodeClass = (0, _css().css)`
182
+ const nodeClass = (0, _client().css)`
183
183
  flex-shrink: 0;
184
184
  display: flex;
185
185
  flex-direction: column;
186
186
  align-items: center;
187
187
  `;
188
188
  exports.nodeClass = nodeClass;
189
- const nodeCardClass = (0, _css().css)`
189
+ const nodeCardClass = (0, _client().css)`
190
190
  position: relative;
191
191
  width: 20em;
192
192
  background: #fff;
@@ -249,7 +249,7 @@ const nodeCardClass = (0, _css().css)`
249
249
  }
250
250
  `;
251
251
  exports.nodeCardClass = nodeCardClass;
252
- const nodeJobButtonClass = (0, _css().css)`
252
+ const nodeJobButtonClass = (0, _client().css)`
253
253
  display: flex;
254
254
  position: absolute;
255
255
  top: 1.25em;
@@ -266,7 +266,7 @@ const nodeJobButtonClass = (0, _css().css)`
266
266
  border: none;
267
267
  }
268
268
 
269
- &.inner{
269
+ &.inner {
270
270
  position: static;
271
271
  }
272
272
 
@@ -280,11 +280,11 @@ const nodeJobButtonClass = (0, _css().css)`
280
280
  }
281
281
  `;
282
282
  exports.nodeJobButtonClass = nodeJobButtonClass;
283
- const nodeHeaderClass = (0, _css().css)`
283
+ const nodeHeaderClass = (0, _client().css)`
284
284
  position: relative;
285
285
  `;
286
286
  exports.nodeHeaderClass = nodeHeaderClass;
287
- const nodeMetaClass = (0, _css().css)`
287
+ const nodeMetaClass = (0, _client().css)`
288
288
  margin-bottom: 0.5em;
289
289
 
290
290
  .workflow-node-id {
@@ -296,7 +296,7 @@ const nodeMetaClass = (0, _css().css)`
296
296
  }
297
297
  `;
298
298
  exports.nodeMetaClass = nodeMetaClass;
299
- const nodeTitleClass = (0, _css().css)`
299
+ const nodeTitleClass = (0, _client().css)`
300
300
  display: flex;
301
301
  align-items: center;
302
302
  font-weight: normal;
@@ -305,13 +305,13 @@ const nodeTitleClass = (0, _css().css)`
305
305
  }
306
306
  `;
307
307
  exports.nodeTitleClass = nodeTitleClass;
308
- const nodeSubtreeClass = (0, _css().css)`
308
+ const nodeSubtreeClass = (0, _client().css)`
309
309
  display: flex;
310
310
  flex-direction: column-reverse;
311
311
  align-items: center;
312
312
  `;
313
313
  exports.nodeSubtreeClass = nodeSubtreeClass;
314
- const addButtonClass = (0, _css().css)`
314
+ const addButtonClass = (0, _client().css)`
315
315
  flex-shrink: 0;
316
316
  padding: 2em 0;
317
317
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
2
3
  declare const _default: {
3
4
  title: string;
@@ -11,7 +12,7 @@ declare const _default: {
11
12
  'x-decorator': string;
12
13
  'x-component': string;
13
14
  'x-component-props': {
14
- dropdownMatchSelectWidth: boolean;
15
+ popupMatchSelectWidth: boolean;
15
16
  };
16
17
  };
17
18
  mode: {
@@ -20,7 +21,7 @@ declare const _default: {
20
21
  'x-decorator': string;
21
22
  'x-component': string;
22
23
  'x-component-props': {
23
- dropdownMatchSelectWidth: boolean;
24
+ popupMatchSelectWidth: boolean;
24
25
  options: {
25
26
  label: string;
26
27
  value: number;
@@ -103,7 +104,7 @@ declare const _default: {
103
104
  useCollectionDataSource: typeof useCollectionDataSource;
104
105
  };
105
106
  components: {
106
- FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
107
+ FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
107
108
  };
108
109
  useVariables(config: any, options: any): import("../variable").VariableOption[];
109
110
  useInitializers(config: any): SchemaInitializerItemOptions | null;
@@ -77,7 +77,7 @@ var _default = {
77
77
  'x-decorator': 'FormItem',
78
78
  'x-component': 'Select',
79
79
  'x-component-props': {
80
- dropdownMatchSelectWidth: false,
80
+ popupMatchSelectWidth: false,
81
81
  options: collectionModeOptions,
82
82
  placeholder: `{{t("Trigger on", { ns: "${_locale.NAMESPACE}" })}}`
83
83
  },
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
1
  import { ISchema } from '@formily/react';
3
- import { Registry } from '@nocobase/utils/client';
4
2
  import { SchemaInitializerItemOptions } from '@nocobase/client';
3
+ import { Registry } from '@nocobase/utils/client';
4
+ import React from 'react';
5
5
  import { VariableOptions } from '../variable';
6
6
  export interface Trigger {
7
7
  title: string;
@@ -5,16 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.triggers = exports.TriggerConfig = void 0;
7
7
  exports.useTrigger = useTrigger;
8
- function _react() {
9
- const data = _interopRequireWildcard(require("react"));
10
- _react = function _react() {
11
- return data;
12
- };
13
- return data;
14
- }
15
- function _css() {
16
- const data = require("@emotion/css");
17
- _css = function _css() {
8
+ function _icons() {
9
+ const data = require("@ant-design/icons");
10
+ _icons = function _icons() {
18
11
  return data;
19
12
  };
20
13
  return data;
@@ -26,46 +19,46 @@ function _core() {
26
19
  };
27
20
  return data;
28
21
  }
29
- function _react2() {
22
+ function _react() {
30
23
  const data = require("@formily/react");
31
- _react2 = function _react2() {
24
+ _react = function _react() {
32
25
  return data;
33
26
  };
34
27
  return data;
35
28
  }
36
29
  function _client() {
37
- const data = require("@nocobase/utils/client");
30
+ const data = require("@nocobase/client");
38
31
  _client = function _client() {
39
32
  return data;
40
33
  };
41
34
  return data;
42
35
  }
43
- function _antd() {
44
- const data = require("antd");
45
- _antd = function _antd() {
36
+ function _client2() {
37
+ const data = require("@nocobase/utils/client");
38
+ _client2 = function _client2() {
46
39
  return data;
47
40
  };
48
41
  return data;
49
42
  }
50
- function _icons() {
51
- const data = require("@ant-design/icons");
52
- _icons = function _icons() {
43
+ function _antd() {
44
+ const data = require("antd");
45
+ _antd = function _antd() {
53
46
  return data;
54
47
  };
55
48
  return data;
56
49
  }
57
- function _client2() {
58
- const data = require("@nocobase/client");
59
- _client2 = function _client2() {
50
+ function _react2() {
51
+ const data = _interopRequireWildcard(require("react"));
52
+ _react2 = function _react2() {
60
53
  return data;
61
54
  };
62
55
  return data;
63
56
  }
64
- var _style = require("../style");
65
57
  var _FlowContext = require("../FlowContext");
58
+ var _locale = require("../locale");
59
+ var _style = require("../style");
66
60
  var _collection = _interopRequireDefault(require("./collection"));
67
61
  var _schedule = _interopRequireDefault(require("./schedule/"));
68
- var _locale = require("../locale");
69
62
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
70
63
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
71
64
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -84,12 +77,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
84
77
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
85
78
  function useUpdateConfigAction() {
86
79
  var _useFlowContext;
87
- const form = (0, _react2().useForm)();
88
- const api = (0, _client2().useAPIClient)();
80
+ const form = (0, _react().useForm)();
81
+ const api = (0, _client().useAPIClient)();
89
82
  const _ref = (_useFlowContext = (0, _FlowContext.useFlowContext)()) !== null && _useFlowContext !== void 0 ? _useFlowContext : {},
90
83
  workflow = _ref.workflow;
91
- const ctx = (0, _client2().useActionContext)();
92
- const _useResourceActionCon = (0, _client2().useResourceActionContext)(),
84
+ const ctx = (0, _client().useActionContext)();
85
+ const _useResourceActionCon = (0, _client().useResourceActionContext)(),
93
86
  refresh = _useResourceActionCon.refresh;
94
87
  return {
95
88
  run() {
@@ -112,12 +105,12 @@ function useUpdateConfigAction() {
112
105
  }
113
106
  };
114
107
  }
115
- const triggers = new (_client().Registry)();
108
+ const triggers = new (_client2().Registry)();
116
109
  exports.triggers = triggers;
117
110
  triggers.register(_collection.default.type, _collection.default);
118
111
  triggers.register(_schedule.default.type, _schedule.default);
119
112
  function TriggerExecution() {
120
- const compile = (0, _client2().useCompile)();
113
+ const compile = (0, _client().useCompile)();
121
114
  const _useFlowContext2 = (0, _FlowContext.useFlowContext)(),
122
115
  workflow = _useFlowContext2.workflow,
123
116
  execution = _useFlowContext2.execution;
@@ -125,13 +118,13 @@ function TriggerExecution() {
125
118
  return null;
126
119
  }
127
120
  const trigger = triggers.get(workflow.type);
128
- return _react().default.createElement(_client2().SchemaComponent, {
121
+ return _react2().default.createElement(_client().SchemaComponent, {
129
122
  schema: {
130
123
  type: 'void',
131
124
  name: 'execution',
132
125
  'x-component': 'Action',
133
126
  'x-component-props': {
134
- title: _react().default.createElement(_icons().InfoOutlined, null),
127
+ title: _react2().default.createElement(_icons().InfoOutlined, null),
135
128
  shape: 'circle',
136
129
  className: _style.nodeJobButtonClass,
137
130
  type: 'primary'
@@ -144,9 +137,9 @@ function TriggerExecution() {
144
137
  initialValue: execution
145
138
  },
146
139
  'x-component': 'Action.Modal',
147
- title: _react().default.createElement("div", {
148
- className: (0, _css().cx)(_style.nodeTitleClass)
149
- }, _react().default.createElement(_antd().Tag, null, compile(trigger.title)), _react().default.createElement("strong", null, workflow.title), _react().default.createElement("span", {
140
+ title: _react2().default.createElement("div", {
141
+ className: (0, _client().cx)(_style.nodeTitleClass)
142
+ }, _react2().default.createElement(_antd().Tag, null, compile(trigger.title)), _react2().default.createElement("strong", null, workflow.title), _react2().default.createElement("span", {
150
143
  className: "workflow-node-id"
151
144
  }, "#", execution.id)),
152
145
  properties: {
@@ -166,7 +159,7 @@ function TriggerExecution() {
166
159
  'x-decorator': 'FormItem',
167
160
  'x-component': 'Input.JSON',
168
161
  'x-component-props': {
169
- className: (0, _css().css)`
162
+ className: (0, _client().css)`
170
163
  padding: 1em;
171
164
  background-color: #eee;
172
165
  `
@@ -180,27 +173,27 @@ function TriggerExecution() {
180
173
  });
181
174
  }
182
175
  const TriggerConfig = () => {
183
- const api = (0, _client2().useAPIClient)();
184
- const compile = (0, _client2().useCompile)();
176
+ const api = (0, _client().useAPIClient)();
177
+ const compile = (0, _client().useCompile)();
185
178
  const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
186
179
  workflow = _useFlowContext3.workflow,
187
180
  refresh = _useFlowContext3.refresh;
188
- const _useState = (0, _react().useState)(''),
181
+ const _useState = (0, _react2().useState)(''),
189
182
  _useState2 = _slicedToArray(_useState, 2),
190
183
  editingTitle = _useState2[0],
191
184
  setEditingTitle = _useState2[1];
192
- const _useState3 = (0, _react().useState)(false),
185
+ const _useState3 = (0, _react2().useState)(false),
193
186
  _useState4 = _slicedToArray(_useState3, 2),
194
187
  editingConfig = _useState4[0],
195
188
  setEditingConfig = _useState4[1];
196
189
  let typeTitle = '';
197
- (0, _react().useEffect)(() => {
190
+ (0, _react2().useEffect)(() => {
198
191
  if (workflow) {
199
192
  var _workflow$title;
200
193
  setEditingTitle((_workflow$title = workflow.title) !== null && _workflow$title !== void 0 ? _workflow$title : typeTitle);
201
194
  }
202
195
  }, [workflow]);
203
- const form = (0, _react().useMemo)(() => (0, _core().createForm)({
196
+ const form = (0, _react2().useMemo)(() => (0, _core().createForm)({
204
197
  initialValues: workflow === null || workflow === void 0 ? void 0 : workflow.config,
205
198
  values: workflow === null || workflow === void 0 ? void 0 : workflow.config,
206
199
  disabled: workflow === null || workflow === void 0 ? void 0 : workflow.executed
@@ -254,24 +247,24 @@ const TriggerConfig = () => {
254
247
  }
255
248
  }
256
249
  }
257
- return _react().default.createElement("div", {
258
- className: (0, _css().cx)(_style.nodeCardClass),
250
+ return _react2().default.createElement("div", {
251
+ className: (0, _client().cx)(_style.nodeCardClass),
259
252
  onClick: onOpenDrawer
260
- }, _react().default.createElement("div", {
261
- className: (0, _css().cx)(_style.nodeMetaClass, 'workflow-node-meta')
262
- }, _react().default.createElement(_antd().Tag, {
253
+ }, _react2().default.createElement("div", {
254
+ className: (0, _client().cx)(_style.nodeMetaClass, 'workflow-node-meta')
255
+ }, _react2().default.createElement(_antd().Tag, {
263
256
  color: "gold"
264
- }, titleText)), _react().default.createElement("div", null, _react().default.createElement(_antd().Input.TextArea, {
257
+ }, titleText)), _react2().default.createElement("div", null, _react2().default.createElement(_antd().Input.TextArea, {
265
258
  value: editingTitle,
266
259
  onChange: ev => setEditingTitle(ev.target.value),
267
260
  onBlur: ev => onChangeTitle(ev.target.value),
268
261
  autoSize: true
269
- })), _react().default.createElement(TriggerExecution, null), _react().default.createElement(_client2().ActionContextProvider, {
262
+ })), _react2().default.createElement(TriggerExecution, null), _react2().default.createElement(_client().ActionContextProvider, {
270
263
  value: {
271
264
  visible: editingConfig,
272
265
  setVisible: setEditingConfig
273
266
  }
274
- }, _react().default.createElement(_client2().SchemaComponent, {
267
+ }, _react2().default.createElement(_client().SchemaComponent, {
275
268
  schema: {
276
269
  name: `workflow-trigger-${workflow.id}`,
277
270
  type: 'void',
@@ -300,7 +293,7 @@ const TriggerConfig = () => {
300
293
  type: 'warning',
301
294
  showIcon: true,
302
295
  message: `{{t("Trigger in executed workflow cannot be modified", { ns: "${_locale.NAMESPACE}" })}}`,
303
- className: (0, _css().css)`
296
+ className: (0, _client().css)`
304
297
  width: 100%;
305
298
  font-size: 85%;
306
299
  margin-bottom: 2em;
@@ -312,7 +305,7 @@ const TriggerConfig = () => {
312
305
  type: 'void',
313
306
  'x-component': 'fieldset',
314
307
  'x-component-props': {
315
- className: (0, _css().css)`
308
+ className: (0, _client().css)`
316
309
  .ant-select:not(.full-width) {
317
310
  width: auto;
318
311
  min-width: 6em;
@@ -55,7 +55,7 @@ const DateFieldsSelect = (0, _react().observer)(props => {
55
55
  values = _useForm.values;
56
56
  const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
57
57
  return _react2().default.createElement(_antd().Select, _objectSpread({
58
- dropdownMatchSelectWidth: false,
58
+ popupMatchSelectWidth: false,
59
59
  placeholder: t('Select field')
60
60
  }, props), fields.filter(field => !field.hidden && (field.uiSchema ? field.type === 'date' : false)).map(field => {
61
61
  var _field$uiSchema;
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.EndsByField = EndsByField;
7
- function _css() {
8
- const data = require("@emotion/css");
9
- _css = function _css() {
7
+ function _client() {
8
+ const data = require("@nocobase/client");
9
+ _client = function _client() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _antd() {
15
- const data = require("antd");
16
- _antd = function _antd() {
14
+ function _client2() {
15
+ const data = require("@nocobase/utils/client");
16
+ _client2 = function _client2() {
17
17
  return data;
18
18
  };
19
19
  return data;
20
20
  }
21
- function _moment() {
22
- const data = _interopRequireDefault(require("moment"));
23
- _moment = function _moment() {
21
+ function _antd() {
22
+ const data = require("antd");
23
+ _antd = function _antd() {
24
24
  return data;
25
25
  };
26
26
  return data;
@@ -43,7 +43,7 @@ function EndsByField({
43
43
  t = _useWorkflowTranslati.t;
44
44
  const type = value != null ? typeof value === 'object' && !(value instanceof Date) ? 'field' : 'date' : null;
45
45
  return _react().default.createElement("fieldset", {
46
- className: (0, _css().css)`
46
+ className: (0, _client().css)`
47
47
  display: flex;
48
48
  gap: 0.5em;
49
49
  `
@@ -63,7 +63,7 @@ function EndsByField({
63
63
  onChange: _onChange
64
64
  }) : null, type === 'date' ? _react().default.createElement(_antd().DatePicker, {
65
65
  showTime: true,
66
- value: (0, _moment().default)(value),
66
+ value: (0, _client2().dayjs)(value),
67
67
  onChange: v => {
68
68
  _onChange(v ? v.toDate() : null);
69
69
  }
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.OnField = OnField;
7
- function _react() {
8
- const data = _interopRequireWildcard(require("react"));
9
- _react = function _react() {
7
+ function _client() {
8
+ const data = require("@nocobase/client");
9
+ _client = function _client() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _css() {
15
- const data = require("@emotion/css");
16
- _css = function _css() {
14
+ function _antd() {
15
+ const data = require("antd");
16
+ _antd = function _antd() {
17
17
  return data;
18
18
  };
19
19
  return data;
20
20
  }
21
- function _antd() {
22
- const data = require("antd");
23
- _antd = function _antd() {
21
+ function _react() {
22
+ const data = _interopRequireWildcard(require("react"));
23
+ _react = function _react() {
24
24
  return data;
25
25
  };
26
26
  return data;
@@ -32,8 +32,8 @@ function _reactI18next() {
32
32
  };
33
33
  return data;
34
34
  }
35
- var _DateFieldsSelect = require("./DateFieldsSelect");
36
35
  var _locale = require("../../locale");
36
+ var _DateFieldsSelect = require("./DateFieldsSelect");
37
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
39
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -60,7 +60,7 @@ function OnField({
60
60
  dir = _useState2[0],
61
61
  setDir = _useState2[1];
62
62
  return _react().default.createElement("fieldset", {
63
- className: (0, _css().css)`
63
+ className: (0, _client().css)`
64
64
  display: flex;
65
65
  gap: 0.5em;
66
66
  `
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RepeatField = RepeatField;
7
- function _css() {
8
- const data = require("@emotion/css");
9
- _css = function _css() {
7
+ function _client() {
8
+ const data = require("@nocobase/client");
9
+ _client = function _client() {
10
10
  return data;
11
11
  };
12
12
  return data;
@@ -114,7 +114,7 @@ function RepeatField({
114
114
  }
115
115
  const locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
116
116
  return _react().default.createElement("fieldset", {
117
- className: (0, _css().css)`
117
+ className: (0, _client().css)`
118
118
  display: flex;
119
119
  flex-direction: ${typeValue === 'cron' ? 'column' : 'row'};
120
120
  align-items: flex-start;