@pega/cosmos-react-demos 3.0.0-dev.8.0 → 3.0.0-dev.9.0

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 (421) hide show
  1. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -3
  2. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  3. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  4. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +15 -15
  5. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  6. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx +49 -46
  7. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -1
  8. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +3 -4
  9. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  10. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +132 -58
  11. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  12. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -3
  13. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  14. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  15. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +5 -6
  16. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  17. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  18. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  19. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +7 -3
  20. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -1
  21. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +1 -2
  22. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  23. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +1 -1
  24. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  25. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +6 -0
  26. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  27. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +145 -2
  28. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -1
  29. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +4 -8
  30. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  31. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +5 -120
  32. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  33. package/jsx/core/Badges/Keyboard.stories.d.ts +6 -0
  34. package/jsx/core/Badges/Keyboard.stories.d.ts.map +1 -0
  35. package/jsx/core/Badges/Keyboard.stories.jsx +17 -0
  36. package/jsx/core/Badges/Keyboard.stories.jsx.map +1 -0
  37. package/jsx/core/Badges/Selection.stories.d.ts +2 -3
  38. package/jsx/core/Badges/Selection.stories.d.ts.map +1 -1
  39. package/jsx/core/Badges/Selection.stories.jsx.map +1 -1
  40. package/jsx/core/Badges/Tag.stories.d.ts +2 -3
  41. package/jsx/core/Badges/Tag.stories.d.ts.map +1 -1
  42. package/jsx/core/Badges/Tag.stories.jsx.map +1 -1
  43. package/jsx/core/Banner/Banner.stories.d.ts +7 -18
  44. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  45. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  46. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -4
  47. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  48. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx.map +1 -1
  49. package/jsx/core/Button/Button.stories.d.ts +2 -3
  50. package/jsx/core/Button/Button.stories.d.ts.map +1 -1
  51. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  52. package/jsx/core/Card/Card.stories.d.ts +1 -2
  53. package/jsx/core/Card/Card.stories.d.ts.map +1 -1
  54. package/jsx/core/Card/Card.stories.jsx.map +1 -1
  55. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts +3 -3
  56. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  57. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx.map +1 -1
  58. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts +1 -2
  59. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  60. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  61. package/jsx/core/Configuration/Configuration.stories.d.ts +2 -3
  62. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  63. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  64. package/jsx/core/CreditCard/CreditCard.stories.d.ts +3 -2
  65. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  66. package/jsx/core/CreditCard/CreditCard.stories.jsx +41 -6
  67. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -1
  68. package/jsx/core/Currency/Currency.stories.d.ts +2 -2
  69. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  70. package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
  71. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +6 -6
  72. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  73. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  74. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts +2 -2
  75. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  76. package/jsx/core/FieldValueList/FieldValueList.stories.jsx.map +1 -1
  77. package/jsx/core/Flex/FlexContainer.stories.d.ts +1 -2
  78. package/jsx/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  79. package/jsx/core/Flex/FlexContainer.stories.jsx.map +1 -1
  80. package/jsx/core/Grid/GridContainer.stories.d.ts +4 -5
  81. package/jsx/core/Grid/GridContainer.stories.d.ts.map +1 -1
  82. package/jsx/core/Grid/GridContainer.stories.jsx.map +1 -1
  83. package/jsx/core/Grid/GridItem.stories.d.ts +1 -2
  84. package/jsx/core/Grid/GridItem.stories.d.ts.map +1 -1
  85. package/jsx/core/Grid/GridItem.stories.jsx.map +1 -1
  86. package/jsx/core/Icon/Icon.stories.d.ts +5 -6
  87. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  88. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  89. package/jsx/core/Image/Image.stories.d.ts +2 -3
  90. package/jsx/core/Image/Image.stories.d.ts.map +1 -1
  91. package/jsx/core/Image/Image.stories.jsx.map +1 -1
  92. package/jsx/core/List/CommaSeparatedList.stories.d.ts +2 -2
  93. package/jsx/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  94. package/jsx/core/List/CommaSeparatedList.stories.jsx.map +1 -1
  95. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +3 -4
  96. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  97. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  98. package/jsx/core/MenuButton/MenuButton.stories.d.ts +6 -6
  99. package/jsx/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  100. package/jsx/core/MenuButton/MenuButton.stories.jsx.map +1 -1
  101. package/jsx/core/Modal/Modal.stories.d.ts +10 -5
  102. package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
  103. package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
  104. package/jsx/core/MultiStep/MultiStep.stories.d.ts +2 -3
  105. package/jsx/core/MultiStep/MultiStep.stories.d.ts.map +1 -1
  106. package/jsx/core/MultiStep/MultiStep.stories.jsx.map +1 -1
  107. package/jsx/core/Number/Number.stories.d.ts +6 -3
  108. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  109. package/jsx/core/Number/Number.stories.jsx +10 -4
  110. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  111. package/jsx/core/Phone/Phone.stories.d.ts.map +1 -1
  112. package/jsx/core/Phone/Phone.stories.jsx +3 -1
  113. package/jsx/core/Phone/Phone.stories.jsx.map +1 -1
  114. package/jsx/core/Popover/Popover.stories.d.ts +1 -1
  115. package/jsx/core/Popover/Popover.stories.d.ts.map +1 -1
  116. package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
  117. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -3
  118. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  119. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -1
  120. package/jsx/core/Slider/Slider.stories.d.ts +4 -3
  121. package/jsx/core/Slider/Slider.stories.d.ts.map +1 -1
  122. package/jsx/core/Slider/Slider.stories.jsx +1 -1
  123. package/jsx/core/Slider/Slider.stories.jsx.map +1 -1
  124. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts +5 -5
  125. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  126. package/jsx/core/SummaryItem/SummaryItem.stories.jsx.map +1 -1
  127. package/jsx/core/SummaryList/SummaryList.stories.d.ts +2 -2
  128. package/jsx/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  129. package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
  130. package/jsx/core/Tabs/Tabs.stories.d.ts +5 -2
  131. package/jsx/core/Tabs/Tabs.stories.d.ts.map +1 -1
  132. package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
  133. package/jsx/core/Toaster/Toaster.stories.d.ts +2 -3
  134. package/jsx/core/Toaster/Toaster.stories.d.ts.map +1 -1
  135. package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
  136. package/jsx/core/Tooltip/Tooltip.stories.d.ts +1 -2
  137. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  138. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  139. package/jsx/core/Tree/Tree.stories.d.ts +1 -2
  140. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  141. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  142. package/jsx/cs/Article/Article.stories.d.ts +3 -4
  143. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  144. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  145. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +3 -4
  146. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  147. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  148. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +3 -4
  149. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  150. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  151. package/jsx/rte/Editor/Editor.stories.d.ts +7 -8
  152. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  153. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  154. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +5 -5
  155. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  156. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +18 -1
  157. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
  158. package/jsx/social/Chat/Chat.stories.d.ts +6 -7
  159. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  160. package/jsx/social/Chat/Chat.stories.jsx +5 -3
  161. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  162. package/jsx/social/Email/Email.stories.d.ts +5 -11
  163. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  164. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  165. package/jsx/social/Feed/Feed.stories.d.ts +6 -11
  166. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  167. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  168. package/jsx/social/Feed/FeedNewPost.stories.d.ts +7 -14
  169. package/jsx/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  170. package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
  171. package/jsx/social/Feed/FeedPost.stories.d.ts +4 -5
  172. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  173. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  174. package/jsx/social/Feed/FeedReply.stories.d.ts +10 -10
  175. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  176. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  177. package/jsx/social/Feed/FeedReplyInput.stories.d.ts +7 -12
  178. package/jsx/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  179. package/jsx/social/Feed/FeedReplyInput.stories.jsx.map +1 -1
  180. package/jsx/work/CaseView/CaseView.stories.d.ts +4 -11
  181. package/jsx/work/CaseView/CaseView.stories.d.ts.map +1 -1
  182. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  183. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -3
  184. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  185. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  186. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -3
  187. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  188. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  189. package/jsx/work/Confirmation/Confirmation.stories.jsx +1 -1
  190. package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
  191. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +2 -3
  192. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  193. package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
  194. package/jsx/work/Tasks/Tasks.stories.jsx +1 -1
  195. package/jsx/work/Tasks/Tasks.stories.jsx.map +1 -1
  196. package/jsx/work/Timeline/Timeline.stories.d.ts +1 -2
  197. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  198. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  199. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -3
  200. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  201. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  202. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +15 -15
  203. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  204. package/lib/build/FlowModeller/FlowModeller.mocks.js +21 -34
  205. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  206. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +3 -4
  207. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  208. package/lib/build/FlowModeller/FlowModeller.stories.js +123 -54
  209. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  210. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -3
  211. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  212. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  213. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +5 -6
  214. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  215. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  216. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  217. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +7 -3
  218. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  219. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +1 -2
  220. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  221. package/lib/build/ObjectSelect/ObjectSelect.stories.js +1 -1
  222. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  223. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +6 -0
  224. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  225. package/lib/build/PageTemplates/PageTemplates.mocks.js +143 -2
  226. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -1
  227. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +4 -8
  228. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  229. package/lib/build/PageTemplates/PageTemplates.stories.js +5 -118
  230. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  231. package/lib/core/Badges/Keyboard.stories.d.ts +6 -0
  232. package/lib/core/Badges/Keyboard.stories.d.ts.map +1 -0
  233. package/lib/core/Badges/Keyboard.stories.js +16 -0
  234. package/lib/core/Badges/Keyboard.stories.js.map +1 -0
  235. package/lib/core/Badges/Selection.stories.d.ts +2 -3
  236. package/lib/core/Badges/Selection.stories.d.ts.map +1 -1
  237. package/lib/core/Badges/Selection.stories.js.map +1 -1
  238. package/lib/core/Badges/Tag.stories.d.ts +2 -3
  239. package/lib/core/Badges/Tag.stories.d.ts.map +1 -1
  240. package/lib/core/Badges/Tag.stories.js.map +1 -1
  241. package/lib/core/Banner/Banner.stories.d.ts +7 -18
  242. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  243. package/lib/core/Banner/Banner.stories.js.map +1 -1
  244. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -4
  245. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  246. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  247. package/lib/core/Button/Button.stories.d.ts +2 -3
  248. package/lib/core/Button/Button.stories.d.ts.map +1 -1
  249. package/lib/core/Button/Button.stories.js.map +1 -1
  250. package/lib/core/Card/Card.stories.d.ts +1 -2
  251. package/lib/core/Card/Card.stories.d.ts.map +1 -1
  252. package/lib/core/Card/Card.stories.js.map +1 -1
  253. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts +3 -3
  254. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  255. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  256. package/lib/core/ColorPicker/ColorPicker.stories.d.ts +1 -2
  257. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  258. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  259. package/lib/core/Configuration/Configuration.stories.d.ts +2 -3
  260. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  261. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  262. package/lib/core/CreditCard/CreditCard.stories.d.ts +3 -2
  263. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  264. package/lib/core/CreditCard/CreditCard.stories.js +41 -6
  265. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -1
  266. package/lib/core/Currency/Currency.stories.d.ts +2 -2
  267. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  268. package/lib/core/Currency/Currency.stories.js.map +1 -1
  269. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +6 -6
  270. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  271. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  272. package/lib/core/FieldValueList/FieldValueList.stories.d.ts +2 -2
  273. package/lib/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  274. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  275. package/lib/core/Flex/FlexContainer.stories.d.ts +1 -2
  276. package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  277. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  278. package/lib/core/Grid/GridContainer.stories.d.ts +4 -5
  279. package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -1
  280. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  281. package/lib/core/Grid/GridItem.stories.d.ts +1 -2
  282. package/lib/core/Grid/GridItem.stories.d.ts.map +1 -1
  283. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  284. package/lib/core/Icon/Icon.stories.d.ts +5 -6
  285. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  286. package/lib/core/Icon/Icon.stories.js.map +1 -1
  287. package/lib/core/Image/Image.stories.d.ts +2 -3
  288. package/lib/core/Image/Image.stories.d.ts.map +1 -1
  289. package/lib/core/Image/Image.stories.js.map +1 -1
  290. package/lib/core/List/CommaSeparatedList.stories.d.ts +2 -2
  291. package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  292. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  293. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +3 -4
  294. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  295. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  296. package/lib/core/MenuButton/MenuButton.stories.d.ts +6 -6
  297. package/lib/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  298. package/lib/core/MenuButton/MenuButton.stories.js.map +1 -1
  299. package/lib/core/Modal/Modal.stories.d.ts +10 -5
  300. package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
  301. package/lib/core/Modal/Modal.stories.js.map +1 -1
  302. package/lib/core/MultiStep/MultiStep.stories.d.ts +2 -3
  303. package/lib/core/MultiStep/MultiStep.stories.d.ts.map +1 -1
  304. package/lib/core/MultiStep/MultiStep.stories.js.map +1 -1
  305. package/lib/core/Number/Number.stories.d.ts +6 -3
  306. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  307. package/lib/core/Number/Number.stories.js +10 -4
  308. package/lib/core/Number/Number.stories.js.map +1 -1
  309. package/lib/core/Phone/Phone.stories.d.ts.map +1 -1
  310. package/lib/core/Phone/Phone.stories.js +3 -1
  311. package/lib/core/Phone/Phone.stories.js.map +1 -1
  312. package/lib/core/Popover/Popover.stories.d.ts +1 -1
  313. package/lib/core/Popover/Popover.stories.d.ts.map +1 -1
  314. package/lib/core/Popover/Popover.stories.js.map +1 -1
  315. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -3
  316. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  317. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  318. package/lib/core/Slider/Slider.stories.d.ts +4 -3
  319. package/lib/core/Slider/Slider.stories.d.ts.map +1 -1
  320. package/lib/core/Slider/Slider.stories.js +1 -1
  321. package/lib/core/Slider/Slider.stories.js.map +1 -1
  322. package/lib/core/SummaryItem/SummaryItem.stories.d.ts +5 -5
  323. package/lib/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  324. package/lib/core/SummaryItem/SummaryItem.stories.js.map +1 -1
  325. package/lib/core/SummaryList/SummaryList.stories.d.ts +2 -2
  326. package/lib/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  327. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  328. package/lib/core/Tabs/Tabs.stories.d.ts +5 -2
  329. package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -1
  330. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  331. package/lib/core/Toaster/Toaster.stories.d.ts +2 -3
  332. package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -1
  333. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  334. package/lib/core/Tooltip/Tooltip.stories.d.ts +1 -2
  335. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  336. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  337. package/lib/core/Tree/Tree.stories.d.ts +1 -2
  338. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  339. package/lib/core/Tree/Tree.stories.js.map +1 -1
  340. package/lib/cs/Article/Article.stories.d.ts +3 -4
  341. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  342. package/lib/cs/Article/Article.stories.js.map +1 -1
  343. package/lib/cs/ArticleList/ArticleList.stories.d.ts +3 -4
  344. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  345. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  346. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +3 -4
  347. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  348. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  349. package/lib/rte/Editor/Editor.stories.d.ts +7 -8
  350. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  351. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  352. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +5 -5
  353. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  354. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +14 -1
  355. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  356. package/lib/social/Chat/Chat.stories.d.ts +6 -7
  357. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  358. package/lib/social/Chat/Chat.stories.js +3 -3
  359. package/lib/social/Chat/Chat.stories.js.map +1 -1
  360. package/lib/social/Email/Email.stories.d.ts +5 -11
  361. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  362. package/lib/social/Email/Email.stories.js.map +1 -1
  363. package/lib/social/Feed/Feed.stories.d.ts +6 -11
  364. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  365. package/lib/social/Feed/Feed.stories.js.map +1 -1
  366. package/lib/social/Feed/FeedNewPost.stories.d.ts +7 -14
  367. package/lib/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  368. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  369. package/lib/social/Feed/FeedPost.stories.d.ts +4 -5
  370. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  371. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  372. package/lib/social/Feed/FeedReply.stories.d.ts +10 -10
  373. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  374. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  375. package/lib/social/Feed/FeedReplyInput.stories.d.ts +7 -12
  376. package/lib/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  377. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  378. package/lib/work/CaseView/CaseView.stories.d.ts +4 -11
  379. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -1
  380. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  381. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -3
  382. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  383. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  384. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -3
  385. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  386. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  387. package/lib/work/Confirmation/Confirmation.stories.js +1 -1
  388. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  389. package/lib/work/Stakeholders/Stakeholders.stories.d.ts +2 -3
  390. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  391. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  392. package/lib/work/Tasks/Tasks.stories.js +1 -1
  393. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  394. package/lib/work/Timeline/Timeline.stories.d.ts +1 -2
  395. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  396. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  397. package/package.json +9 -9
  398. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -4
  399. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  400. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx +0 -9
  401. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx.map +0 -1
  402. package/jsx/build/ObjectPreview/ObjectPreview.stories.d.ts +0 -8
  403. package/jsx/build/ObjectPreview/ObjectPreview.stories.d.ts.map +0 -1
  404. package/jsx/build/ObjectPreview/ObjectPreview.stories.jsx +0 -93
  405. package/jsx/build/ObjectPreview/ObjectPreview.stories.jsx.map +0 -1
  406. package/jsx/build/ObjectPreview/ObjectPreview.styles.d.ts +0 -3
  407. package/jsx/build/ObjectPreview/ObjectPreview.styles.d.ts.map +0 -1
  408. package/jsx/build/ObjectPreview/ObjectPreview.styles.js +0 -22
  409. package/jsx/build/ObjectPreview/ObjectPreview.styles.js.map +0 -1
  410. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -4
  411. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  412. package/lib/build/ObjectPreview/ObjectPreview.mocks.js +0 -8
  413. package/lib/build/ObjectPreview/ObjectPreview.mocks.js.map +0 -1
  414. package/lib/build/ObjectPreview/ObjectPreview.stories.d.ts +0 -8
  415. package/lib/build/ObjectPreview/ObjectPreview.stories.d.ts.map +0 -1
  416. package/lib/build/ObjectPreview/ObjectPreview.stories.js +0 -90
  417. package/lib/build/ObjectPreview/ObjectPreview.stories.js.map +0 -1
  418. package/lib/build/ObjectPreview/ObjectPreview.styles.d.ts +0 -3
  419. package/lib/build/ObjectPreview/ObjectPreview.styles.d.ts.map +0 -1
  420. package/lib/build/ObjectPreview/ObjectPreview.styles.js +0 -22
  421. package/lib/build/ObjectPreview/ObjectPreview.styles.js.map +0 -1
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
1
+ import { Meta, Story } from '@storybook/react';
3
2
  import { DynamicContentEditorProps } from '@pega/cosmos-react-build';
4
3
  declare const _default: Meta<import("@storybook/react").Args>;
5
4
  export default _default;
6
5
  export interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {
7
6
  }
8
- export declare const DynamicContentEditorDemo: (args: DynamicContentEditorStoryProps) => JSX.Element;
7
+ export declare const DynamicContentEditorDemo: Story<DynamicContentEditorStoryProps>;
9
8
  //# 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;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
+ {"version":3,"file":"DynamicContentEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/build/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAgB/C,OAAO,EAEL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;;AAIlC,wBAGU;AAEV,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;CAAG;AAEpF,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,8BAA8B,CA6G1E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.stories.jsx","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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I,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,oBAAoB,CACnB,YAAY,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,CACxC,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,wBAAwB,CAC9B,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CACvE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC,CACtD,mBAAmB,CAAC,CAAC,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,CACrE,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,CAC1C,MAAM,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAElC;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC1B;QAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,CAC5D;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,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
+ {"version":3,"file":"DynamicContentEditor.stories.jsx","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;AAEj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AAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,oBAAoB,CACnB,YAAY,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,CACxC,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,wBAAwB,CAC9B,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CACvE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC,CACtD,mBAAmB,CAAC,CAAC,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,CACrE,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,CAC1C,MAAM,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAElC;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC1B;QAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,CAC5D;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } 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: Story<DynamicContentEditorStoryProps> = (\n args: DynamicContentEditorStoryProps\n) => {\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,21 +1,21 @@
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;
1
+ import { FC } from 'react';
2
+ import { Action, ForwardProps } from '@pega/cosmos-react-core';
3
+ import { NodeProps, ConnectorProps, NodeLibraryItem, DeleteNodeOutcome, GraphData } from '@pega/cosmos-react-build';
4
+ interface DecisionTableProps {
5
+ updatedData: GraphData<NodeProps, ConnectorProps>;
15
6
  connectors: ConnectorProps[];
16
7
  node: NodeProps;
8
+ onDeleteRow: (data: GraphData<NodeProps, ConnectorProps>, deleteItems?: DeleteNodeOutcome['deletes'], e?: MouseEvent) => void;
9
+ onAddRow: (data: GraphData<NodeProps, ConnectorProps>) => void;
10
+ }
11
+ interface DeletePopoverProps {
12
+ targetId: string | null;
13
+ showPopover: boolean;
14
+ onCancel: () => void;
15
+ onDelete: () => void;
17
16
  }
18
- export declare const DecisionTable: ({ updatedData, connectors, onDeleteRow, onAddRow, node, update }: DecisionTableProps) => JSX.Element;
17
+ export declare const DecisionTable: FC<DecisionTableProps & ForwardProps>;
18
+ export declare const DeletePopover: FC<DeletePopoverProps & ForwardProps>;
19
19
  export declare const exampleCRMNodesData: NodeProps[];
20
20
  export declare const exampleCRMConnectorsData: ConnectorProps[];
21
21
  export declare const emptyNodesData: NodeProps[];
@@ -1 +1 @@
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,EAA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IAAI,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CA4D/D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CAsC/D,CAAC;AAsGF,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,41 +1,17 @@
1
- import { useContext, useState, useEffect } from 'react';
2
- import { Input, Modal, ModalManagerContext, Table, Text, Button, Icon, Flex, createUID } from '@pega/cosmos-react-core';
3
- import { DirectedGraph, FlowModellerHelper, START_NODETYPE, STOP_NODETYPE } from '@pega/cosmos-react-build';
4
- export const DecisionTable = ({ updatedData, connectors, onDeleteRow, onAddRow, node, update }) => {
1
+ import { useState, useEffect, forwardRef } from 'react';
2
+ import { Input, Table, Text, Button, Icon, Flex, createUID, Card, CardContent, CardHeader, useI18n, Popover, CardFooter } from '@pega/cosmos-react-core';
3
+ import { FlowModellerHelper, START_NODETYPE, STOP_NODETYPE } from '@pega/cosmos-react-build';
4
+ export const DecisionTable = forwardRef(({ updatedData, connectors, onDeleteRow, onAddRow, node }, ref) => {
5
5
  const [tableData, setTableData] = useState(connectors);
6
- const message = 'Please delete the nodes in the connector manually and delete this connector again';
7
- const { create } = useContext(ModalManagerContext);
6
+ const t = useI18n();
8
7
  const onAddCondition = () => {
9
8
  const label = 'otherwise';
10
- const updatedGraphData = FlowModellerHelper.addBranch(updatedData, node.id, label);
11
- const graph = new DirectedGraph(updatedGraphData);
12
- const outConnectors = graph.getOutConnectors(node.id);
13
- update({
14
- node,
15
- connectors: outConnectors,
16
- updatedData: updatedGraphData
17
- });
9
+ const updatedGraphData = FlowModellerHelper.addConnector(updatedData, node.id, label);
18
10
  onAddRow(updatedGraphData);
19
11
  };
20
- const onDeleteCondition = (connector) => {
12
+ const onDeleteCondition = (connector, e) => {
21
13
  const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);
22
- if (updatedGraphData) {
23
- const updatedGraph = new DirectedGraph(updatedGraphData);
24
- const updatedOutConnectors = updatedGraph.getOutConnectors(node.id);
25
- update({
26
- node,
27
- connectors: updatedOutConnectors,
28
- updatedData: updatedGraphData
29
- });
30
- onDeleteRow(updatedGraphData);
31
- }
32
- else {
33
- create(() => {
34
- return (<Modal heading='Confirm'>
35
- <Text>{message}</Text>
36
- </Modal>);
37
- }, { center: true });
38
- }
14
+ onDeleteRow(updatedGraphData.graphData, updatedGraphData.deletes, e);
39
15
  };
40
16
  const columns = [
41
17
  {
@@ -45,13 +21,9 @@ export const DecisionTable = ({ updatedData, connectors, onDeleteRow, onAddRow,
45
21
  { renderer: () => <Text>No value</Text>, label: 'Decision output' },
46
22
  {
47
23
  renderer: connector => {
48
- return (<>
49
- <Button variant='simple' label='Delete' disabled={tableData.length < 3} icon onClick={() => {
50
- onDeleteCondition(connector);
51
- }}>
24
+ return (<Button variant='simple' ref={ref} disabled={connectors.length < 3} id={connector.id} icon onClick={(e) => onDeleteCondition(connector, e)} label={t('delete')}>
52
25
  <Icon name='trash'/>
53
- </Button>
54
- </>);
26
+ </Button>);
55
27
  },
56
28
  label: 'Action'
57
29
  }
@@ -60,14 +32,45 @@ export const DecisionTable = ({ updatedData, connectors, onDeleteRow, onAddRow,
60
32
  setTableData(connectors);
61
33
  }, [connectors]);
62
34
  return (<>
63
- <Table title='Decision outcomes' hoverHighlight data={tableData} columns={columns}/>
64
- <Flex container={{ pad: [1, 0] }}>
65
- <Button variant='simple' onClick={onAddCondition}>
66
- Add Condition
67
- </Button>
68
- </Flex>
69
- </>);
70
- };
35
+ <Table title='Decision outcomes' hoverHighlight data={tableData} columns={columns}/>
36
+ <Flex container={{ pad: [1, 0] }}>
37
+ <Button variant='simple' onClick={onAddCondition}>
38
+ Add Condition
39
+ </Button>
40
+ </Flex>
41
+ </>);
42
+ });
43
+ export const DeletePopover = forwardRef(({ targetId, showPopover, onCancel, onDelete }, ref) => {
44
+ const [elementTarget, setElementTarget] = useState();
45
+ const t = useI18n();
46
+ useEffect(() => {
47
+ const element = document.querySelector(`button[id='${targetId}']`);
48
+ if (element) {
49
+ setElementTarget(element);
50
+ }
51
+ });
52
+ return (<>
53
+ {elementTarget && showPopover && (<Popover target={elementTarget} ref={ref} show={showPopover}>
54
+ <Card>
55
+ <CardHeader>
56
+ <Text variant='h4'>Delete Outcome</Text>
57
+ <Button variant='simple' icon label={t('close')} onClick={onCancel}>
58
+ <Icon name='times'/>
59
+ </Button>
60
+ </CardHeader>
61
+ <CardContent>
62
+ Are you sure you want to delete this outcome and all its steps?
63
+ </CardContent>
64
+ <CardFooter container={{ justify: 'between' }}>
65
+ <Button onClick={onCancel}>Cancel</Button>
66
+ <Button variant='primary' onClick={onDelete}>
67
+ Delete
68
+ </Button>
69
+ </CardFooter>
70
+ </Card>
71
+ </Popover>)}
72
+ </>);
73
+ });
71
74
  const FlowShapeType = Object.freeze({
72
75
  START: START_NODETYPE,
73
76
  STOP: STOP_NODETYPE,
@@ -1 +1 @@
1
- {"version":3,"file":"FlowModeller.mocks.jsx","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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AAW,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: 'darkYellow',\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: 'japaneseLaurel',\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: 'japaneseLaurel',\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: '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: 'yellow',\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: 'congressBlue',\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
+ {"version":3,"file":"FlowModeller.mocks.jsx","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAO,UAAU,EAAM,MAAM,OAAO,CAAC;AAEjE,OAAO,EACL,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EAGT,IAAI,EACJ,WAAW,EACX,UAAU,EACV,OAAO,EACP,OAAO,EACP,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,kBAAkB,EAIlB,cAAc,EACd,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAoBlC,MAAM,CAAC,MAAM,aAAa,GAA0C,UAAU,CAC5E,CACE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAsB,EAC5E,GAA2B,EAC3B,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAmB,UAAU,CAAC,CAAC;IACzE,MAAM,CAAC,GAAG,OAAO,EAA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,YAAY;aACjC;SACF;KACF;CACF,CAAC","sourcesContent":["import { useState, useEffect, Ref, forwardRef, FC } from 'react';\n\nimport {\n Input,\n Table,\n ColumnProps,\n Text,\n Button,\n Icon,\n Flex,\n createUID,\n Action,\n ForwardProps,\n Card,\n CardContent,\n CardHeader,\n useI18n,\n Popover,\n CardFooter\n} from '@pega/cosmos-react-core';\nimport {\n NodeProps,\n ConnectorProps,\n FlowModellerHelper,\n NodeType,\n NodeLibraryItem,\n DeleteNodeOutcome,\n START_NODETYPE,\n STOP_NODETYPE,\n GraphData\n} from '@pega/cosmos-react-build';\n\ninterface DecisionTableProps {\n updatedData: GraphData<NodeProps, ConnectorProps>;\n connectors: ConnectorProps[];\n node: NodeProps;\n onDeleteRow: (\n data: GraphData<NodeProps, ConnectorProps>,\n deleteItems?: DeleteNodeOutcome['deletes'],\n e?: MouseEvent\n ) => void;\n onAddRow: (data: GraphData<NodeProps, ConnectorProps>) => void;\n}\ninterface DeletePopoverProps {\n targetId: string | null;\n showPopover: boolean;\n onCancel: () => void;\n onDelete: () => void;\n}\n\nexport const DecisionTable: FC<DecisionTableProps & ForwardProps> = forwardRef(\n (\n { updatedData, connectors, onDeleteRow, onAddRow, node }: DecisionTableProps,\n ref: Ref<HTMLButtonElement>\n ) => {\n const [tableData, setTableData] = useState<ConnectorProps[]>(connectors);\n const t = useI18n();\n\n const onAddCondition = () => {\n const label = 'otherwise';\n const updatedGraphData = FlowModellerHelper.addConnector(updatedData, node.id, label);\n onAddRow(updatedGraphData);\n };\n\n const onDeleteCondition = (connector: ConnectorProps, e: MouseEvent) => {\n const updatedGraphData = FlowModellerHelper.deleteConnector(updatedData, connector);\n onDeleteRow(updatedGraphData!.graphData, updatedGraphData!.deletes, e);\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 <Button\n variant='simple'\n ref={ref}\n disabled={connectors.length < 3}\n id={connector.id}\n icon\n onClick={(e: MouseEvent) => onDeleteCondition(connector, e)}\n label={t('delete')}\n >\n <Icon name='trash' />\n </Button>\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);\n\nexport const DeletePopover: FC<DeletePopoverProps & ForwardProps> = forwardRef(\n ({ targetId, showPopover, onCancel, onDelete }, ref: Ref<HTMLDivElement>) => {\n const [elementTarget, setElementTarget] = useState<Element>();\n const t = useI18n();\n\n useEffect(() => {\n const element = document.querySelector(`button[id='${targetId}']`);\n if (element) {\n setElementTarget(element);\n }\n });\n\n return (\n <>\n {elementTarget && showPopover && (\n <Popover target={elementTarget} ref={ref} show={showPopover}>\n <Card>\n <CardHeader>\n <Text variant='h4'>Delete Outcome</Text>\n <Button variant='simple' icon label={t('close')} onClick={onCancel}>\n <Icon name='times' />\n </Button>\n </CardHeader>\n <CardContent>\n Are you sure you want to delete this outcome and all its steps?\n </CardContent>\n <CardFooter container={{ justify: 'between' }}>\n <Button onClick={onCancel}>Cancel</Button>\n <Button variant='primary' onClick={onDelete}>\n Delete\n </Button>\n </CardFooter>\n </Card>\n </Popover>\n )}\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: 'darkYellow',\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: 'japaneseLaurel',\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: 'japaneseLaurel',\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: '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: 'yellow',\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: 'congressBlue',\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,7 +1,6 @@
1
- /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
1
+ import { Meta, Story } from '@storybook/react';
3
2
  declare const _default: Meta<import("@storybook/react").Args>;
4
3
  export default _default;
5
- export declare const EmptyFlowChartView: () => JSX.Element;
6
- export declare const CRMFlowChartView: () => JSX.Element;
4
+ export declare const EmptyFlowChartView: Story;
5
+ export declare const CRMFlowChartView: Story;
7
6
  //# sourceMappingURL=FlowModeller.stories.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"FlowModeller.stories.d.ts","sourceRoot":"","sources":["../../../src/build/FlowModeller/FlowModeller.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AA8B/C,wBAMU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAyIhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAyI9B,CAAC"}
@@ -1,8 +1,8 @@
1
- import { useContext, useState } from 'react';
1
+ import { memo, useState } from 'react';
2
2
  import { action } from '@storybook/addon-actions';
3
- import { ModalManagerContext, Modal, Input } from '@pega/cosmos-react-core';
4
- import { FlowModeller, DirectedGraph, FlowModellerHelper } from '@pega/cosmos-react-build';
5
- import { nodeLibrary, nodeActions, exampleCRMNodesData, exampleCRMConnectorsData, emptyNodesData, emptyConnectorsData, DecisionTable } from './FlowModeller.mocks';
3
+ import { FlowModeller, DirectedGraph, FlowModellerHelper, Workbench } from '@pega/cosmos-react-build';
4
+ import { useOuterEvent, useEscape, useElement } from '@pega/cosmos-react-core';
5
+ import { nodeLibrary, nodeActions, exampleCRMNodesData, exampleCRMConnectorsData, emptyNodesData, emptyConnectorsData, DecisionTable, DeletePopover } from './FlowModeller.mocks';
6
6
  import { StyledWrapper } from './FlowModeller.styles';
7
7
  export default {
8
8
  title: 'Build/FlowModeller',
@@ -16,21 +16,22 @@ export const EmptyFlowChartView = () => {
16
16
  nodes: emptyNodesData,
17
17
  connectors: emptyConnectorsData
18
18
  });
19
- const { create } = useContext(ModalManagerContext);
20
- const onTableActionClick = (updatedData) => {
21
- setGraphData(updatedData);
22
- };
23
- const LaunchPropertyModal = ({ node, connectors, updatedData }) => {
24
- const { ModalContext } = useContext(ModalManagerContext);
25
- const { update } = useContext(ModalContext);
26
- return (<Modal heading={node.label}>
27
- <Input label='Description' defaultValue={node.description}/>
28
- {connectors.length > 1 && (<DecisionTable updatedData={updatedData} connectors={connectors} onDeleteRow={(data) => {
29
- onTableActionClick(data);
30
- }} node={node} onAddRow={(data) => {
31
- onTableActionClick(data);
32
- }} update={update}/>)}
33
- </Modal>);
19
+ const [highlightItems, setHighlightItems] = useState();
20
+ const [open, setOpen] = useState(false);
21
+ const [nodeData, setNodeData] = useState();
22
+ const [showPopover, setPopover] = useState(false);
23
+ const [buffer, setBuffer] = useState();
24
+ const [target, setTarget] = useState(null);
25
+ const [deletePopoverEl, setDeletePopoverEl] = useElement(null);
26
+ const selectNode = (nodeId) => {
27
+ const graph = new DirectedGraph(graphData);
28
+ const selectedNode = graph.getNode(nodeId);
29
+ const outConnectors = graph.getOutConnectors(nodeId);
30
+ setOpen(true);
31
+ setNodeData({
32
+ nodes: [selectedNode],
33
+ connectors: outConnectors
34
+ });
34
35
  };
35
36
  const onNodeActionClick = (params) => {
36
37
  if (params.actionId === 'action-2') {
@@ -47,25 +48,61 @@ export const EmptyFlowChartView = () => {
47
48
  metaData
48
49
  });
49
50
  if (UpdatedData) {
50
- const newGraphData = UpdatedData;
51
- setGraphData(newGraphData);
51
+ setGraphData(UpdatedData);
52
52
  }
53
53
  };
54
54
  const deleteNode = (params) => {
55
55
  setGraphData(params.additionalData?.graphData);
56
56
  };
57
- const selectNode = (nodeId) => {
58
- const graph = new DirectedGraph(graphData);
59
- const node = graph.getNode(nodeId);
60
- const outConnectors = graph.getOutConnectors(nodeId);
61
- create(LaunchPropertyModal, {
62
- node,
63
- connectors: outConnectors,
64
- updatedData: graphData
65
- });
57
+ const onAddRow = (updatedData) => {
58
+ const graph = new DirectedGraph(updatedData);
59
+ const outConnectors = graph.getOutConnectors(nodeData.nodes[0].id);
60
+ setNodeData({ nodes: nodeData.nodes, connectors: outConnectors });
61
+ setGraphData(updatedData);
62
+ };
63
+ const onDeleteRow = (updatedData, highlightsData, e) => {
64
+ setHighlightItems(highlightsData);
65
+ setPopover(!showPopover);
66
+ setBuffer(updatedData);
67
+ if (e?.target instanceof Element) {
68
+ const targetElem = e.target;
69
+ setTarget(targetElem?.getAttribute('id'));
70
+ }
66
71
  };
72
+ const onDelete = () => {
73
+ setHighlightItems(undefined);
74
+ const graph = new DirectedGraph(buffer);
75
+ const outConnectors = graph.getOutConnectors(nodeData.nodes[0].id);
76
+ setNodeData({ nodes: nodeData.nodes, connectors: outConnectors });
77
+ if (buffer)
78
+ setGraphData(buffer);
79
+ setPopover(false);
80
+ };
81
+ const onCancel = () => {
82
+ setHighlightItems(undefined);
83
+ setPopover(false);
84
+ };
85
+ const WorkbenchContent = memo(() => {
86
+ return (<>
87
+ {nodeData && (<DecisionTable updatedData={graphData} connectors={nodeData?.connectors} onDeleteRow={onDeleteRow} node={nodeData?.nodes[0]} onAddRow={onAddRow}/>)}
88
+ </>);
89
+ });
90
+ useEscape(() => {
91
+ onCancel();
92
+ });
93
+ useOuterEvent('mousedown', [deletePopoverEl], onCancel);
67
94
  return (<StyledWrapper>
68
- <FlowModeller graphData={graphData} nodeLibrary={nodeLibrary} onNodeAdd={addNode} onNodeClick={selectNode} actions={nodeActions} onNodeActionClick={onNodeActionClick} onDelete={deleteNode}/>
95
+ <Workbench initiallyVisiblePanelId={undefined} configurationPanel={{
96
+ open,
97
+ content: <WorkbenchContent />,
98
+ header: nodeData?.nodes[0].label,
99
+ onDismiss: () => {
100
+ setOpen(false);
101
+ }
102
+ }}>
103
+ <FlowModeller graphData={graphData} nodeLibrary={nodeLibrary} onNodeAdd={addNode} onNodeClick={selectNode} actions={nodeActions} highlightData={highlightItems} onNodeActionClick={onNodeActionClick} onDelete={deleteNode}/>
104
+ <DeletePopover targetId={target} ref={setDeletePopoverEl} onDelete={onDelete} onCancel={onCancel} showPopover={showPopover}/>
105
+ </Workbench>
69
106
  </StyledWrapper>);
70
107
  };
71
108
  export const CRMFlowChartView = () => {
@@ -73,21 +110,22 @@ export const CRMFlowChartView = () => {
73
110
  nodes: exampleCRMNodesData,
74
111
  connectors: exampleCRMConnectorsData
75
112
  });
76
- const { create } = useContext(ModalManagerContext);
77
- const onTableActionClick = (updatedData) => {
78
- setGraphData(updatedData);
79
- };
80
- const LaunchPropertyModal = ({ node, connectors, updatedData }) => {
81
- const { ModalContext } = useContext(ModalManagerContext);
82
- const { update } = useContext(ModalContext);
83
- return (<Modal heading={node.label}>
84
- <Input label='Description' defaultValue={node.description}/>
85
- {connectors.length > 1 && (<DecisionTable updatedData={updatedData} connectors={connectors} onDeleteRow={(data) => {
86
- onTableActionClick(data);
87
- }} node={node} onAddRow={(data) => {
88
- onTableActionClick(data);
89
- }} update={update}/>)}
90
- </Modal>);
113
+ const [highlightItems, setHighlightItems] = useState();
114
+ const [open, setOpen] = useState(false);
115
+ const [nodeData, setNodeData] = useState();
116
+ const [showPopover, setPopover] = useState(false);
117
+ const [buffer, setBuffer] = useState();
118
+ const [target, setTarget] = useState(null);
119
+ const [deletePopoverEl, setDeletePopoverEl] = useElement(null);
120
+ const selectNode = (nodeId) => {
121
+ const graph = new DirectedGraph(graphData);
122
+ const selectedNode = graph.getNode(nodeId);
123
+ const outConnectors = graph.getOutConnectors(nodeId);
124
+ setOpen(true);
125
+ setNodeData({
126
+ nodes: [selectedNode],
127
+ connectors: outConnectors
128
+ });
91
129
  };
92
130
  const onNodeActionClick = (params) => {
93
131
  if (params.actionId === 'action-2') {
@@ -104,25 +142,61 @@ export const CRMFlowChartView = () => {
104
142
  metaData
105
143
  });
106
144
  if (UpdatedData) {
107
- const newGraphData = UpdatedData;
108
- setGraphData(newGraphData);
145
+ setGraphData(UpdatedData);
109
146
  }
110
147
  };
111
148
  const deleteNode = (params) => {
112
149
  setGraphData(params.additionalData?.graphData);
113
150
  };
114
- const selectNode = (nodeId) => {
115
- const graph = new DirectedGraph(graphData);
116
- const node = graph.getNode(nodeId);
117
- const outConnectors = graph.getOutConnectors(nodeId);
118
- create(LaunchPropertyModal, {
119
- node,
120
- connectors: outConnectors,
121
- updatedData: graphData
122
- });
151
+ const onAddRow = (updatedData) => {
152
+ const graph = new DirectedGraph(updatedData);
153
+ const outConnectors = graph.getOutConnectors(nodeData.nodes[0].id);
154
+ setNodeData({ nodes: nodeData.nodes, connectors: outConnectors });
155
+ setGraphData(updatedData);
156
+ };
157
+ const onDeleteRow = (updatedData, highlightsData, e) => {
158
+ setHighlightItems(highlightsData);
159
+ setPopover(!showPopover);
160
+ setBuffer(updatedData);
161
+ if (e?.target instanceof Element) {
162
+ const targetElem = e.target;
163
+ setTarget(targetElem?.getAttribute('id'));
164
+ }
123
165
  };
166
+ const onDelete = () => {
167
+ setPopover(false);
168
+ setHighlightItems(undefined);
169
+ const graph = new DirectedGraph(buffer);
170
+ const outConnectors = graph.getOutConnectors(nodeData.nodes[0].id);
171
+ setNodeData({ nodes: nodeData.nodes, connectors: outConnectors });
172
+ if (buffer)
173
+ setGraphData(buffer);
174
+ };
175
+ const onCancel = () => {
176
+ setHighlightItems(undefined);
177
+ setPopover(false);
178
+ };
179
+ const WorkbenchContent = memo(() => {
180
+ return (<>
181
+ {nodeData && (<DecisionTable updatedData={graphData} connectors={nodeData?.connectors} onDeleteRow={onDeleteRow} node={nodeData?.nodes[0]} onAddRow={onAddRow}/>)}
182
+ </>);
183
+ });
184
+ useEscape(() => {
185
+ onCancel();
186
+ });
187
+ useOuterEvent('mousedown', [deletePopoverEl], onCancel);
124
188
  return (<StyledWrapper>
125
- <FlowModeller graphData={graphData} nodeLibrary={nodeLibrary} onNodeAdd={addNode} onNodeClick={selectNode} actions={nodeActions} onNodeActionClick={onNodeActionClick} onDelete={deleteNode}/>
189
+ <Workbench initiallyVisiblePanelId={undefined} configurationPanel={{
190
+ open,
191
+ content: <WorkbenchContent />,
192
+ header: nodeData?.nodes[0].label,
193
+ onDismiss: () => {
194
+ setOpen(false);
195
+ }
196
+ }}>
197
+ <FlowModeller graphData={graphData} nodeLibrary={nodeLibrary} onNodeAdd={addNode} onNodeClick={selectNode} actions={nodeActions} highlightData={highlightItems} onNodeActionClick={onNodeActionClick} onDelete={deleteNode}/>
198
+ <DeletePopover targetId={target} ref={setDeletePopoverEl} onDelete={onDelete} onCancel={onCancel} showPopover={showPopover}/>
199
+ </Workbench>
126
200
  </StyledWrapper>);
127
201
  };
128
202
  //# sourceMappingURL=FlowModeller.stories.jsx.map