@pega/cosmos-react-demos 3.0.0-dev.4.1 → 3.0.0-dev.6.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 (753) hide show
  1. package/jsx/build/AppShell/AppShell.mocks.d.ts +17 -0
  2. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  3. package/jsx/build/AppShell/AppShell.mocks.js +15 -0
  4. package/jsx/build/AppShell/AppShell.mocks.js.map +1 -1
  5. package/jsx/build/AppShell/AppShell.stories.d.ts +2 -0
  6. package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
  7. package/jsx/build/AppShell/AppShell.stories.jsx +2 -17
  8. package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
  9. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  10. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +2 -1
  11. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  12. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  13. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  14. package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +77 -13
  15. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
  16. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  17. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  18. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
  19. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  20. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  21. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  22. package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
  23. package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  24. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +1 -5
  25. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -1
  26. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +5 -10
  27. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -1
  28. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  29. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  30. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  31. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts +3 -0
  32. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  33. package/jsx/build/LifeCycle/LifeCycle.mocks.js +106 -18
  34. package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  35. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  36. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  37. package/jsx/build/LifeCycle/LifeCycle.stories.jsx +111 -27
  38. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  39. package/jsx/build/LifeCycle/utils.d.ts.map +1 -1
  40. package/jsx/build/LifeCycle/utils.js +5 -4
  41. package/jsx/build/LifeCycle/utils.js.map +1 -1
  42. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  43. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  44. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
  45. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
  46. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  47. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  48. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +5 -180
  49. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  50. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  51. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  52. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
  53. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
  54. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  55. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  56. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
  57. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
  58. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  59. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  60. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
  61. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
  62. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  63. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  64. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
  65. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  66. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  67. package/jsx/build/Workbench/Workbench.stories.jsx +1 -9
  68. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  69. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  70. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  71. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  72. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  73. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  74. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  75. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
  76. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
  77. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  78. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  79. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  80. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  81. package/jsx/core/Button/Button.stories.jsx +6 -6
  82. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  83. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  84. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
  85. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  86. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  87. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  88. package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
  89. package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  90. package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
  91. package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  92. package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
  93. package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
  94. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  95. package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
  96. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  97. package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
  98. package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
  99. package/jsx/core/Configuration/Configuration.styles.js +12 -0
  100. package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
  101. package/jsx/core/CreditCard/CreditCard.stories.d.ts +10 -0
  102. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -0
  103. package/jsx/core/CreditCard/CreditCard.stories.jsx +10 -0
  104. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -0
  105. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  106. package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
  107. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  108. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  109. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  110. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +69 -1
  111. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  112. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  113. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +2 -70
  114. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  115. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
  116. package/jsx/core/HTML/HTML.stories.jsx +1 -1
  117. package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
  118. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  119. package/jsx/core/Icon/Icon.stories.jsx +5 -27
  120. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  121. package/jsx/core/Icon/Icon.styles.d.ts +4 -0
  122. package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
  123. package/jsx/core/Icon/Icon.styles.js +25 -0
  124. package/jsx/core/Icon/Icon.styles.js.map +1 -0
  125. package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
  126. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  127. package/jsx/core/Link/Link.stories.d.ts +1 -11
  128. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  129. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  130. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  131. package/jsx/core/Number/Number.stories.jsx +2 -0
  132. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  133. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  134. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
  135. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  136. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  137. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  138. package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
  139. package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  140. package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
  141. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  142. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  143. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  144. package/jsx/core/Tree/Tree.stories.jsx +2 -2
  145. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  146. package/jsx/cs/Article/Article.stories.d.ts +2 -10
  147. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  148. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  149. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  150. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  151. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  152. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  153. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  154. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
  155. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  156. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  157. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  158. package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
  159. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
  160. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  161. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  162. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
  163. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  164. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  165. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  166. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
  167. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  168. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  169. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  170. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
  171. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  172. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  173. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  174. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  175. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  176. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  177. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  178. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
  179. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  180. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  181. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  182. package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
  183. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  184. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  185. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  186. package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
  187. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  188. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  189. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  190. package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
  191. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
  192. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  193. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  194. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
  195. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
  196. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  197. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  198. package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
  199. package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
  200. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  201. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  202. package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
  203. package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  204. package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
  205. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
  206. package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
  207. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
  208. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  209. package/jsx/rte/Editor/Editor.stories.jsx +1 -19
  210. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  211. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.jsx.map +1 -1
  212. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  213. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  214. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  215. package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
  216. package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  217. package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
  218. package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
  219. package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
  220. package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  221. package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
  222. package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
  223. package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
  224. package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  225. package/jsx/social/Chat/RepeatingView.styles.js +22 -0
  226. package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
  227. package/jsx/social/Email/Email.mocks.d.ts +155 -2
  228. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  229. package/jsx/social/Email/Email.mocks.jsx +766 -0
  230. package/jsx/social/Email/Email.mocks.jsx.map +1 -0
  231. package/jsx/social/Email/Email.stories.d.ts +14 -14
  232. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  233. package/jsx/social/Email/Email.stories.jsx +108 -435
  234. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  235. package/jsx/social/Email/Email.styles.d.ts +4 -0
  236. package/jsx/social/Email/Email.styles.d.ts.map +1 -0
  237. package/jsx/social/Email/Email.styles.js +14 -0
  238. package/jsx/social/Email/Email.styles.js.map +1 -0
  239. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  240. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  241. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  242. package/jsx/social/Feed/Feed.stories.jsx +23 -18
  243. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  244. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  245. package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
  246. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  247. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  248. package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
  249. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  250. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  251. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  252. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  253. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  254. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  255. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
  256. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
  257. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  258. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  259. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
  260. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  261. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  262. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  263. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  264. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  265. package/jsx/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  266. package/jsx/work/Glimpse/Glimpse.stories.jsx.map +1 -1
  267. package/lib/build/AppHeader/AppHeader.stories.js +1 -1
  268. package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
  269. package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
  270. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  271. package/lib/build/AppShell/AppShell.mocks.js +16 -0
  272. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  273. package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
  274. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  275. package/lib/build/AppShell/AppShell.stories.js +7 -22
  276. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  277. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  278. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +3 -2
  279. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  280. package/lib/build/DynamicContentEditor/FieldSelector.js +1 -1
  281. package/lib/build/DynamicContentEditor/FieldSelector.js.map +1 -1
  282. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  283. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  284. package/lib/build/FlowModeller/FlowModeller.mocks.js +64 -12
  285. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  286. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  287. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  288. package/lib/build/FlowModeller/FlowModeller.stories.js +19 -94
  289. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  290. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  291. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  292. package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
  293. package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  294. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +1 -5
  295. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -1
  296. package/lib/build/ItemLibrary/LibraryPicker.mocks.js +5 -10
  297. package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -1
  298. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  299. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  300. package/lib/build/ItemLibrary/LibraryPicker.stories.js +1 -1
  301. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  302. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +3 -0
  303. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  304. package/lib/build/LifeCycle/LifeCycle.mocks.js +106 -18
  305. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  306. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  307. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  308. package/lib/build/LifeCycle/LifeCycle.stories.js +115 -31
  309. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  310. package/lib/build/LifeCycle/utils.d.ts.map +1 -1
  311. package/lib/build/LifeCycle/utils.js +5 -4
  312. package/lib/build/LifeCycle/utils.js.map +1 -1
  313. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  314. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  315. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  316. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  317. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  318. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  319. package/lib/build/ObjectSelect/ObjectSelect.stories.js +16 -140
  320. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  321. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  322. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  323. package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
  324. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
  325. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  326. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  327. package/lib/build/PageTemplates/GalleryPage.stories.js +4 -80
  328. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  329. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  330. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  331. package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
  332. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
  333. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  334. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  335. package/lib/build/PageTemplates/PageTemplates.stories.js +19 -109
  336. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  337. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  338. package/lib/build/Workbench/Workbench.stories.js +12 -20
  339. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  340. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  341. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  342. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  343. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  344. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  345. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  346. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +59 -57
  347. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  348. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  349. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  350. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  351. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  352. package/lib/core/AppShell/AppShell.mocks.js +5 -5
  353. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  354. package/lib/core/AppShell/AppShell.stories.js +8 -8
  355. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  356. package/lib/core/Avatar/Avatar.stories.js +6 -6
  357. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  358. package/lib/core/Backdrop/Backdrop.stories.js +2 -2
  359. package/lib/core/Backdrop/Backdrop.stories.js.map +1 -1
  360. package/lib/core/Badges/Alert.stories.js +1 -1
  361. package/lib/core/Badges/Alert.stories.js.map +1 -1
  362. package/lib/core/Badges/Count.stories.js +1 -1
  363. package/lib/core/Badges/Count.stories.js.map +1 -1
  364. package/lib/core/Badges/Selection.stories.js +1 -1
  365. package/lib/core/Badges/Selection.stories.js.map +1 -1
  366. package/lib/core/Badges/Status.stories.js +2 -2
  367. package/lib/core/Badges/Status.stories.js.map +1 -1
  368. package/lib/core/Badges/Tag.stories.js +1 -1
  369. package/lib/core/Badges/Tag.stories.js.map +1 -1
  370. package/lib/core/Banner/Banner.mocks.js +1 -1
  371. package/lib/core/Banner/Banner.mocks.js.map +1 -1
  372. package/lib/core/Banner/Banner.stories.js +11 -11
  373. package/lib/core/Banner/Banner.stories.js.map +1 -1
  374. package/lib/core/Boolean/BooleanDisplay.stories.js +1 -1
  375. package/lib/core/Boolean/BooleanDisplay.stories.js.map +1 -1
  376. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js +2 -2
  377. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  378. package/lib/core/Button/Button.stories.js +8 -8
  379. package/lib/core/Button/Button.stories.js.map +1 -1
  380. package/lib/core/Card/Card.stories.js +4 -4
  381. package/lib/core/Card/Card.stories.js.map +1 -1
  382. package/lib/core/Checkbox/Checkbox.stories.js +3 -3
  383. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  384. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js +3 -3
  385. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  386. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  387. package/lib/core/ColorPicker/ColorPicker.stories.js +7 -15
  388. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  389. package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  390. package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  391. package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
  392. package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  393. package/lib/core/ComboBox/ComboBox.stories.js +6 -6
  394. package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
  395. package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
  396. package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  397. package/lib/core/Configuration/Configuration.mocks.js +6 -0
  398. package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
  399. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  400. package/lib/core/Configuration/Configuration.stories.js +13 -25
  401. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  402. package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
  403. package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
  404. package/lib/core/Configuration/Configuration.styles.js +12 -0
  405. package/lib/core/Configuration/Configuration.styles.js.map +1 -0
  406. package/lib/core/CreditCard/CreditCard.stories.d.ts +10 -0
  407. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -0
  408. package/lib/core/CreditCard/CreditCard.stories.js +11 -0
  409. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -0
  410. package/lib/core/Currency/Currency.stories.js +2 -2
  411. package/lib/core/Currency/Currency.stories.js.map +1 -1
  412. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  413. package/lib/core/DateTime/DateTime.stories.js +11 -9
  414. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  415. package/lib/core/DateTime/DateTimeDisplay.stories.js +2 -2
  416. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  417. package/lib/core/DateTime/DateTimePicker.stories.js +2 -2
  418. package/lib/core/DateTime/DateTimePicker.stories.js.map +1 -1
  419. package/lib/core/Drawer/Drawer.stories.js +4 -4
  420. package/lib/core/Drawer/Drawer.stories.js.map +1 -1
  421. package/lib/core/Email/EmailDisplay.stories.js +1 -1
  422. package/lib/core/Email/EmailDisplay.stories.js.map +1 -1
  423. package/lib/core/EmojiPicker/EmojiPicker.stories.js +3 -3
  424. package/lib/core/EmojiPicker/EmojiPicker.stories.js.map +1 -1
  425. package/lib/core/EmptyState/EmptyState.stories.js +1 -1
  426. package/lib/core/EmptyState/EmptyState.stories.js.map +1 -1
  427. package/lib/core/ErrorState/ErrorState.stories.js +1 -1
  428. package/lib/core/ErrorState/ErrorState.stories.js.map +1 -1
  429. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js +2 -2
  430. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js.map +1 -1
  431. package/lib/core/FieldGroup/FieldGroup.stories.js +1 -1
  432. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  433. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  434. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  435. package/lib/core/FieldGroup/FieldGroupList.mocks.js +46 -2
  436. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  437. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  438. package/lib/core/FieldGroup/FieldGroupList.stories.js +13 -57
  439. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  440. package/lib/core/FieldValueList/FieldValueList.stories.js +4 -4
  441. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  442. package/lib/core/File/FileDisplay.stories.js +10 -10
  443. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  444. package/lib/core/File/FileInput.stories.js +2 -2
  445. package/lib/core/File/FileInput.stories.js.map +1 -1
  446. package/lib/core/Flex/FlexContainer.stories.js +7 -7
  447. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  448. package/lib/core/Flex/FlexItem.stories.js +3 -3
  449. package/lib/core/Flex/FlexItem.stories.js.map +1 -1
  450. package/lib/core/Form/Form.mocks.js +3 -3
  451. package/lib/core/Form/Form.mocks.js.map +1 -1
  452. package/lib/core/Form/Form.stories.js +8 -8
  453. package/lib/core/Form/Form.stories.js.map +1 -1
  454. package/lib/core/Grid/GridContainer.stories.js +9 -9
  455. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  456. package/lib/core/Grid/GridItem.stories.js +3 -3
  457. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  458. package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
  459. package/lib/core/HTML/HTML.stories.js +1 -1
  460. package/lib/core/HTML/HTML.stories.js.map +1 -1
  461. package/lib/core/Icon/Icon.mocks.js +1 -1
  462. package/lib/core/Icon/Icon.mocks.js.map +1 -1
  463. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  464. package/lib/core/Icon/Icon.stories.js +12 -35
  465. package/lib/core/Icon/Icon.stories.js.map +1 -1
  466. package/lib/core/Icon/Icon.styles.d.ts +4 -0
  467. package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
  468. package/lib/core/Icon/Icon.styles.js +25 -0
  469. package/lib/core/Icon/Icon.styles.js.map +1 -0
  470. package/lib/core/IconPicker/IconPicker.stories.js +2 -2
  471. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  472. package/lib/core/Image/Image.stories.js +1 -1
  473. package/lib/core/Image/Image.stories.js.map +1 -1
  474. package/lib/core/Input/Input.stories.js +2 -2
  475. package/lib/core/Input/Input.stories.js.map +1 -1
  476. package/lib/core/Label/Label.stories.js +2 -2
  477. package/lib/core/Label/Label.stories.js.map +1 -1
  478. package/lib/core/Lightbox/Lightbox.stories.js +3 -3
  479. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  480. package/lib/core/Link/Link.stories.d.ts +1 -11
  481. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  482. package/lib/core/Link/Link.stories.js +3 -3
  483. package/lib/core/Link/Link.stories.js.map +1 -1
  484. package/lib/core/List/CommaSeparatedList.stories.js +1 -1
  485. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  486. package/lib/core/List/OrderedList.stories.js +1 -1
  487. package/lib/core/List/OrderedList.stories.js.map +1 -1
  488. package/lib/core/List/UnorderedList.stories.js +1 -1
  489. package/lib/core/List/UnorderedList.stories.js.map +1 -1
  490. package/lib/core/ListToolbar/ListToolbar.mocks.js +5 -5
  491. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -1
  492. package/lib/core/ListToolbar/ListToolbar.stories.js +2 -2
  493. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  494. package/lib/core/Location/Location.stories.js +4 -4
  495. package/lib/core/Location/Location.stories.js.map +1 -1
  496. package/lib/core/Menu/Menu.stories.js +5 -5
  497. package/lib/core/Menu/Menu.stories.js.map +1 -1
  498. package/lib/core/MenuButton/MenuButton.stories.js +9 -9
  499. package/lib/core/MenuButton/MenuButton.stories.js.map +1 -1
  500. package/lib/core/MetaList/MetaList.stories.js +3 -3
  501. package/lib/core/MetaList/MetaList.stories.js.map +1 -1
  502. package/lib/core/Modal/Modal.mocks.js +8 -8
  503. package/lib/core/Modal/Modal.mocks.js.map +1 -1
  504. package/lib/core/Modal/Modal.stories.js +29 -29
  505. package/lib/core/Modal/Modal.stories.js.map +1 -1
  506. package/lib/core/MultiStep/MultiStep.stories.js +3 -3
  507. package/lib/core/MultiStep/MultiStep.stories.js.map +1 -1
  508. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  509. package/lib/core/Number/Number.stories.js +5 -3
  510. package/lib/core/Number/Number.stories.js.map +1 -1
  511. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  512. package/lib/core/PageTemplates/PageTemplates.stories.js +28 -38
  513. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  514. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  515. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  516. package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
  517. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  518. package/lib/core/Pagination/Pagination.stories.js +1 -1
  519. package/lib/core/Pagination/Pagination.stories.js.map +1 -1
  520. package/lib/core/Paragraph/ParagraphDisplay.stories.js +1 -1
  521. package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
  522. package/lib/core/Phone/Phone.stories.js +2 -2
  523. package/lib/core/Phone/Phone.stories.js.map +1 -1
  524. package/lib/core/Popover/Popover.stories.js +2 -2
  525. package/lib/core/Popover/Popover.stories.js.map +1 -1
  526. package/lib/core/Progress/Progress.stories.js +3 -3
  527. package/lib/core/Progress/Progress.stories.js.map +1 -1
  528. package/lib/core/RadioButton/RadioButton.stories.js +3 -3
  529. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  530. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +3 -3
  531. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  532. package/lib/core/Rating/Rating.stories.js +2 -2
  533. package/lib/core/Rating/Rating.stories.js.map +1 -1
  534. package/lib/core/SearchInput/SearchInput.stories.js +2 -2
  535. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  536. package/lib/core/Select/Select.stories.js +2 -2
  537. package/lib/core/Select/Select.stories.js.map +1 -1
  538. package/lib/core/Sentiment/Sentiment.stories.js +2 -2
  539. package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
  540. package/lib/core/Slider/Slider.stories.js +1 -1
  541. package/lib/core/Slider/Slider.stories.js.map +1 -1
  542. package/lib/core/SummaryItem/SummaryItem.stories.js +4 -4
  543. package/lib/core/SummaryItem/SummaryItem.stories.js.map +1 -1
  544. package/lib/core/SummaryList/SummaryList.mocks.js +2 -2
  545. package/lib/core/SummaryList/SummaryList.mocks.js.map +1 -1
  546. package/lib/core/SummaryList/SummaryList.stories.js +5 -5
  547. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  548. package/lib/core/Switch/Switch.stories.js +3 -3
  549. package/lib/core/Switch/Switch.stories.js.map +1 -1
  550. package/lib/core/Table/Table.mocks.js +1 -1
  551. package/lib/core/Table/Table.mocks.js.map +1 -1
  552. package/lib/core/Table/Table.stories.js +9 -9
  553. package/lib/core/Table/Table.stories.js.map +1 -1
  554. package/lib/core/Tabs/Tabs.stories.js +3 -3
  555. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  556. package/lib/core/Text/Text.stories.js +2 -2
  557. package/lib/core/Text/Text.stories.js.map +1 -1
  558. package/lib/core/TextArea/TextArea.stories.js +2 -2
  559. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  560. package/lib/core/Toaster/Toaster.stories.js +2 -2
  561. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  562. package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
  563. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  564. package/lib/core/Tooltip/Tooltip.stories.js +2 -2
  565. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  566. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  567. package/lib/core/Tree/Tree.stories.js +5 -5
  568. package/lib/core/Tree/Tree.stories.js.map +1 -1
  569. package/lib/core/URL/URL.stories.js +1 -1
  570. package/lib/core/URL/URL.stories.js.map +1 -1
  571. package/lib/cs/Article/Article.stories.d.ts +2 -10
  572. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  573. package/lib/cs/Article/Article.stories.js +9 -9
  574. package/lib/cs/Article/Article.stories.js.map +1 -1
  575. package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  576. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  577. package/lib/cs/ArticleList/ArticleList.stories.js +11 -11
  578. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  579. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  580. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  581. package/lib/cs/CSCaseView/CSAppShell.stories.js +15 -28
  582. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  583. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  584. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  585. package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
  586. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
  587. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  588. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  589. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +6 -6
  590. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  591. package/lib/cs/DialPad/DialPad.stories.js +1 -1
  592. package/lib/cs/DialPad/DialPad.stories.js.map +1 -1
  593. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  594. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  595. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +18 -18
  596. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  597. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  598. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  599. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
  600. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  601. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  602. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  603. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  604. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  605. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  606. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  607. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +7 -31
  608. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  609. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  610. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  611. package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
  612. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  613. package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  614. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  615. package/lib/cs/TaskManager/TaskManager.stories.js +33 -37
  616. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  617. package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  618. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  619. package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
  620. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
  621. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  622. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  623. package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
  624. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
  625. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  626. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  627. package/lib/dnd/DragDropList/DragDropList.stories.js +16 -87
  628. package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
  629. package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  630. package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  631. package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
  632. package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  633. package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
  634. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
  635. package/lib/rte/Editor/Editor.mocks.js +23 -0
  636. package/lib/rte/Editor/Editor.mocks.js.map +1 -0
  637. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  638. package/lib/rte/Editor/Editor.stories.js +7 -27
  639. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  640. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js +5 -5
  641. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js.map +1 -1
  642. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  643. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  644. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +5 -5
  645. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  646. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +5 -5
  647. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  648. package/lib/social/Chat/Chat.stories.js +27 -27
  649. package/lib/social/Chat/Chat.stories.js.map +1 -1
  650. package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
  651. package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  652. package/lib/social/Chat/RepeatingView.mocks.js +11 -0
  653. package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
  654. package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
  655. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  656. package/lib/social/Chat/RepeatingView.stories.js +18 -48
  657. package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
  658. package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
  659. package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  660. package/lib/social/Chat/RepeatingView.styles.js +22 -0
  661. package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
  662. package/lib/social/Email/Email.mocks.d.ts +155 -2
  663. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  664. package/lib/social/Email/Email.mocks.js +372 -0
  665. package/lib/social/Email/Email.mocks.js.map +1 -1
  666. package/lib/social/Email/Email.stories.d.ts +14 -14
  667. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  668. package/lib/social/Email/Email.stories.js +120 -460
  669. package/lib/social/Email/Email.stories.js.map +1 -1
  670. package/lib/social/Email/Email.styles.d.ts +4 -0
  671. package/lib/social/Email/Email.styles.d.ts.map +1 -0
  672. package/lib/social/Email/Email.styles.js +14 -0
  673. package/lib/social/Email/Email.styles.js.map +1 -0
  674. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  675. package/lib/social/Feed/Feed.mocks.js +40 -40
  676. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  677. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  678. package/lib/social/Feed/Feed.stories.js +29 -24
  679. package/lib/social/Feed/Feed.stories.js.map +1 -1
  680. package/lib/social/Feed/FeedNewPost.stories.js +2 -2
  681. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  682. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  683. package/lib/social/Feed/FeedPost.stories.js +37 -27
  684. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  685. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  686. package/lib/social/Feed/FeedReply.stories.js +25 -20
  687. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  688. package/lib/social/Feed/FeedReplyInput.stories.js +2 -2
  689. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  690. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +1 -1
  691. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
  692. package/lib/work/CaseView/Attachments.mocks.js +15 -15
  693. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  694. package/lib/work/CaseView/CaseView.mocks.js +7 -7
  695. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  696. package/lib/work/CaseView/CaseView.stories.js +21 -21
  697. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  698. package/lib/work/CaseView/Details.mocks.js +1 -1
  699. package/lib/work/CaseView/Details.mocks.js.map +1 -1
  700. package/lib/work/CaseView/FileService.mock.js +1 -1
  701. package/lib/work/CaseView/FileService.mock.js.map +1 -1
  702. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  703. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  704. package/lib/work/CaseView/MobileCaseView.stories.js +1 -1
  705. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  706. package/lib/work/CaseView/Pulse.mocks.js +2 -2
  707. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  708. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  709. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  710. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
  711. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
  712. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  713. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  714. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +4 -174
  715. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  716. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  717. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  718. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  719. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  720. package/lib/work/Confirmation/Confirmation.stories.js +2 -2
  721. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  722. package/lib/work/Details/Details.stories.js +15 -15
  723. package/lib/work/Details/Details.stories.js.map +1 -1
  724. package/lib/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  725. package/lib/work/Glimpse/Glimpse.stories.js +3 -3
  726. package/lib/work/Glimpse/Glimpse.stories.js.map +1 -1
  727. package/lib/work/SearchResults/SearchResults.mocks.js +4 -4
  728. package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
  729. package/lib/work/SearchResults/SearchResults.stories.js +11 -11
  730. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  731. package/lib/work/Stages/Stages.stories.js +2 -2
  732. package/lib/work/Stages/Stages.stories.js.map +1 -1
  733. package/lib/work/Stakeholders/Stakeholders.mocks.js +2 -2
  734. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
  735. package/lib/work/Stakeholders/Stakeholders.stories.js +1 -1
  736. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  737. package/lib/work/Tags/Tags.stories.js +1 -1
  738. package/lib/work/Tags/Tags.stories.js.map +1 -1
  739. package/lib/work/Tasks/TaskList.stories.js +3 -3
  740. package/lib/work/Tasks/TaskList.stories.js.map +1 -1
  741. package/lib/work/Tasks/Tasks.stories.js +11 -11
  742. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  743. package/lib/work/Timeline/Timeline.mocks.js +8 -8
  744. package/lib/work/Timeline/Timeline.mocks.js.map +1 -1
  745. package/lib/work/Timeline/Timeline.stories.js +2 -2
  746. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  747. package/package.json +10 -11
  748. package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  749. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
  750. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
  751. package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
  752. package/jsx/social/Email/Email.mocks.js +0 -395
  753. package/jsx/social/Email/Email.mocks.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Editor.mocks.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,qBAAqB,CAAC;AAYxC,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,cAAc;IAMd,iBAAiB;CAOlB"}
@@ -0,0 +1,20 @@
1
+ import ReactDOM from 'react-dom';
2
+ export const label = 'Form field label';
3
+ const PegaCustom = ({ children }) => {
4
+ return (<p style={{ color: 'blue', textTransform: 'uppercase' }} dangerouslySetInnerHTML={{ __html: children }}/>);
5
+ };
6
+ export class PegaCustomElement extends HTMLElement {
7
+ removeElements() {
8
+ while (this.firstChild) {
9
+ this.removeChild(this.firstChild);
10
+ }
11
+ }
12
+ connectedCallback() {
13
+ const inner = this.innerHTML;
14
+ this.removeElements();
15
+ const mountPoint = document.createElement('span');
16
+ this.appendChild(mountPoint);
17
+ ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
18
+ }
19
+ }
20
+ //# sourceMappingURL=Editor.mocks.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Editor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,CAAC,CACA,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAErD,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC9C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACnC;IACH,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7B,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;CACF","sourcesContent":["import ReactDOM from 'react-dom';\n\nexport const label = 'Form field label';\n\nconst PegaCustom = ({ children }: { children: string }) => {\n return (\n <p\n style={{ color: 'blue', textTransform: 'uppercase' }}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: children }}\n />\n );\n};\n\nexport class PegaCustomElement extends HTMLElement {\n removeElements() {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n }\n\n connectedCallback() {\n const inner = this.innerHTML;\n this.removeElements();\n const mountPoint = document.createElement('span');\n this.appendChild(mountPoint);\n ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAiBxC,wBAGU;AAIV,eAAO,MAAM,UAAU,mBAmBtB,CAAC;AAEF,eAAO,MAAM,eAAe,mBAmB3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAc7B,CAAC;AA4BF,eAAO,MAAM,mBAAmB,mBA6B/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAkClC,CAAC;AAEF,eAAO,MAAM,6BAA6B,mBA8BzC,CAAC"}
1
+ {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAkBxC,wBAGU;AAEV,eAAO,MAAM,UAAU,mBAmBtB,CAAC;AAEF,eAAO,MAAM,eAAe,mBAmB3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAc7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBA6B/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAkClC,CAAC;AAEF,eAAO,MAAM,6BAA6B,mBA8BzC,CAAC"}
@@ -1,13 +1,12 @@
1
1
  import { useState, useRef } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
  import { action } from '@storybook/addon-actions';
4
3
  import { Button, Card, CardContent, CardFooter, Flex, Text, TextArea } from '@pega/cosmos-react-core';
5
4
  import { Editor } from '@pega/cosmos-react-rte';
5
+ import { label, PegaCustomElement } from './Editor.mocks';
6
6
  export default {
7
7
  title: 'RTE/Editor',
8
8
  component: Editor
9
9
  };
10
- const label = 'Form field label';
11
10
  export const EditorDemo = () => {
12
11
  const editorRef = useRef(null);
13
12
  const onImageAdded = (image, id) => {
@@ -33,23 +32,6 @@ export const ReadonlyFormField = () => {
33
32
  <div id="on-github" class="on-github"><h3>Found a problem with this page?</h3><ul><li><a href="https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md" title="You're going to need to sign in to GitHub first (Opens in a new tab)" target="_blank" rel="noopener noreferrer">Edit on <b>GitHub</b></a></li><li><a href="https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md" title="Folder: en-us/web/html (Opens in a new tab)" target="_blank" rel="noopener noreferrer">Source on <b>GitHub</b></a></li><li><a href="https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML" title="This will take you to https://github.com/mdn/content to file a new issue" target="_blank" rel="noopener noreferrer">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href="https://github.com/mdn/content/blob/main/README.md" target="_blank" rel="noopener noreferrer">our Contribution guide</a>.</li></ul></div>
34
33
  `}/>);
35
34
  };
36
- const PegaCustom = ({ children }) => {
37
- return (<p style={{ color: 'blue', textTransform: 'uppercase' }} dangerouslySetInnerHTML={{ __html: children }}/>);
38
- };
39
- class PegaCustomElement extends HTMLElement {
40
- removeElements() {
41
- while (this.firstChild) {
42
- this.removeChild(this.firstChild);
43
- }
44
- }
45
- connectedCallback() {
46
- const inner = this.innerHTML;
47
- this.removeElements();
48
- const mountPoint = document.createElement('span');
49
- this.appendChild(mountPoint);
50
- ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
51
- }
52
- }
53
35
  export const CustomComponentDemo = () => {
54
36
  const editorRef = useRef(null);
55
37
  const [editor, setEditor] = useState({});
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC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,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nconst label = 'Form field label';\n\nexport const EditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><img alt=\"placeholder\" src=\"http://via.placeholder.com/640x360\"/></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code>&lt;head&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code>&lt;title&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code>&lt;body&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code>&lt;header&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code>&lt;footer&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code>&lt;article&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code>&lt;section&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code>&lt;p&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code>&lt;div&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code>&lt;span&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code>&lt;img&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code>&lt;aside&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code>&lt;audio&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code>&lt;canvas&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code>&lt;datalist&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code>&lt;details&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code>&lt;embed&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code>&lt;nav&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code>&lt;output&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code>&lt;progress&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code>&lt;video&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code>&lt;ul&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code>&lt;ol&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code>&lt;li&gt;</code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code>&lt;</code>\" and \"<code>&gt;</code>\".&nbsp; The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code>&lt;title&gt;</code> tag can be written as <code>&lt;Title&gt;</code>, <code>&lt;TITLE&gt;</code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nconst PegaCustom = ({ children }: { children: string }) => {\n return (\n <p\n style={{ color: 'blue', textTransform: 'uppercase' }}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: children }}\n />\n );\n};\n\nclass PegaCustomElement extends HTMLElement {\n removeElements() {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n }\n\n connectedCallback() {\n const inner = this.innerHTML;\n this.removeElements();\n const mountPoint = document.createElement('span');\n this.appendChild(mountPoint);\n ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);\n }\n}\n\nexport const CustomComponentDemo = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\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\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\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 <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,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U,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,CACL,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAEhG;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nimport { label, PegaCustomElement } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nexport const EditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><img alt=\"placeholder\" src=\"http://via.placeholder.com/640x360\"/></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code>&lt;head&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code>&lt;title&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code>&lt;body&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code>&lt;header&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code>&lt;footer&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code>&lt;article&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code>&lt;section&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code>&lt;p&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code>&lt;div&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code>&lt;span&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code>&lt;img&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code>&lt;aside&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code>&lt;audio&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code>&lt;canvas&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code>&lt;datalist&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code>&lt;details&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code>&lt;embed&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code>&lt;nav&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code>&lt;output&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code>&lt;progress&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code>&lt;video&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code>&lt;ul&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code>&lt;ol&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code>&lt;li&gt;</code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code>&lt;</code>\" and \"<code>&gt;</code>\".&nbsp; The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code>&lt;title&gt;</code> tag can be written as <code>&lt;Title&gt;</code>, <code>&lt;TITLE&gt;</code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nexport const CustomComponentDemo = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\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\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\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 <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,yBAAyB,CAAC;AAGhE,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAG;KAChD;CACF,CAAC","sourcesContent":["import { Avatar, MenuItemProps } from '@pega/cosmos-react-core';\n\n// cspell:disable\nexport const demoUsers: MenuItemProps[] = [\n {\n id: 'turnc',\n primary: 'Cindy Turner',\n secondary: ['Lead Engineer'],\n visual: <Avatar size='l' name='Cindy Turner' />\n },\n {\n id: 'deans',\n primary: 'Seth DeAngelo',\n secondary: ['Senior Software Engineer', 'Backend Developer'],\n visual: <Avatar size='l' name='Seth DeAngelo' />\n },\n {\n id: 'moorj',\n primary: 'Janet Moore',\n secondary: ['Backend Developer'],\n visual: <Avatar size='l' name='Janet Moore' />\n },\n {\n id: 'thomd',\n primary: 'Dean Thomas',\n secondary: ['Designer'],\n visual: <Avatar size='l' name='Dean Thomas' />\n },\n {\n id: 'hathb',\n primary: 'Bob Hathoway',\n secondary: ['Lead Designer', 'Product Owner'],\n visual: <Avatar size='l' name='Bob Hathoway' />\n }\n];\n"]}
1
+ {"version":3,"file":"RichTextEditor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,yBAAyB,CAAC;AAGhE,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAG;KAChD;CACF,CAAC","sourcesContent":["import { Avatar, MenuItemProps } from '@pega/cosmos-react-core';\n\n// cspell:disable\nexport const demoUsers: MenuItemProps[] = [\n {\n id: 'turnc',\n primary: 'Cindy Turner',\n secondary: ['Lead Engineer'],\n visual: <Avatar size='l' name='Cindy Turner' />\n },\n {\n id: 'deans',\n primary: 'Seth DeAngelo',\n secondary: ['Senior Software Engineer', 'Backend Developer'],\n visual: <Avatar size='l' name='Seth DeAngelo' />\n },\n {\n id: 'moorj',\n primary: 'Janet Moore',\n secondary: ['Backend Developer'],\n visual: <Avatar size='l' name='Janet Moore' />\n },\n {\n id: 'thomd',\n primary: 'Dean Thomas',\n secondary: ['Designer'],\n visual: <Avatar size='l' name='Dean Thomas' />\n },\n {\n id: 'hathb',\n primary: 'Bob Hathoway',\n secondary: ['Lead Designer', 'Product Owner'],\n visual: <Avatar size='l' name='Bob Hathoway' />\n }\n];\n// cspell:enable\n"]}
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { Meta, Story } from '@storybook/react';
3
2
  import { RichTextEditorProps } from '@pega/cosmos-react-rte';
4
3
  declare const _default: Meta<import("@storybook/react").Args>;
5
4
  export default _default;
6
5
  export declare const RichTextEditorDemo: Story<RichTextEditorProps>;
7
- export declare const RichTextEditorWithLogs: () => JSX.Element;
6
+ export declare const RichTextEditorWithLogs: Story;
8
7
  export declare const RichTextEditorMDDemo: Story<RichTextEditorProps>;
9
- export declare const RichTextEditorHtmlParsingDemo: () => JSX.Element;
8
+ export declare const RichTextEditorHtmlParsingDemo: Story;
10
9
  //# sourceMappingURL=RichTextEditor.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAAkB,mBAAmB,EAAuB,MAAM,wBAAwB,CAAC;;AAIlG,wBAqBU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,mBAAmB,CAkDzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBA2ClC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,mBAAmB,CAuC3D,CAAC;AAEF,eAAO,MAAM,6BAA6B,mBAuCzC,CAAC"}
1
+ {"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAAkB,mBAAmB,EAAuB,MAAM,wBAAwB,CAAC;;AAIlG,wBAqBU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAAK,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C,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,cAAc,CACb,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC;YACP,gBAAgB;YAChB,SAAS;YACT,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,OAAO;YACP,gBAAgB;YAChB,aAAa;SACd,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const RichTextEditorDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const editorRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with &#39;Hello world!&#39; HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert &#39;Hi mom!&#39;\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(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\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\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 <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextEditor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,wBAAwB,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE;QACJ,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACpC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAC5F,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC1C,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EA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AAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,cAAc,CACb,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC;YACP,gBAAgB;YAChB,SAAS;YACT,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,OAAO;YACP,gBAAgB;YAChB,aAAa;SACd,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const RichTextEditorDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const editorRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with &#39;Hello world!&#39; HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert &#39;Hi mom!&#39;\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(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\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\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 <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,14 @@
1
+ import { RepeatingViewRow } from '@pega/cosmos-react-social';
2
+ export interface Contact extends RepeatingViewRow {
3
+ name: {
4
+ title: string;
5
+ first: string;
6
+ last: string;
7
+ };
8
+ phone: string;
9
+ picture: {
10
+ thumbnail: string;
11
+ };
12
+ }
13
+ export declare const FetchContactsAPI: (results: number, abortController: AbortController) => Promise<Contact[]>;
14
+ //# sourceMappingURL=RepeatingView.mocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepeatingView.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,EAAE,CAC7B,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,eAAe,KAC7B,OAAO,CAAC,OAAO,EAAE,CAWrB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const FetchContactsAPI = (results, abortController) => {
2
+ return fetch(`https://randomuser.me/api?results=${results}`, {
3
+ signal: abortController.signal
4
+ })
5
+ .then(res => res.json())
6
+ .then((data) => [...data.results].map(item => ({
7
+ ...item,
8
+ id: Math.floor(Math.random() * Math.floor(500000)).toString()
9
+ })));
10
+ };
11
+ //# sourceMappingURL=RepeatingView.mocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepeatingView.mocks.js","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.mocks.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,gBAAgB,GAGH,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE;IACrD,OAAO,KAAK,CAAC,qCAAqC,OAAO,EAAE,EAAE;QAC3D,MAAM,EAAE,eAAe,CAAC,MAAM;KAC/B,CAAC;SACC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACvB,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAClB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,GAAG,IAAI;QACP,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC9D,CAAC,CAAC,CACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { RepeatingViewRow } from '@pega/cosmos-react-social';\n\nexport interface Contact extends RepeatingViewRow {\n name: { title: string; first: string; last: string };\n phone: string;\n picture: { thumbnail: string };\n}\n\nexport const FetchContactsAPI: (\n results: number,\n abortController: AbortController\n) => Promise<Contact[]> = (results, abortController) => {\n return fetch(`https://randomuser.me/api?results=${results}`, {\n signal: abortController.signal\n })\n .then(res => res.json())\n .then((data: any) =>\n [...data.results].map(item => ({\n ...item,\n id: Math.floor(Math.random() * Math.floor(500000)).toString()\n }))\n );\n};\n"]}
@@ -1,20 +1,9 @@
1
- /// <reference types="react" />
2
- import { RepeatingViewRow, RepeatingViewProps } from '@pega/cosmos-react-social';
3
- declare const _default: {
4
- title: string;
5
- component: import("react").FunctionComponent<RepeatingViewProps & import("@pega/cosmos-react-core").ForwardProps>;
6
- };
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { RepeatingViewProps } from '@pega/cosmos-react-social';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
7
4
  export default _default;
8
- export interface Contact extends RepeatingViewRow {
9
- name: {
10
- title: string;
11
- first: string;
12
- last: string;
13
- };
14
- phone: string;
15
- picture: {
16
- thumbnail: string;
17
- };
5
+ interface RepeatingViewStoryProps {
6
+ scrollDirection: RepeatingViewProps['scrollDirection'];
18
7
  }
19
- export declare const RepeatingViewSample: () => JSX.Element;
8
+ export declare const RepeatingViewSample: Story<RepeatingViewStoryProps>;
20
9
  //# sourceMappingURL=RepeatingView.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RepeatingView.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;;;;;AAEnC,wBAGE;AAEF,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AA6CD,eAAO,MAAM,mBAAmB,mBAmF/B,CAAC"}
1
+ {"version":3,"file":"RepeatingView.stories.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAiB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;;AAK9E,wBAGU;AAEV,UAAU,uBAAuB;IAC/B,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,uBAAuB,CAgF9D,CAAC"}
@@ -1,57 +1,21 @@
1
1
  import { useCallback, useState, useEffect, useMemo } from 'react';
2
- import styled, { css } from 'styled-components';
3
- import { radios } from '@storybook/addon-knobs';
4
- import { Avatar, SummaryItem, defaultThemeProp } from '@pega/cosmos-react-core';
5
- import { RepeatingView, StyledRepeatingViewItem, StyledRepeatingView } from '@pega/cosmos-react-social';
2
+ import { Avatar, SummaryItem } from '@pega/cosmos-react-core';
3
+ import { RepeatingView } from '@pega/cosmos-react-social';
4
+ import { StyledContactsBook } from './RepeatingView.styles';
5
+ import { FetchContactsAPI } from './RepeatingView.mocks';
6
6
  export default {
7
7
  title: 'Social/Chat/RepeatingView',
8
8
  component: RepeatingView
9
9
  };
10
- const StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {
11
- const bdrColor = theme.base.palette['border-line'];
12
- return css `
13
- width: 25rem;
14
- position: absolute;
15
- top: 0;
16
- left: 50%;
17
- transform: translate(-50%, 0%);
18
- z-index: 1;
19
- border: 0.0625rem solid ${bdrColor};
20
- background-color: ${theme.base.palette['primary-background']};
21
- ${StyledRepeatingViewItem} {
22
- border-bottom: 0.0625rem solid ${bdrColor};
23
- padding: calc(0.5 * ${theme.base.spacing});
24
- }
25
- `;
26
- });
27
- StyledContactsBook.defaultProps = defaultThemeProp;
28
- const INITIAL_CHUNK_SIZE = 50;
29
- const APPEND_CHUNK_SIZE = 25;
30
- const FETCH_AHEAD_OFFSET = 10;
31
- const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);
32
- function id() {
33
- return Math.floor(Math.random() * Math.floor(500000)).toString();
34
- }
35
- const FetchContactsAPI = (results, abortController) => {
36
- return fetch(`https://randomuser.me/api?results=${results}`, {
37
- signal: abortController.signal
38
- })
39
- .then(res => res.json())
40
- .then((data) => [...data.results].map(item => ({
41
- ...item,
42
- id: id()
43
- })));
44
- };
45
- export const RepeatingViewSample = () => {
10
+ export const RepeatingViewSample = (args) => {
11
+ const INITIAL_CHUNK_SIZE = 50;
12
+ const APPEND_CHUNK_SIZE = 25;
13
+ const FETCH_AHEAD_OFFSET = 10;
14
+ const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);
46
15
  const [rows, setRows] = useState({
47
16
  data: [],
48
17
  isLoading: true
49
18
  });
50
- const scrollDirectionOptions = {
51
- 'Top to bottom': 'top-to-bottom',
52
- 'Bottom to top': 'bottom-to-top'
53
- };
54
- const scrollDirection = radios('Scroll direction', scrollDirectionOptions, scrollDirectionOptions[Object.keys(scrollDirectionOptions)[0]]);
55
19
  const abortController = useMemo(() => {
56
20
  return new AbortController();
57
21
  }, []);
@@ -80,11 +44,17 @@ export const RepeatingViewSample = () => {
80
44
  });
81
45
  }
82
46
  }, [rows, setRows]);
83
- return (<RepeatingView as={StyledContactsBook} loading={rows.isLoading} rows={rows.data} style={{ height: '40rem', maxHeight: '100vh' }} loadMore={loadMore} offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET} scrollDirection={scrollDirection}>
47
+ return (<RepeatingView as={StyledContactsBook} loading={rows.isLoading} rows={rows.data} style={{ height: '40rem', maxHeight: '100vh' }} loadMore={loadMore} offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET} scrollDirection={args.scrollDirection}>
84
48
  {row => {
85
49
  const { name: { title, first, last }, phone, picture: { thumbnail } } = row;
86
50
  return (<SummaryItem primary={[title, first, last].join(' ')} visual={<Avatar imageSrc={thumbnail} name={[title, first, last].join(' ')} shape='circle' size='l'/>} secondary={phone}/>);
87
51
  }}
88
52
  </RepeatingView>);
89
53
  };
54
+ RepeatingViewSample.args = {
55
+ scrollDirection: 'top-to-bottom'
56
+ };
57
+ RepeatingViewSample.argTypes = {
58
+ scrollDirection: { options: ['top-to-bottom', 'bottom-to-top'], control: { type: 'select' } }
59
+ };
90
60
  //# sourceMappingURL=RepeatingView.stories.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"RepeatingView.stories.jsx","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,MAAM,EAAE,EAA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,EAAE,EAC5B,KAAK,EACL,OAAO,EAAE,EAAE,SAAS,EAAE,EACvB,GAAG,GAAc,CAAC;YACnB,OAAO,CACL,CAAC,WAAW,CACV,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACxC,MAAM,CAAC,CACL,CAAC,MAAM,CACL,QAAQ,CAAC,CAAC,SAAS,CAAC,CACpB,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACrC,KAAK,CAAC,QAAQ,CACd,IAAI,CAAC,GAAG,EACR,CACH,CACD,SAAS,CAAC,CAAC,KAAK,CAAC,EACjB,CACH,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback, useState, useEffect, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\nimport { radios } from '@storybook/addon-knobs';\n\nimport { Avatar, SummaryItem, defaultThemeProp } from '@pega/cosmos-react-core';\nimport {\n RepeatingView,\n StyledRepeatingViewItem,\n StyledRepeatingView,\n RepeatingViewRow,\n RepeatingViewProps\n} from '@pega/cosmos-react-social';\n\nexport default {\n title: 'Social/Chat/RepeatingView',\n component: RepeatingView\n};\n\nexport interface Contact extends RepeatingViewRow {\n name: { title: string; first: string; last: string };\n phone: string;\n picture: { thumbnail: string };\n}\n\nconst StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {\n const bdrColor = theme.base.palette['border-line'];\n return css`\n width: 25rem;\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, 0%);\n z-index: 1;\n border: 0.0625rem solid ${bdrColor};\n background-color: ${theme.base.palette['primary-background']};\n ${StyledRepeatingViewItem} {\n border-bottom: 0.0625rem solid ${bdrColor};\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledContactsBook.defaultProps = defaultThemeProp;\n\nconst INITIAL_CHUNK_SIZE = 50;\nconst APPEND_CHUNK_SIZE = 25;\nconst FETCH_AHEAD_OFFSET = 10;\nconst TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);\n\nfunction id() {\n return Math.floor(Math.random() * Math.floor(500000)).toString();\n}\n\nconst FetchContactsAPI: (results: number, abortController: AbortController) => Promise<Contact[]> =\n (results, abortController) => {\n return fetch(`https://randomuser.me/api?results=${results}`, {\n signal: abortController.signal\n })\n .then(res => res.json())\n .then((data: any) =>\n [...data.results].map(item => ({\n ...item,\n id: id()\n }))\n );\n };\n\nexport const RepeatingViewSample = () => {\n const [rows, setRows] = useState<{\n data: Contact[];\n isLoading: boolean;\n }>({\n data: [],\n isLoading: true\n });\n\n const scrollDirectionOptions: Record<string, RepeatingViewProps['scrollDirection']> = {\n 'Top to bottom': 'top-to-bottom',\n 'Bottom to top': 'bottom-to-top'\n };\n const scrollDirection = radios(\n 'Scroll direction',\n scrollDirectionOptions,\n scrollDirectionOptions[Object.keys(scrollDirectionOptions)[0]]\n );\n\n const abortController = useMemo(() => {\n return new AbortController();\n }, []);\n\n useEffect(() => {\n FetchContactsAPI(INITIAL_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n return () => {\n abortController.abort();\n };\n }, []);\n\n const loadMore = useCallback(() => {\n if (!rows.isLoading) {\n setRows(prevRows => ({\n ...prevRows,\n isLoading: true\n }));\n FetchContactsAPI(APPEND_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n }\n }, [rows, setRows]);\n\n return (\n <RepeatingView\n as={StyledContactsBook}\n loading={rows.isLoading}\n rows={rows.data}\n style={{ height: '40rem', maxHeight: '100vh' }}\n loadMore={loadMore}\n offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET}\n scrollDirection={scrollDirection}\n >\n {row => {\n const {\n name: { title, first, last },\n phone,\n picture: { thumbnail }\n } = row as Contact;\n return (\n <SummaryItem\n primary={[title, first, last].join(' ')}\n visual={\n <Avatar\n imageSrc={thumbnail}\n name={[title, first, last].join(' ')}\n shape='circle'\n size='l'\n />\n }\n secondary={phone}\n />\n );\n }}\n </RepeatingView>\n );\n};\n"]}
1
+ {"version":3,"file":"RepeatingView.stories.jsx","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAsB,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAW,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAElE,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,aAAa;CACjB,CAAC;AAMV,MAAM,CAAC,MAAM,mBAAmB,GAAmC,CACjE,IAA6B,EAC7B,EAAE;IACF,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAC9B,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAC7B,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAExD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAG7B;QACD,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,OAAO,IAAI,eAAe,EAAE,CAAC;IAC/B,CAAC,E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{ Meta, Story } from '@storybook/react';\n\nimport { Avatar, SummaryItem } from '@pega/cosmos-react-core';\nimport { RepeatingView, RepeatingViewProps } from '@pega/cosmos-react-social';\n\nimport { StyledContactsBook } from './RepeatingView.styles';\nimport { Contact, FetchContactsAPI } from './RepeatingView.mocks';\n\nexport default {\n title: 'Social/Chat/RepeatingView',\n component: RepeatingView\n} as Meta;\n\ninterface RepeatingViewStoryProps {\n scrollDirection: RepeatingViewProps['scrollDirection'];\n}\n\nexport const RepeatingViewSample: Story<RepeatingViewStoryProps> = (\n args: RepeatingViewStoryProps\n) => {\n const INITIAL_CHUNK_SIZE = 50;\n const APPEND_CHUNK_SIZE = 25;\n const FETCH_AHEAD_OFFSET = 10;\n const TOTAL_RECORDS = Math.max(INITIAL_CHUNK_SIZE, 100);\n\n const [rows, setRows] = useState<{\n data: Contact[];\n isLoading: boolean;\n }>({\n data: [],\n isLoading: true\n });\n\n const abortController = useMemo(() => {\n return new AbortController();\n }, []);\n\n useEffect(() => {\n FetchContactsAPI(INITIAL_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n return () => {\n abortController.abort();\n };\n }, []);\n\n const loadMore = useCallback(() => {\n if (!rows.isLoading) {\n setRows(prevRows => ({\n ...prevRows,\n isLoading: true\n }));\n FetchContactsAPI(APPEND_CHUNK_SIZE, abortController).then((newRows: Contact[]) => {\n setRows(prevRows => ({\n isLoading: false,\n data: [...prevRows.data, ...newRows]\n }));\n });\n }\n }, [rows, setRows]);\n\n return (\n <RepeatingView\n as={StyledContactsBook}\n loading={rows.isLoading}\n rows={rows.data}\n style={{ height: '40rem', maxHeight: '100vh' }}\n loadMore={loadMore}\n offset={rows.data.length === TOTAL_RECORDS ? -1 : rows.data.length - FETCH_AHEAD_OFFSET}\n scrollDirection={args.scrollDirection}\n >\n {row => {\n const {\n name: { title, first, last },\n phone,\n picture: { thumbnail }\n } = row as Contact;\n return (\n <SummaryItem\n primary={[title, first, last].join(' ')}\n visual={\n <Avatar\n imageSrc={thumbnail}\n name={[title, first, last].join(' ')}\n shape='circle'\n size='l'\n />\n }\n secondary={phone}\n />\n );\n }}\n </RepeatingView>\n );\n};\n\nRepeatingViewSample.args = {\n scrollDirection: 'top-to-bottom'\n};\n\nRepeatingViewSample.argTypes = {\n scrollDirection: { options: ['top-to-bottom', 'bottom-to-top'], control: { type: 'select' } }\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const StyledContactsBook: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ //# sourceMappingURL=RepeatingView.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepeatingView.styles.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yGAgB7B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { defaultThemeProp } from '@pega/cosmos-react-core';
3
+ import { StyledRepeatingView, StyledRepeatingViewItem } from '@pega/cosmos-react-social';
4
+ export const StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {
5
+ const bdrColor = theme.base.palette['border-line'];
6
+ return css `
7
+ width: 25rem;
8
+ position: absolute;
9
+ top: 0;
10
+ left: 50%;
11
+ transform: translate(-50%, 0%);
12
+ z-index: 1;
13
+ border: 0.0625rem solid ${bdrColor};
14
+ background-color: ${theme.base.palette['primary-background']};
15
+ ${StyledRepeatingViewItem} {
16
+ border-bottom: 0.0625rem solid ${bdrColor};
17
+ padding: calc(0.5 * ${theme.base.spacing});
18
+ }
19
+ `;
20
+ });
21
+ StyledContactsBook.defaultProps = defaultThemeProp;
22
+ //# sourceMappingURL=RepeatingView.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepeatingView.styles.js","sourceRoot":"","sources":["../../../src/social/Chat/RepeatingView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACnD,OAAO,GAAG,CAAA;;;;;;;8BAOkB,QAAQ;wBACd,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;MAC1D,uBAAuB;uCACU,QAAQ;4BACnB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { StyledRepeatingView, StyledRepeatingViewItem } from '@pega/cosmos-react-social';\n\nexport const StyledContactsBook = styled(StyledRepeatingView)(({ theme }) => {\n const bdrColor = theme.base.palette['border-line'];\n return css`\n width: 25rem;\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, 0%);\n z-index: 1;\n border: 0.0625rem solid ${bdrColor};\n background-color: ${theme.base.palette['primary-background']};\n ${StyledRepeatingViewItem} {\n border-bottom: 0.0625rem solid ${bdrColor};\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledContactsBook.defaultProps = defaultThemeProp;\n"]}