@pega/cosmos-react-demos 3.0.0-dev.3.0 → 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 (557) 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 +4 -1
  10. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  11. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +18 -2
  12. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  13. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  14. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  15. package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +71 -7
  16. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
  17. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  18. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  19. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
  20. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  21. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  22. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  23. package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
  24. package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  25. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  26. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  27. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  28. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  29. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  30. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  31. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +40 -0
  32. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
  33. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
  34. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
  35. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +9 -0
  36. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
  37. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +137 -0
  38. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -0
  39. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
  40. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
  41. package/jsx/build/ObjectSelect/ObjectSelect.styles.js +27 -0
  42. package/jsx/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
  43. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  44. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  45. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
  46. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
  47. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  48. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  49. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
  50. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
  51. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  52. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  53. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
  54. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
  55. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  56. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  57. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
  58. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  59. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  60. package/jsx/build/Workbench/Workbench.stories.jsx +3 -14
  61. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  62. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  63. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  64. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  65. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  66. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  67. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  68. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
  69. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
  70. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  71. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  72. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  73. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  74. package/jsx/core/AppShell/AppShell.stories.d.ts +1 -0
  75. package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
  76. package/jsx/core/AppShell/AppShell.stories.jsx +3 -1
  77. package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
  78. package/jsx/core/Button/Button.stories.jsx +6 -6
  79. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  80. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  81. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
  82. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  83. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  84. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  85. package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
  86. package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  87. package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
  88. package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  89. package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
  90. package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
  91. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  92. package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
  93. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  94. package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
  95. package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
  96. package/jsx/core/Configuration/Configuration.styles.js +12 -0
  97. package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
  98. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  99. package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
  100. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  101. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  102. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  103. package/jsx/core/FieldGroup/FieldGroup.stories.jsx +8 -4
  104. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  105. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  106. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  107. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +70 -2
  108. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  109. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
  110. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  111. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +51 -88
  112. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  113. package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
  114. package/jsx/core/File/FileDisplay.stories.jsx +16 -38
  115. package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
  116. package/jsx/core/HTML/HTML.stories.d.ts +6 -0
  117. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -0
  118. package/jsx/core/HTML/HTML.stories.jsx +13 -0
  119. package/jsx/core/HTML/HTML.stories.jsx.map +1 -0
  120. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  121. package/jsx/core/Icon/Icon.stories.jsx +5 -27
  122. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  123. package/jsx/core/Icon/Icon.styles.d.ts +4 -0
  124. package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
  125. package/jsx/core/Icon/Icon.styles.js +25 -0
  126. package/jsx/core/Icon/Icon.styles.js.map +1 -0
  127. package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
  128. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  129. package/jsx/core/Link/Link.stories.d.ts +1 -11
  130. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  131. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  132. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
  133. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
  134. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx +71 -0
  135. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -0
  136. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
  137. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
  138. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +87 -0
  139. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -0
  140. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  141. package/jsx/core/Number/Number.stories.jsx +2 -0
  142. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  143. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  144. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
  145. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  146. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  147. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  148. package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
  149. package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  150. package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
  151. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  152. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  153. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  154. package/jsx/core/Tree/Tree.stories.jsx +2 -2
  155. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  156. package/jsx/cs/Article/Article.stories.d.ts +2 -10
  157. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  158. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  159. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  160. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  161. package/jsx/cs/ArticleList/ArticleList.stories.jsx +2 -1
  162. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  163. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  164. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  165. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
  166. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  167. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  168. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  169. package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
  170. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
  171. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  172. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  173. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
  174. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  175. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  176. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  177. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
  178. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  179. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  180. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  181. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
  182. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  183. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  184. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  185. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  186. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  187. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  188. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  189. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
  190. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  191. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  192. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  193. package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
  194. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  195. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  196. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  197. package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
  198. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  199. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  200. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  201. package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
  202. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
  203. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  204. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  205. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
  206. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
  207. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  208. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  209. package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
  210. package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
  211. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  212. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  213. package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
  214. package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  215. package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
  216. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
  217. package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
  218. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
  219. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  220. package/jsx/rte/Editor/Editor.stories.jsx +2 -20
  221. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  222. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  223. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  224. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  225. package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
  226. package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  227. package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
  228. package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
  229. package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
  230. package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  231. package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
  232. package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
  233. package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
  234. package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  235. package/jsx/social/Chat/RepeatingView.styles.js +22 -0
  236. package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
  237. package/jsx/social/Email/Email.mocks.d.ts +155 -2
  238. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  239. package/jsx/social/Email/Email.mocks.jsx +756 -0
  240. package/jsx/social/Email/Email.mocks.jsx.map +1 -0
  241. package/jsx/social/Email/Email.stories.d.ts +14 -14
  242. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  243. package/jsx/social/Email/Email.stories.jsx +115 -407
  244. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  245. package/jsx/social/Email/Email.styles.d.ts +4 -0
  246. package/jsx/social/Email/Email.styles.d.ts.map +1 -0
  247. package/jsx/social/Email/Email.styles.js +14 -0
  248. package/jsx/social/Email/Email.styles.js.map +1 -0
  249. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  250. package/jsx/social/Feed/Feed.stories.jsx +23 -18
  251. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  252. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  253. package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
  254. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  255. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  256. package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
  257. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  258. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  259. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  260. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  261. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  262. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  263. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
  264. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
  265. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  266. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  267. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
  268. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  269. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  270. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  271. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  272. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  273. package/jsx/work/Timeline/Timeline.stories.d.ts +2 -0
  274. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  275. package/jsx/work/Timeline/Timeline.stories.jsx +28 -1
  276. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  277. package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
  278. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  279. package/lib/build/AppShell/AppShell.mocks.js +16 -0
  280. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  281. package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
  282. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  283. package/lib/build/AppShell/AppShell.stories.js +3 -18
  284. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  285. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +4 -1
  286. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  287. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +18 -2
  288. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  289. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  290. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  291. package/lib/build/FlowModeller/FlowModeller.mocks.js +58 -6
  292. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  293. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  294. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  295. package/lib/build/FlowModeller/FlowModeller.stories.js +15 -90
  296. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  297. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  298. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  299. package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
  300. package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  301. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  302. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  303. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  304. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  305. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  306. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  307. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +40 -0
  308. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
  309. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +272 -0
  310. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -0
  311. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +9 -0
  312. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
  313. package/lib/build/ObjectSelect/ObjectSelect.stories.js +123 -0
  314. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -0
  315. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
  316. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
  317. package/lib/build/ObjectSelect/ObjectSelect.styles.js +27 -0
  318. package/lib/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
  319. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  320. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  321. package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
  322. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
  323. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  324. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  325. package/lib/build/PageTemplates/GalleryPage.stories.js +3 -79
  326. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  327. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  328. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  329. package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
  330. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
  331. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  332. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  333. package/lib/build/PageTemplates/PageTemplates.stories.js +5 -95
  334. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  335. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  336. package/lib/build/Workbench/Workbench.stories.js +3 -14
  337. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  338. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  339. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  340. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  341. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  342. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  343. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  344. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +56 -54
  345. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  346. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  347. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  348. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  349. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  350. package/lib/core/AppShell/AppShell.stories.d.ts +1 -0
  351. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
  352. package/lib/core/AppShell/AppShell.stories.js +3 -1
  353. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  354. package/lib/core/Button/Button.stories.js +2 -2
  355. package/lib/core/Button/Button.stories.js.map +1 -1
  356. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  357. package/lib/core/ColorPicker/ColorPicker.stories.js +2 -10
  358. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  359. package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  360. package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  361. package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
  362. package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  363. package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
  364. package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  365. package/lib/core/Configuration/Configuration.mocks.js +6 -0
  366. package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
  367. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  368. package/lib/core/Configuration/Configuration.stories.js +3 -15
  369. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  370. package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
  371. package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
  372. package/lib/core/Configuration/Configuration.styles.js +12 -0
  373. package/lib/core/Configuration/Configuration.styles.js.map +1 -0
  374. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  375. package/lib/core/DateTime/DateTime.stories.js +2 -0
  376. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  377. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  378. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  379. package/lib/core/FieldGroup/FieldGroup.stories.js +7 -3
  380. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  381. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  382. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  383. package/lib/core/FieldGroup/FieldGroupList.mocks.js +47 -3
  384. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  385. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
  386. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  387. package/lib/core/FieldGroup/FieldGroupList.stories.js +52 -65
  388. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  389. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
  390. package/lib/core/File/FileDisplay.stories.js +17 -29
  391. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  392. package/lib/core/HTML/HTML.stories.d.ts +6 -0
  393. package/lib/core/HTML/HTML.stories.d.ts.map +1 -0
  394. package/lib/core/HTML/HTML.stories.js +14 -0
  395. package/lib/core/HTML/HTML.stories.js.map +1 -0
  396. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  397. package/lib/core/Icon/Icon.stories.js +6 -29
  398. package/lib/core/Icon/Icon.stories.js.map +1 -1
  399. package/lib/core/Icon/Icon.styles.d.ts +4 -0
  400. package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
  401. package/lib/core/Icon/Icon.styles.js +25 -0
  402. package/lib/core/Icon/Icon.styles.js.map +1 -0
  403. package/lib/core/IconPicker/IconPicker.stories.js +1 -1
  404. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  405. package/lib/core/Link/Link.stories.d.ts +1 -11
  406. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  407. package/lib/core/Link/Link.stories.js.map +1 -1
  408. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
  409. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
  410. package/lib/core/ListToolbar/ListToolbar.mocks.js +50 -0
  411. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -0
  412. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
  413. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
  414. package/lib/core/ListToolbar/ListToolbar.stories.js +79 -0
  415. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -0
  416. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  417. package/lib/core/Number/Number.stories.js +2 -0
  418. package/lib/core/Number/Number.stories.js.map +1 -1
  419. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  420. package/lib/core/PageTemplates/PageTemplates.stories.js +1 -11
  421. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  422. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  423. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  424. package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
  425. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  426. package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
  427. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  428. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  429. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  430. package/lib/core/Tree/Tree.stories.js +2 -2
  431. package/lib/core/Tree/Tree.stories.js.map +1 -1
  432. package/lib/cs/Article/Article.stories.d.ts +2 -10
  433. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  434. package/lib/cs/Article/Article.stories.js.map +1 -1
  435. package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  436. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  437. package/lib/cs/ArticleList/ArticleList.stories.js +2 -1
  438. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  439. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  440. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  441. package/lib/cs/CSCaseView/CSAppShell.stories.js +6 -19
  442. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  443. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  444. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  445. package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
  446. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
  447. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  448. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  449. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +4 -4
  450. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  451. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  452. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  453. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +3 -3
  454. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  455. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  456. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  457. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
  458. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  459. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  460. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  461. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  462. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  463. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  464. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  465. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +6 -30
  466. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  467. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  468. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  469. package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
  470. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  471. package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  472. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  473. package/lib/cs/TaskManager/TaskManager.stories.js +25 -29
  474. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  475. package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  476. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  477. package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
  478. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
  479. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  480. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  481. package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
  482. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
  483. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  484. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  485. package/lib/dnd/DragDropList/DragDropList.stories.js +14 -85
  486. package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
  487. package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  488. package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  489. package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
  490. package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  491. package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
  492. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
  493. package/lib/rte/Editor/Editor.mocks.js +23 -0
  494. package/lib/rte/Editor/Editor.mocks.js.map +1 -0
  495. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  496. package/lib/rte/Editor/Editor.stories.js +2 -22
  497. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  498. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  499. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  500. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  501. package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
  502. package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  503. package/lib/social/Chat/RepeatingView.mocks.js +11 -0
  504. package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
  505. package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
  506. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  507. package/lib/social/Chat/RepeatingView.stories.js +16 -46
  508. package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
  509. package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
  510. package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  511. package/lib/social/Chat/RepeatingView.styles.js +22 -0
  512. package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
  513. package/lib/social/Email/Email.mocks.d.ts +155 -2
  514. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  515. package/lib/social/Email/Email.mocks.js +361 -0
  516. package/lib/social/Email/Email.mocks.js.map +1 -1
  517. package/lib/social/Email/Email.stories.d.ts +14 -14
  518. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  519. package/lib/social/Email/Email.stories.js +117 -423
  520. package/lib/social/Email/Email.stories.js.map +1 -1
  521. package/lib/social/Email/Email.styles.d.ts +4 -0
  522. package/lib/social/Email/Email.styles.d.ts.map +1 -0
  523. package/lib/social/Email/Email.styles.js +14 -0
  524. package/lib/social/Email/Email.styles.js.map +1 -0
  525. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  526. package/lib/social/Feed/Feed.stories.js +23 -18
  527. package/lib/social/Feed/Feed.stories.js.map +1 -1
  528. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  529. package/lib/social/Feed/FeedPost.stories.js +30 -20
  530. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  531. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  532. package/lib/social/Feed/FeedReply.stories.js +21 -16
  533. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  534. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  535. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  536. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  537. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  538. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  539. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
  540. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
  541. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  542. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  543. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +2 -172
  544. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  545. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  546. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  547. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  548. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  549. package/lib/work/Timeline/Timeline.stories.d.ts +2 -0
  550. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  551. package/lib/work/Timeline/Timeline.stories.js +22 -2
  552. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  553. package/package.json +16 -17
  554. package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  555. package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
  556. package/jsx/social/Email/Email.mocks.js +0 -395
  557. package/jsx/social/Email/Email.mocks.js.map +0 -1
@@ -1,6 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { Meta } from '@storybook/react';
3
+ import { DynamicContentEditorProps } from '@pega/cosmos-react-build';
3
4
  declare const _default: Meta<import("@storybook/react").Args>;
4
5
  export default _default;
5
- export declare const DynamicContentEditorDemo: () => JSX.Element;
6
+ export interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {
7
+ }
8
+ export declare const DynamicContentEditorDemo: (args: DynamicContentEditorStoryProps) => JSX.Element;
6
9
  //# sourceMappingURL=DynamicContentEditor.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/build/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAmBxC,wBAGU;AAEV,eAAO,MAAM,wBAAwB,mBAwFpC,CAAC"}
1
+ {"version":3,"file":"DynamicContentEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/build/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAgBxC,OAAO,EAEL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;;AAIlC,wBAGU;AAEV,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;CAAG;AAEpF,eAAO,MAAM,wBAAwB,SAAU,8BAA8B,gBA2G5E,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState, useCallback } from 'react';
3
+ import { action } from '@storybook/addon-actions';
3
4
  import { Button, Card, CardContent, CardFooter, Flex, TextArea, useAutoResize, useConsolidatedRef, useI18n } from '@pega/cosmos-react-core';
4
5
  import { DynamicContentEditor } from '@pega/cosmos-react-build';
5
6
  import FieldSelector from './FieldSelector';
@@ -7,9 +8,23 @@ export default {
7
8
  title: 'Build/DynamicContentEditor',
8
9
  component: DynamicContentEditor
9
10
  };
10
- export const DynamicContentEditorDemo = () => {
11
+ export const DynamicContentEditorDemo = (args) => {
11
12
  const [html, setHtml] = useState('<p>Hi <pega-reference role="button" contenteditable="false" data-rule-type="field" data-rule-id="CustomerName">CustomerName</pega-reference><p>please check this <a href="https://google.com">link</a></p></p>');
12
13
  const rteRef = useRef(null);
14
+ const fieldItems = [
15
+ { id: 'CustomerName', primary: 'CustomerName' },
16
+ { id: 'Address', primary: 'Address' },
17
+ { id: 'Locality', primary: 'Locality' },
18
+ { id: 'Country', primary: 'Country' },
19
+ { id: 'Region', primary: 'Region' },
20
+ { id: 'Occupation', primary: 'Occupation' },
21
+ { id: 'City', primary: 'City' },
22
+ { id: 'Colony', primary: 'Colony' },
23
+ { id: 'Lastname', primary: 'Lastname' },
24
+ { id: 'Preference', primary: 'Preference' },
25
+ { id: 'Currency', primary: 'Currency' },
26
+ { id: 'Iconname', primary: 'Iconname' }
27
+ ];
13
28
  const onImageAdded = (image, id) => {
14
29
  const src = URL.createObjectURL(image);
15
30
  rteRef.current?.appendImage({ src, alt: image.name }, id);
@@ -43,6 +58,7 @@ export const DynamicContentEditorDemo = () => {
43
58
  { id: 'Region', text: 'Region' },
44
59
  { id: 'Occupation', text: 'Occupation' }
45
60
  ], label: 'Field', updateSelection: updateSelection, placeholder: t('select'), defaultSelection: selectedField }, selectedField?.id) }, void 0));
46
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value), autoResize: true, ref: consolidatedRef }, void 0) }, void 0), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }, void 0) }, void 0)] }, void 0), _jsx(DynamicContentEditor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: 'Dynamic content editor', toolbar: ['inline-styling', 'lists', 'indentation', 'links', 'images'], form: { onSubmit, dynamicContentPicker }, onActiveFieldChange: (field) => setSelectedField(field) }, void 0), _jsx(Flex, { container: { gap: 1 }, children: _jsx(Button, { onClick: () => handleShowHtml(), children: "Show HTML" }, void 0) }, void 0)] }, void 0));
61
+ const onActiveFieldChange = (field) => setSelectedField(field);
62
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value), autoResize: true, ref: consolidatedRef }, void 0) }, void 0), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }, void 0) }, void 0)] }, void 0), _jsx(DynamicContentEditor, { defaultValue: args.defaultValue || html, onImageAdded: onImageAdded, ref: rteRef, label: 'Dynamic content editor', toolbar: ['inline-styling', 'lists', 'indentation', 'links', 'images'], form: args.form || { onSubmit, dynamicContentPicker }, onActiveFieldChange: args.onActiveFieldChange || onActiveFieldChange, fieldItems: args.fieldItems || fieldItems, onBlur: action('Editor onBlur') }, void 0), _jsx(Flex, { container: { gap: 1 }, children: _jsx(Button, { onClick: () => handleShowHtml(), children: "Show HTML" }, void 0) }, void 0)] }, void 0));
47
63
  };
48
64
  //# sourceMappingURL=DynamicContentEditor.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.stories.js","sourceRoot":"","sources":["../../../src/build/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,MAAM,EACN,IAAI,EACJ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C,MAAM,CAAC,KAAK,CAAC,EACtC,UAAU,QACV,GAAG,EAAE,eAAe,WACpB,WACU,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,oDAE3D,WACE,YACR,EACP,KAAC,oBAAoB,IACnB,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,wBAAwB,EAC9B,OAAO,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EACtE,IAAI,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EACxC,mBAAmB,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,WACjE,EACF,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,YACzB,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,kCAAoB,WACtD,YACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useRef, useState, useCallback } from 'react';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n TextArea,\n useAutoResize,\n useConsolidatedRef,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { EditorState } from '@pega/cosmos-react-rte';\nimport { DynamicContentEditor, ItemType } from '@pega/cosmos-react-build';\n\nimport FieldSelector, { FieldSelectorProps } from './FieldSelector';\n\nexport default {\n title: 'Build/DynamicContentEditor',\n component: DynamicContentEditor\n} as Meta;\n\nexport const DynamicContentEditorDemo = () => {\n const [html, setHtml] = useState(\n '<p>Hi <pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"CustomerName\">CustomerName</pega-reference><p>please check this <a href=\"https://google.com\">link</a></p></p>'\n );\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n const [textAreaRef, resizeTextArea] = useAutoResize<HTMLTextAreaElement>(undefined, 100);\n const ref = useRef(null);\n const consolidatedRef = useConsolidatedRef(textAreaRef, ref);\n const handleShowHtml = () => {\n resizeTextArea();\n setHtml(rteRef.current?.getHtml() || '');\n };\n const t = useI18n();\n const [selectedField, setSelectedField] = useState<ItemType>({\n id: '',\n text: ''\n });\n\n const updateSelection: FieldSelectorProps['updateSelection'] = (selectedItem: ItemType) => {\n setSelectedField(selectedItem);\n };\n const onSubmit = useCallback(\n (insertField: (selectedField: ItemType) => void) => {\n insertField(selectedField);\n },\n [selectedField]\n );\n\n const dynamicContentPicker = (\n <Flex\n container={{\n gap: 2,\n direction: 'column'\n }}\n >\n <FieldSelector\n itemList={[\n { id: 'CustomerName', text: 'CustomerName' },\n { id: 'Address', text: 'Address' },\n { id: 'Locality', text: 'Locality' },\n { id: 'Country', text: 'Country' },\n { id: 'Region', text: 'Region' },\n { id: 'Occupation', text: 'Occupation' }\n ]}\n key={selectedField?.id}\n label='Field'\n updateSelection={updateSelection}\n placeholder={t('select')}\n defaultSelection={selectedField}\n />\n </Flex>\n );\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea\n value={html}\n onChange={e => setHtml(e.target.value)}\n autoResize\n ref={consolidatedRef}\n />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <DynamicContentEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Dynamic content editor'\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n form={{ onSubmit, dynamicContentPicker }}\n onActiveFieldChange={(field: ItemType) => setSelectedField(field)}\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => handleShowHtml()}>Show HTML</Button>\n </Flex>\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"DynamicContentEditor.stories.js","sourceRoot":"","sources":["../../../src/build/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,OAAO,EACR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,oBAAoB,EAGrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,aAAqC,MAAM,iBAAiB,CAAC;AAEpE,eAAe;IACb,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,oBAAoB;CACxB,CAAC;AAIV,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAoC,EAAE,EAAE;IAC/E,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAC9B,gNAAgN,CACjN,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAEzC,MAAM,UAAU,GAA4C;QAC1D,EAAE,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE;QAC/C,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;QACrC,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE;QACvC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;QACrC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;QACnC,EAAE,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EA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AC,CAAC,MAAM,CAAC,KAAK,CAAC,EACtC,UAAU,QACV,GAAG,EAAE,eAAe,WACpB,WACU,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,oDAE3D,WACE,YACR,EACP,KAAC,oBAAoB,IACnB,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,EACvC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,wBAAwB,EAC9B,OAAO,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EACtE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EACrD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,EACpE,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,UAAU,EACzC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,WAC/B,EACF,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,YACzB,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,kCAAoB,WACtD,YACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useRef, useState, useCallback } from 'react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n TextArea,\n useAutoResize,\n useConsolidatedRef,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { EditorState } from '@pega/cosmos-react-rte';\nimport {\n DynamicContentEditor,\n DynamicContentEditorProps,\n ItemType\n} from '@pega/cosmos-react-build';\n\nimport FieldSelector, { FieldSelectorProps } from './FieldSelector';\n\nexport default {\n title: 'Build/DynamicContentEditor',\n component: DynamicContentEditor\n} as Meta;\n\nexport interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {}\n\nexport const DynamicContentEditorDemo = (args: DynamicContentEditorStoryProps) => {\n const [html, setHtml] = useState(\n '<p>Hi <pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"CustomerName\">CustomerName</pega-reference><p>please check this <a href=\"https://google.com\">link</a></p></p>'\n );\n const rteRef = useRef<EditorState>(null);\n\n const fieldItems: DynamicContentEditorProps['fieldItems'] = [\n { id: 'CustomerName', primary: 'CustomerName' },\n { id: 'Address', primary: 'Address' },\n { id: 'Locality', primary: 'Locality' },\n { id: 'Country', primary: 'Country' },\n { id: 'Region', primary: 'Region' },\n { id: 'Occupation', primary: 'Occupation' },\n { id: 'City', primary: 'City' },\n { id: 'Colony', primary: 'Colony' },\n { id: 'Lastname', primary: 'Lastname' },\n { id: 'Preference', primary: 'Preference' },\n { id: 'Currency', primary: 'Currency' },\n { id: 'Iconname', primary: 'Iconname' }\n ];\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n const [textAreaRef, resizeTextArea] = useAutoResize<HTMLTextAreaElement>(undefined, 100);\n const ref = useRef(null);\n const consolidatedRef = useConsolidatedRef(textAreaRef, ref);\n const handleShowHtml = () => {\n resizeTextArea();\n setHtml(rteRef.current?.getHtml() || '');\n };\n const t = useI18n();\n const [selectedField, setSelectedField] = useState<ItemType>({\n id: '',\n text: ''\n });\n\n const updateSelection: FieldSelectorProps['updateSelection'] = (selectedItem: ItemType) => {\n setSelectedField(selectedItem);\n };\n const onSubmit = useCallback(\n (insertField: (selectedField: ItemType) => void) => {\n insertField(selectedField);\n },\n [selectedField]\n );\n\n const dynamicContentPicker = (\n <Flex\n container={{\n gap: 2,\n direction: 'column'\n }}\n >\n <FieldSelector\n itemList={[\n { id: 'CustomerName', text: 'CustomerName' },\n { id: 'Address', text: 'Address' },\n { id: 'Locality', text: 'Locality' },\n { id: 'Country', text: 'Country' },\n { id: 'Region', text: 'Region' },\n { id: 'Occupation', text: 'Occupation' }\n ]}\n key={selectedField?.id}\n label='Field'\n updateSelection={updateSelection}\n placeholder={t('select')}\n defaultSelection={selectedField}\n />\n </Flex>\n );\n const onActiveFieldChange = (field: ItemType) => setSelectedField(field);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea\n value={html}\n onChange={e => setHtml(e.target.value)}\n autoResize\n ref={consolidatedRef}\n />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <DynamicContentEditor\n defaultValue={args.defaultValue || html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Dynamic content editor'\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n form={args.form || { onSubmit, dynamicContentPicker }}\n onActiveFieldChange={args.onActiveFieldChange || onActiveFieldChange}\n fieldItems={args.fieldItems || fieldItems}\n onBlur={action('Editor onBlur')}\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => handleShowHtml()}>Show HTML</Button>\n </Flex>\n </Flex>\n );\n};\n"]}
@@ -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,EAAE;gBACT;oBACE,KAAK,EAAE,SAAS;iBACjB;gBACD;oBACE,KAAK,EAAE,WAAW;iBACnB;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,WAAW;QACjB,aAAa,EAAE,CAAC;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,KAAK,EAAE,UAAU;aAClB;YACD,SAAS,EAAE;gBACT;oBACE,KAAK,EAAE,YAAY;iBACpB;gBACD;oBACE,KAAK,EAAE,YAAY;iBACpB;gBACD;oBACE,KAAK,EAAE,YAAY;iBACpB;aACF;SACF;KACF;IACD,UAAU,EAAE;QACV,EAAE,EAAE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AAU;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,aAAa,CAAC,UAAU;KAC/B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,aAAa,CAAC,OAAO;KAC5B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;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 { 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,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAmB,UAAU,CAAC,CAAC;IACzE,MAAM,OAAO,GACX,mFAAmF,CAAC;IACtF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAEnD,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,KAAK,GAAG,WAAW,CAAC;QAC1B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACnF,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,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AAI;KACzB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,YAAY;QACnB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC;QACE,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,aAAa,CAAC,UAAU;KAC/B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,aAAa,CAAC,OAAO;KAC5B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;QACf,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,EAAE,EAAE,SAAS,EAAE;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,O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MAAM,EAAE,CAAC,EAAE,CAAC;SACxC;aAAM;YACL,sCAAsC;YACtC,OAAO,CAAC,IAAI,CAAC,kBAAkB,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;SACnD;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,CAAC,QAAkB,EAAE,QAA8B,EAAE,EAAE;QACrE,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC;YAC7C,QAAQ;YACR,SAAS;YACT,QAAQ;SACT,CAAC,CAAC;QACH,IAAI,WAAW,EAAE;YACf,MAAM,YAAY,GAAyC,WAAW,CAAC;YACvE,YAAY,CAAC,YAAY,CAAC,CAAC;SAC5B;IACH,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,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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,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"}