@uipath/apollo-react 4.0.0 → 4.1.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 (247) hide show
  1. package/dist/canvas/components/AddNodePanel/AddNodePreview.cjs +4 -4
  2. package/dist/canvas/components/AddNodePanel/AddNodePreview.js +4 -4
  3. package/dist/canvas/components/AgentCanvas/AgentFlow.cjs +4 -4
  4. package/dist/canvas/components/AgentCanvas/AgentFlow.js +4 -4
  5. package/dist/canvas/components/AgentCanvas/components/PaneContextMenu.cjs +3 -3
  6. package/dist/canvas/components/AgentCanvas/components/PaneContextMenu.js +3 -3
  7. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.cjs +6 -6
  8. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.d.ts.map +1 -1
  9. package/dist/canvas/components/AgentCanvas/components/SuggestionGroupPanel.js +6 -6
  10. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.cjs +14 -14
  11. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.js +14 -14
  12. package/dist/canvas/components/AgentCanvas/edges/StaticEdge.cjs +8 -8
  13. package/dist/canvas/components/AgentCanvas/edges/StaticEdge.js +8 -8
  14. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.cjs +12 -12
  15. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.js +12 -12
  16. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.styles.cjs +18 -18
  17. package/dist/canvas/components/AgentCanvas/nodes/AgentNode.styles.js +18 -18
  18. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.cjs +12 -12
  19. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.d.ts.map +1 -1
  20. package/dist/canvas/components/AgentCanvas/nodes/ResourceNode.js +12 -12
  21. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.cjs +2 -2
  22. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.d.ts +2 -2
  23. package/dist/canvas/components/BaseCanvas/BaseCanvas.constants.js +2 -2
  24. package/dist/canvas/components/BaseCanvas/PanShortcutTeachingUI.cjs +2 -2
  25. package/dist/canvas/components/BaseCanvas/PanShortcutTeachingUI.js +2 -2
  26. package/dist/canvas/components/BaseNode/BaseNode.cjs +2 -2
  27. package/dist/canvas/components/BaseNode/BaseNode.js +2 -2
  28. package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +24 -24
  29. package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +1 -1
  30. package/dist/canvas/components/BaseNode/BaseNode.styles.js +24 -24
  31. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.cjs +1 -1
  32. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.js +1 -1
  33. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.styles.cjs +6 -6
  34. package/dist/canvas/components/BlankCanvasNode/BlankCanvasNode.styles.js +6 -6
  35. package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +1 -1
  36. package/dist/canvas/components/ButtonHandle/ButtonHandle.js +1 -1
  37. package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.cjs +11 -11
  38. package/dist/canvas/components/ButtonHandle/ButtonHandle.styles.js +11 -11
  39. package/dist/canvas/components/ButtonHandle/SmartHandle.cjs +1 -1
  40. package/dist/canvas/components/ButtonHandle/SmartHandle.d.ts.map +1 -1
  41. package/dist/canvas/components/ButtonHandle/SmartHandle.js +1 -1
  42. package/dist/canvas/components/CodedAgent/CodedAgentFlow.cjs +6 -6
  43. package/dist/canvas/components/CodedAgent/CodedAgentFlow.d.ts.map +1 -1
  44. package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +6 -6
  45. package/dist/canvas/components/Edges/EdgeUtils.cjs +14 -14
  46. package/dist/canvas/components/Edges/EdgeUtils.js +14 -14
  47. package/dist/canvas/components/Edges/SequenceEdge.cjs +11 -11
  48. package/dist/canvas/components/Edges/SequenceEdge.js +11 -11
  49. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +4 -4
  50. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
  51. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +4 -4
  52. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +5 -5
  53. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +5 -5
  54. package/dist/canvas/components/GroupNode/GroupNode.styles.cjs +19 -19
  55. package/dist/canvas/components/GroupNode/GroupNode.styles.js +19 -19
  56. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +2 -2
  57. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +2 -2
  58. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.cjs +3 -3
  59. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.js +3 -3
  60. package/dist/canvas/components/MiniCanvasNavigator/MiniCanvasNavigator.cjs +2 -2
  61. package/dist/canvas/components/MiniCanvasNavigator/MiniCanvasNavigator.js +2 -2
  62. package/dist/canvas/components/NodeInspector.cjs +4 -4
  63. package/dist/canvas/components/NodeInspector.js +4 -4
  64. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.cjs +30 -30
  65. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.js +30 -30
  66. package/dist/canvas/components/StageNode/StageConnectionEdge.cjs +1 -1
  67. package/dist/canvas/components/StageNode/StageConnectionEdge.js +1 -1
  68. package/dist/canvas/components/StageNode/StageEdge.cjs +7 -7
  69. package/dist/canvas/components/StageNode/StageEdge.js +7 -7
  70. package/dist/canvas/components/StageNode/StageNode.styles.cjs +34 -34
  71. package/dist/canvas/components/StageNode/StageNode.styles.js +34 -34
  72. package/dist/canvas/components/StageNode/TaskContent.cjs +1 -1
  73. package/dist/canvas/components/StageNode/TaskContent.js +1 -1
  74. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.cjs +20 -20
  75. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.d.ts.map +1 -1
  76. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.js +20 -20
  77. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.cjs +1 -1
  78. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.d.ts +1 -1
  79. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.types.js +1 -1
  80. package/dist/canvas/components/TaskIcon/TaskIcon.styles.cjs +1 -1
  81. package/dist/canvas/components/TaskIcon/TaskIcon.styles.js +1 -1
  82. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.cjs +2 -2
  83. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.js +2 -2
  84. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.cjs +9 -9
  85. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.js +9 -9
  86. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.cjs +3 -3
  87. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.js +3 -3
  88. package/dist/canvas/components/Toolbox/ListView.cjs +3 -3
  89. package/dist/canvas/components/Toolbox/ListView.js +3 -3
  90. package/dist/canvas/components/Toolbox/ListView.styles.cjs +7 -7
  91. package/dist/canvas/components/Toolbox/ListView.styles.js +7 -7
  92. package/dist/canvas/components/Toolbox/SearchBox.styles.cjs +8 -8
  93. package/dist/canvas/components/Toolbox/SearchBox.styles.js +8 -8
  94. package/dist/canvas/components/Toolbox/Toolbox.styles.cjs +2 -2
  95. package/dist/canvas/components/Toolbox/Toolbox.styles.js +2 -2
  96. package/dist/canvas/components/TriggerNode/TriggerNode.styles.cjs +15 -15
  97. package/dist/canvas/components/TriggerNode/TriggerNode.styles.js +15 -15
  98. package/dist/canvas/styles/execution-status.cjs +10 -10
  99. package/dist/canvas/styles/execution-status.js +10 -10
  100. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  101. package/dist/canvas/styles/variables.css +67 -32
  102. package/dist/canvas/utils/adornment-resolver.cjs +2 -2
  103. package/dist/canvas/utils/adornment-resolver.js +2 -2
  104. package/dist/canvas/utils/coded-agents/mermaid-parser.cjs +1 -1
  105. package/dist/canvas/utils/coded-agents/mermaid-parser.js +1 -1
  106. package/dist/canvas/utils/createPreviewNode.cjs +1 -1
  107. package/dist/canvas/utils/createPreviewNode.js +1 -1
  108. package/dist/canvas/utils/export-canvas.cjs +1 -1
  109. package/dist/canvas/utils/export-canvas.d.ts.map +1 -1
  110. package/dist/canvas/utils/export-canvas.js +1 -1
  111. package/package.json +2 -2
  112. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.cjs +0 -429
  113. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.d.ts +0 -11
  114. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.d.ts.map +0 -1
  115. package/dist/canvas/components/AddNodePanel/AddNodePanel.stories.js +0 -380
  116. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.cjs +0 -2209
  117. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.d.ts +0 -11
  118. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.d.ts.map +0 -1
  119. package/dist/canvas/components/AgentCanvas/AgentFlow.stories.js +0 -2160
  120. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.cjs +0 -246
  121. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.d.ts +0 -10
  122. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.d.ts.map +0 -1
  123. package/dist/canvas/components/AgentCanvas/components/TimelinePlayer.stories.js +0 -200
  124. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.cjs +0 -981
  125. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.d.ts +0 -12
  126. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.d.ts.map +0 -1
  127. package/dist/canvas/components/BaseCanvas/BaseCanvas.stories.js +0 -929
  128. package/dist/canvas/components/BaseNode/BaseNode.stories.cjs +0 -1150
  129. package/dist/canvas/components/BaseNode/BaseNode.stories.d.ts +0 -11
  130. package/dist/canvas/components/BaseNode/BaseNode.stories.d.ts.map +0 -1
  131. package/dist/canvas/components/BaseNode/BaseNode.stories.js +0 -1101
  132. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.cjs +0 -969
  133. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.d.ts +0 -9
  134. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.d.ts.map +0 -1
  135. package/dist/canvas/components/ButtonHandle/ButtonHandle.stories.js +0 -926
  136. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.cjs +0 -608
  137. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.d.ts +0 -8
  138. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.d.ts.map +0 -1
  139. package/dist/canvas/components/ButtonHandle/SmartHandle.stories.js +0 -568
  140. package/dist/canvas/components/CanvasPerformance.stories.cjs +0 -349
  141. package/dist/canvas/components/CanvasPerformance.stories.d.ts +0 -6
  142. package/dist/canvas/components/CanvasPerformance.stories.d.ts.map +0 -1
  143. package/dist/canvas/components/CanvasPerformance.stories.js +0 -312
  144. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.cjs +0 -119
  145. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.d.ts +0 -10
  146. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.d.ts.map +0 -1
  147. package/dist/canvas/components/CodedAgent/CodedAgentFlow.stories.js +0 -73
  148. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.cjs +0 -518
  149. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.d.ts +0 -6
  150. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.d.ts.map +0 -1
  151. package/dist/canvas/components/CollapseConfig/CollapseConfig.stories.js +0 -481
  152. package/dist/canvas/components/Edges/SequenceEdge.stories.cjs +0 -1073
  153. package/dist/canvas/components/Edges/SequenceEdge.stories.d.ts +0 -10
  154. package/dist/canvas/components/Edges/SequenceEdge.stories.d.ts.map +0 -1
  155. package/dist/canvas/components/Edges/SequenceEdge.stories.js +0 -1024
  156. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.cjs +0 -796
  157. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.d.ts +0 -7
  158. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.d.ts.map +0 -1
  159. package/dist/canvas/components/Edges/XyFlowEdgeComparison.stories.js +0 -756
  160. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.cjs +0 -245
  161. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.d.ts +0 -30
  162. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.d.ts.map +0 -1
  163. package/dist/canvas/components/ExecutionStatusIcon/ExecutionStatusIcon.stories.js +0 -208
  164. package/dist/canvas/components/Flow.stories.cjs +0 -778
  165. package/dist/canvas/components/Flow.stories.d.ts +0 -11
  166. package/dist/canvas/components/Flow.stories.d.ts.map +0 -1
  167. package/dist/canvas/components/Flow.stories.js +0 -725
  168. package/dist/canvas/components/GroupNode/GroupNode.stories.cjs +0 -837
  169. package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts +0 -12
  170. package/dist/canvas/components/GroupNode/GroupNode.stories.d.ts.map +0 -1
  171. package/dist/canvas/components/GroupNode/GroupNode.stories.js +0 -782
  172. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.cjs +0 -88
  173. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.d.ts +0 -7
  174. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.d.ts.map +0 -1
  175. package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.stories.js +0 -51
  176. package/dist/canvas/components/NodeInspector.stories.cjs +0 -229
  177. package/dist/canvas/components/NodeInspector.stories.d.ts +0 -20
  178. package/dist/canvas/components/NodeInspector.stories.d.ts.map +0 -1
  179. package/dist/canvas/components/NodeInspector.stories.js +0 -192
  180. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.cjs +0 -122
  181. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.d.ts +0 -7
  182. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.d.ts.map +0 -1
  183. package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.js +0 -85
  184. package/dist/canvas/components/StageNode/StageNode.stories.cjs +0 -2690
  185. package/dist/canvas/components/StageNode/StageNode.stories.d.ts +0 -17
  186. package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +0 -1
  187. package/dist/canvas/components/StageNode/StageNode.stories.js +0 -2623
  188. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.cjs +0 -552
  189. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.d.ts +0 -8
  190. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.d.ts.map +0 -1
  191. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.stories.js +0 -509
  192. package/dist/canvas/components/TaskIcon/TaskIcon.stories.cjs +0 -109
  193. package/dist/canvas/components/TaskIcon/TaskIcon.stories.d.ts +0 -10
  194. package/dist/canvas/components/TaskIcon/TaskIcon.stories.d.ts.map +0 -1
  195. package/dist/canvas/components/TaskIcon/TaskIcon.stories.js +0 -72
  196. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.cjs +0 -283
  197. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.d.ts +0 -7
  198. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.d.ts.map +0 -1
  199. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.stories.js +0 -243
  200. package/dist/canvas/components/TriggerNode/TriggerNode.stories.cjs +0 -270
  201. package/dist/canvas/components/TriggerNode/TriggerNode.stories.d.ts +0 -16
  202. package/dist/canvas/components/TriggerNode/TriggerNode.stories.d.ts.map +0 -1
  203. package/dist/canvas/components/TriggerNode/TriggerNode.stories.js +0 -233
  204. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.cjs +0 -76
  205. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.d.ts +0 -7
  206. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.d.ts.map +0 -1
  207. package/dist/canvas/controls/Breadcrumb/Breadcrumb.stories.js +0 -39
  208. package/dist/canvas/icons/Icons.stories.cjs +0 -207
  209. package/dist/canvas/icons/Icons.stories.d.ts +0 -6
  210. package/dist/canvas/icons/Icons.stories.d.ts.map +0 -1
  211. package/dist/canvas/icons/Icons.stories.js +0 -167
  212. package/dist/canvas/layouts/Column.stories.cjs +0 -716
  213. package/dist/canvas/layouts/Column.stories.d.ts +0 -14
  214. package/dist/canvas/layouts/Column.stories.d.ts.map +0 -1
  215. package/dist/canvas/layouts/Column.stories.js +0 -658
  216. package/dist/canvas/layouts/Grid.stories.cjs +0 -1033
  217. package/dist/canvas/layouts/Grid.stories.d.ts +0 -19
  218. package/dist/canvas/layouts/Grid.stories.d.ts.map +0 -1
  219. package/dist/canvas/layouts/Grid.stories.js +0 -960
  220. package/dist/canvas/layouts/Row.stories.cjs +0 -687
  221. package/dist/canvas/layouts/Row.stories.d.ts +0 -14
  222. package/dist/canvas/layouts/Row.stories.d.ts.map +0 -1
  223. package/dist/canvas/layouts/Row.stories.js +0 -629
  224. package/dist/canvas/storybook-utils/components/StoryInfoPanel.cjs +0 -100
  225. package/dist/canvas/storybook-utils/components/StoryInfoPanel.js +0 -66
  226. package/dist/canvas/storybook-utils/components/index.cjs +0 -58
  227. package/dist/canvas/storybook-utils/components/index.js +0 -1
  228. package/dist/canvas/storybook-utils/decorators.cjs +0 -101
  229. package/dist/canvas/storybook-utils/decorators.js +0 -64
  230. package/dist/canvas/storybook-utils/hooks/index.cjs +0 -58
  231. package/dist/canvas/storybook-utils/hooks/index.js +0 -1
  232. package/dist/canvas/storybook-utils/hooks/useCanvasStory.cjs +0 -118
  233. package/dist/canvas/storybook-utils/hooks/useCanvasStory.js +0 -81
  234. package/dist/canvas/storybook-utils/index.cjs +0 -86
  235. package/dist/canvas/storybook-utils/index.js +0 -5
  236. package/dist/canvas/storybook-utils/manifests/category-definitions.cjs +0 -220
  237. package/dist/canvas/storybook-utils/manifests/category-definitions.js +0 -186
  238. package/dist/canvas/storybook-utils/manifests/index.cjs +0 -82
  239. package/dist/canvas/storybook-utils/manifests/index.js +0 -10
  240. package/dist/canvas/storybook-utils/manifests/node-definitions.cjs +0 -1133
  241. package/dist/canvas/storybook-utils/manifests/node-definitions.js +0 -1099
  242. package/dist/canvas/storybook-utils/mocks/index.cjs +0 -65
  243. package/dist/canvas/storybook-utils/mocks/index.js +0 -2
  244. package/dist/canvas/storybook-utils/mocks/nodes.cjs +0 -237
  245. package/dist/canvas/storybook-utils/mocks/nodes.js +0 -191
  246. package/dist/canvas/storybook-utils/mocks/resources.cjs +0 -296
  247. package/dist/canvas/storybook-utils/mocks/resources.js +0 -238
@@ -1,2623 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ConnectionMode, Panel, ReactFlowProvider, addEdge, useEdgesState, useNodesState } from "../../xyflow/react.js";
3
- import { ApButton, ApMenu } from "../../../material/components/index.js";
4
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
- import { DefaultCanvasTranslations } from "../../types.js";
6
- import { createGroupModificationHandlers, getHandlerForModificationType } from "../../utils/GroupModificationUtils.js";
7
- import { BaseCanvas } from "../BaseCanvas/index.js";
8
- import { CanvasPositionControls } from "../CanvasPositionControls.js";
9
- import { TaskIcon, TaskItemTypeValues } from "../TaskIcon/index.js";
10
- import { StageConnectionEdge } from "./StageConnectionEdge.js";
11
- import { StageEdge } from "./StageEdge.js";
12
- import { StageNode } from "./StageNode.js";
13
- import { StageNodeWrapper } from "./StageNode.stories.utils.js";
14
- import { StageHeaderChipType } from "./StageNode.types.js";
15
- const DefaultCanvasDecorator = ({ initialNodes, initialEdges = [] })=>{
16
- const [nodes, _setNodes, onNodesChange] = useNodesState(initialNodes);
17
- const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
18
- const onConnect = useCallback((connection)=>{
19
- setEdges((eds)=>addEdge(connection, eds));
20
- }, [
21
- setEdges
22
- ]);
23
- const nodeTypes = useMemo(()=>({
24
- stage: StageNodeWrapper
25
- }), []);
26
- const edgeTypes = useMemo(()=>({
27
- stage: StageEdge
28
- }), []);
29
- const defaultEdgeOptions = useMemo(()=>({
30
- type: 'stage'
31
- }), []);
32
- return /*#__PURE__*/ jsx("div", {
33
- style: {
34
- width: '100vw',
35
- height: '100vh'
36
- },
37
- children: /*#__PURE__*/ jsx(ReactFlowProvider, {
38
- children: /*#__PURE__*/ jsx(BaseCanvas, {
39
- nodes: nodes,
40
- edges: edges,
41
- onNodesChange: onNodesChange,
42
- onEdgesChange: onEdgesChange,
43
- onConnect: onConnect,
44
- nodeTypes: nodeTypes,
45
- edgeTypes: edgeTypes,
46
- mode: "design",
47
- connectionMode: ConnectionMode.Strict,
48
- defaultEdgeOptions: defaultEdgeOptions,
49
- connectionLineComponent: StageConnectionEdge,
50
- elevateEdgesOnSelect: true,
51
- children: /*#__PURE__*/ jsx(Panel, {
52
- position: "bottom-right",
53
- children: /*#__PURE__*/ jsx(CanvasPositionControls, {
54
- translations: DefaultCanvasTranslations
55
- })
56
- })
57
- })
58
- })
59
- });
60
- };
61
- const meta = {
62
- title: 'Canvas/StageNode',
63
- component: StageNode,
64
- parameters: {
65
- layout: 'fullscreen'
66
- },
67
- decorators: [
68
- (Story, context)=>{
69
- if (context.parameters?.useCustomRender) return /*#__PURE__*/ jsx(Story, {});
70
- const initialNodes = context.parameters?.nodes || [
71
- {
72
- id: '1',
73
- type: 'stage',
74
- position: {
75
- x: 250,
76
- y: 100
77
- },
78
- data: {
79
- stageDetails: context.args.stageDetails,
80
- execution: context.args.execution,
81
- addTaskLabel: context.args.addTaskLabel,
82
- menuItems: context.args.menuItems,
83
- onTaskAdd: context.args.onTaskAdd,
84
- onTaskClick: context.args.onTaskClick
85
- }
86
- }
87
- ];
88
- const initialEdges = context.parameters?.edges || [];
89
- return /*#__PURE__*/ jsx(DefaultCanvasDecorator, {
90
- initialNodes: initialNodes,
91
- initialEdges: initialEdges
92
- });
93
- }
94
- ],
95
- args: {
96
- stageDetails: {
97
- label: 'Default Stage',
98
- tasks: []
99
- }
100
- },
101
- argTypes: {
102
- addTaskLabel: {
103
- control: 'text',
104
- description: 'Label for the add process button',
105
- defaultValue: 'Add process'
106
- }
107
- }
108
- };
109
- const StageNode_stories = meta;
110
- const ProcessIcon = ()=>/*#__PURE__*/ jsxs("svg", {
111
- viewBox: "0 0 24 24",
112
- fill: "none",
113
- stroke: "currentColor",
114
- strokeWidth: "1.5",
115
- children: [
116
- /*#__PURE__*/ jsx("rect", {
117
- x: "3",
118
- y: "3",
119
- width: "7",
120
- height: "7",
121
- rx: "1"
122
- }),
123
- /*#__PURE__*/ jsx("rect", {
124
- x: "14",
125
- y: "3",
126
- width: "7",
127
- height: "7",
128
- rx: "1"
129
- }),
130
- /*#__PURE__*/ jsx("rect", {
131
- x: "3",
132
- y: "14",
133
- width: "7",
134
- height: "7",
135
- rx: "1"
136
- }),
137
- /*#__PURE__*/ jsx("rect", {
138
- x: "14",
139
- y: "14",
140
- width: "7",
141
- height: "7",
142
- rx: "1"
143
- })
144
- ]
145
- });
146
- const VerificationIcon = ()=>/*#__PURE__*/ jsxs("svg", {
147
- viewBox: "0 0 24 24",
148
- fill: "none",
149
- stroke: "currentColor",
150
- strokeWidth: "1.5",
151
- children: [
152
- /*#__PURE__*/ jsx("path", {
153
- d: "M9 11L12 14L20 6"
154
- }),
155
- /*#__PURE__*/ jsx("path", {
156
- d: "M20 12V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4H13"
157
- })
158
- ]
159
- });
160
- const DocumentIcon = ()=>/*#__PURE__*/ jsxs("svg", {
161
- viewBox: "0 0 24 24",
162
- fill: "none",
163
- stroke: "currentColor",
164
- strokeWidth: "1.5",
165
- children: [
166
- /*#__PURE__*/ jsx("path", {
167
- d: "M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2Z"
168
- }),
169
- /*#__PURE__*/ jsx("path", {
170
- d: "M14 2V8H20"
171
- }),
172
- /*#__PURE__*/ jsx("path", {
173
- d: "M8 12H16"
174
- }),
175
- /*#__PURE__*/ jsx("path", {
176
- d: "M8 16H16"
177
- })
178
- ]
179
- });
180
- const sampleTasks = [
181
- [
182
- {
183
- id: 'liability_check',
184
- label: 'Liability Check',
185
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
186
- }
187
- ],
188
- [
189
- {
190
- id: 'credit_review',
191
- label: 'Credit Review',
192
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
193
- }
194
- ],
195
- [
196
- {
197
- id: 'address_verification',
198
- label: 'Address Verification and a really long label that might wrap',
199
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
200
- },
201
- {
202
- id: 'property_verification',
203
- label: 'Property Verification',
204
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
205
- }
206
- ],
207
- [
208
- {
209
- id: 'processing_review',
210
- label: 'Processing Review',
211
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
212
- }
213
- ]
214
- ];
215
- const Default = {
216
- name: 'Default',
217
- parameters: {
218
- nodes: [
219
- {
220
- id: '0',
221
- type: 'stage',
222
- position: {
223
- x: 48,
224
- y: 96
225
- },
226
- width: 304,
227
- data: {
228
- stageDetails: {
229
- label: 'Application',
230
- tasks: []
231
- },
232
- execution: {
233
- stageStatus: {
234
- duration: 'SLA: None'
235
- }
236
- },
237
- onTaskAdd: ()=>{
238
- window.alert('Add task functionality - this would open a dialog to add a new task');
239
- }
240
- }
241
- },
242
- {
243
- id: '1',
244
- type: 'stage',
245
- position: {
246
- x: 400,
247
- y: 96
248
- },
249
- width: 304,
250
- data: {
251
- stageDetails: {
252
- label: 'Processing with a really really really long label that might wrap',
253
- tasks: sampleTasks,
254
- sla: '1h',
255
- slaBreached: false,
256
- escalation: '1h',
257
- escalationsTriggered: false
258
- },
259
- execution: {
260
- stageStatus: {
261
- duration: 'SLA: None'
262
- }
263
- },
264
- onAddTaskFromToolbox: (taskItem)=>{
265
- window.alert(`Add task (${taskItem.data.type}) - this would open a panel to configure the new task`);
266
- },
267
- taskOptions: sampleTasks.flat().map((task)=>({
268
- id: task.id,
269
- name: task.label,
270
- icon: {
271
- Component: ()=>task.icon
272
- },
273
- data: {
274
- type: task.id
275
- }
276
- }))
277
- }
278
- },
279
- {
280
- id: '2',
281
- type: 'stage',
282
- position: {
283
- x: 752,
284
- y: 96
285
- },
286
- width: 304,
287
- data: {
288
- onReplaceTaskFromToolbox: ()=>{},
289
- stageDetails: {
290
- label: 'Validation - Failed',
291
- isReadOnly: true,
292
- tasks: [
293
- [
294
- {
295
- id: '1',
296
- label: 'Data Validation',
297
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
298
- }
299
- ],
300
- [
301
- {
302
- id: '2',
303
- label: 'Compliance Check',
304
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
305
- }
306
- ]
307
- ]
308
- },
309
- execution: {
310
- stageStatus: {
311
- label: 'error message',
312
- status: 'Failed'
313
- },
314
- taskStatus: {
315
- 2: {
316
- status: 'Failed',
317
- message: 'Compliance requirements not met'
318
- }
319
- }
320
- }
321
- }
322
- },
323
- {
324
- id: '3',
325
- type: 'stage',
326
- position: {
327
- x: 1104,
328
- y: 96
329
- },
330
- width: 304,
331
- data: {
332
- stageDetails: {
333
- label: 'Review - Warning',
334
- isReadOnly: true,
335
- tasks: [
336
- [
337
- {
338
- id: '1',
339
- label: 'Risk Assessment',
340
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
341
- }
342
- ],
343
- [
344
- {
345
- id: '2',
346
- label: 'Policy Review',
347
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
348
- }
349
- ]
350
- ]
351
- },
352
- execution: {
353
- stageStatus: {
354
- label: 'Needs attention',
355
- status: 'Warning'
356
- },
357
- taskStatus: {
358
- 2: {
359
- status: 'Warning',
360
- message: 'Policy review requires manual intervention'
361
- }
362
- }
363
- }
364
- }
365
- }
366
- ]
367
- }
368
- };
369
- const WithTaskIcons = {
370
- name: 'With Task Icons',
371
- parameters: {
372
- nodes: [
373
- {
374
- id: '1',
375
- type: 'stage',
376
- position: {
377
- x: 48,
378
- y: 96
379
- },
380
- width: 304,
381
- data: {
382
- stageDetails: {
383
- label: 'Task Icons Demo',
384
- tasks: [
385
- [
386
- {
387
- id: 'human-task',
388
- label: 'Human in the Loop',
389
- icon: /*#__PURE__*/ jsx(TaskIcon, {
390
- type: TaskItemTypeValues.User,
391
- size: "sm"
392
- })
393
- }
394
- ],
395
- [
396
- {
397
- id: 'agent-task',
398
- label: 'Agent Task',
399
- icon: /*#__PURE__*/ jsx(TaskIcon, {
400
- type: TaskItemTypeValues.Agent,
401
- size: "sm"
402
- })
403
- },
404
- {
405
- id: 'external-agent-task',
406
- label: 'External Agent',
407
- icon: /*#__PURE__*/ jsx(TaskIcon, {
408
- type: TaskItemTypeValues.ExternalAgent,
409
- size: "sm"
410
- })
411
- }
412
- ],
413
- [
414
- {
415
- id: 'rpa-task',
416
- label: 'RPA Automation',
417
- icon: /*#__PURE__*/ jsx(TaskIcon, {
418
- type: TaskItemTypeValues.Automation,
419
- size: "sm"
420
- })
421
- },
422
- {
423
- id: 'api-task',
424
- label: 'API Automation',
425
- icon: /*#__PURE__*/ jsx(TaskIcon, {
426
- type: TaskItemTypeValues.ApiAutomation,
427
- size: "sm"
428
- })
429
- }
430
- ],
431
- [
432
- {
433
- id: 'process-task',
434
- label: 'Agentic Process',
435
- icon: /*#__PURE__*/ jsx(TaskIcon, {
436
- type: TaskItemTypeValues.AgenticProcess,
437
- size: "sm"
438
- })
439
- },
440
- {
441
- id: 'connector-task',
442
- label: 'Connector',
443
- icon: /*#__PURE__*/ jsx(TaskIcon, {
444
- type: TaskItemTypeValues.Connector,
445
- size: "sm"
446
- })
447
- }
448
- ],
449
- [
450
- {
451
- id: 'timer-task',
452
- label: 'Timer',
453
- icon: /*#__PURE__*/ jsx(TaskIcon, {
454
- type: TaskItemTypeValues.Timer,
455
- size: "sm"
456
- })
457
- }
458
- ]
459
- ]
460
- }
461
- }
462
- }
463
- ]
464
- }
465
- };
466
- const ExecutionStatus = {
467
- name: 'Execution Status',
468
- parameters: {
469
- nodes: [
470
- {
471
- id: '0',
472
- type: 'stage',
473
- position: {
474
- x: 48,
475
- y: 96
476
- },
477
- width: 304,
478
- data: {
479
- stageDetails: {
480
- sla: '1h',
481
- slaBreached: false,
482
- escalation: '1h',
483
- escalationsTriggered: false,
484
- label: 'Application',
485
- isReadOnly: true,
486
- tasks: [
487
- [
488
- {
489
- id: '1',
490
- label: 'KYC and AML Checks',
491
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
492
- }
493
- ],
494
- [
495
- {
496
- id: '2',
497
- label: 'Document Verification is going to be very very really long',
498
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
499
- }
500
- ]
501
- ]
502
- },
503
- execution: {
504
- stageStatus: {
505
- status: 'Completed',
506
- duration: 'SLA: 4h'
507
- },
508
- taskStatus: {
509
- 1: {
510
- status: 'Completed',
511
- label: 'KYC and AML Checks',
512
- duration: '2h 15m'
513
- },
514
- 2: {
515
- status: 'Completed',
516
- label: 'Document Verification',
517
- duration: '1h 45m'
518
- }
519
- }
520
- }
521
- }
522
- },
523
- {
524
- id: '1',
525
- type: 'stage',
526
- position: {
527
- x: 400,
528
- y: 96
529
- },
530
- width: 304,
531
- data: {
532
- stageDetails: {
533
- sla: '1h',
534
- slaBreached: true,
535
- escalation: '1h',
536
- escalationsTriggered: true,
537
- label: 'Processing',
538
- isReadOnly: true,
539
- tasks: [
540
- [
541
- {
542
- id: '1',
543
- label: 'Liability Check',
544
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
545
- }
546
- ],
547
- [
548
- {
549
- id: '2',
550
- label: 'Credit Review',
551
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
552
- }
553
- ],
554
- [
555
- {
556
- id: '3',
557
- label: 'Address Verification',
558
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
559
- },
560
- {
561
- id: '4',
562
- label: 'Property Verification',
563
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
564
- }
565
- ],
566
- [
567
- {
568
- id: '5',
569
- label: 'Processing Review',
570
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
571
- }
572
- ]
573
- ],
574
- selectedTasks: [
575
- '2'
576
- ]
577
- },
578
- execution: {
579
- stageStatus: {
580
- status: 'Completed',
581
- duration: 'SLA: 6h 15m'
582
- },
583
- taskStatus: {
584
- 1: {
585
- status: 'Completed',
586
- label: 'Liability Check',
587
- duration: '1h 30m',
588
- retryDuration: '25m',
589
- badge: 'Reworked',
590
- badgeStatus: 'error',
591
- retryCount: 2
592
- },
593
- 2: {
594
- status: 'Completed',
595
- label: 'Credit Review',
596
- duration: '1h 30m',
597
- retryDuration: '32m',
598
- badge: 'Reworked',
599
- retryCount: 1
600
- },
601
- 3: {
602
- status: 'Completed',
603
- label: 'Address Verification',
604
- duration: '30m'
605
- },
606
- 4: {
607
- status: 'Completed',
608
- label: 'Property Verification',
609
- duration: '1h 30m',
610
- retryDuration: '1h 5m',
611
- badge: 'Reworked',
612
- retryCount: 3
613
- },
614
- 5: {
615
- status: 'Completed',
616
- label: 'Processing Review',
617
- duration: '1h 15m'
618
- }
619
- }
620
- }
621
- }
622
- },
623
- {
624
- id: '2',
625
- type: 'stage',
626
- position: {
627
- x: 752,
628
- y: 96
629
- },
630
- width: 304,
631
- data: {
632
- stageDetails: {
633
- label: 'Underwriting',
634
- isReadOnly: true,
635
- tasks: [
636
- [
637
- {
638
- id: '1',
639
- label: 'Report Ordering',
640
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
641
- }
642
- ],
643
- [
644
- {
645
- id: '2',
646
- label: 'Underwriting Verification',
647
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
648
- }
649
- ]
650
- ]
651
- },
652
- onTaskClick: (id)=>window.alert(`Task clicked: ${id}`),
653
- execution: {
654
- stageStatus: {
655
- status: 'InProgress',
656
- label: 'In progress',
657
- duration: 'SLA: 2h 15m'
658
- },
659
- taskStatus: {
660
- 1: {
661
- status: 'Completed',
662
- label: 'Report Ordering',
663
- duration: '2h 15m'
664
- },
665
- 2: {
666
- status: 'InProgress',
667
- label: 'Underwriting Verification'
668
- }
669
- }
670
- }
671
- }
672
- },
673
- {
674
- id: '3',
675
- type: 'stage',
676
- position: {
677
- x: 1104,
678
- y: 96
679
- },
680
- width: 304,
681
- data: {
682
- stageDetails: {
683
- label: 'Closing',
684
- isReadOnly: true,
685
- tasks: [
686
- [
687
- {
688
- id: '1',
689
- label: 'Loan Packet Creation',
690
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
691
- }
692
- ],
693
- [
694
- {
695
- id: '2',
696
- label: 'Customer Signing',
697
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
698
- }
699
- ],
700
- [
701
- {
702
- id: '3',
703
- label: 'Generate Audit Report',
704
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
705
- }
706
- ]
707
- ]
708
- },
709
- execution: {
710
- stageStatus: {
711
- status: 'NotExecuted',
712
- label: 'Not started'
713
- },
714
- taskStatus: {}
715
- }
716
- }
717
- },
718
- {
719
- id: '4',
720
- type: 'stage',
721
- position: {
722
- x: 1104,
723
- y: 400
724
- },
725
- width: 304,
726
- data: {
727
- stageDetails: {
728
- label: 'Rejected',
729
- isException: true,
730
- isReadOnly: true,
731
- tasks: [
732
- [
733
- {
734
- id: '1',
735
- label: 'Customer Notification',
736
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
737
- }
738
- ],
739
- [
740
- {
741
- id: '2',
742
- label: 'Generate Audit Report',
743
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
744
- }
745
- ]
746
- ]
747
- },
748
- execution: {
749
- stageStatus: {
750
- status: 'NotExecuted',
751
- label: 'Not started'
752
- },
753
- taskStatus: {}
754
- }
755
- }
756
- }
757
- ],
758
- edges: [
759
- {
760
- id: 'e1',
761
- type: 'stage',
762
- source: '0',
763
- sourceHandle: '0____source____right',
764
- target: '1',
765
- targetHandle: '1____target____left'
766
- },
767
- {
768
- id: 'e2',
769
- type: 'stage',
770
- source: '1',
771
- sourceHandle: '1____source____right',
772
- target: '2',
773
- targetHandle: '2____target____left'
774
- },
775
- {
776
- id: 'e3',
777
- type: 'stage',
778
- source: '2',
779
- sourceHandle: '2____source____right',
780
- target: '3',
781
- targetHandle: '3____target____left'
782
- }
783
- ]
784
- }
785
- };
786
- const InteractiveTaskManagement = {
787
- name: 'Interactive Task Management',
788
- parameters: {
789
- nodes: [
790
- {
791
- id: 'design-stage',
792
- type: 'stage',
793
- position: {
794
- x: 48,
795
- y: 96
796
- },
797
- width: 352,
798
- data: {
799
- stageDetails: {
800
- label: 'Design Mode - Editable',
801
- tasks: [
802
- [
803
- {
804
- id: '1',
805
- label: 'Initial Task',
806
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
807
- }
808
- ],
809
- [
810
- {
811
- id: '2',
812
- label: 'Credit Review with a very long label that will be truncated and show tooltip',
813
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
814
- }
815
- ],
816
- [
817
- {
818
- id: '3',
819
- label: 'Address Verification',
820
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
821
- },
822
- {
823
- id: '4',
824
- label: 'Property Verification with Long Name',
825
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
826
- },
827
- {
828
- id: '5',
829
- label: 'Background Check',
830
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
831
- }
832
- ],
833
- [
834
- {
835
- id: '6',
836
- label: "Final Review Task with Extended Description",
837
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
838
- }
839
- ]
840
- ]
841
- },
842
- onTaskClick: (taskId)=>{
843
- window.alert(`Task clicked: ${taskId}`);
844
- },
845
- onTaskRemove: (groupIndex, taskIndex)=>{
846
- window.alert(`Task removal requested!\nGroup: ${groupIndex}\nTask: ${taskIndex}\n\nIn a real app, this would remove the task from the data.`);
847
- },
848
- onTaskAdd: ()=>{
849
- window.alert('Add task functionality - this would open a dialog to add a new task');
850
- }
851
- }
852
- },
853
- {
854
- id: 'execution-stage',
855
- type: 'stage',
856
- position: {
857
- x: 448,
858
- y: 96
859
- },
860
- width: 352,
861
- data: {
862
- stageDetails: {
863
- label: 'Execution Mode - Read Only',
864
- isReadOnly: true,
865
- tasks: [
866
- [
867
- {
868
- id: '1',
869
- label: 'Task with execution status and very long name that will be truncated',
870
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
871
- }
872
- ],
873
- [
874
- {
875
- id: '2',
876
- label: 'Credit Review Processing',
877
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
878
- }
879
- ],
880
- [
881
- {
882
- id: '3',
883
- label: 'Parallel Address Verification Task',
884
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
885
- },
886
- {
887
- id: '4',
888
- label: 'Parallel Property Verification with Extended Name',
889
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
890
- }
891
- ],
892
- [
893
- {
894
- id: '5',
895
- label: 'Final Review and Approval Process',
896
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
897
- }
898
- ]
899
- ]
900
- },
901
- execution: {
902
- stageStatus: {
903
- status: 'InProgress',
904
- label: 'In progress',
905
- duration: '2h 15m'
906
- },
907
- taskStatus: {
908
- 1: {
909
- status: 'Completed',
910
- duration: '30m',
911
- badge: 'Completed',
912
- badgeStatus: 'info'
913
- },
914
- 2: {
915
- status: 'InProgress',
916
- duration: '1h 15m',
917
- retryDuration: '15m',
918
- badge: 'Retry',
919
- badgeStatus: 'warning',
920
- retryCount: 2
921
- },
922
- 3: {
923
- status: 'Completed',
924
- duration: '45m'
925
- },
926
- 4: {
927
- status: 'Failed',
928
- duration: '20m',
929
- retryDuration: '10m',
930
- badge: 'Error',
931
- badgeStatus: 'error',
932
- retryCount: 1
933
- },
934
- 5: {
935
- status: 'NotExecuted'
936
- }
937
- }
938
- },
939
- onTaskClick: (taskId)=>{
940
- window.alert(`Task clicked: ${taskId} (execution mode - read only)`);
941
- }
942
- }
943
- }
944
- ]
945
- }
946
- };
947
- const LoanProcessingWorkflow = {
948
- name: 'Loan Processing Workflow',
949
- parameters: {
950
- nodes: [
951
- {
952
- id: 'application',
953
- type: 'stage',
954
- position: {
955
- x: 48,
956
- y: 96
957
- },
958
- width: 304,
959
- data: {
960
- stageDetails: {
961
- label: 'Application',
962
- tasks: [
963
- [
964
- {
965
- id: '1',
966
- label: 'KYC and AML Checks',
967
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
968
- }
969
- ],
970
- [
971
- {
972
- id: '2',
973
- label: 'Document Verification',
974
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
975
- }
976
- ]
977
- ],
978
- selectedTasks: [
979
- '1'
980
- ]
981
- }
982
- }
983
- },
984
- {
985
- id: 'processing',
986
- type: 'stage',
987
- position: {
988
- x: 448,
989
- y: 96
990
- },
991
- width: 304,
992
- data: {
993
- stageDetails: {
994
- label: 'Processing',
995
- tasks: [
996
- [
997
- {
998
- id: '1',
999
- label: 'Liability Check',
1000
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1001
- }
1002
- ],
1003
- [
1004
- {
1005
- id: '2',
1006
- label: 'Credit Review',
1007
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1008
- }
1009
- ],
1010
- [
1011
- {
1012
- id: '3',
1013
- label: 'Address Verification',
1014
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1015
- },
1016
- {
1017
- id: '4',
1018
- label: 'Property Verification',
1019
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1020
- }
1021
- ],
1022
- [
1023
- {
1024
- id: '5',
1025
- label: 'Processing Review',
1026
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1027
- }
1028
- ]
1029
- ],
1030
- selectedTasks: [
1031
- '4'
1032
- ]
1033
- }
1034
- }
1035
- },
1036
- {
1037
- id: 'underwriting',
1038
- type: 'stage',
1039
- position: {
1040
- x: 848,
1041
- y: 96
1042
- },
1043
- width: 304,
1044
- data: {
1045
- stageDetails: {
1046
- label: 'Underwriting',
1047
- tasks: [
1048
- [
1049
- {
1050
- id: '1',
1051
- label: 'Report Ordering',
1052
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1053
- }
1054
- ],
1055
- [
1056
- {
1057
- id: '2',
1058
- label: 'Underwriting Verification',
1059
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1060
- }
1061
- ]
1062
- ]
1063
- }
1064
- }
1065
- },
1066
- {
1067
- id: 'closing',
1068
- type: 'stage',
1069
- position: {
1070
- x: 1248,
1071
- y: 96
1072
- },
1073
- width: 304,
1074
- data: {
1075
- stageDetails: {
1076
- label: 'Closing',
1077
- tasks: [
1078
- [
1079
- {
1080
- id: '1',
1081
- label: 'Loan Packet Creation',
1082
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1083
- }
1084
- ],
1085
- [
1086
- {
1087
- id: '2',
1088
- label: 'Customer Signing',
1089
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1090
- }
1091
- ],
1092
- [
1093
- {
1094
- id: '3',
1095
- label: 'Generate Audit Report',
1096
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1097
- }
1098
- ]
1099
- ]
1100
- }
1101
- }
1102
- },
1103
- {
1104
- id: 'funding',
1105
- type: 'stage',
1106
- position: {
1107
- x: 1648,
1108
- y: 96
1109
- },
1110
- width: 304,
1111
- data: {
1112
- stageDetails: {
1113
- label: 'Funding',
1114
- tasks: [
1115
- [
1116
- {
1117
- id: '1',
1118
- label: 'Disperse Loan',
1119
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1120
- }
1121
- ],
1122
- [
1123
- {
1124
- id: '2',
1125
- label: 'Generate Audit Report',
1126
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1127
- }
1128
- ]
1129
- ]
1130
- }
1131
- }
1132
- },
1133
- {
1134
- id: 'rejected',
1135
- type: 'stage',
1136
- position: {
1137
- x: 1248,
1138
- y: 400
1139
- },
1140
- width: 304,
1141
- data: {
1142
- stageDetails: {
1143
- label: 'Rejected',
1144
- isException: true,
1145
- tasks: [
1146
- [
1147
- {
1148
- id: '1',
1149
- label: 'Customer Notification',
1150
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1151
- }
1152
- ],
1153
- [
1154
- {
1155
- id: '2',
1156
- label: 'Generate Audit Report',
1157
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1158
- }
1159
- ]
1160
- ]
1161
- }
1162
- }
1163
- },
1164
- {
1165
- id: 'withdrawn',
1166
- type: 'stage',
1167
- position: {
1168
- x: 448,
1169
- y: 608
1170
- },
1171
- width: 304,
1172
- data: {
1173
- stageDetails: {
1174
- label: 'Withdrawn',
1175
- isException: true,
1176
- tasks: [
1177
- [
1178
- {
1179
- id: '1',
1180
- label: 'Customer Notification',
1181
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1182
- }
1183
- ],
1184
- [
1185
- {
1186
- id: '2',
1187
- label: 'Generate Audit Report',
1188
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1189
- }
1190
- ]
1191
- ]
1192
- }
1193
- }
1194
- }
1195
- ],
1196
- edges: [
1197
- {
1198
- id: 'e1',
1199
- type: 'stage',
1200
- source: 'application',
1201
- sourceHandle: 'application____source____right',
1202
- target: 'processing',
1203
- targetHandle: 'processing____target____left'
1204
- },
1205
- {
1206
- id: 'e2',
1207
- type: 'stage',
1208
- source: 'processing',
1209
- sourceHandle: 'processing____source____right',
1210
- target: 'underwriting',
1211
- targetHandle: 'underwriting____target____left'
1212
- },
1213
- {
1214
- id: 'e3',
1215
- type: 'stage',
1216
- source: 'underwriting',
1217
- sourceHandle: 'underwriting____source____right',
1218
- target: 'closing',
1219
- targetHandle: 'closing____target____left'
1220
- },
1221
- {
1222
- id: 'e4',
1223
- type: 'stage',
1224
- source: 'closing',
1225
- sourceHandle: 'closing____source____right',
1226
- target: 'funding',
1227
- targetHandle: 'funding____target____left'
1228
- }
1229
- ]
1230
- }
1231
- };
1232
- const initialTasks = [
1233
- [
1234
- {
1235
- id: 'task-1',
1236
- label: 'KYC Verification',
1237
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1238
- }
1239
- ],
1240
- [
1241
- {
1242
- id: 'task-2',
1243
- label: 'Document Review',
1244
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1245
- },
1246
- {
1247
- id: 'task-6',
1248
- label: 'Credit Check',
1249
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1250
- }
1251
- ],
1252
- [
1253
- {
1254
- id: 'task-7',
1255
- label: 'Ad hoc - Manual Review',
1256
- icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
1257
- isAdhoc: true
1258
- }
1259
- ],
1260
- [
1261
- {
1262
- id: 'task-3',
1263
- label: 'Address Check',
1264
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1265
- },
1266
- {
1267
- id: 'task-4',
1268
- label: 'Property Check',
1269
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1270
- }
1271
- ],
1272
- [
1273
- {
1274
- id: 'task-8',
1275
- label: 'Ad hoc - Exception Handling',
1276
- icon: /*#__PURE__*/ jsx(ProcessIcon, {}),
1277
- isAdhoc: true
1278
- }
1279
- ],
1280
- [
1281
- {
1282
- id: 'task-5',
1283
- label: 'Final Approval',
1284
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1285
- }
1286
- ]
1287
- ];
1288
- const DraggableTaskReorderingStory = ()=>{
1289
- const nodeTypes = useMemo(()=>({
1290
- stage: StageNodeWrapper
1291
- }), []);
1292
- const edgeTypes = useMemo(()=>({
1293
- stage: StageEdge
1294
- }), []);
1295
- const [nodes, setNodes, onNodesChange] = useNodesState([
1296
- {
1297
- id: 'reorder-stage',
1298
- type: 'stage',
1299
- position: {
1300
- x: 320,
1301
- y: 96
1302
- },
1303
- data: {
1304
- stageDetails: {
1305
- label: 'Drag to Reorder Tasks',
1306
- tasks: initialTasks
1307
- },
1308
- onTaskClick: (taskId)=>console.log('Task clicked:', taskId)
1309
- }
1310
- }
1311
- ]);
1312
- const [edges, setEdges, onEdgesChange] = useEdgesState([]);
1313
- const handleTaskReorder = useCallback((reorderedTasks)=>{
1314
- setNodes((nds)=>nds.map((node)=>'reorder-stage' === node.id ? {
1315
- ...node,
1316
- data: {
1317
- ...node.data,
1318
- stageDetails: {
1319
- ...node.data.stageDetails,
1320
- tasks: reorderedTasks
1321
- }
1322
- }
1323
- } : node));
1324
- }, [
1325
- setNodes
1326
- ]);
1327
- const groupModificationHandlers = useMemo(()=>createGroupModificationHandlers(), []);
1328
- const handleTaskGroupModification = useCallback((groupModificationType, groupIndex, taskIndex)=>{
1329
- const handler = getHandlerForModificationType(groupModificationHandlers, groupModificationType);
1330
- setNodes((nds)=>nds.map((node)=>'reorder-stage' === node.id ? {
1331
- ...node,
1332
- data: {
1333
- ...node.data,
1334
- stageDetails: {
1335
- ...node.data.stageDetails,
1336
- tasks: handler(node.data.stageDetails.tasks, groupIndex, taskIndex)
1337
- }
1338
- }
1339
- } : node));
1340
- }, [
1341
- groupModificationHandlers,
1342
- setNodes
1343
- ]);
1344
- const nodesWithHandler = useMemo(()=>nodes.map((node)=>({
1345
- ...node,
1346
- data: {
1347
- ...node.data,
1348
- onTaskReorder: handleTaskReorder,
1349
- onTaskGroupModification: handleTaskGroupModification
1350
- }
1351
- })), [
1352
- nodes,
1353
- handleTaskReorder,
1354
- handleTaskGroupModification
1355
- ]);
1356
- const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
1357
- setEdges
1358
- ]);
1359
- return /*#__PURE__*/ jsx("div", {
1360
- style: {
1361
- width: '100vw',
1362
- height: '100vh'
1363
- },
1364
- children: /*#__PURE__*/ jsx(ReactFlowProvider, {
1365
- children: /*#__PURE__*/ jsx(BaseCanvas, {
1366
- nodes: nodesWithHandler,
1367
- edges: edges,
1368
- onNodesChange: onNodesChange,
1369
- onEdgesChange: onEdgesChange,
1370
- onConnect: onConnect,
1371
- nodeTypes: nodeTypes,
1372
- edgeTypes: edgeTypes,
1373
- mode: "design",
1374
- connectionMode: ConnectionMode.Strict,
1375
- defaultEdgeOptions: {
1376
- type: 'stage'
1377
- },
1378
- connectionLineComponent: StageConnectionEdge,
1379
- elevateEdgesOnSelect: true,
1380
- defaultViewport: {
1381
- x: 0,
1382
- y: 0,
1383
- zoom: 1.5
1384
- },
1385
- children: /*#__PURE__*/ jsx(Panel, {
1386
- position: "bottom-right",
1387
- children: /*#__PURE__*/ jsx(CanvasPositionControls, {
1388
- translations: DefaultCanvasTranslations
1389
- })
1390
- })
1391
- })
1392
- })
1393
- });
1394
- };
1395
- const DraggableTaskReordering = {
1396
- name: 'Draggable Task Reordering',
1397
- parameters: {
1398
- useCustomRender: true
1399
- },
1400
- render: ()=>/*#__PURE__*/ jsx(DraggableTaskReorderingStory, {})
1401
- };
1402
- const initialTasksForAddReplace = [
1403
- [
1404
- {
1405
- id: 'task-1',
1406
- label: 'Initial Verification',
1407
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1408
- }
1409
- ],
1410
- [
1411
- {
1412
- id: 'task-adhoc-1',
1413
- label: 'Ad hoc - Manual Check',
1414
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
1415
- isAdhoc: true
1416
- }
1417
- ],
1418
- [
1419
- {
1420
- id: 'task-2',
1421
- label: 'Document Review',
1422
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1423
- }
1424
- ],
1425
- [
1426
- {
1427
- id: 'task-3',
1428
- label: 'Process Validation',
1429
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1430
- }
1431
- ]
1432
- ];
1433
- const availableTaskOptions = [
1434
- {
1435
- id: 'verification-task',
1436
- name: 'Verification task',
1437
- icon: {
1438
- Component: ()=>/*#__PURE__*/ jsx(VerificationIcon, {})
1439
- },
1440
- data: {
1441
- type: 'verification'
1442
- }
1443
- },
1444
- {
1445
- id: 'document-task',
1446
- name: 'Document task',
1447
- icon: {
1448
- Component: ()=>/*#__PURE__*/ jsx(DocumentIcon, {})
1449
- },
1450
- data: {
1451
- type: 'document'
1452
- }
1453
- },
1454
- {
1455
- id: 'process-task',
1456
- name: 'Process task',
1457
- icon: {
1458
- Component: ()=>/*#__PURE__*/ jsx(ProcessIcon, {})
1459
- },
1460
- data: {
1461
- type: 'process'
1462
- }
1463
- },
1464
- {
1465
- id: 'credit-check',
1466
- name: 'Credit check',
1467
- icon: {
1468
- Component: ()=>/*#__PURE__*/ jsx(VerificationIcon, {})
1469
- },
1470
- data: {
1471
- type: 'credit'
1472
- }
1473
- },
1474
- {
1475
- id: 'address-verification',
1476
- name: 'Address verification',
1477
- icon: {
1478
- Component: ()=>/*#__PURE__*/ jsx(VerificationIcon, {})
1479
- },
1480
- data: {
1481
- type: 'address'
1482
- }
1483
- }
1484
- ];
1485
- const AddAndReplaceTasksStory = ()=>{
1486
- const nodeTypes = useMemo(()=>({
1487
- stage: StageNodeWrapper
1488
- }), []);
1489
- const edgeTypes = useMemo(()=>({
1490
- stage: StageEdge
1491
- }), []);
1492
- const [pendingReplaceTask, setPendingReplaceTask] = useState(false);
1493
- const [selectedTaskId, setSelectedTaskId] = useState();
1494
- const [menuAnchorEl, setMenuAnchorEl] = useState(null);
1495
- const [nodesState, setNodes, onNodesChange] = useNodesState([
1496
- {
1497
- id: 'add-replace-stage',
1498
- type: 'stage',
1499
- position: {
1500
- x: 320,
1501
- y: 96
1502
- },
1503
- data: {
1504
- stageDetails: {
1505
- label: 'Add, Replace, and Group Tasks',
1506
- isReadOnly: false,
1507
- tasks: initialTasksForAddReplace
1508
- },
1509
- taskOptions: availableTaskOptions
1510
- }
1511
- },
1512
- {
1513
- id: 'readonly-stage',
1514
- type: 'stage',
1515
- position: {
1516
- x: 720,
1517
- y: 96
1518
- },
1519
- data: {
1520
- stageDetails: {
1521
- label: 'ReadOnly Stage',
1522
- isReadOnly: true,
1523
- tasks: initialTasksForAddReplace
1524
- },
1525
- taskOptions: availableTaskOptions
1526
- }
1527
- }
1528
- ]);
1529
- const [edges, setEdges, onEdgesChange] = useEdgesState([]);
1530
- const handleAddTask = useCallback((taskItem)=>{
1531
- const newTask = {
1532
- id: `${taskItem.id}-${Date.now()}`,
1533
- label: taskItem.name,
1534
- icon: taskItem.icon?.Component ? /*#__PURE__*/ jsx(taskItem.icon.Component, {}) : void 0
1535
- };
1536
- setNodes((prevNodes)=>prevNodes.map((node)=>'add-replace-stage' === node.id ? {
1537
- ...node,
1538
- data: {
1539
- ...node.data,
1540
- stageDetails: {
1541
- ...node.data.stageDetails,
1542
- tasks: [
1543
- ...node.data.stageDetails.tasks,
1544
- [
1545
- newTask
1546
- ]
1547
- ]
1548
- }
1549
- }
1550
- } : node));
1551
- }, [
1552
- setNodes
1553
- ]);
1554
- const handleReplaceTask = useCallback((taskItem, groupIndex, taskIndex)=>{
1555
- if (groupIndex < 0 || taskIndex < 0) return;
1556
- const listItem = taskItem;
1557
- const replacedTask = {
1558
- id: `${listItem.id}-replaced-${Date.now()}`,
1559
- label: listItem.name,
1560
- icon: listItem.icon?.Component ? /*#__PURE__*/ jsx(listItem.icon.Component, {}) : void 0
1561
- };
1562
- setNodes((prevNodes)=>prevNodes.map((node)=>{
1563
- if ('add-replace-stage' !== node.id) return node;
1564
- const prevTasks = node.data.stageDetails.tasks;
1565
- if (groupIndex >= prevTasks.length) return node;
1566
- const currentGroup = prevTasks[groupIndex];
1567
- if (!currentGroup || taskIndex >= currentGroup.length) return node;
1568
- const updatedTasks = prevTasks.map((group, gIdx)=>{
1569
- if (gIdx === groupIndex) return group.map((task, tIdx)=>tIdx === taskIndex ? replacedTask : task);
1570
- return group;
1571
- });
1572
- return {
1573
- ...node,
1574
- data: {
1575
- ...node.data,
1576
- stageDetails: {
1577
- ...node.data.stageDetails,
1578
- tasks: updatedTasks
1579
- }
1580
- }
1581
- };
1582
- }));
1583
- setPendingReplaceTask(false);
1584
- setSelectedTaskId(void 0);
1585
- }, [
1586
- setNodes
1587
- ]);
1588
- const groupModificationHandlers = useMemo(()=>createGroupModificationHandlers(), []);
1589
- const handleTaskGroupModification = useCallback((groupModificationType, groupIndex, taskIndex)=>{
1590
- const handler = getHandlerForModificationType(groupModificationHandlers, groupModificationType);
1591
- setNodes((prevNodes)=>prevNodes.map((node)=>{
1592
- if ('add-replace-stage' !== node.id) return node;
1593
- const prevTasks = node.data.stageDetails.tasks;
1594
- const updatedTasks = handler(prevTasks, groupIndex, taskIndex);
1595
- return {
1596
- ...node,
1597
- data: {
1598
- ...node.data,
1599
- stageDetails: {
1600
- ...node.data.stageDetails,
1601
- tasks: updatedTasks
1602
- }
1603
- }
1604
- };
1605
- }));
1606
- }, [
1607
- groupModificationHandlers,
1608
- setNodes
1609
- ]);
1610
- const handleTaskReorder = useCallback((reorderedTasks)=>{
1611
- setNodes((prevNodes)=>prevNodes.map((node)=>'add-replace-stage' === node.id ? {
1612
- ...node,
1613
- data: {
1614
- ...node.data,
1615
- stageDetails: {
1616
- ...node.data.stageDetails,
1617
- tasks: reorderedTasks
1618
- }
1619
- }
1620
- } : node));
1621
- }, [
1622
- setNodes
1623
- ]);
1624
- const handleTaskClick = useCallback((taskId)=>{
1625
- setSelectedTaskId(taskId);
1626
- }, []);
1627
- const handlePaneClick = useCallback(()=>{
1628
- setSelectedTaskId(void 0);
1629
- setPendingReplaceTask(false);
1630
- }, []);
1631
- const handleNodesChange = useCallback((...args)=>{
1632
- onNodesChange(...args);
1633
- const deselected = args[0].some((c)=>'select' === c.type && 'add-replace-stage' === c.id && !c.selected);
1634
- if (deselected) {
1635
- setPendingReplaceTask(false);
1636
- setSelectedTaskId(void 0);
1637
- }
1638
- }, [
1639
- onNodesChange
1640
- ]);
1641
- const currentTasks = nodesState.find((n)=>'add-replace-stage' === n.id)?.data.stageDetails.tasks || [];
1642
- const taskMenuItems = useMemo(()=>currentTasks.flatMap((group)=>group.map((task)=>({
1643
- title: task.label,
1644
- variant: 'item',
1645
- startIcon: task.icon,
1646
- onClick: ()=>{
1647
- setSelectedTaskId(task.id);
1648
- setPendingReplaceTask(true);
1649
- setMenuAnchorEl(null);
1650
- }
1651
- }))), [
1652
- currentTasks
1653
- ]);
1654
- const nodesWithMetadata = useMemo(()=>nodesState.map((node)=>'add-replace-stage' === node.id ? {
1655
- ...node,
1656
- data: {
1657
- ...node.data,
1658
- ...selectedTaskId && {
1659
- pendingReplaceTask
1660
- },
1661
- stageDetails: {
1662
- ...node.data.stageDetails,
1663
- selectedTaskId
1664
- },
1665
- onAddTaskFromToolbox: handleAddTask,
1666
- onReplaceTaskFromToolbox: handleReplaceTask,
1667
- onTaskGroupModification: handleTaskGroupModification,
1668
- onTaskReorder: handleTaskReorder,
1669
- onTaskClick: handleTaskClick
1670
- }
1671
- } : node), [
1672
- nodesState,
1673
- pendingReplaceTask,
1674
- selectedTaskId,
1675
- handleAddTask,
1676
- handleReplaceTask,
1677
- handleTaskGroupModification,
1678
- handleTaskReorder,
1679
- handleTaskClick
1680
- ]);
1681
- const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
1682
- setEdges
1683
- ]);
1684
- const replaceButtonLabel = useMemo(()=>{
1685
- if (pendingReplaceTask && selectedTaskId) {
1686
- const taskBeingReplaced = currentTasks.flat().find((t)=>t.id === selectedTaskId);
1687
- if (taskBeingReplaced) return `Replacing Task: ${taskBeingReplaced.label}`;
1688
- }
1689
- return 'Replace Task';
1690
- }, [
1691
- pendingReplaceTask,
1692
- selectedTaskId,
1693
- currentTasks
1694
- ]);
1695
- return /*#__PURE__*/ jsx("div", {
1696
- style: {
1697
- width: '100vw',
1698
- height: '100vh'
1699
- },
1700
- children: /*#__PURE__*/ jsx(ReactFlowProvider, {
1701
- children: /*#__PURE__*/ jsxs(BaseCanvas, {
1702
- nodes: nodesWithMetadata,
1703
- edges: edges,
1704
- onNodesChange: handleNodesChange,
1705
- onEdgesChange: onEdgesChange,
1706
- onConnect: onConnect,
1707
- onPaneClick: handlePaneClick,
1708
- nodeTypes: nodeTypes,
1709
- edgeTypes: edgeTypes,
1710
- mode: "design",
1711
- connectionMode: ConnectionMode.Strict,
1712
- defaultEdgeOptions: {
1713
- type: 'stage'
1714
- },
1715
- connectionLineComponent: StageConnectionEdge,
1716
- elevateEdgesOnSelect: true,
1717
- defaultViewport: {
1718
- x: 0,
1719
- y: 0,
1720
- zoom: 1.5
1721
- },
1722
- children: [
1723
- /*#__PURE__*/ jsxs(Panel, {
1724
- position: "top-right",
1725
- children: [
1726
- /*#__PURE__*/ jsx(ApButton, {
1727
- variant: "primary",
1728
- label: replaceButtonLabel,
1729
- onClick: (e)=>{
1730
- setMenuAnchorEl(e.currentTarget);
1731
- }
1732
- }),
1733
- /*#__PURE__*/ jsx(ApMenu, {
1734
- isOpen: Boolean(menuAnchorEl),
1735
- anchorEl: menuAnchorEl,
1736
- menuItems: taskMenuItems,
1737
- onClose: ()=>setMenuAnchorEl(null),
1738
- width: 300
1739
- })
1740
- ]
1741
- }),
1742
- /*#__PURE__*/ jsx(Panel, {
1743
- position: "bottom-right",
1744
- children: /*#__PURE__*/ jsx(CanvasPositionControls, {
1745
- translations: DefaultCanvasTranslations
1746
- })
1747
- })
1748
- ]
1749
- })
1750
- })
1751
- });
1752
- };
1753
- const AddAndReplaceTasks = {
1754
- name: 'Add, Replace, and Group Tasks',
1755
- parameters: {
1756
- useCustomRender: true
1757
- },
1758
- render: ()=>/*#__PURE__*/ jsx(AddAndReplaceTasksStory, {})
1759
- };
1760
- const InlineTitleEditStory = ()=>{
1761
- const nodeTypes = useMemo(()=>({
1762
- stage: StageNodeWrapper
1763
- }), []);
1764
- const edgeTypes = useMemo(()=>({
1765
- stage: StageEdge
1766
- }), []);
1767
- const setNodesRef = useRef(null);
1768
- const createTitleChangeHandler = useCallback((nodeId)=>(newTitle)=>{
1769
- setNodesRef.current((nds)=>nds.map((node)=>node.id === nodeId ? {
1770
- ...node,
1771
- data: {
1772
- ...node.data,
1773
- stageDetails: {
1774
- ...node.data.stageDetails,
1775
- label: newTitle
1776
- }
1777
- }
1778
- } : node));
1779
- }, []);
1780
- const initialNodes = useMemo(()=>[
1781
- {
1782
- id: 'editable-stage',
1783
- type: 'stage',
1784
- position: {
1785
- x: 48,
1786
- y: 96
1787
- },
1788
- width: 304,
1789
- data: {
1790
- stageDetails: {
1791
- label: 'Click to Edit Title',
1792
- tasks: [
1793
- [
1794
- {
1795
- id: '1',
1796
- label: 'KYC Verification',
1797
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1798
- }
1799
- ],
1800
- [
1801
- {
1802
- id: '2',
1803
- label: 'Document Review',
1804
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
1805
- }
1806
- ]
1807
- ]
1808
- },
1809
- onTaskAdd: ()=>{
1810
- window.alert('Add task functionality - this would open a dialog to add a new task');
1811
- },
1812
- onStageTitleChange: createTitleChangeHandler('editable-stage')
1813
- }
1814
- },
1815
- {
1816
- id: 'long-title-stage',
1817
- type: 'stage',
1818
- position: {
1819
- x: 400,
1820
- y: 96
1821
- },
1822
- width: 304,
1823
- data: {
1824
- stageDetails: {
1825
- label: 'A Very Long Stage Title That Should Truncate With Ellipsis',
1826
- tasks: [
1827
- [
1828
- {
1829
- id: '1',
1830
- label: 'Processing Task',
1831
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
1832
- }
1833
- ]
1834
- ]
1835
- },
1836
- onTaskAdd: ()=>{
1837
- window.alert('Add task functionality - this would open a dialog to add a new task');
1838
- },
1839
- onStageTitleChange: createTitleChangeHandler('long-title-stage')
1840
- }
1841
- }
1842
- ], [
1843
- createTitleChangeHandler
1844
- ]);
1845
- const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
1846
- setNodesRef.current = setNodes;
1847
- const [edges, setEdges, onEdgesChange] = useEdgesState([]);
1848
- const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
1849
- setEdges
1850
- ]);
1851
- return /*#__PURE__*/ jsx("div", {
1852
- style: {
1853
- width: '100vw',
1854
- height: '100vh'
1855
- },
1856
- children: /*#__PURE__*/ jsx(ReactFlowProvider, {
1857
- children: /*#__PURE__*/ jsx(BaseCanvas, {
1858
- nodes: nodes,
1859
- edges: edges,
1860
- onNodesChange: onNodesChange,
1861
- onEdgesChange: onEdgesChange,
1862
- onConnect: onConnect,
1863
- nodeTypes: nodeTypes,
1864
- edgeTypes: edgeTypes,
1865
- mode: "design",
1866
- connectionMode: ConnectionMode.Strict,
1867
- defaultEdgeOptions: {
1868
- type: 'stage'
1869
- },
1870
- connectionLineComponent: StageConnectionEdge,
1871
- elevateEdgesOnSelect: true,
1872
- defaultViewport: {
1873
- x: 0,
1874
- y: 0,
1875
- zoom: 1.5
1876
- },
1877
- children: /*#__PURE__*/ jsx(Panel, {
1878
- position: "bottom-right",
1879
- children: /*#__PURE__*/ jsx(CanvasPositionControls, {
1880
- translations: DefaultCanvasTranslations
1881
- })
1882
- })
1883
- })
1884
- })
1885
- });
1886
- };
1887
- const EditableStageTitle = {
1888
- name: 'Editable Stage Title',
1889
- parameters: {
1890
- useCustomRender: true
1891
- },
1892
- render: ()=>/*#__PURE__*/ jsx(InlineTitleEditStory, {})
1893
- };
1894
- const fetchChildren = (id)=>new Promise((resolve)=>{
1895
- setTimeout(()=>{
1896
- resolve([
1897
- {
1898
- id: `${id}-sub-1`,
1899
- name: `${id} - Subtask A`,
1900
- data: {
1901
- type: `${id}-a`
1902
- }
1903
- },
1904
- {
1905
- id: `${id}-sub-2`,
1906
- name: `${id} - Subtask B`,
1907
- data: {
1908
- type: `${id}-b`
1909
- }
1910
- },
1911
- {
1912
- id: `${id}-sub-3`,
1913
- name: `${id} - Subtask C`,
1914
- data: {
1915
- type: `${id}-c`
1916
- }
1917
- }
1918
- ]);
1919
- }, 2000);
1920
- });
1921
- const loadedTaskOptionsWithChildren = [
1922
- {
1923
- id: 'email',
1924
- name: 'Email',
1925
- data: {
1926
- type: 'email'
1927
- },
1928
- children: (id)=>fetchChildren(id)
1929
- },
1930
- {
1931
- id: 'approval',
1932
- name: 'Approval',
1933
- data: {
1934
- type: 'approval'
1935
- },
1936
- children: (id)=>fetchChildren(id)
1937
- },
1938
- {
1939
- id: "script",
1940
- name: 'Script',
1941
- data: {
1942
- type: "script"
1943
- },
1944
- children: (id)=>fetchChildren(id)
1945
- }
1946
- ];
1947
- const AddTaskLoadingStory = ()=>{
1948
- const nodeTypes = useMemo(()=>({
1949
- stage: StageNodeWrapper
1950
- }), []);
1951
- const edgeTypes = useMemo(()=>({
1952
- stage: StageEdge
1953
- }), []);
1954
- const setNodesRef = useRef(null);
1955
- const timeoutRef = useRef(void 0);
1956
- const handleAddTaskFromToolbox = useCallback((nodeId, _taskItem)=>{
1957
- clearTimeout(timeoutRef.current);
1958
- setNodesRef.current((nds)=>nds.map((n)=>n.id === nodeId ? {
1959
- ...n,
1960
- data: {
1961
- ...n.data,
1962
- addTaskLoading: true
1963
- }
1964
- } : n));
1965
- timeoutRef.current = setTimeout(()=>{
1966
- setNodesRef.current((nds)=>nds.map((n)=>n.id === nodeId ? {
1967
- ...n,
1968
- data: {
1969
- ...n.data,
1970
- addTaskLoading: false
1971
- }
1972
- } : n));
1973
- }, 2000);
1974
- }, []);
1975
- const initialNodes = useMemo(()=>[
1976
- {
1977
- id: 'loading-stage-empty',
1978
- type: 'stage',
1979
- position: {
1980
- x: 48,
1981
- y: 96
1982
- },
1983
- width: 304,
1984
- data: {
1985
- stageDetails: {
1986
- label: 'Loading (+ disabled for 3s)',
1987
- tasks: []
1988
- },
1989
- addTaskLoading: true,
1990
- taskOptions: [],
1991
- onAddTaskFromToolbox: (taskItem)=>{
1992
- handleAddTaskFromToolbox('loading-stage-empty', taskItem);
1993
- }
1994
- }
1995
- },
1996
- {
1997
- id: 'loading-stage-children',
1998
- type: 'stage',
1999
- position: {
2000
- x: 400,
2001
- y: 96
2002
- },
2003
- width: 304,
2004
- data: {
2005
- stageDetails: {
2006
- label: 'Async children (click +)',
2007
- tasks: [
2008
- [
2009
- {
2010
- id: 'task-1',
2011
- label: 'Existing Task',
2012
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2013
- }
2014
- ]
2015
- ]
2016
- },
2017
- addTaskLoading: false,
2018
- taskOptions: loadedTaskOptionsWithChildren,
2019
- onAddTaskFromToolbox: (taskItem)=>{
2020
- handleAddTaskFromToolbox('loading-stage-children', taskItem);
2021
- }
2022
- }
2023
- }
2024
- ], [
2025
- handleAddTaskFromToolbox
2026
- ]);
2027
- const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
2028
- setNodesRef.current = setNodes;
2029
- const [edges, setEdges, onEdgesChange] = useEdgesState([]);
2030
- useEffect(()=>{
2031
- const timeout = setTimeout(()=>{
2032
- setNodes((nds)=>nds.map((node)=>'loading-stage-empty' === node.id ? {
2033
- ...node,
2034
- data: {
2035
- ...node.data,
2036
- addTaskLoading: false,
2037
- taskOptions: loadedTaskOptionsWithChildren
2038
- }
2039
- } : node));
2040
- }, 3000);
2041
- return ()=>clearTimeout(timeout);
2042
- }, [
2043
- setNodes
2044
- ]);
2045
- useEffect(()=>()=>clearTimeout(timeoutRef.current), []);
2046
- const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
2047
- setEdges
2048
- ]);
2049
- return /*#__PURE__*/ jsx("div", {
2050
- style: {
2051
- width: '100vw',
2052
- height: '100vh'
2053
- },
2054
- children: /*#__PURE__*/ jsx(ReactFlowProvider, {
2055
- children: /*#__PURE__*/ jsx(BaseCanvas, {
2056
- nodes: nodes,
2057
- edges: edges,
2058
- onNodesChange: onNodesChange,
2059
- onEdgesChange: onEdgesChange,
2060
- onConnect: onConnect,
2061
- nodeTypes: nodeTypes,
2062
- edgeTypes: edgeTypes,
2063
- mode: "design",
2064
- connectionMode: ConnectionMode.Strict,
2065
- defaultEdgeOptions: {
2066
- type: 'stage'
2067
- },
2068
- connectionLineComponent: StageConnectionEdge,
2069
- elevateEdgesOnSelect: true,
2070
- defaultViewport: {
2071
- x: 0,
2072
- y: 0,
2073
- zoom: 1.5
2074
- },
2075
- children: /*#__PURE__*/ jsx(Panel, {
2076
- position: "bottom-right",
2077
- children: /*#__PURE__*/ jsx(CanvasPositionControls, {
2078
- translations: DefaultCanvasTranslations
2079
- })
2080
- })
2081
- })
2082
- })
2083
- });
2084
- };
2085
- const AddTaskLoading = {
2086
- name: 'Add Task Loading State',
2087
- parameters: {
2088
- useCustomRender: true
2089
- },
2090
- render: ()=>/*#__PURE__*/ jsx(AddTaskLoadingStory, {})
2091
- };
2092
- const AdhocTasks = {
2093
- name: 'Ad hoc Tasks',
2094
- parameters: {
2095
- nodes: [
2096
- {
2097
- id: '0',
2098
- type: 'stage',
2099
- position: {
2100
- x: 48,
2101
- y: 96
2102
- },
2103
- width: 304,
2104
- data: {
2105
- stageDetails: {
2106
- label: 'With onTaskPlay',
2107
- tasks: [
2108
- [
2109
- {
2110
- id: '1',
2111
- label: 'Ad hoc - KYC Check',
2112
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2113
- isAdhoc: true
2114
- }
2115
- ],
2116
- [
2117
- {
2118
- id: '2',
2119
- label: 'Ad hoc - Document Review',
2120
- icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2121
- isAdhoc: true
2122
- }
2123
- ]
2124
- ]
2125
- },
2126
- onTaskPlay: (taskId)=>new Promise((resolve)=>setTimeout(()=>{
2127
- resolve();
2128
- console.log(`Play task: ${taskId}`);
2129
- }, 5000)),
2130
- onTaskClick: (taskId)=>{
2131
- window.alert(`Task clicked: ${taskId}`);
2132
- }
2133
- }
2134
- },
2135
- {
2136
- id: '1',
2137
- type: 'stage',
2138
- position: {
2139
- x: 400,
2140
- y: 96
2141
- },
2142
- width: 304,
2143
- data: {
2144
- stageDetails: {
2145
- label: 'Without onTaskPlay and Menu',
2146
- tasks: [
2147
- [
2148
- {
2149
- id: '1',
2150
- label: 'Ad hoc - Risk Assessment',
2151
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2152
- isAdhoc: true
2153
- }
2154
- ],
2155
- [
2156
- {
2157
- id: '2',
2158
- label: 'Ad hoc - Compliance Review',
2159
- icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2160
- isAdhoc: true
2161
- }
2162
- ],
2163
- [
2164
- {
2165
- id: '3',
2166
- label: 'Regular Task',
2167
- icon: /*#__PURE__*/ jsx(ProcessIcon, {}),
2168
- hasEntryCondition: true
2169
- }
2170
- ]
2171
- ]
2172
- },
2173
- onTaskClick: (taskId)=>{
2174
- window.alert(`Task clicked: ${taskId}`);
2175
- },
2176
- onTaskGroupModification: (type, groupIndex, taskIndex)=>{
2177
- console.log(`Task group modification: ${type}, group: ${groupIndex}, task: ${taskIndex}`);
2178
- },
2179
- onReplaceTaskFromToolbox: (task, groupIndex, taskIndex)=>{
2180
- console.log(`Replace task at group: ${groupIndex}, task: ${taskIndex}`, task);
2181
- }
2182
- }
2183
- },
2184
- {
2185
- id: '2',
2186
- type: 'stage',
2187
- position: {
2188
- x: 752,
2189
- y: 96
2190
- },
2191
- width: 304,
2192
- data: {
2193
- stageDetails: {
2194
- label: 'Mixed with Parallel',
2195
- isReadOnly: true,
2196
- tasks: [
2197
- [
2198
- {
2199
- id: '1',
2200
- label: 'Ad hoc - Verify Address',
2201
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2202
- isAdhoc: true
2203
- },
2204
- {
2205
- id: '2',
2206
- label: 'Ad hoc - Verify Identity',
2207
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2208
- isAdhoc: true
2209
- }
2210
- ],
2211
- [
2212
- {
2213
- id: '3',
2214
- label: 'Ad hoc - Bkgd Check',
2215
- icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2216
- isAdhoc: true
2217
- }
2218
- ],
2219
- [
2220
- {
2221
- id: '4',
2222
- label: 'Ad hoc - Review Docs',
2223
- icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2224
- isAdhoc: true
2225
- }
2226
- ],
2227
- [
2228
- {
2229
- id: '5',
2230
- label: 'Regular Processing',
2231
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
2232
- }
2233
- ]
2234
- ]
2235
- },
2236
- execution: {
2237
- stageStatus: {
2238
- status: 'InProgress',
2239
- label: 'In progress',
2240
- duration: 'SLA: 3h 45m'
2241
- },
2242
- taskStatus: {
2243
- 1: {
2244
- status: 'Completed',
2245
- label: 'Verify Address',
2246
- duration: '1h 20m',
2247
- retryDuration: '35m',
2248
- badge: 'Reworked',
2249
- badgeStatus: 'warning',
2250
- retryCount: 2
2251
- },
2252
- 2: {
2253
- status: 'Failed',
2254
- label: 'Verify Identity',
2255
- duration: '45m',
2256
- message: 'Identity verification failed - document expired',
2257
- badge: 'Action needed',
2258
- badgeStatus: 'error'
2259
- },
2260
- 3: {
2261
- status: 'InProgress',
2262
- label: 'Background Check'
2263
- },
2264
- 4: {
2265
- status: 'InProgress',
2266
- label: 'Review Docs',
2267
- duration: '30m',
2268
- retryDuration: '10m',
2269
- badge: 'Reworked',
2270
- badgeStatus: 'info',
2271
- retryCount: 1
2272
- },
2273
- 5: {
2274
- status: 'InProgress',
2275
- label: 'Regular Processing'
2276
- }
2277
- }
2278
- },
2279
- onTaskPlay: (taskId)=>new Promise((resolve)=>setTimeout(()=>{
2280
- resolve();
2281
- console.log(`Play task: ${taskId}`);
2282
- }, 5000))
2283
- }
2284
- }
2285
- ]
2286
- }
2287
- };
2288
- const WithRulesTags = {
2289
- name: 'With Rules & Tags',
2290
- parameters: {
2291
- nodes: [
2292
- {
2293
- id: '1',
2294
- type: 'stage',
2295
- position: {
2296
- x: 48,
2297
- y: 96
2298
- },
2299
- width: 304,
2300
- data: {
2301
- stageDetails: {
2302
- label: 'Application',
2303
- tasks: [
2304
- [
2305
- {
2306
- id: 't1',
2307
- label: 'Verify applicant identity',
2308
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2309
- }
2310
- ],
2311
- [
2312
- {
2313
- id: 't2',
2314
- label: 'Pull credit report',
2315
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2316
- }
2317
- ]
2318
- ],
2319
- headerChips: [
2320
- {
2321
- type: StageHeaderChipType.Entry,
2322
- count: 1,
2323
- tooltip: 'Entry rules',
2324
- onClick: ()=>window.alert('Open entry rules panel')
2325
- },
2326
- {
2327
- type: StageHeaderChipType.Exit,
2328
- count: 3,
2329
- tooltip: 'Exit rules',
2330
- onClick: ()=>window.alert('Open exit rules panel')
2331
- }
2332
- ]
2333
- },
2334
- onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2335
- onTaskAdd: ()=>window.alert('Add task')
2336
- }
2337
- },
2338
- {
2339
- id: '2',
2340
- type: 'stage',
2341
- position: {
2342
- x: 400,
2343
- y: 96
2344
- },
2345
- width: 304,
2346
- data: {
2347
- stageDetails: {
2348
- label: 'Pending with customer',
2349
- tasks: [
2350
- [
2351
- {
2352
- id: 't3',
2353
- label: 'Request documents',
2354
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2355
- }
2356
- ],
2357
- [
2358
- {
2359
- id: 't4',
2360
- label: 'Send reminder or request',
2361
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
2362
- }
2363
- ]
2364
- ],
2365
- headerChips: [
2366
- {
2367
- type: StageHeaderChipType.Entry,
2368
- count: 2,
2369
- tooltip: 'Entry rules',
2370
- onClick: ()=>window.alert('Open entry rules panel')
2371
- },
2372
- {
2373
- type: StageHeaderChipType.Exit,
2374
- count: 1,
2375
- tooltip: 'Exit rules',
2376
- onClick: ()=>window.alert('Open exit rules panel')
2377
- },
2378
- {
2379
- type: StageHeaderChipType.ReturnToOrigin,
2380
- tooltip: 'Return to origin conditions',
2381
- onClick: ()=>window.alert('Open return to origin panel')
2382
- }
2383
- ]
2384
- },
2385
- onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2386
- onTaskAdd: ()=>window.alert('Add task')
2387
- }
2388
- },
2389
- {
2390
- id: '3',
2391
- type: 'stage',
2392
- position: {
2393
- x: 752,
2394
- y: 96
2395
- },
2396
- width: 304,
2397
- data: {
2398
- stageDetails: {
2399
- label: 'Withdrawn',
2400
- tasks: [
2401
- [
2402
- {
2403
- id: 't5',
2404
- label: 'Process withdrawal',
2405
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
2406
- }
2407
- ]
2408
- ],
2409
- headerChips: [
2410
- {
2411
- type: StageHeaderChipType.Entry,
2412
- count: 2,
2413
- tooltip: 'Entry rules',
2414
- onClick: ()=>window.alert('Open entry rules panel')
2415
- },
2416
- {
2417
- type: StageHeaderChipType.Exit,
2418
- count: 1,
2419
- tooltip: 'Exit rules',
2420
- onClick: ()=>window.alert('Open exit rules panel')
2421
- },
2422
- {
2423
- type: StageHeaderChipType.CaseExit,
2424
- tooltip: 'Case exit',
2425
- onClick: ()=>window.alert('Open case exit panel')
2426
- }
2427
- ]
2428
- },
2429
- onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2430
- onTaskAdd: ()=>window.alert('Add task')
2431
- }
2432
- },
2433
- {
2434
- id: '4',
2435
- type: 'stage',
2436
- position: {
2437
- x: 1104,
2438
- y: 96
2439
- },
2440
- width: 304,
2441
- data: {
2442
- stageDetails: {
2443
- label: 'Closing',
2444
- tasks: [
2445
- [
2446
- {
2447
- id: 't6',
2448
- label: 'Prepare closing docs',
2449
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2450
- }
2451
- ],
2452
- [
2453
- {
2454
- id: 't7',
2455
- label: 'eSign envelope',
2456
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
2457
- }
2458
- ]
2459
- ],
2460
- headerChips: [
2461
- {
2462
- type: StageHeaderChipType.Entry,
2463
- count: 1,
2464
- tooltip: 'Entry rules',
2465
- onClick: ()=>window.alert('Open entry rules panel')
2466
- },
2467
- {
2468
- type: StageHeaderChipType.Exit,
2469
- count: 3,
2470
- tooltip: 'Exit rules',
2471
- onClick: ()=>window.alert('Open exit rules panel')
2472
- },
2473
- {
2474
- type: StageHeaderChipType.CaseCompletion,
2475
- tooltip: 'Case completion',
2476
- onClick: ()=>window.alert('Open case completion panel')
2477
- }
2478
- ]
2479
- },
2480
- onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2481
- onTaskAdd: ()=>window.alert('Add task')
2482
- }
2483
- },
2484
- {
2485
- id: '5',
2486
- type: 'stage',
2487
- position: {
2488
- x: 48,
2489
- y: 400
2490
- },
2491
- width: 304,
2492
- data: {
2493
- stageDetails: {
2494
- label: 'No chips (comparison)',
2495
- tasks: [
2496
- [
2497
- {
2498
- id: 't8',
2499
- label: 'Verify applicant identity',
2500
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2501
- }
2502
- ],
2503
- [
2504
- {
2505
- id: 't9',
2506
- label: 'Pull credit report',
2507
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2508
- }
2509
- ]
2510
- ]
2511
- },
2512
- onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2513
- onTaskAdd: ()=>window.alert('Add task')
2514
- }
2515
- },
2516
- {
2517
- id: '6',
2518
- type: 'stage',
2519
- position: {
2520
- x: 400,
2521
- y: 400
2522
- },
2523
- width: 304,
2524
- data: {
2525
- stageDetails: {
2526
- label: 'ReadOnly + completed + chips',
2527
- isReadOnly: true,
2528
- tasks: [
2529
- [
2530
- {
2531
- id: 't10',
2532
- label: 'Verify applicant identity',
2533
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2534
- }
2535
- ],
2536
- [
2537
- {
2538
- id: 't11',
2539
- label: 'Pull credit report',
2540
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2541
- }
2542
- ]
2543
- ],
2544
- headerChips: [
2545
- {
2546
- type: StageHeaderChipType.Entry,
2547
- count: 1,
2548
- tooltip: 'Entry rules',
2549
- onClick: ()=>window.alert('Open entry rules panel')
2550
- },
2551
- {
2552
- type: StageHeaderChipType.Exit,
2553
- count: 3,
2554
- tooltip: 'Exit rules',
2555
- onClick: ()=>window.alert('Open exit rules panel')
2556
- }
2557
- ]
2558
- },
2559
- execution: {
2560
- stageStatus: {
2561
- status: 'Completed',
2562
- label: 'Completed',
2563
- duration: 'SLA: 4h'
2564
- }
2565
- }
2566
- }
2567
- },
2568
- {
2569
- id: '7',
2570
- type: 'stage',
2571
- position: {
2572
- x: 752,
2573
- y: 400
2574
- },
2575
- width: 304,
2576
- data: {
2577
- stageDetails: {
2578
- label: 'ReadOnly + in progress + chips',
2579
- isReadOnly: true,
2580
- tasks: [
2581
- [
2582
- {
2583
- id: 't12',
2584
- label: 'Verify applicant identity',
2585
- icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2586
- }
2587
- ],
2588
- [
2589
- {
2590
- id: 't13',
2591
- label: 'Pull credit report',
2592
- icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2593
- }
2594
- ]
2595
- ],
2596
- headerChips: [
2597
- {
2598
- type: StageHeaderChipType.Entry,
2599
- count: 2,
2600
- tooltip: 'Entry rules',
2601
- onClick: ()=>window.alert('Open entry rules panel')
2602
- },
2603
- {
2604
- type: StageHeaderChipType.Exit,
2605
- count: 1,
2606
- tooltip: 'Exit rules',
2607
- onClick: ()=>window.alert('Open exit rules panel')
2608
- }
2609
- ]
2610
- },
2611
- execution: {
2612
- stageStatus: {
2613
- status: 'InProgress',
2614
- label: 'In progress',
2615
- duration: 'SLA: 2h'
2616
- }
2617
- }
2618
- }
2619
- }
2620
- ]
2621
- }
2622
- };
2623
- export { AddAndReplaceTasks, AddTaskLoading, AdhocTasks, Default, DraggableTaskReordering, EditableStageTitle, ExecutionStatus, InteractiveTaskManagement, LoanProcessingWorkflow, WithRulesTags, WithTaskIcons, StageNode_stories as default };