@pega/cosmos-react-demos 3.0.0-dev.4.1 → 3.0.0-dev.4.2

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 (497) hide show
  1. package/jsx/build/AppShell/AppShell.mocks.d.ts +17 -0
  2. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  3. package/jsx/build/AppShell/AppShell.mocks.js +15 -0
  4. package/jsx/build/AppShell/AppShell.mocks.js.map +1 -1
  5. package/jsx/build/AppShell/AppShell.stories.d.ts +2 -0
  6. package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
  7. package/jsx/build/AppShell/AppShell.stories.jsx +2 -17
  8. package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
  9. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  10. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +2 -1
  11. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  12. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  13. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  14. package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +71 -7
  15. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
  16. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  17. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  18. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
  19. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  20. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  21. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  22. package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
  23. package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  24. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  25. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  26. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  27. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  28. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  29. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  30. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  31. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  32. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
  33. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
  34. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  35. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  36. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +5 -180
  37. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  38. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  39. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  40. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
  41. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
  42. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  43. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  44. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
  45. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
  46. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  47. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  48. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
  49. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
  50. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  51. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  52. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
  53. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  54. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  55. package/jsx/build/Workbench/Workbench.stories.jsx +1 -9
  56. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  57. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  58. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  59. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  60. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  61. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  62. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  63. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
  64. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
  65. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  66. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  67. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  68. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  69. package/jsx/core/Button/Button.stories.jsx +6 -6
  70. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  71. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  72. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
  73. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  74. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  75. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  76. package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
  77. package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  78. package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
  79. package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  80. package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
  81. package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
  82. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  83. package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
  84. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  85. package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
  86. package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
  87. package/jsx/core/Configuration/Configuration.styles.js +12 -0
  88. package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
  89. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  90. package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
  91. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  92. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  93. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  94. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +69 -1
  95. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  96. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  97. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +2 -70
  98. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  99. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
  100. package/jsx/core/HTML/HTML.stories.jsx +1 -1
  101. package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
  102. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  103. package/jsx/core/Icon/Icon.stories.jsx +5 -27
  104. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  105. package/jsx/core/Icon/Icon.styles.d.ts +4 -0
  106. package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
  107. package/jsx/core/Icon/Icon.styles.js +25 -0
  108. package/jsx/core/Icon/Icon.styles.js.map +1 -0
  109. package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
  110. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  111. package/jsx/core/Link/Link.stories.d.ts +1 -11
  112. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  113. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  114. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  115. package/jsx/core/Number/Number.stories.jsx +2 -0
  116. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  117. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  118. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
  119. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  120. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  121. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  122. package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
  123. package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  124. package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
  125. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  126. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  127. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  128. package/jsx/core/Tree/Tree.stories.jsx +2 -2
  129. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  130. package/jsx/cs/Article/Article.stories.d.ts +2 -10
  131. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  132. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  133. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  134. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  135. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  136. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  137. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  138. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
  139. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  140. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  141. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  142. package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
  143. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
  144. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  145. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  146. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
  147. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  148. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  149. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  150. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
  151. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  152. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  153. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  154. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
  155. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  156. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  157. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  158. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  159. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  160. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  161. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  162. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
  163. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  164. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  165. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  166. package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
  167. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  168. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  169. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  170. package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
  171. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  172. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  173. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  174. package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
  175. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
  176. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  177. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  178. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
  179. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
  180. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  181. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  182. package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
  183. package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
  184. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  185. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  186. package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
  187. package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  188. package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
  189. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
  190. package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
  191. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
  192. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  193. package/jsx/rte/Editor/Editor.stories.jsx +1 -19
  194. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  195. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  196. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  197. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  198. package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
  199. package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  200. package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
  201. package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
  202. package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
  203. package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  204. package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
  205. package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
  206. package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
  207. package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  208. package/jsx/social/Chat/RepeatingView.styles.js +22 -0
  209. package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
  210. package/jsx/social/Email/Email.mocks.d.ts +155 -2
  211. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  212. package/jsx/social/Email/Email.mocks.jsx +756 -0
  213. package/jsx/social/Email/Email.mocks.jsx.map +1 -0
  214. package/jsx/social/Email/Email.stories.d.ts +14 -14
  215. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  216. package/jsx/social/Email/Email.stories.jsx +97 -411
  217. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  218. package/jsx/social/Email/Email.styles.d.ts +4 -0
  219. package/jsx/social/Email/Email.styles.d.ts.map +1 -0
  220. package/jsx/social/Email/Email.styles.js +14 -0
  221. package/jsx/social/Email/Email.styles.js.map +1 -0
  222. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  223. package/jsx/social/Feed/Feed.stories.jsx +23 -18
  224. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  225. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  226. package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
  227. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  228. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  229. package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
  230. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  231. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  232. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  233. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  234. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  235. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  236. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
  237. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
  238. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  239. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  240. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
  241. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  242. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  243. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  244. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  245. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  246. package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
  247. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  248. package/lib/build/AppShell/AppShell.mocks.js +16 -0
  249. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  250. package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
  251. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  252. package/lib/build/AppShell/AppShell.stories.js +3 -18
  253. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  254. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  255. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +2 -1
  256. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  257. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  258. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  259. package/lib/build/FlowModeller/FlowModeller.mocks.js +58 -6
  260. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  261. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  262. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  263. package/lib/build/FlowModeller/FlowModeller.stories.js +15 -90
  264. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  265. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  266. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  267. package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
  268. package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  269. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  270. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  271. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  272. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  273. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  274. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  275. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  276. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  277. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  278. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  279. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  280. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  281. package/lib/build/ObjectSelect/ObjectSelect.stories.js +12 -136
  282. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  283. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  284. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  285. package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
  286. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
  287. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  288. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  289. package/lib/build/PageTemplates/GalleryPage.stories.js +3 -79
  290. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  291. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  292. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  293. package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
  294. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
  295. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  296. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  297. package/lib/build/PageTemplates/PageTemplates.stories.js +5 -95
  298. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  299. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  300. package/lib/build/Workbench/Workbench.stories.js +1 -9
  301. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  302. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  303. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  304. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  305. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  306. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  307. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  308. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +56 -54
  309. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  310. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  311. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  312. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  313. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  314. package/lib/core/Button/Button.stories.js +2 -2
  315. package/lib/core/Button/Button.stories.js.map +1 -1
  316. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  317. package/lib/core/ColorPicker/ColorPicker.stories.js +2 -10
  318. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  319. package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  320. package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  321. package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
  322. package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  323. package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
  324. package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  325. package/lib/core/Configuration/Configuration.mocks.js +6 -0
  326. package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
  327. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  328. package/lib/core/Configuration/Configuration.stories.js +3 -15
  329. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  330. package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
  331. package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
  332. package/lib/core/Configuration/Configuration.styles.js +12 -0
  333. package/lib/core/Configuration/Configuration.styles.js.map +1 -0
  334. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  335. package/lib/core/DateTime/DateTime.stories.js +2 -0
  336. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  337. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  338. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  339. package/lib/core/FieldGroup/FieldGroupList.mocks.js +46 -2
  340. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  341. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  342. package/lib/core/FieldGroup/FieldGroupList.stories.js +3 -47
  343. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  344. package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
  345. package/lib/core/HTML/HTML.stories.js +1 -1
  346. package/lib/core/HTML/HTML.stories.js.map +1 -1
  347. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  348. package/lib/core/Icon/Icon.stories.js +6 -29
  349. package/lib/core/Icon/Icon.stories.js.map +1 -1
  350. package/lib/core/Icon/Icon.styles.d.ts +4 -0
  351. package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
  352. package/lib/core/Icon/Icon.styles.js +25 -0
  353. package/lib/core/Icon/Icon.styles.js.map +1 -0
  354. package/lib/core/IconPicker/IconPicker.stories.js +1 -1
  355. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  356. package/lib/core/Link/Link.stories.d.ts +1 -11
  357. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  358. package/lib/core/Link/Link.stories.js.map +1 -1
  359. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  360. package/lib/core/Number/Number.stories.js +2 -0
  361. package/lib/core/Number/Number.stories.js.map +1 -1
  362. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  363. package/lib/core/PageTemplates/PageTemplates.stories.js +1 -11
  364. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  365. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  366. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  367. package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
  368. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  369. package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
  370. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  371. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  372. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  373. package/lib/core/Tree/Tree.stories.js +2 -2
  374. package/lib/core/Tree/Tree.stories.js.map +1 -1
  375. package/lib/cs/Article/Article.stories.d.ts +2 -10
  376. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  377. package/lib/cs/Article/Article.stories.js.map +1 -1
  378. package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  379. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  380. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  381. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  382. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  383. package/lib/cs/CSCaseView/CSAppShell.stories.js +6 -19
  384. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  385. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  386. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  387. package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
  388. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
  389. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  390. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  391. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +4 -4
  392. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  393. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  394. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  395. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +3 -3
  396. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  397. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  398. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  399. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
  400. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  401. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  402. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  403. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  404. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  405. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  406. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  407. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +6 -30
  408. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  409. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  410. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  411. package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
  412. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  413. package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  414. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  415. package/lib/cs/TaskManager/TaskManager.stories.js +25 -29
  416. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  417. package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  418. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  419. package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
  420. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
  421. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  422. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  423. package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
  424. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
  425. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  426. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  427. package/lib/dnd/DragDropList/DragDropList.stories.js +14 -85
  428. package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
  429. package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  430. package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  431. package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
  432. package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  433. package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
  434. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
  435. package/lib/rte/Editor/Editor.mocks.js +23 -0
  436. package/lib/rte/Editor/Editor.mocks.js.map +1 -0
  437. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  438. package/lib/rte/Editor/Editor.stories.js +1 -21
  439. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  440. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  441. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  442. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  443. package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
  444. package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  445. package/lib/social/Chat/RepeatingView.mocks.js +11 -0
  446. package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
  447. package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
  448. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  449. package/lib/social/Chat/RepeatingView.stories.js +16 -46
  450. package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
  451. package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
  452. package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  453. package/lib/social/Chat/RepeatingView.styles.js +22 -0
  454. package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
  455. package/lib/social/Email/Email.mocks.d.ts +155 -2
  456. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  457. package/lib/social/Email/Email.mocks.js +361 -0
  458. package/lib/social/Email/Email.mocks.js.map +1 -1
  459. package/lib/social/Email/Email.stories.d.ts +14 -14
  460. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  461. package/lib/social/Email/Email.stories.js +99 -427
  462. package/lib/social/Email/Email.stories.js.map +1 -1
  463. package/lib/social/Email/Email.styles.d.ts +4 -0
  464. package/lib/social/Email/Email.styles.d.ts.map +1 -0
  465. package/lib/social/Email/Email.styles.js +14 -0
  466. package/lib/social/Email/Email.styles.js.map +1 -0
  467. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  468. package/lib/social/Feed/Feed.stories.js +23 -18
  469. package/lib/social/Feed/Feed.stories.js.map +1 -1
  470. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  471. package/lib/social/Feed/FeedPost.stories.js +30 -20
  472. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  473. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  474. package/lib/social/Feed/FeedReply.stories.js +21 -16
  475. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  476. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  477. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  478. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  479. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  480. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  481. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
  482. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
  483. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  484. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  485. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +2 -172
  486. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  487. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  488. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  489. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  490. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  491. package/package.json +9 -10
  492. package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  493. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
  494. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
  495. package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
  496. package/jsx/social/Email/Email.mocks.js +0 -395
  497. package/jsx/social/Email/Email.mocks.js.map +0 -1
@@ -1,9 +1,26 @@
1
- import { Action } from '@pega/cosmos-react-core';
2
- import { ConnectorProps, NodeProps, NodeLibraryItem } from '@pega/cosmos-react-build';
1
+ /// <reference types="react" />
2
+ import { ModalMethods, Action } from '@pega/cosmos-react-core';
3
+ import { NodeProps, ConnectorProps, NodeLibraryItem } from '@pega/cosmos-react-build';
4
+ interface DecisionTableProps extends ModalProps {
5
+ onDeleteRow: (data: NodeDataType) => void;
6
+ onAddRow: (data: NodeDataType) => void;
7
+ update: ModalMethods['update'];
8
+ }
9
+ export interface NodeDataType {
10
+ nodes: NodeProps[];
11
+ connectors: ConnectorProps[];
12
+ }
13
+ export interface ModalProps {
14
+ updatedData: NodeDataType;
15
+ connectors: ConnectorProps[];
16
+ node: NodeProps;
17
+ }
18
+ export declare const DecisionTable: ({ updatedData, connectors, onDeleteRow, onAddRow, node, update }: DecisionTableProps) => JSX.Element;
3
19
  export declare const exampleCRMNodesData: NodeProps[];
4
20
  export declare const exampleCRMConnectorsData: ConnectorProps[];
5
21
  export declare const emptyNodesData: NodeProps[];
6
22
  export declare const emptyConnectorsData: ConnectorProps[];
7
23
  export declare const nodeActions: Action[];
8
24
  export declare const nodeLibrary: NodeLibraryItem[];
25
+ export {};
9
26
  //# sourceMappingURL=FlowModeller.mocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlowModeller.mocks.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,SAAS,EAET,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAuGlC,eAAO,MAAM,mBAAmB,EAAE,SAAS,EAoH1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAAc,EAyHpD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAAS,EAWrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAO/C,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,EAS/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,eAAe,EAsCxC,CAAC"}
1
+ {"version":3,"file":"FlowModeller.mocks.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.mocks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAGL,YAAY,EASZ,MAAM,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,EAET,cAAc,EAGd,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAElC,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,YAAY,CAAC;IAC1B,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,qEAOvB,kBAAkB,gBAsFpB,CAAC;AAuGF,eAAO,MAAM,mBAAmB,EAAE,SAAS,EAoH1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAAc,EAyHpD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAAS,EAWrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAO/C,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,EAK/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,eAAe,EAsCxC,CAAC"}
@@ -1,5 +1,61 @@
1
- import { createUID } from '@pega/cosmos-react-core';
2
- import { START_NODETYPE, STOP_NODETYPE } from '@pega/cosmos-react-build';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext, useState, useEffect } from 'react';
3
+ import { Input, Modal, ModalManagerContext, Table, Text, Button, Icon, Flex, createUID } from '@pega/cosmos-react-core';
4
+ import { DirectedGraph, FlowModellerHelper, START_NODETYPE, STOP_NODETYPE } from '@pega/cosmos-react-build';
5
+ export const DecisionTable = ({ updatedData, connectors, onDeleteRow, onAddRow, node, update }) => {
6
+ const [tableData, setTableData] = useState(connectors);
7
+ const message = 'Please delete the nodes in the connector manually and delete this connector again';
8
+ const { create } = useContext(ModalManagerContext);
9
+ const onAddCondition = () => {
10
+ const label = 'otherwise';
11
+ const updatedGraphData = FlowModellerHelper.addBranch(updatedData, node.id, label);
12
+ const graph = new DirectedGraph(updatedGraphData);
13
+ const outConnectors = graph.getOutConnectors(node.id);
14
+ update({
15
+ node,
16
+ connectors: outConnectors,
17
+ updatedData: updatedGraphData
18
+ });
19
+ onAddRow(updatedGraphData);
20
+ };
21
+ const onDeleteCondition = (connector) => {
22
+ const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);
23
+ if (updatedGraphData) {
24
+ const updatedGraph = new DirectedGraph(updatedGraphData);
25
+ const updatedOutConnectors = updatedGraph.getOutConnectors(node.id);
26
+ update({
27
+ node,
28
+ connectors: updatedOutConnectors,
29
+ updatedData: updatedGraphData
30
+ });
31
+ onDeleteRow(updatedGraphData);
32
+ }
33
+ else {
34
+ create(() => {
35
+ return (_jsx(Modal, { heading: 'Confirm', children: _jsx(Text, { children: message }, void 0) }, void 0));
36
+ }, { center: true });
37
+ }
38
+ };
39
+ const columns = [
40
+ {
41
+ renderer: connector => _jsx(Input, { value: connector.label, readOnly: true }, void 0),
42
+ label: 'Outcome'
43
+ },
44
+ { renderer: () => _jsx(Text, { children: "No value" }, void 0), label: 'Decision output' },
45
+ {
46
+ renderer: connector => {
47
+ return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'simple', label: 'Delete', disabled: tableData.length < 3, icon: true, onClick: () => {
48
+ onDeleteCondition(connector);
49
+ }, children: _jsx(Icon, { name: 'trash' }, void 0) }, void 0) }, void 0));
50
+ },
51
+ label: 'Action'
52
+ }
53
+ ];
54
+ useEffect(() => {
55
+ setTableData(connectors);
56
+ }, [connectors]);
57
+ return (_jsxs(_Fragment, { children: [_jsx(Table, { title: 'Decision outcomes', hoverHighlight: true, data: tableData, columns: columns }, void 0), _jsx(Flex, { container: { pad: [1, 0] }, children: _jsx(Button, { variant: 'simple', onClick: onAddCondition, children: "Add Condition" }, void 0) }, void 0)] }, void 0));
58
+ };
3
59
  const FlowShapeType = Object.freeze({
4
60
  START: START_NODETYPE,
5
61
  STOP: STOP_NODETYPE,
@@ -360,10 +416,6 @@ export const emptyConnectorsData = [
360
416
  }
361
417
  ];
362
418
  export const nodeActions = [
363
- {
364
- id: 'action-1',
365
- text: 'Delete'
366
- },
367
419
  {
368
420
  id: 'action-2',
369
421
  text: 'Reassign'
@@ -1 +1 @@
1
- {"version":3,"file":"FlowModeller.mocks.js","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAKL,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,MAAM,aAAa,GAA6B,MAAM,CAAC,MAAM,CAAC;IAC5D,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,aAAa,EAAE,CAAC;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,gDAAgD;aAC9D;YACD,SAAS,E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E,aAAa,CAAC,YAAY;aACjC;SACF;KACF;CACF,CAAC","sourcesContent":["import { createUID, Action } from '@pega/cosmos-react-core';\nimport {\n ConnectorProps,\n NodeProps,\n NodeType,\n NodeLibraryItem,\n START_NODETYPE,\n STOP_NODETYPE\n} from '@pega/cosmos-react-build';\n\nconst FlowShapeType: Record<string, NodeType> = Object.freeze({\n START: START_NODETYPE,\n STOP: STOP_NODETYPE,\n DECISION: {\n id: 'decision',\n name: 'Decision',\n color: '#ffaa75',\n icon: 'diamond',\n minConnectors: 2,\n defaults: {\n node: {\n label: 'Decision',\n description: 'Adjust the conditions using the property panel'\n },\n connector: [\n {\n label: 'Default'\n },\n {\n label: 'Otherwise'\n }\n ]\n }\n },\n QUESTION: {\n id: 'question',\n name: 'Question',\n color: '#7ee791',\n icon: 'chat-help',\n minConnectors: 3,\n defaults: {\n node: {\n label: 'Question'\n },\n connector: [\n {\n label: 'Question 1'\n },\n {\n label: 'Question 2'\n },\n {\n label: 'Question 3'\n }\n ]\n }\n },\n ASSIGNMENT: {\n id: 'assignment',\n name: 'Assignment',\n color: '#20aa50',\n icon: 'clipboard-data',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Assignment'\n },\n connector: [{ label: '' }]\n }\n },\n MESSAGE: {\n id: 'message',\n name: 'Message',\n color: '#fd6000', // dark orange\n icon: 'chat',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Message'\n },\n connector: [{ label: '' }]\n }\n },\n SEND_EMAIL: {\n id: 'send_email',\n name: 'Send email',\n color: '#ffaa75', // light blue\n icon: 'mail',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Send email'\n },\n connector: [{ label: '' }]\n }\n },\n GENERATE_PDF: {\n id: 'generate_pdf',\n name: 'Generate PDF',\n color: '#0076d1', // light blue\n icon: 'polaris',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Generate PDF'\n },\n connector: [{ label: '' }]\n }\n }\n});\n\nexport const exampleCRMNodesData: NodeProps[] = [\n {\n id: '100',\n label: 'Open',\n type: FlowShapeType.START\n },\n {\n id: '101',\n label: 'Is B2B',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '102',\n label: 'Update Org Domains',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '103',\n label: 'CreateC2OFromContact',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '104',\n label: 'CreateC2AFromContact',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '105',\n label: 'Is B2C',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '106',\n label: 'CreatePrimaryIndividualAccount',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '107',\n label: 'Capture Event',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '108',\n label: 'Update Private Data',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '109',\n label: 'Attach Business Card',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '110',\n label: 'Has Address',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '111',\n label: 'RemoveWORelatedNBA',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '112',\n label: 'Bulk Processing',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '113',\n label: 'Queue For Agent',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '114',\n label: 'Retrieve Lat Long',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '115',\n label: 'RemoveWORelatedNBA',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '121',\n label: 'STOP',\n type: FlowShapeType.STOP\n }\n];\n\nexport const exampleCRMConnectorsData: ConnectorProps[] = [\n {\n id: '100-101',\n label: '',\n fromNodeId: '100',\n toNodeId: '101'\n },\n {\n id: '101-102',\n label: 'isSellingModeB2BOrB2BB2C',\n fromNodeId: '101',\n toNodeId: '102'\n },\n {\n id: '102-103',\n label: '',\n fromNodeId: '102',\n toNodeId: '103'\n },\n {\n id: '103-104',\n label: '',\n fromNodeId: '103',\n toNodeId: '104'\n },\n {\n id: '104-105',\n label: '',\n fromNodeId: '104',\n toNodeId: '105'\n },\n {\n id: '101-105',\n label: 'Else',\n fromNodeId: '101',\n toNodeId: '105'\n },\n {\n id: '105-106',\n label: 'isSellingModeB2COrB2BB2C',\n fromNodeId: '105',\n toNodeId: '106'\n },\n {\n id: '106-107',\n label: '',\n fromNodeId: '106',\n toNodeId: '107'\n },\n {\n id: '105-107',\n label: 'Else',\n fromNodeId: '105',\n toNodeId: '107'\n },\n {\n id: '107-108',\n label: '',\n fromNodeId: '107',\n toNodeId: '108'\n },\n {\n id: '108-109',\n label: '',\n fromNodeId: '108',\n toNodeId: '109'\n },\n {\n id: '109-110',\n label: '',\n fromNodeId: '109',\n toNodeId: '110'\n },\n {\n id: '110-112',\n label: 'crmHasAddress',\n fromNodeId: '110',\n toNodeId: '112'\n },\n {\n id: '112-113',\n label: 'Bulk Processing',\n fromNodeId: '112',\n toNodeId: '113'\n },\n {\n id: '112-114',\n label: 'Manual',\n fromNodeId: '112',\n toNodeId: '114'\n },\n {\n id: '114-115',\n label: '',\n fromNodeId: '114',\n toNodeId: '115'\n },\n {\n id: '115-121',\n label: '',\n fromNodeId: '115',\n toNodeId: '121'\n },\n {\n id: '113-121',\n label: '',\n fromNodeId: '113',\n toNodeId: '121'\n },\n {\n id: '110-111',\n label: 'Else',\n fromNodeId: '110',\n toNodeId: '111'\n },\n {\n id: '111-121',\n label: '',\n fromNodeId: '111',\n toNodeId: '121'\n }\n];\n\nexport const emptyNodesData: NodeProps[] = [\n {\n id: '100',\n label: 'START',\n type: FlowShapeType.START\n },\n {\n id: '120',\n label: 'STOP',\n type: FlowShapeType.STOP\n }\n];\n\nexport const emptyConnectorsData: ConnectorProps[] = [\n {\n id: '100-120',\n label: 'happy path',\n fromNodeId: '100',\n toNodeId: '120'\n }\n];\n\nexport const nodeActions: Action[] = [\n {\n id: 'action-1',\n text: 'Delete'\n },\n {\n id: 'action-2',\n text: 'Reassign'\n }\n];\n\nexport const nodeLibrary: NodeLibraryItem[] = [\n {\n id: createUID(),\n primary: 'Assignment',\n type: FlowShapeType.ASSIGNMENT\n },\n {\n id: createUID(),\n primary: 'Decision',\n type: FlowShapeType.DECISION\n },\n {\n id: createUID(),\n primary: 'Send a message',\n type: FlowShapeType.MESSAGE\n },\n {\n id: createUID(),\n primary: 'Ask a question',\n type: FlowShapeType.QUESTION\n },\n {\n id: createUID(),\n primary: 'Automations',\n type: FlowShapeType.AUTOMATION,\n items: [\n {\n id: createUID(),\n primary: 'Send email',\n type: FlowShapeType.SEND_EMAIL\n },\n {\n id: createUID(),\n primary: 'Generate PDF',\n type: FlowShapeType.GENERATE_PDF\n }\n ]\n }\n];\n"]}
1
+ {"version":3,"file":"FlowModeller.mocks.js","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EACL,KAAK,EACL,KAAK,EAEL,mBAAmB,EACnB,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EAEV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,aAAa,EAEb,kBAAkB,EAGlB,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAmBlC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACa,EAAE,EAAE;IACvB,MAAM,CAAC,SAA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AAE;QACf,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,aAAa,CAAC,UAAU;QAC9B,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,SAAS,EAAE;gBACf,OAAO,EAAE,YAAY;gBACrB,IAAI,EAAE,aAAa,CAAC,UAAU;aAC/B;YACD;gBACE,EAAE,EAAE,SAAS,EAAE;gBACf,OAAO,EAAE,cAAc;gBACvB,IAAI,EAAE,aAAa,CAAC,YAAY;aACjC;SACF;KACF;CACF,CAAC","sourcesContent":["import { useContext, useState, useEffect } from 'react';\n\nimport {\n Input,\n Modal,\n ModalMethods,\n ModalManagerContext,\n Table,\n ColumnProps,\n Text,\n Button,\n Icon,\n Flex,\n createUID,\n Action\n} from '@pega/cosmos-react-core';\nimport {\n NodeProps,\n DirectedGraph,\n ConnectorProps,\n FlowModellerHelper,\n NodeType,\n NodeLibraryItem,\n START_NODETYPE,\n STOP_NODETYPE\n} from '@pega/cosmos-react-build';\n\ninterface DecisionTableProps extends ModalProps {\n onDeleteRow: (data: NodeDataType) => void;\n onAddRow: (data: NodeDataType) => void;\n update: ModalMethods['update'];\n}\n\nexport interface NodeDataType {\n nodes: NodeProps[];\n connectors: ConnectorProps[];\n}\n\nexport interface ModalProps {\n updatedData: NodeDataType;\n connectors: ConnectorProps[];\n node: NodeProps;\n}\n\nexport const DecisionTable = ({\n updatedData,\n connectors,\n onDeleteRow,\n onAddRow,\n node,\n update\n}: DecisionTableProps) => {\n const [tableData, setTableData] = useState<ConnectorProps[]>(connectors);\n const message =\n 'Please delete the nodes in the connector manually and delete this connector again';\n const { create } = useContext(ModalManagerContext);\n\n const onAddCondition = () => {\n const label = 'otherwise';\n const updatedGraphData = FlowModellerHelper.addBranch(updatedData, node.id, label);\n const graph = new DirectedGraph(updatedGraphData);\n const outConnectors = graph.getOutConnectors(node.id);\n update({\n node,\n connectors: outConnectors,\n updatedData: updatedGraphData\n });\n onAddRow(updatedGraphData);\n };\n\n const onDeleteCondition = (connector: ConnectorProps) => {\n const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);\n if (updatedGraphData) {\n const updatedGraph = new DirectedGraph(updatedGraphData);\n const updatedOutConnectors = updatedGraph.getOutConnectors(node.id);\n update({\n node,\n connectors: updatedOutConnectors,\n updatedData: updatedGraphData\n });\n onDeleteRow(updatedGraphData);\n } else {\n create(\n () => {\n return (\n <Modal heading='Confirm'>\n <Text>{message}</Text>\n </Modal>\n );\n },\n { center: true }\n );\n }\n };\n\n const columns: ColumnProps<ConnectorProps>[] = [\n {\n renderer: connector => <Input value={connector.label} readOnly />,\n label: 'Outcome'\n },\n { renderer: () => <Text>No value</Text>, label: 'Decision output' },\n {\n renderer: connector => {\n return (\n <>\n <Button\n variant='simple'\n label='Delete'\n disabled={tableData.length < 3}\n icon\n onClick={() => {\n onDeleteCondition(connector);\n }}\n >\n <Icon name='trash' />\n </Button>\n </>\n );\n },\n label: 'Action'\n }\n ];\n\n useEffect(() => {\n setTableData(connectors);\n }, [connectors]);\n\n return (\n <>\n <Table title='Decision outcomes' hoverHighlight data={tableData} columns={columns} />\n <Flex container={{ pad: [1, 0] }}>\n <Button variant='simple' onClick={onAddCondition}>\n Add Condition\n </Button>\n </Flex>\n </>\n );\n};\n\nconst FlowShapeType: Record<string, NodeType> = Object.freeze({\n START: START_NODETYPE,\n STOP: STOP_NODETYPE,\n DECISION: {\n id: 'decision',\n name: 'Decision',\n color: '#ffaa75',\n icon: 'diamond',\n minConnectors: 2,\n defaults: {\n node: {\n label: 'Decision',\n description: 'Adjust the conditions using the property panel'\n },\n connector: [\n {\n label: 'Default'\n },\n {\n label: 'Otherwise'\n }\n ]\n }\n },\n QUESTION: {\n id: 'question',\n name: 'Question',\n color: '#7ee791',\n icon: 'chat-help',\n minConnectors: 3,\n defaults: {\n node: {\n label: 'Question'\n },\n connector: [\n {\n label: 'Question 1'\n },\n {\n label: 'Question 2'\n },\n {\n label: 'Question 3'\n }\n ]\n }\n },\n ASSIGNMENT: {\n id: 'assignment',\n name: 'Assignment',\n color: '#20aa50',\n icon: 'clipboard-data',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Assignment'\n },\n connector: [{ label: '' }]\n }\n },\n MESSAGE: {\n id: 'message',\n name: 'Message',\n color: '#fd6000', // dark orange\n icon: 'chat',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Message'\n },\n connector: [{ label: '' }]\n }\n },\n SEND_EMAIL: {\n id: 'send_email',\n name: 'Send email',\n color: '#ffaa75', // light blue\n icon: 'mail',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Send email'\n },\n connector: [{ label: '' }]\n }\n },\n GENERATE_PDF: {\n id: 'generate_pdf',\n name: 'Generate PDF',\n color: '#0076d1', // light blue\n icon: 'polaris',\n minConnectors: 1,\n defaults: {\n node: {\n label: 'Generate PDF'\n },\n connector: [{ label: '' }]\n }\n }\n});\n\nexport const exampleCRMNodesData: NodeProps[] = [\n {\n id: '100',\n label: 'Open',\n type: FlowShapeType.START\n },\n {\n id: '101',\n label: 'Is B2B',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '102',\n label: 'Update Org Domains',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '103',\n label: 'CreateC2OFromContact',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '104',\n label: 'CreateC2AFromContact',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '105',\n label: 'Is B2C',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '106',\n label: 'CreatePrimaryIndividualAccount',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '107',\n label: 'Capture Event',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '108',\n label: 'Update Private Data',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '109',\n label: 'Attach Business Card',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '110',\n label: 'Has Address',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '111',\n label: 'RemoveWORelatedNBA',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '112',\n label: 'Bulk Processing',\n description: '',\n type: FlowShapeType.DECISION,\n additionalData: []\n },\n {\n id: '113',\n label: 'Queue For Agent',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '114',\n label: 'Retrieve Lat Long',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '115',\n label: 'RemoveWORelatedNBA',\n description: '',\n type: FlowShapeType.ASSIGNMENT,\n additionalData: []\n },\n {\n id: '121',\n label: 'STOP',\n type: FlowShapeType.STOP\n }\n];\n\nexport const exampleCRMConnectorsData: ConnectorProps[] = [\n {\n id: '100-101',\n label: '',\n fromNodeId: '100',\n toNodeId: '101'\n },\n {\n id: '101-102',\n label: 'isSellingModeB2BOrB2BB2C',\n fromNodeId: '101',\n toNodeId: '102'\n },\n {\n id: '102-103',\n label: '',\n fromNodeId: '102',\n toNodeId: '103'\n },\n {\n id: '103-104',\n label: '',\n fromNodeId: '103',\n toNodeId: '104'\n },\n {\n id: '104-105',\n label: '',\n fromNodeId: '104',\n toNodeId: '105'\n },\n {\n id: '101-105',\n label: 'Else',\n fromNodeId: '101',\n toNodeId: '105'\n },\n {\n id: '105-106',\n label: 'isSellingModeB2COrB2BB2C',\n fromNodeId: '105',\n toNodeId: '106'\n },\n {\n id: '106-107',\n label: '',\n fromNodeId: '106',\n toNodeId: '107'\n },\n {\n id: '105-107',\n label: 'Else',\n fromNodeId: '105',\n toNodeId: '107'\n },\n {\n id: '107-108',\n label: '',\n fromNodeId: '107',\n toNodeId: '108'\n },\n {\n id: '108-109',\n label: '',\n fromNodeId: '108',\n toNodeId: '109'\n },\n {\n id: '109-110',\n label: '',\n fromNodeId: '109',\n toNodeId: '110'\n },\n {\n id: '110-112',\n label: 'crmHasAddress',\n fromNodeId: '110',\n toNodeId: '112'\n },\n {\n id: '112-113',\n label: 'Bulk Processing',\n fromNodeId: '112',\n toNodeId: '113'\n },\n {\n id: '112-114',\n label: 'Manual',\n fromNodeId: '112',\n toNodeId: '114'\n },\n {\n id: '114-115',\n label: '',\n fromNodeId: '114',\n toNodeId: '115'\n },\n {\n id: '115-121',\n label: '',\n fromNodeId: '115',\n toNodeId: '121'\n },\n {\n id: '113-121',\n label: '',\n fromNodeId: '113',\n toNodeId: '121'\n },\n {\n id: '110-111',\n label: 'Else',\n fromNodeId: '110',\n toNodeId: '111'\n },\n {\n id: '111-121',\n label: '',\n fromNodeId: '111',\n toNodeId: '121'\n }\n];\n\nexport const emptyNodesData: NodeProps[] = [\n {\n id: '100',\n label: 'START',\n type: FlowShapeType.START\n },\n {\n id: '120',\n label: 'STOP',\n type: FlowShapeType.STOP\n }\n];\n\nexport const emptyConnectorsData: ConnectorProps[] = [\n {\n id: '100-120',\n label: 'happy path',\n fromNodeId: '100',\n toNodeId: '120'\n }\n];\n\nexport const nodeActions: Action[] = [\n {\n id: 'action-2',\n text: 'Reassign'\n }\n];\n\nexport const nodeLibrary: NodeLibraryItem[] = [\n {\n id: createUID(),\n primary: 'Assignment',\n type: FlowShapeType.ASSIGNMENT\n },\n {\n id: createUID(),\n primary: 'Decision',\n type: FlowShapeType.DECISION\n },\n {\n id: createUID(),\n primary: 'Send a message',\n type: FlowShapeType.MESSAGE\n },\n {\n id: createUID(),\n primary: 'Ask a question',\n type: FlowShapeType.QUESTION\n },\n {\n id: createUID(),\n primary: 'Automations',\n type: FlowShapeType.AUTOMATION,\n items: [\n {\n id: createUID(),\n primary: 'Send email',\n type: FlowShapeType.SEND_EMAIL\n },\n {\n id: createUID(),\n primary: 'Generate PDF',\n type: FlowShapeType.GENERATE_PDF\n }\n ]\n }\n];\n"]}
@@ -1,11 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare const _default: {
3
- title: string;
4
- component: ({ graphData, onNodeActionClick, onNodeClick, onNodeAdd, nodeLibrary, actions }: import("@pega/cosmos-react-build").FlowModellerProps) => JSX.Element;
5
- parameters: {
6
- layout: string;
7
- };
8
- };
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
9
4
  export default _default;
10
5
  export declare const EmptyFlowChartView: () => JSX.Element;
11
6
  export declare const CRMFlowChartView: () => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"FlowModeller.stories.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.stories.tsx"],"names":[],"mappings":";;;;;;;;AAqCA,wBAME;AA0HF,eAAO,MAAM,kBAAkB,mBAwF9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBAwF5B,CAAC"}
1
+ {"version":3,"file":"FlowModeller.stories.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AA6BxC,wBAMU;AAEV,eAAO,MAAM,kBAAkB,mBAyF9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBAyF5B,CAAC"}
@@ -1,10 +1,10 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useContext, useState, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext, useState } from 'react';
3
3
  import { action } from '@storybook/addon-actions';
4
- import styled, { css } from 'styled-components';
5
- import { ModalManagerContext, Modal, Input, Table, Text, Button, Icon, Flex } from '@pega/cosmos-react-core';
4
+ import { ModalManagerContext, Modal, Input } from '@pega/cosmos-react-core';
6
5
  import { FlowModeller, DirectedGraph, FlowModellerHelper } from '@pega/cosmos-react-build';
7
- import { nodeLibrary, nodeActions, exampleCRMNodesData, exampleCRMConnectorsData, emptyNodesData, emptyConnectorsData } from './FlowModeller.mocks';
6
+ import { nodeLibrary, nodeActions, exampleCRMNodesData, exampleCRMConnectorsData, emptyNodesData, emptyConnectorsData, DecisionTable } from './FlowModeller.mocks';
7
+ import { StyledWrapper } from './FlowModeller.styles';
8
8
  export default {
9
9
  title: 'Build/FlowModeller',
10
10
  component: FlowModeller,
@@ -12,67 +12,6 @@ export default {
12
12
  layout: 'fullscreen'
13
13
  }
14
14
  };
15
- const StyledWrapper = styled.div(() => {
16
- return css `
17
- height: 100vh;
18
- overflow: auto;
19
- `;
20
- });
21
- const DELETE_ACTION_ID = 'action-1';
22
- const DecisionTable = ({ updatedData, connectors, onDeleteRow, onAddRow, node, update }) => {
23
- const [tableData, setTableData] = useState(connectors);
24
- const message = 'Please delete the nodes in the connector manually and delete this connector again';
25
- const { create } = useContext(ModalManagerContext);
26
- const onAddCondition = () => {
27
- const label = 'otherwise';
28
- const updatedGraphData = FlowModellerHelper.addBranch(updatedData, node.id, label);
29
- const graph = new DirectedGraph(updatedGraphData);
30
- const outConnectors = graph.getOutConnectors(node.id);
31
- update({
32
- node,
33
- connectors: outConnectors,
34
- updatedData: updatedGraphData
35
- });
36
- onAddRow(updatedGraphData);
37
- };
38
- const onDeleteCondition = (connector) => {
39
- const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);
40
- if (updatedGraphData) {
41
- const updatedGraph = new DirectedGraph(updatedGraphData);
42
- const updatedOutConnectors = updatedGraph.getOutConnectors(node.id);
43
- update({
44
- node,
45
- connectors: updatedOutConnectors,
46
- updatedData: updatedGraphData
47
- });
48
- onDeleteRow(updatedGraphData);
49
- }
50
- else {
51
- create(() => {
52
- return (_jsx(Modal, { heading: 'Confirm', children: _jsx(Text, { children: message }, void 0) }, void 0));
53
- }, { center: true });
54
- }
55
- };
56
- const columns = [
57
- {
58
- renderer: connector => _jsx(Input, { value: connector.label, readOnly: true }, void 0),
59
- label: 'Outcome'
60
- },
61
- { renderer: () => _jsx(Text, { children: "No value" }, void 0), label: 'Decision output' },
62
- {
63
- renderer: connector => {
64
- return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'simple', label: 'Delete', disabled: tableData.length < 3, icon: true, onClick: () => {
65
- onDeleteCondition(connector);
66
- }, children: _jsx(Icon, { name: 'trash' }, void 0) }, void 0) }, void 0));
67
- },
68
- label: 'Action'
69
- }
70
- ];
71
- useEffect(() => {
72
- setTableData(connectors);
73
- }, [connectors]);
74
- return (_jsxs(_Fragment, { children: [_jsx(Table, { title: 'Decision outcomes', hoverHighlight: true, data: tableData, columns: columns }, void 0), _jsx(Flex, { container: { pad: [1, 0] }, children: _jsx(Button, { variant: 'simple', onClick: onAddCondition, children: "Add Condition" }, void 0) }, void 0)] }, void 0));
75
- };
76
15
  export const EmptyFlowChartView = () => {
77
16
  const [graphData, setGraphData] = useState({
78
17
  nodes: emptyNodesData,
@@ -92,17 +31,7 @@ export const EmptyFlowChartView = () => {
92
31
  }, update: update }, void 0))] }, void 0));
93
32
  };
94
33
  const onNodeActionClick = (params) => {
95
- if (params.actionId === DELETE_ACTION_ID) {
96
- const modifiedGraph = FlowModellerHelper.deleteNode(graphData, params.nodeId);
97
- if (modifiedGraph) {
98
- setGraphData(modifiedGraph);
99
- }
100
- else if (!modifiedGraph) {
101
- // eslint-disable-next-line no-alert
102
- alert('Deletion of this node is not supported ');
103
- }
104
- }
105
- else if (params.actionId === 'action-2') {
34
+ if (params.actionId === 'action-2') {
106
35
  action(`ressigned ${params.nodeId}`)();
107
36
  }
108
37
  else {
@@ -121,6 +50,9 @@ export const EmptyFlowChartView = () => {
121
50
  setGraphData(newGraphData);
122
51
  }
123
52
  };
53
+ const deleteNode = (params) => {
54
+ setGraphData(params.additionalData?.graphData);
55
+ };
124
56
  const selectNode = (nodeId) => {
125
57
  const graph = new DirectedGraph(graphData);
126
58
  const node = graph.getNode(nodeId);
@@ -132,7 +64,7 @@ export const EmptyFlowChartView = () => {
132
64
  updatedData: graphData
133
65
  });
134
66
  };
135
- return (_jsx(StyledWrapper, { children: _jsx(FlowModeller, { graphData: graphData, nodeLibrary: nodeLibrary, onNodeAdd: addNode, onNodeClick: selectNode, actions: nodeActions, onNodeActionClick: onNodeActionClick }, void 0) }, void 0));
67
+ return (_jsx(StyledWrapper, { children: _jsx(FlowModeller, { graphData: graphData, nodeLibrary: nodeLibrary, onNodeAdd: addNode, onNodeClick: selectNode, actions: nodeActions, onNodeActionClick: onNodeActionClick, onDelete: deleteNode }, void 0) }, void 0));
136
68
  };
137
69
  export const CRMFlowChartView = () => {
138
70
  const [graphData, setGraphData] = useState({
@@ -153,17 +85,7 @@ export const CRMFlowChartView = () => {
153
85
  }, update: update }, void 0))] }, void 0));
154
86
  };
155
87
  const onNodeActionClick = (params) => {
156
- if (params.actionId === DELETE_ACTION_ID) {
157
- const modifiedGraph = FlowModellerHelper.deleteNode(graphData, params.nodeId);
158
- if (modifiedGraph) {
159
- setGraphData(modifiedGraph);
160
- }
161
- else if (!modifiedGraph) {
162
- // eslint-disable-next-line no-alert
163
- alert('Deletion of this node is not supported ');
164
- }
165
- }
166
- else if (params.actionId === 'action-2') {
88
+ if (params.actionId === 'action-2') {
167
89
  action(`ressigned ${params.nodeId}`)();
168
90
  }
169
91
  else {
@@ -182,6 +104,9 @@ export const CRMFlowChartView = () => {
182
104
  setGraphData(newGraphData);
183
105
  }
184
106
  };
107
+ const deleteNode = (params) => {
108
+ setGraphData(params.additionalData?.graphData);
109
+ };
185
110
  const selectNode = (nodeId) => {
186
111
  const graph = new DirectedGraph(graphData);
187
112
  const node = graph.getNode(nodeId);
@@ -192,6 +117,6 @@ export const CRMFlowChartView = () => {
192
117
  updatedData: graphData
193
118
  });
194
119
  };
195
- return (_jsx(StyledWrapper, { children: _jsx(FlowModeller, { graphData: graphData, nodeLibrary: nodeLibrary, onNodeAdd: addNode, onNodeClick: selectNode, actions: nodeActions, onNodeActionClick: onNodeActionClick }, void 0) }, void 0));
120
+ return (_jsx(StyledWrapper, { children: _jsx(FlowModeller, { graphData: graphData, nodeLibrary: nodeLibrary, onNodeAdd: addNode, onNodeClick: selectNode, actions: nodeActions, onNodeActionClick: onNodeActionClick, onDelete: deleteNode }, void 0) }, void 0));
196
121
  };
197
122
  //# sourceMappingURL=FlowModeller.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlowModeller.stories.js","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,mBAAmB,EACnB,KAAK,EACL,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EAEL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,YAAY,EAIZ,aAAa,EAGb,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IACpC,OAAO,GAAG,CAAA;;;GAGT,CAAC;AACJ,CAAC,CAAC,CAAC;AAOH,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAapC,MAAM,aAAa,GAAG,CAAC,EACrB,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACa,EAAE,EAAE;IACvB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GA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zB,WAAW,EAAE,SAAS;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,cACZ,KAAC,YAAY,IACX,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,WAAW,EACpB,iBAAiB,EAAE,iBAAiB,WACpC,WACY,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useContext, useState, useEffect } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport styled, { css } from 'styled-components';\n\nimport {\n ModalManagerContext,\n Modal,\n Input,\n Table,\n ColumnProps,\n Text,\n Button,\n Icon,\n Flex,\n ModalMethods\n} from '@pega/cosmos-react-core';\nimport {\n FlowModeller,\n ActionParams,\n NodeProps,\n NodeType,\n DirectedGraph,\n GraphData,\n ConnectorProps,\n FlowModellerHelper,\n AddNodeHandlerParams\n} from '@pega/cosmos-react-build';\n\nimport {\n nodeLibrary,\n nodeActions,\n exampleCRMNodesData,\n exampleCRMConnectorsData,\n emptyNodesData,\n emptyConnectorsData\n} from './FlowModeller.mocks';\n\nexport default {\n title: 'Build/FlowModeller',\n component: FlowModeller,\n parameters: {\n layout: 'fullscreen'\n }\n};\n\nconst StyledWrapper = styled.div(() => {\n return css`\n height: 100vh;\n overflow: auto;\n `;\n});\n\ninterface NodeDataType {\n nodes: NodeProps[];\n connectors: ConnectorProps[];\n}\n\nconst DELETE_ACTION_ID = 'action-1';\n\ninterface ModalProps {\n updatedData: NodeDataType;\n connectors: ConnectorProps[];\n node: NodeProps;\n}\n\ninterface DecisionTableProps extends ModalProps {\n onDeleteRow: (data: NodeDataType) => void;\n onAddRow: (data: NodeDataType) => void;\n update: ModalMethods['update'];\n}\nconst DecisionTable = ({\n updatedData,\n connectors,\n onDeleteRow,\n onAddRow,\n node,\n update\n}: DecisionTableProps) => {\n const [tableData, setTableData] = useState<ConnectorProps[]>(connectors);\n const message =\n 'Please delete the nodes in the connector manually and delete this connector again';\n const { create } = useContext(ModalManagerContext);\n\n const onAddCondition = () => {\n const label = 'otherwise';\n const updatedGraphData = FlowModellerHelper.addBranch(updatedData, node.id, label);\n const graph = new DirectedGraph(updatedGraphData);\n const outConnectors = graph.getOutConnectors(node.id);\n update({\n node,\n connectors: outConnectors,\n updatedData: updatedGraphData\n });\n onAddRow(updatedGraphData);\n };\n\n const onDeleteCondition = (connector: ConnectorProps) => {\n const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);\n if (updatedGraphData) {\n const updatedGraph = new DirectedGraph(updatedGraphData);\n const updatedOutConnectors = updatedGraph.getOutConnectors(node.id);\n update({\n node,\n connectors: updatedOutConnectors,\n updatedData: updatedGraphData\n });\n onDeleteRow(updatedGraphData);\n } else {\n create(\n () => {\n return (\n <Modal heading='Confirm'>\n <Text>{message}</Text>\n </Modal>\n );\n },\n { center: true }\n );\n }\n };\n\n const columns: ColumnProps<ConnectorProps>[] = [\n {\n renderer: connector => <Input value={connector.label} readOnly />,\n label: 'Outcome'\n },\n { renderer: () => <Text>No value</Text>, label: 'Decision output' },\n {\n renderer: connector => {\n return (\n <>\n <Button\n variant='simple'\n label='Delete'\n disabled={tableData.length < 3}\n icon\n onClick={() => {\n onDeleteCondition(connector);\n }}\n >\n <Icon name='trash' />\n </Button>\n </>\n );\n },\n label: 'Action'\n }\n ];\n\n useEffect(() => {\n setTableData(connectors);\n }, [connectors]);\n\n return (\n <>\n <Table title='Decision outcomes' hoverHighlight data={tableData} columns={columns} />\n <Flex container={{ pad: [1, 0] }}>\n <Button variant='simple' onClick={onAddCondition}>\n Add Condition\n </Button>\n </Flex>\n </>\n );\n};\n\nexport const EmptyFlowChartView = () => {\n const [graphData, setGraphData] = useState<NodeDataType>({\n nodes: emptyNodesData,\n connectors: emptyConnectorsData\n });\n const { create } = useContext(ModalManagerContext);\n\n const onTableActionClick = (updatedData: NodeDataType) => {\n setGraphData(updatedData);\n };\n const LaunchPropertyModal = ({ node, connectors, updatedData }: ModalProps) => {\n const { ModalContext } = useContext(ModalManagerContext);\n const { update } = useContext(ModalContext);\n return (\n <Modal heading={node.label}>\n <Input label='Description' defaultValue={node.description} />\n {connectors.length > 1 && (\n <DecisionTable\n updatedData={updatedData}\n connectors={connectors}\n onDeleteRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n node={node}\n onAddRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n update={update}\n />\n )}\n </Modal>\n );\n };\n\n const onNodeActionClick = (params: ActionParams) => {\n if (params.actionId === DELETE_ACTION_ID) {\n const modifiedGraph = FlowModellerHelper.deleteNode(graphData, params.nodeId);\n\n if (modifiedGraph) {\n setGraphData(modifiedGraph);\n } else if (!modifiedGraph) {\n // eslint-disable-next-line no-alert\n alert('Deletion of this node is not supported ');\n }\n } else if (params.actionId === 'action-2') {\n action(`ressigned ${params.nodeId}`)();\n } else {\n // eslint-disable-next-line no-console\n console.warn(`Unknown action ${params.actionId}`);\n }\n };\n\n const addNode = (nodeType: NodeType, metaData: AddNodeHandlerParams) => {\n const UpdatedData = FlowModellerHelper.addNode({\n nodeType,\n graphData,\n metaData\n });\n if (UpdatedData) {\n const newGraphData: GraphData<NodeProps, ConnectorProps> = UpdatedData;\n setGraphData(newGraphData);\n }\n };\n\n const selectNode = (nodeId: NodeProps['id']) => {\n const graph = new DirectedGraph(graphData);\n const node = graph.getNode(nodeId);\n const outConnectors = graph.getOutConnectors(nodeId);\n // LaunchPropertyModal(node, outConnectors, graphData);\n create(LaunchPropertyModal, {\n node,\n connectors: outConnectors,\n updatedData: graphData\n });\n };\n\n return (\n <StyledWrapper>\n <FlowModeller\n graphData={graphData}\n nodeLibrary={nodeLibrary}\n onNodeAdd={addNode}\n onNodeClick={selectNode}\n actions={nodeActions}\n onNodeActionClick={onNodeActionClick}\n />\n </StyledWrapper>\n );\n};\n\nexport const CRMFlowChartView = () => {\n const [graphData, setGraphData] = useState<GraphData<NodeProps, ConnectorProps>>({\n nodes: exampleCRMNodesData,\n connectors: exampleCRMConnectorsData\n });\n const { create } = useContext(ModalManagerContext);\n\n const onTableActionClick = (updatedData: NodeDataType) => {\n setGraphData(updatedData);\n };\n\n const LaunchPropertyModal = ({ node, connectors, updatedData }: ModalProps) => {\n const { ModalContext } = useContext(ModalManagerContext);\n const { update } = useContext(ModalContext);\n return (\n <Modal heading={node.label}>\n <Input label='Description' defaultValue={node.description} />\n {connectors.length > 1 && (\n <DecisionTable\n updatedData={updatedData}\n connectors={connectors}\n onDeleteRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n node={node}\n onAddRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n update={update}\n />\n )}\n </Modal>\n );\n };\n\n const onNodeActionClick = (params: ActionParams) => {\n if (params.actionId === DELETE_ACTION_ID) {\n const modifiedGraph = FlowModellerHelper.deleteNode(graphData, params.nodeId);\n\n if (modifiedGraph) {\n setGraphData(modifiedGraph);\n } else if (!modifiedGraph) {\n // eslint-disable-next-line no-alert\n alert('Deletion of this node is not supported ');\n }\n } else if (params.actionId === 'action-2') {\n action(`ressigned ${params.nodeId}`)();\n } else {\n // eslint-disable-next-line no-console\n console.warn(`Unknown action ${params.actionId}`);\n }\n };\n\n const addNode = (nodeType: NodeType, metaData: AddNodeHandlerParams) => {\n const UpdatedData = FlowModellerHelper.addNode({\n nodeType,\n graphData,\n metaData\n });\n if (UpdatedData) {\n const newGraphData: GraphData<NodeProps, ConnectorProps> = UpdatedData;\n setGraphData(newGraphData);\n }\n };\n\n const selectNode = (nodeId: NodeProps['id']) => {\n const graph = new DirectedGraph(graphData);\n const node = graph.getNode(nodeId);\n const outConnectors = graph.getOutConnectors(nodeId);\n create(LaunchPropertyModal, {\n node,\n connectors: outConnectors,\n updatedData: graphData\n });\n };\n\n return (\n <StyledWrapper>\n <FlowModeller\n graphData={graphData}\n nodeLibrary={nodeLibrary}\n onNodeAdd={addNode}\n onNodeClick={selectNode}\n actions={nodeActions}\n onNodeActionClick={onNodeActionClick}\n />\n </StyledWrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"FlowModeller.stories.js","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EACL,YAAY,EAIZ,aAAa,EAGb,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EAEnB,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAe;QACvD,KAAK,EAAE,cAAc;QACrB,UAAU,EAAE,mBAAmB;KAChC,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAEnD,MAAM,kBAAkB,GAAG,CAAC,WAAyB,EAAE,EAAE;QACvD,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC,CAAC;IACF,MAAM,mBAAmB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAc,EAAE,EAAE;QAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;QACzD,MAAM,EAA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,EAAE,EAAE;QAC1C,YAAY,CACT,MAAM,CAAC,cAAoC,EAAE,SAG7C,CACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,MAAuB,EAAE,EAAE;QAC7C,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,mBAAmB,EAAE;YAC1B,IAAI;YACJ,UAAU,EAAE,aAAa;YACzB,WAAW,EAAE,SAAS;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,cACZ,KAAC,YAAY,IACX,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,WAAW,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,UAAU,WACpB,WACY,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useContext, useState } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Meta } from '@storybook/react';\n\nimport { ModalManagerContext, Modal, Input } from '@pega/cosmos-react-core';\nimport {\n FlowModeller,\n ActionParams,\n NodeProps,\n NodeType,\n DirectedGraph,\n GraphData,\n ConnectorProps,\n FlowModellerHelper,\n AddNodeHandlerParams,\n DeleteNodeOutcome\n} from '@pega/cosmos-react-build';\n\nimport {\n ModalProps,\n nodeLibrary,\n nodeActions,\n exampleCRMNodesData,\n exampleCRMConnectorsData,\n emptyNodesData,\n emptyConnectorsData,\n NodeDataType,\n DecisionTable\n} from './FlowModeller.mocks';\nimport { StyledWrapper } from './FlowModeller.styles';\n\nexport default {\n title: 'Build/FlowModeller',\n component: FlowModeller,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\nexport const EmptyFlowChartView = () => {\n const [graphData, setGraphData] = useState<NodeDataType>({\n nodes: emptyNodesData,\n connectors: emptyConnectorsData\n });\n const { create } = useContext(ModalManagerContext);\n\n const onTableActionClick = (updatedData: NodeDataType) => {\n setGraphData(updatedData);\n };\n const LaunchPropertyModal = ({ node, connectors, updatedData }: ModalProps) => {\n const { ModalContext } = useContext(ModalManagerContext);\n const { update } = useContext(ModalContext);\n return (\n <Modal heading={node.label}>\n <Input label='Description' defaultValue={node.description} />\n {connectors.length > 1 && (\n <DecisionTable\n updatedData={updatedData}\n connectors={connectors}\n onDeleteRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n node={node}\n onAddRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n update={update}\n />\n )}\n </Modal>\n );\n };\n\n const onNodeActionClick = (params: ActionParams) => {\n if (params.actionId === 'action-2') {\n action(`ressigned ${params.nodeId}`)();\n } else {\n // eslint-disable-next-line no-console\n console.warn(`Unknown action ${params.actionId}`);\n }\n };\n\n const addNode = (nodeType: NodeType, metaData: AddNodeHandlerParams) => {\n const UpdatedData = FlowModellerHelper.addNode({\n nodeType,\n graphData,\n metaData\n });\n if (UpdatedData) {\n const newGraphData: GraphData<NodeProps, ConnectorProps> = UpdatedData;\n setGraphData(newGraphData);\n }\n };\n\n const deleteNode = (params: ActionParams) => {\n setGraphData(\n (params.additionalData as DeleteNodeOutcome)?.graphData as GraphData<\n NodeProps,\n ConnectorProps\n >\n );\n };\n\n const selectNode = (nodeId: NodeProps['id']) => {\n const graph = new DirectedGraph(graphData);\n const node = graph.getNode(nodeId);\n const outConnectors = graph.getOutConnectors(nodeId);\n // LaunchPropertyModal(node, outConnectors, graphData);\n create(LaunchPropertyModal, {\n node,\n connectors: outConnectors,\n updatedData: graphData\n });\n };\n\n return (\n <StyledWrapper>\n <FlowModeller\n graphData={graphData}\n nodeLibrary={nodeLibrary}\n onNodeAdd={addNode}\n onNodeClick={selectNode}\n actions={nodeActions}\n onNodeActionClick={onNodeActionClick}\n onDelete={deleteNode}\n />\n </StyledWrapper>\n );\n};\n\nexport const CRMFlowChartView = () => {\n const [graphData, setGraphData] = useState<GraphData<NodeProps, ConnectorProps>>({\n nodes: exampleCRMNodesData,\n connectors: exampleCRMConnectorsData\n });\n const { create } = useContext(ModalManagerContext);\n\n const onTableActionClick = (updatedData: NodeDataType) => {\n setGraphData(updatedData);\n };\n\n const LaunchPropertyModal = ({ node, connectors, updatedData }: ModalProps) => {\n const { ModalContext } = useContext(ModalManagerContext);\n const { update } = useContext(ModalContext);\n return (\n <Modal heading={node.label}>\n <Input label='Description' defaultValue={node.description} />\n {connectors.length > 1 && (\n <DecisionTable\n updatedData={updatedData}\n connectors={connectors}\n onDeleteRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n node={node}\n onAddRow={(data: NodeDataType) => {\n onTableActionClick(data);\n }}\n update={update}\n />\n )}\n </Modal>\n );\n };\n\n const onNodeActionClick = (params: ActionParams) => {\n if (params.actionId === 'action-2') {\n action(`ressigned ${params.nodeId}`)();\n } else {\n // eslint-disable-next-line no-console\n console.warn(`Unknown action ${params.actionId}`);\n }\n };\n\n const addNode = (nodeType: NodeType, metaData: AddNodeHandlerParams) => {\n const UpdatedData = FlowModellerHelper.addNode({\n nodeType,\n graphData,\n metaData\n });\n if (UpdatedData) {\n const newGraphData: GraphData<NodeProps, ConnectorProps> = UpdatedData;\n setGraphData(newGraphData);\n }\n };\n\n const deleteNode = (params: ActionParams) => {\n setGraphData(\n (params.additionalData as DeleteNodeOutcome)?.graphData as GraphData<\n NodeProps,\n ConnectorProps\n >\n );\n };\n\n const selectNode = (nodeId: NodeProps['id']) => {\n const graph = new DirectedGraph(graphData);\n const node = graph.getNode(nodeId);\n const outConnectors = graph.getOutConnectors(nodeId);\n create(LaunchPropertyModal, {\n node,\n connectors: outConnectors,\n updatedData: graphData\n });\n };\n\n return (\n <StyledWrapper>\n <FlowModeller\n graphData={graphData}\n nodeLibrary={nodeLibrary}\n onNodeAdd={addNode}\n onNodeClick={selectNode}\n actions={nodeActions}\n onNodeActionClick={onNodeActionClick}\n onDelete={deleteNode}\n />\n </StyledWrapper>\n );\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ //# sourceMappingURL=FlowModeller.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowModeller.styles.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,yGAKxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import styled, { css } from 'styled-components';
2
+ export const StyledWrapper = styled.div(() => {
3
+ return css `
4
+ height: 100vh;
5
+ overflow: auto;
6
+ `;
7
+ });
8
+ //# sourceMappingURL=FlowModeller.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowModeller.styles.js","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IAC3C,OAAO,GAAG,CAAA;;;GAGT,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nexport const StyledWrapper = styled.div(() => {\n return css`\n height: 100vh;\n overflow: auto;\n `;\n});\n"]}
@@ -1,9 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { LibraryItem } from '@pega/cosmos-react-build';
3
- declare const _default: {
4
- title: string;
5
- component: import("react").FC<import("@pega/cosmos-react-build").ItemLibraryProps<LibraryItem> & import("@pega/cosmos-react-core").ForwardProps>;
6
- };
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/addons").Args>;
7
4
  export default _default;
8
5
  export declare const ColorPicker: () => JSX.Element;
9
6
  //# sourceMappingURL=LibraryPicker.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LibraryPicker.stories.d.ts","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAe,WAAW,EAAE,MAAM,0BAA0B,CAAC;;;;;AAKpE,wBAGE;AAEF,eAAO,MAAM,WAAW,mBAiDvB,CAAC"}
1
+ {"version":3,"file":"LibraryPicker.stories.d.ts","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAOxC,wBAGU;AAEV,eAAO,MAAM,WAAW,mBAiDvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LibraryPicker.stories.js","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,EAAe,CAAC;IAChE,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,U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ffect, useState } from 'react';\nimport { useRef } from '@storybook/addons';\n\nimport { ItemLibrary, LibraryItem } from '@pega/cosmos-react-build';\nimport { Button, useElement, useOuterEvent } from '@pega/cosmos-react-core';\n\nimport { nodeLibrary } from './LibraryPicker.mocks';\n\nexport default {\n title: 'Build/LibraryPicker',\n component: ItemLibrary\n};\n\nexport const ColorPicker = () => {\n const [selectedItem, setSelectedItem] = useState<LibraryItem>();\n const [showPicker, updatePicker] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n const targetRef = useRef<HTMLButtonElement | null>(null);\n\n const closeMenu = () => {\n updatePicker(false);\n };\n\n const btnClick = () => {\n updatePicker(true);\n };\n\n const onSelect = (item: LibraryItem) => {\n setSelectedItem(item);\n closeMenu();\n };\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeMenu();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n useOuterEvent('mousedown', [popoverEl], closeMenu);\n\n return (\n <>\n {selectedItem ? <div>Selected: {selectedItem.primary}</div> : ''}\n <Button onClick={btnClick} ref={targetRef}>\n Select from library\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showPicker}\n target={targetRef && (targetRef.current as HTMLElement)}\n ref={setPopoverEl}\n onClick={onSelect}\n />\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"LibraryPicker.stories.js","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAe,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,WAA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CAAgB,YAAY,CAAC,OAAO,YAAO,CAAC,CAAC,CAAC,EAAE,EAChE,KAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,4CAEhC,EACT,KAAC,WAAW,IACV,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,SAAS,IAAK,SAAS,CAAC,OAAuB,EACvD,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,QAAQ,WACjB,YACD,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { useRef } from '@storybook/addons';\nimport { Meta } from '@storybook/react';\n\nimport { ItemLibrary, LibraryItem } from '@pega/cosmos-react-build';\nimport { Button, useElement, useOuterEvent } from '@pega/cosmos-react-core';\n\nimport { nodeLibrary } from './LibraryPicker.mocks';\n\nexport default {\n title: 'Build/LibraryPicker',\n component: ItemLibrary\n} as Meta;\n\nexport const ColorPicker = () => {\n const [selectedItem, setSelectedItem] = useState<LibraryItem>();\n const [showPicker, updatePicker] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n const targetRef = useRef<HTMLButtonElement | null>(null);\n\n const closeMenu = () => {\n updatePicker(false);\n };\n\n const btnClick = () => {\n updatePicker(true);\n };\n\n const onSelect = (item: LibraryItem) => {\n setSelectedItem(item);\n closeMenu();\n };\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeMenu();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n useOuterEvent('mousedown', [popoverEl], closeMenu);\n\n return (\n <>\n {selectedItem ? <div>Selected: {selectedItem.primary}</div> : ''}\n <Button onClick={btnClick} ref={targetRef}>\n Select from library\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showPicker}\n target={targetRef && (targetRef.current as HTMLElement)}\n ref={setPopoverEl}\n onClick={onSelect}\n />\n </>\n );\n};\n"]}
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare const _default: {
3
- title: string;
4
- component: import("react").FunctionComponent<import("@pega/cosmos-react-build").LifeCycleProps & import("@pega/cosmos-react-core").ForwardProps>;
5
- };
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
6
4
  export default _default;
7
5
  export declare const PlanView: () => JSX.Element;
8
6
  export declare const EmptyPlanView: () => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycle.stories.d.ts","sourceRoot":"","sources":["../../../src/build/LifeCycle/LifeCycle.stories.tsx"],"names":[],"mappings":";;;;;AA0BA,wBAGE;AAEF,eAAO,MAAM,QAAQ,mBA4JpB,CAAC;AAEF,eAAO,MAAM,aAAa,mBA0JzB,CAAC;AAEF,eAAO,MAAM,YAAY,mBA6KxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAuI7B,CAAC"}
1
+ {"version":3,"file":"LifeCycle.stories.d.ts","sourceRoot":"","sources":["../../../src/build/LifeCycle/LifeCycle.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AA0BxC,wBAGU;AAEV,eAAO,MAAM,QAAQ,mBA4JpB,CAAC;AAEF,eAAO,MAAM,aAAa,mBA0JzB,CAAC;AAEF,eAAO,MAAM,YAAY,mBA6KxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAuI7B,CAAC"}