@pega/cosmos-react-demos 3.0.0-dev.4.0 → 3.0.0-dev.5.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 (788) 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 +70 -2
  111. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  112. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
  113. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  114. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +51 -88
  115. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  116. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
  117. package/jsx/core/HTML/HTML.stories.jsx +1 -1
  118. package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
  119. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  120. package/jsx/core/Icon/Icon.stories.jsx +5 -27
  121. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  122. package/jsx/core/Icon/Icon.styles.d.ts +4 -0
  123. package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
  124. package/jsx/core/Icon/Icon.styles.js +25 -0
  125. package/jsx/core/Icon/Icon.styles.js.map +1 -0
  126. package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
  127. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  128. package/jsx/core/Link/Link.stories.d.ts +1 -11
  129. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  130. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  131. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
  132. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
  133. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx +71 -0
  134. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -0
  135. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
  136. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
  137. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +87 -0
  138. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -0
  139. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  140. package/jsx/core/Number/Number.stories.jsx +2 -0
  141. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  142. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  143. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
  144. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  145. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  146. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  147. package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
  148. package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  149. package/jsx/core/SearchInput/SearchInput.mocks.d.ts +11 -0
  150. package/jsx/core/SearchInput/SearchInput.mocks.d.ts.map +1 -0
  151. package/jsx/core/SearchInput/SearchInput.mocks.js +25 -0
  152. package/jsx/core/SearchInput/SearchInput.mocks.js.map +1 -0
  153. package/jsx/core/SearchInput/SearchInput.stories.d.ts +1 -0
  154. package/jsx/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  155. package/jsx/core/SearchInput/SearchInput.stories.jsx +28 -0
  156. package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
  157. package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
  158. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  159. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  160. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  161. package/jsx/core/Tree/Tree.stories.jsx +2 -2
  162. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  163. package/jsx/cs/Article/Article.stories.d.ts +2 -10
  164. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  165. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  166. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  167. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  168. package/jsx/cs/ArticleList/ArticleList.stories.jsx +2 -1
  169. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  170. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  171. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  172. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
  173. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  174. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  175. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  176. package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
  177. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
  178. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  179. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  180. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
  181. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  182. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  183. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  184. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
  185. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  186. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  187. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  188. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
  189. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  190. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  191. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  192. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  193. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  194. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  195. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  196. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
  197. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  198. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  199. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  200. package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
  201. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  202. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  203. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  204. package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
  205. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  206. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  207. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  208. package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
  209. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
  210. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  211. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  212. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
  213. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
  214. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  215. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  216. package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
  217. package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
  218. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  219. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  220. package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
  221. package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  222. package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
  223. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
  224. package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
  225. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
  226. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  227. package/jsx/rte/Editor/Editor.stories.jsx +1 -19
  228. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  229. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.jsx.map +1 -1
  230. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  231. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  232. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  233. package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
  234. package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  235. package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
  236. package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
  237. package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
  238. package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  239. package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
  240. package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
  241. package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
  242. package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  243. package/jsx/social/Chat/RepeatingView.styles.js +22 -0
  244. package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
  245. package/jsx/social/Email/Email.mocks.d.ts +155 -2
  246. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  247. package/jsx/social/Email/Email.mocks.jsx +766 -0
  248. package/jsx/social/Email/Email.mocks.jsx.map +1 -0
  249. package/jsx/social/Email/Email.stories.d.ts +14 -14
  250. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  251. package/jsx/social/Email/Email.stories.jsx +108 -435
  252. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  253. package/jsx/social/Email/Email.styles.d.ts +4 -0
  254. package/jsx/social/Email/Email.styles.d.ts.map +1 -0
  255. package/jsx/social/Email/Email.styles.js +14 -0
  256. package/jsx/social/Email/Email.styles.js.map +1 -0
  257. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  258. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  259. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  260. package/jsx/social/Feed/Feed.stories.jsx +23 -18
  261. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  262. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  263. package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
  264. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  265. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  266. package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
  267. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  268. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  269. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  270. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  271. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  272. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  273. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
  274. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
  275. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  276. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  277. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
  278. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  279. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  280. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  281. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  282. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  283. package/jsx/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  284. package/jsx/work/Glimpse/Glimpse.stories.jsx.map +1 -1
  285. package/jsx/work/Timeline/Timeline.stories.d.ts +2 -0
  286. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  287. package/jsx/work/Timeline/Timeline.stories.jsx +28 -1
  288. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  289. package/lib/build/AppHeader/AppHeader.stories.js +1 -1
  290. package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
  291. package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
  292. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  293. package/lib/build/AppShell/AppShell.mocks.js +16 -0
  294. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  295. package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
  296. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  297. package/lib/build/AppShell/AppShell.stories.js +7 -22
  298. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  299. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  300. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +3 -2
  301. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  302. package/lib/build/DynamicContentEditor/FieldSelector.js +1 -1
  303. package/lib/build/DynamicContentEditor/FieldSelector.js.map +1 -1
  304. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  305. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  306. package/lib/build/FlowModeller/FlowModeller.mocks.js +64 -12
  307. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  308. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  309. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  310. package/lib/build/FlowModeller/FlowModeller.stories.js +19 -94
  311. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  312. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  313. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  314. package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
  315. package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  316. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +1 -5
  317. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -1
  318. package/lib/build/ItemLibrary/LibraryPicker.mocks.js +5 -10
  319. package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -1
  320. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  321. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  322. package/lib/build/ItemLibrary/LibraryPicker.stories.js +1 -1
  323. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  324. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +3 -0
  325. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  326. package/lib/build/LifeCycle/LifeCycle.mocks.js +106 -18
  327. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  328. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  329. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  330. package/lib/build/LifeCycle/LifeCycle.stories.js +115 -31
  331. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  332. package/lib/build/LifeCycle/utils.d.ts.map +1 -1
  333. package/lib/build/LifeCycle/utils.js +5 -4
  334. package/lib/build/LifeCycle/utils.js.map +1 -1
  335. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  336. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  337. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  338. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  339. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  340. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  341. package/lib/build/ObjectSelect/ObjectSelect.stories.js +16 -140
  342. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  343. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  344. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  345. package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
  346. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
  347. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  348. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  349. package/lib/build/PageTemplates/GalleryPage.stories.js +4 -80
  350. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  351. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  352. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  353. package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
  354. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
  355. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  356. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  357. package/lib/build/PageTemplates/PageTemplates.stories.js +19 -109
  358. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  359. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  360. package/lib/build/Workbench/Workbench.stories.js +12 -20
  361. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  362. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  363. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  364. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  365. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  366. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  367. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  368. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +59 -57
  369. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  370. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  371. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  372. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  373. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  374. package/lib/core/AppShell/AppShell.mocks.js +5 -5
  375. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  376. package/lib/core/AppShell/AppShell.stories.js +8 -8
  377. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  378. package/lib/core/Avatar/Avatar.stories.js +6 -6
  379. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  380. package/lib/core/Backdrop/Backdrop.stories.js +2 -2
  381. package/lib/core/Backdrop/Backdrop.stories.js.map +1 -1
  382. package/lib/core/Badges/Alert.stories.js +1 -1
  383. package/lib/core/Badges/Alert.stories.js.map +1 -1
  384. package/lib/core/Badges/Count.stories.js +1 -1
  385. package/lib/core/Badges/Count.stories.js.map +1 -1
  386. package/lib/core/Badges/Selection.stories.js +1 -1
  387. package/lib/core/Badges/Selection.stories.js.map +1 -1
  388. package/lib/core/Badges/Status.stories.js +2 -2
  389. package/lib/core/Badges/Status.stories.js.map +1 -1
  390. package/lib/core/Badges/Tag.stories.js +1 -1
  391. package/lib/core/Badges/Tag.stories.js.map +1 -1
  392. package/lib/core/Banner/Banner.mocks.js +1 -1
  393. package/lib/core/Banner/Banner.mocks.js.map +1 -1
  394. package/lib/core/Banner/Banner.stories.js +11 -11
  395. package/lib/core/Banner/Banner.stories.js.map +1 -1
  396. package/lib/core/Boolean/BooleanDisplay.stories.js +1 -1
  397. package/lib/core/Boolean/BooleanDisplay.stories.js.map +1 -1
  398. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js +2 -2
  399. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  400. package/lib/core/Button/Button.stories.js +8 -8
  401. package/lib/core/Button/Button.stories.js.map +1 -1
  402. package/lib/core/Card/Card.stories.js +4 -4
  403. package/lib/core/Card/Card.stories.js.map +1 -1
  404. package/lib/core/Checkbox/Checkbox.stories.js +3 -3
  405. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  406. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js +3 -3
  407. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  408. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  409. package/lib/core/ColorPicker/ColorPicker.stories.js +7 -15
  410. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  411. package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  412. package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  413. package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
  414. package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  415. package/lib/core/ComboBox/ComboBox.stories.js +6 -6
  416. package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
  417. package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
  418. package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  419. package/lib/core/Configuration/Configuration.mocks.js +6 -0
  420. package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
  421. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  422. package/lib/core/Configuration/Configuration.stories.js +13 -25
  423. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  424. package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
  425. package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
  426. package/lib/core/Configuration/Configuration.styles.js +12 -0
  427. package/lib/core/Configuration/Configuration.styles.js.map +1 -0
  428. package/lib/core/CreditCard/CreditCard.stories.d.ts +10 -0
  429. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -0
  430. package/lib/core/CreditCard/CreditCard.stories.js +11 -0
  431. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -0
  432. package/lib/core/Currency/Currency.stories.js +2 -2
  433. package/lib/core/Currency/Currency.stories.js.map +1 -1
  434. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  435. package/lib/core/DateTime/DateTime.stories.js +11 -9
  436. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  437. package/lib/core/DateTime/DateTimeDisplay.stories.js +2 -2
  438. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  439. package/lib/core/DateTime/DateTimePicker.stories.js +2 -2
  440. package/lib/core/DateTime/DateTimePicker.stories.js.map +1 -1
  441. package/lib/core/Drawer/Drawer.stories.js +4 -4
  442. package/lib/core/Drawer/Drawer.stories.js.map +1 -1
  443. package/lib/core/Email/EmailDisplay.stories.js +1 -1
  444. package/lib/core/Email/EmailDisplay.stories.js.map +1 -1
  445. package/lib/core/EmojiPicker/EmojiPicker.stories.js +3 -3
  446. package/lib/core/EmojiPicker/EmojiPicker.stories.js.map +1 -1
  447. package/lib/core/EmptyState/EmptyState.stories.js +1 -1
  448. package/lib/core/EmptyState/EmptyState.stories.js.map +1 -1
  449. package/lib/core/ErrorState/ErrorState.stories.js +1 -1
  450. package/lib/core/ErrorState/ErrorState.stories.js.map +1 -1
  451. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js +2 -2
  452. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js.map +1 -1
  453. package/lib/core/FieldGroup/FieldGroup.stories.js +1 -1
  454. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  455. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  456. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  457. package/lib/core/FieldGroup/FieldGroupList.mocks.js +47 -3
  458. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  459. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
  460. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  461. package/lib/core/FieldGroup/FieldGroupList.stories.js +54 -67
  462. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  463. package/lib/core/FieldValueList/FieldValueList.stories.js +4 -4
  464. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  465. package/lib/core/File/FileDisplay.stories.js +10 -10
  466. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  467. package/lib/core/File/FileInput.stories.js +2 -2
  468. package/lib/core/File/FileInput.stories.js.map +1 -1
  469. package/lib/core/Flex/FlexContainer.stories.js +7 -7
  470. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  471. package/lib/core/Flex/FlexItem.stories.js +3 -3
  472. package/lib/core/Flex/FlexItem.stories.js.map +1 -1
  473. package/lib/core/Form/Form.mocks.js +3 -3
  474. package/lib/core/Form/Form.mocks.js.map +1 -1
  475. package/lib/core/Form/Form.stories.js +8 -8
  476. package/lib/core/Form/Form.stories.js.map +1 -1
  477. package/lib/core/Grid/GridContainer.stories.js +9 -9
  478. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  479. package/lib/core/Grid/GridItem.stories.js +3 -3
  480. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  481. package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
  482. package/lib/core/HTML/HTML.stories.js +1 -1
  483. package/lib/core/HTML/HTML.stories.js.map +1 -1
  484. package/lib/core/Icon/Icon.mocks.js +1 -1
  485. package/lib/core/Icon/Icon.mocks.js.map +1 -1
  486. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  487. package/lib/core/Icon/Icon.stories.js +12 -35
  488. package/lib/core/Icon/Icon.stories.js.map +1 -1
  489. package/lib/core/Icon/Icon.styles.d.ts +4 -0
  490. package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
  491. package/lib/core/Icon/Icon.styles.js +25 -0
  492. package/lib/core/Icon/Icon.styles.js.map +1 -0
  493. package/lib/core/IconPicker/IconPicker.stories.js +2 -2
  494. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  495. package/lib/core/Image/Image.stories.js +1 -1
  496. package/lib/core/Image/Image.stories.js.map +1 -1
  497. package/lib/core/Input/Input.stories.js +2 -2
  498. package/lib/core/Input/Input.stories.js.map +1 -1
  499. package/lib/core/Label/Label.stories.js +2 -2
  500. package/lib/core/Label/Label.stories.js.map +1 -1
  501. package/lib/core/Lightbox/Lightbox.stories.js +3 -3
  502. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  503. package/lib/core/Link/Link.stories.d.ts +1 -11
  504. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  505. package/lib/core/Link/Link.stories.js +3 -3
  506. package/lib/core/Link/Link.stories.js.map +1 -1
  507. package/lib/core/List/CommaSeparatedList.stories.js +1 -1
  508. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  509. package/lib/core/List/OrderedList.stories.js +1 -1
  510. package/lib/core/List/OrderedList.stories.js.map +1 -1
  511. package/lib/core/List/UnorderedList.stories.js +1 -1
  512. package/lib/core/List/UnorderedList.stories.js.map +1 -1
  513. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
  514. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
  515. package/lib/core/ListToolbar/ListToolbar.mocks.js +50 -0
  516. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -0
  517. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
  518. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
  519. package/lib/core/ListToolbar/ListToolbar.stories.js +79 -0
  520. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -0
  521. package/lib/core/Location/Location.stories.js +4 -4
  522. package/lib/core/Location/Location.stories.js.map +1 -1
  523. package/lib/core/Menu/Menu.stories.js +5 -5
  524. package/lib/core/Menu/Menu.stories.js.map +1 -1
  525. package/lib/core/MenuButton/MenuButton.stories.js +9 -9
  526. package/lib/core/MenuButton/MenuButton.stories.js.map +1 -1
  527. package/lib/core/MetaList/MetaList.stories.js +3 -3
  528. package/lib/core/MetaList/MetaList.stories.js.map +1 -1
  529. package/lib/core/Modal/Modal.mocks.js +8 -8
  530. package/lib/core/Modal/Modal.mocks.js.map +1 -1
  531. package/lib/core/Modal/Modal.stories.js +29 -29
  532. package/lib/core/Modal/Modal.stories.js.map +1 -1
  533. package/lib/core/MultiStep/MultiStep.stories.js +3 -3
  534. package/lib/core/MultiStep/MultiStep.stories.js.map +1 -1
  535. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  536. package/lib/core/Number/Number.stories.js +5 -3
  537. package/lib/core/Number/Number.stories.js.map +1 -1
  538. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  539. package/lib/core/PageTemplates/PageTemplates.stories.js +28 -38
  540. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  541. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  542. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  543. package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
  544. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  545. package/lib/core/Pagination/Pagination.stories.js +1 -1
  546. package/lib/core/Pagination/Pagination.stories.js.map +1 -1
  547. package/lib/core/Paragraph/ParagraphDisplay.stories.js +1 -1
  548. package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
  549. package/lib/core/Phone/Phone.stories.js +2 -2
  550. package/lib/core/Phone/Phone.stories.js.map +1 -1
  551. package/lib/core/Popover/Popover.stories.js +2 -2
  552. package/lib/core/Popover/Popover.stories.js.map +1 -1
  553. package/lib/core/Progress/Progress.stories.js +3 -3
  554. package/lib/core/Progress/Progress.stories.js.map +1 -1
  555. package/lib/core/RadioButton/RadioButton.stories.js +3 -3
  556. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  557. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +3 -3
  558. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  559. package/lib/core/Rating/Rating.stories.js +2 -2
  560. package/lib/core/Rating/Rating.stories.js.map +1 -1
  561. package/lib/core/SearchInput/SearchInput.mocks.d.ts +11 -0
  562. package/lib/core/SearchInput/SearchInput.mocks.d.ts.map +1 -0
  563. package/lib/core/SearchInput/SearchInput.mocks.js +25 -0
  564. package/lib/core/SearchInput/SearchInput.mocks.js.map +1 -0
  565. package/lib/core/SearchInput/SearchInput.stories.d.ts +1 -0
  566. package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  567. package/lib/core/SearchInput/SearchInput.stories.js +30 -2
  568. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  569. package/lib/core/Select/Select.stories.js +2 -2
  570. package/lib/core/Select/Select.stories.js.map +1 -1
  571. package/lib/core/Sentiment/Sentiment.stories.js +2 -2
  572. package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
  573. package/lib/core/Slider/Slider.stories.js +1 -1
  574. package/lib/core/Slider/Slider.stories.js.map +1 -1
  575. package/lib/core/SummaryItem/SummaryItem.stories.js +4 -4
  576. package/lib/core/SummaryItem/SummaryItem.stories.js.map +1 -1
  577. package/lib/core/SummaryList/SummaryList.mocks.js +2 -2
  578. package/lib/core/SummaryList/SummaryList.mocks.js.map +1 -1
  579. package/lib/core/SummaryList/SummaryList.stories.js +5 -5
  580. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  581. package/lib/core/Switch/Switch.stories.js +3 -3
  582. package/lib/core/Switch/Switch.stories.js.map +1 -1
  583. package/lib/core/Table/Table.mocks.js +1 -1
  584. package/lib/core/Table/Table.mocks.js.map +1 -1
  585. package/lib/core/Table/Table.stories.js +9 -9
  586. package/lib/core/Table/Table.stories.js.map +1 -1
  587. package/lib/core/Tabs/Tabs.stories.js +3 -3
  588. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  589. package/lib/core/Text/Text.stories.js +2 -2
  590. package/lib/core/Text/Text.stories.js.map +1 -1
  591. package/lib/core/TextArea/TextArea.stories.js +2 -2
  592. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  593. package/lib/core/Toaster/Toaster.stories.js +2 -2
  594. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  595. package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
  596. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  597. package/lib/core/Tooltip/Tooltip.stories.js +2 -2
  598. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  599. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  600. package/lib/core/Tree/Tree.stories.js +5 -5
  601. package/lib/core/Tree/Tree.stories.js.map +1 -1
  602. package/lib/core/URL/URL.stories.js +1 -1
  603. package/lib/core/URL/URL.stories.js.map +1 -1
  604. package/lib/cs/Article/Article.stories.d.ts +2 -10
  605. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  606. package/lib/cs/Article/Article.stories.js +9 -9
  607. package/lib/cs/Article/Article.stories.js.map +1 -1
  608. package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  609. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  610. package/lib/cs/ArticleList/ArticleList.stories.js +12 -11
  611. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  612. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  613. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  614. package/lib/cs/CSCaseView/CSAppShell.stories.js +15 -28
  615. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  616. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  617. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  618. package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
  619. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
  620. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  621. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  622. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +6 -6
  623. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  624. package/lib/cs/DialPad/DialPad.stories.js +1 -1
  625. package/lib/cs/DialPad/DialPad.stories.js.map +1 -1
  626. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  627. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  628. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +18 -18
  629. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  630. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  631. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  632. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
  633. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  634. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  635. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  636. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  637. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  638. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  639. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  640. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +7 -31
  641. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  642. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  643. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  644. package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
  645. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  646. package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  647. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  648. package/lib/cs/TaskManager/TaskManager.stories.js +33 -37
  649. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  650. package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  651. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  652. package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
  653. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
  654. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  655. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  656. package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
  657. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
  658. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  659. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  660. package/lib/dnd/DragDropList/DragDropList.stories.js +16 -87
  661. package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
  662. package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  663. package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  664. package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
  665. package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  666. package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
  667. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
  668. package/lib/rte/Editor/Editor.mocks.js +23 -0
  669. package/lib/rte/Editor/Editor.mocks.js.map +1 -0
  670. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  671. package/lib/rte/Editor/Editor.stories.js +7 -27
  672. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  673. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js +5 -5
  674. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js.map +1 -1
  675. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  676. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  677. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +5 -5
  678. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  679. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +5 -5
  680. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  681. package/lib/social/Chat/Chat.stories.js +27 -27
  682. package/lib/social/Chat/Chat.stories.js.map +1 -1
  683. package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
  684. package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  685. package/lib/social/Chat/RepeatingView.mocks.js +11 -0
  686. package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
  687. package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
  688. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  689. package/lib/social/Chat/RepeatingView.stories.js +18 -48
  690. package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
  691. package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
  692. package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  693. package/lib/social/Chat/RepeatingView.styles.js +22 -0
  694. package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
  695. package/lib/social/Email/Email.mocks.d.ts +155 -2
  696. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  697. package/lib/social/Email/Email.mocks.js +372 -0
  698. package/lib/social/Email/Email.mocks.js.map +1 -1
  699. package/lib/social/Email/Email.stories.d.ts +14 -14
  700. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  701. package/lib/social/Email/Email.stories.js +120 -460
  702. package/lib/social/Email/Email.stories.js.map +1 -1
  703. package/lib/social/Email/Email.styles.d.ts +4 -0
  704. package/lib/social/Email/Email.styles.d.ts.map +1 -0
  705. package/lib/social/Email/Email.styles.js +14 -0
  706. package/lib/social/Email/Email.styles.js.map +1 -0
  707. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  708. package/lib/social/Feed/Feed.mocks.js +40 -40
  709. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  710. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  711. package/lib/social/Feed/Feed.stories.js +29 -24
  712. package/lib/social/Feed/Feed.stories.js.map +1 -1
  713. package/lib/social/Feed/FeedNewPost.stories.js +2 -2
  714. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  715. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  716. package/lib/social/Feed/FeedPost.stories.js +37 -27
  717. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  718. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  719. package/lib/social/Feed/FeedReply.stories.js +25 -20
  720. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  721. package/lib/social/Feed/FeedReplyInput.stories.js +2 -2
  722. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  723. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +1 -1
  724. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
  725. package/lib/work/CaseView/Attachments.mocks.js +15 -15
  726. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  727. package/lib/work/CaseView/CaseView.mocks.js +7 -7
  728. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  729. package/lib/work/CaseView/CaseView.stories.js +21 -21
  730. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  731. package/lib/work/CaseView/Details.mocks.js +1 -1
  732. package/lib/work/CaseView/Details.mocks.js.map +1 -1
  733. package/lib/work/CaseView/FileService.mock.js +1 -1
  734. package/lib/work/CaseView/FileService.mock.js.map +1 -1
  735. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  736. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  737. package/lib/work/CaseView/MobileCaseView.stories.js +1 -1
  738. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  739. package/lib/work/CaseView/Pulse.mocks.js +2 -2
  740. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  741. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  742. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  743. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
  744. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
  745. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  746. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  747. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +4 -174
  748. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  749. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  750. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  751. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  752. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  753. package/lib/work/Confirmation/Confirmation.stories.js +2 -2
  754. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  755. package/lib/work/Details/Details.stories.js +15 -15
  756. package/lib/work/Details/Details.stories.js.map +1 -1
  757. package/lib/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  758. package/lib/work/Glimpse/Glimpse.stories.js +3 -3
  759. package/lib/work/Glimpse/Glimpse.stories.js.map +1 -1
  760. package/lib/work/SearchResults/SearchResults.mocks.js +4 -4
  761. package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
  762. package/lib/work/SearchResults/SearchResults.stories.js +11 -11
  763. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  764. package/lib/work/Stages/Stages.stories.js +2 -2
  765. package/lib/work/Stages/Stages.stories.js.map +1 -1
  766. package/lib/work/Stakeholders/Stakeholders.mocks.js +2 -2
  767. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
  768. package/lib/work/Stakeholders/Stakeholders.stories.js +1 -1
  769. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  770. package/lib/work/Tags/Tags.stories.js +1 -1
  771. package/lib/work/Tags/Tags.stories.js.map +1 -1
  772. package/lib/work/Tasks/TaskList.stories.js +3 -3
  773. package/lib/work/Tasks/TaskList.stories.js.map +1 -1
  774. package/lib/work/Tasks/Tasks.stories.js +11 -11
  775. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  776. package/lib/work/Timeline/Timeline.mocks.js +8 -8
  777. package/lib/work/Timeline/Timeline.mocks.js.map +1 -1
  778. package/lib/work/Timeline/Timeline.stories.d.ts +2 -0
  779. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  780. package/lib/work/Timeline/Timeline.stories.js +23 -3
  781. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  782. package/package.json +10 -11
  783. package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  784. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
  785. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
  786. package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
  787. package/jsx/social/Email/Email.mocks.js +0 -395
  788. 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,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import ReactDOM from 'react-dom';
3
+ export const label = 'Form field label';
4
+ const PegaCustom = ({ children }) => {
5
+ return (_jsx("p", { style: { color: 'blue', textTransform: 'uppercase' },
6
+ // eslint-disable-next-line react/no-danger
7
+ dangerouslySetInnerHTML: { __html: children } }));
8
+ };
9
+ export class PegaCustomElement extends HTMLElement {
10
+ removeElements() {
11
+ while (this.firstChild) {
12
+ this.removeChild(this.firstChild);
13
+ }
14
+ }
15
+ connectedCallback() {
16
+ const inner = this.innerHTML;
17
+ this.removeElements();
18
+ const mountPoint = document.createElement('span');
19
+ this.appendChild(mountPoint);
20
+ ReactDOM.render(_jsx(PegaCustom, { children: inner }), mountPoint);
21
+ }
22
+ }
23
+ //# sourceMappingURL=Editor.mocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Editor.mocks.js","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,YACE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE;QACpD,2CAA2C;QAC3C,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAC7C,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,KAAC,UAAU,cAAE,KAAK,GAAc,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,21 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useRef } from 'react';
3
- import ReactDOM from 'react-dom';
4
3
  import { action } from '@storybook/addon-actions';
5
4
  import { Button, Card, CardContent, CardFooter, Flex, Text, TextArea } from '@pega/cosmos-react-core';
6
5
  import { Editor } from '@pega/cosmos-react-rte';
6
+ import { label, PegaCustomElement } from './Editor.mocks';
7
7
  export default {
8
8
  title: 'RTE/Editor',
9
9
  component: Editor
10
10
  };
11
- const label = 'Form field label';
12
11
  export const EditorDemo = () => {
13
12
  const editorRef = useRef(null);
14
13
  const onImageAdded = (image, id) => {
15
14
  const src = URL.createObjectURL(image);
16
15
  editorRef.current?.appendImage({ src, alt: image.name }, id);
17
16
  };
18
- return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onFocus: action('Editor focused'), onBlur: action('Editor blurred'), onImageAdded: onImageAdded, defaultValue: '<body><p>Hi mom <a href="https://google.com">link</a></p><img alt="placeholder" src="http://via.placeholder.com/640x360"/></body>' }, void 0));
17
+ return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onFocus: action('Editor focused'), onBlur: action('Editor blurred'), onImageAdded: onImageAdded, defaultValue: '<body><p>Hi mom <a href="https://google.com">link</a></p><img alt="placeholder" src="http://via.placeholder.com/640x360"/></body>' }));
19
18
  };
20
19
  export const EmptyEditorDemo = () => {
21
20
  const editorRef = useRef(null);
@@ -23,7 +22,7 @@ export const EmptyEditorDemo = () => {
23
22
  const src = URL.createObjectURL(image);
24
23
  editorRef.current?.appendImage({ src, alt: image.name }, id);
25
24
  };
26
- return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onImageAdded: onImageAdded, onFocus: action('Editor has focus'), onBlur: action('Editor has blurred'), placeholder: 'Type some stuff in here' }, void 0));
25
+ return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onImageAdded: onImageAdded, onFocus: action('Editor has focus'), onBlur: action('Editor has blurred'), placeholder: 'Type some stuff in here' }));
27
26
  };
28
27
  export const ReadonlyFormField = () => {
29
28
  return (_jsx(Editor, { label: label, readOnly: true, 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>
@@ -32,27 +31,8 @@ export const ReadonlyFormField = () => {
32
31
  <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>
33
32
 
34
33
  <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>
35
- ` }, void 0));
34
+ ` }));
36
35
  };
37
- const PegaCustom = ({ children }) => {
38
- return (_jsx("p", { style: { color: 'blue', textTransform: 'uppercase' },
39
- // eslint-disable-next-line react/no-danger
40
- dangerouslySetInnerHTML: { __html: children } }, void 0));
41
- };
42
- class PegaCustomElement extends HTMLElement {
43
- removeElements() {
44
- while (this.firstChild) {
45
- this.removeChild(this.firstChild);
46
- }
47
- }
48
- connectedCallback() {
49
- const inner = this.innerHTML;
50
- this.removeElements();
51
- const mountPoint = document.createElement('span');
52
- this.appendChild(mountPoint);
53
- ReactDOM.render(_jsx(PegaCustom, { children: inner }, void 0), mountPoint);
54
- }
55
- }
56
36
  export const CustomComponentDemo = () => {
57
37
  const editorRef = useRef(null);
58
38
  const [editor, setEditor] = useState({});
@@ -69,7 +49,7 @@ export const CustomComponentDemo = () => {
69
49
  }
70
50
  ], onInit: initializedEditor => {
71
51
  setEditor(initializedEditor);
72
- } }, void 0));
52
+ } }));
73
53
  };
74
54
  export const RichTextEditorWithLogs = () => {
75
55
  const editorRef = useRef(null);
@@ -86,7 +66,7 @@ export const RichTextEditorWithLogs = () => {
86
66
  else if (type === 'rich_text')
87
67
  setContent(editorRef.current?.getRichText());
88
68
  };
89
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(Editor, { ref: editorRef, toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'], onImageAdded: onImageAdded, label: 'Rich text editor with logs', info: 'Click on the buttons below to show the different formatted outputs of the RTE' }, void 0), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: () => showContent('html'), children: "Show HTML" }, void 0), _jsx(Button, { onClick: () => showContent('plain_text'), children: "Show plain text" }, void 0), _jsx(Button, { onClick: () => showContent('rich_text'), children: "Show rich text" }, void 0)] }, void 0), _jsx(Text, { children: content }, void 0)] }, void 0));
69
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsx(Editor, { ref: editorRef, toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'], onImageAdded: onImageAdded, label: 'Rich text editor with logs', info: 'Click on the buttons below to show the different formatted outputs of the RTE' }), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: () => showContent('html'), children: "Show HTML" }), _jsx(Button, { onClick: () => showContent('plain_text'), children: "Show plain text" }), _jsx(Button, { onClick: () => showContent('rich_text'), children: "Show rich text" })] }), _jsx(Text, { children: content })] }));
90
70
  };
91
71
  export const RichTextEditorHtmlParsingDemo = () => {
92
72
  const [html, setHtml] = useState('<p>Hello world!</p>');
@@ -95,6 +75,6 @@ export const RichTextEditorHtmlParsingDemo = () => {
95
75
  const src = URL.createObjectURL(image);
96
76
  rteRef.current?.appendImage({ src, alt: image.name }, id);
97
77
  };
98
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }, void 0) }, void 0), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }, void 0) }, void 0)] }, void 0), _jsx(Editor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: label, toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'] }, void 0)] }, void 0));
78
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }) }), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }) })] }), _jsx(Editor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: label, toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'] })] }));
99
79
  };
100
80
  //# sourceMappingURL=Editor.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.js","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,CA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,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,eACH,KAAC,WAAW,cACV,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAI,WACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,oDAE3D,WACE,YACR,EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,WAC3F,YACG,CACR,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.js","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,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,CAAC,GAAI,GACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,GAC3F,IACG,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"]}
@@ -6,31 +6,31 @@ export const demoUsers = [
6
6
  id: 'turnc',
7
7
  primary: 'Cindy Turner',
8
8
  secondary: ['Lead Engineer'],
9
- visual: _jsx(Avatar, { size: 'l', name: 'Cindy Turner' }, void 0)
9
+ visual: _jsx(Avatar, { size: 'l', name: 'Cindy Turner' })
10
10
  },
11
11
  {
12
12
  id: 'deans',
13
13
  primary: 'Seth DeAngelo',
14
14
  secondary: ['Senior Software Engineer', 'Backend Developer'],
15
- visual: _jsx(Avatar, { size: 'l', name: 'Seth DeAngelo' }, void 0)
15
+ visual: _jsx(Avatar, { size: 'l', name: 'Seth DeAngelo' })
16
16
  },
17
17
  {
18
18
  id: 'moorj',
19
19
  primary: 'Janet Moore',
20
20
  secondary: ['Backend Developer'],
21
- visual: _jsx(Avatar, { size: 'l', name: 'Janet Moore' }, void 0)
21
+ visual: _jsx(Avatar, { size: 'l', name: 'Janet Moore' })
22
22
  },
23
23
  {
24
24
  id: 'thomd',
25
25
  primary: 'Dean Thomas',
26
26
  secondary: ['Designer'],
27
- visual: _jsx(Avatar, { size: 'l', name: 'Dean Thomas' }, void 0)
27
+ visual: _jsx(Avatar, { size: 'l', name: 'Dean Thomas' })
28
28
  },
29
29
  {
30
30
  id: 'hathb',
31
31
  primary: 'Bob Hathoway',
32
32
  secondary: ['Lead Designer', 'Product Owner'],
33
- visual: _jsx(Avatar, { size: 'l', name: 'Bob Hathoway' }, void 0)
33
+ visual: _jsx(Avatar, { size: 'l', name: 'Bob Hathoway' })
34
34
  }
35
35
  ];
36
36
  //# sourceMappingURL=RichTextEditor.mocks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.mocks.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,yBAAyB,CAAC;AAEhE,iBAAiB;AACjB,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,WAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,eAAe,WAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,WAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,WAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,WAAG;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.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,yBAAyB,CAAC;AAEhE,iBAAiB;AACjB,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,eAAe,GAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;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,CAAC,mBAAmB,CAkDzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA2CpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,mBAAmB,CAuC3D,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAuC3C,CAAC"}
@@ -46,7 +46,7 @@ export const RichTextEditorDemo = (args) => {
46
46
  'lists',
47
47
  'cut-copy-paste',
48
48
  'indentation'
49
- ], onImageAdded: onImageAdded, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly, defaultValue: '<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>' }, void 0), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: overwriteText, children: "Overwrite RTE value with 'Hello world!' HTML" }, void 0), _jsx(Button, { onClick: insertText, label: 'RTE Must be focused for insert text to work', children: "Insert 'Hi mom!'" }, void 0)] }, void 0)] }, void 0));
49
+ ], onImageAdded: onImageAdded, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly, defaultValue: '<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>' }), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: overwriteText, children: "Overwrite RTE value with 'Hello world!' HTML" }), _jsx(Button, { onClick: insertText, label: 'RTE Must be focused for insert text to work', children: "Insert 'Hi mom!'" })] })] }));
50
50
  };
51
51
  export const RichTextEditorWithLogs = () => {
52
52
  const editorRef = useRef(null);
@@ -72,7 +72,7 @@ export const RichTextEditorWithLogs = () => {
72
72
  'lists',
73
73
  'cut-copy-paste',
74
74
  'indentation'
75
- ], onImageAdded: onImageAdded, label: 'Rich text editor with logs', info: 'Click on the buttons below to show the different formatted outputs of the RTE' }, void 0), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: () => showContent('html'), children: "Show HTML" }, void 0), _jsx(Button, { onClick: () => showContent('plain_text'), children: "Show plain text" }, void 0), _jsx(Button, { onClick: () => showContent('rich_text'), children: "Show rich text" }, void 0)] }, void 0), _jsx(Text, { children: content }, void 0)] }, void 0));
75
+ ], onImageAdded: onImageAdded, label: 'Rich text editor with logs', info: 'Click on the buttons below to show the different formatted outputs of the RTE' }), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: () => showContent('html'), children: "Show HTML" }), _jsx(Button, { onClick: () => showContent('plain_text'), children: "Show plain text" }), _jsx(Button, { onClick: () => showContent('rich_text'), children: "Show rich text" })] }), _jsx(Text, { children: content })] }));
76
76
  };
77
77
  export const RichTextEditorMDDemo = (args) => {
78
78
  const [users, setUsers] = useState(demoUsers);
@@ -91,7 +91,7 @@ export const RichTextEditorMDDemo = (args) => {
91
91
  markdown: `@${item.id}:${item.primary}:user:`,
92
92
  text: item.primary
93
93
  };
94
- }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly }, void 0));
94
+ }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly }));
95
95
  };
96
96
  export const RichTextEditorHtmlParsingDemo = () => {
97
97
  const [html, setHtml] = useState('<p>Hello world!</p>');
@@ -100,7 +100,7 @@ export const RichTextEditorHtmlParsingDemo = () => {
100
100
  const src = URL.createObjectURL(image);
101
101
  rteRef.current?.appendImage({ src, alt: image.name }, id);
102
102
  };
103
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }, void 0) }, void 0), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }, void 0) }, void 0)] }, void 0), _jsx(RichTextEditor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: 'Rich text editor', toolbar: [
103
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }) }), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }) })] }), _jsx(RichTextEditor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: 'Rich text editor', toolbar: [
104
104
  'inline-styling',
105
105
  'headers',
106
106
  'tables',
@@ -109,6 +109,6 @@ export const RichTextEditorHtmlParsingDemo = () => {
109
109
  'lists',
110
110
  'cut-copy-paste',
111
111
  'indentation'
112
- ] }, void 0)] }, void 0));
112
+ ] })] }));
113
113
  };
114
114
  //# sourceMappingURL=RichTextEditor.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.stories.js","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,EAA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,CAAC,qBAAqB,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,eACH,KAAC,WAAW,cACV,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAI,WACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,oDAE3D,WACE,YACR,EACP,KAAC,cAAc,IACb,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE;oBACP,gBAAgB;oBAChB,SAAS;oBACT,QAAQ;oBACR,OAAO;oBACP,QAAQ;oBACR,OAAO;oBACP,gBAAgB;oBAChB,aAAa;iBACd,WACD,YACG,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.js","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,QAA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,SAAS;oBACT,QAAQ;oBACR,OAAO;oBACP,QAAQ;oBACR,OAAO;oBACP,gBAAgB;oBAChB,aAAa;iBACd,GACD,IACG,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"]}
@@ -19,7 +19,7 @@ export const RichTextViewerDemo = () => {
19
19
  'lists',
20
20
  'cut-copy-paste',
21
21
  'indentation'
22
- ], onChange: () => setContent(editorRef.current?.getRichText() || '') }, void 0), _jsx(RichTextViewer, { content: content, type: 'richtext' }, void 0)] }, void 0));
22
+ ], onChange: () => setContent(editorRef.current?.getRichText() || '') }), _jsx(RichTextViewer, { content: content, type: 'richtext' })] }));
23
23
  };
24
24
  export const RichTextViewerHTMLDemo = () => {
25
25
  const editorRef = useRef(null);
@@ -32,11 +32,11 @@ export const RichTextViewerHTMLDemo = () => {
32
32
  'lists',
33
33
  'cut-copy-paste',
34
34
  'indentation'
35
- ], onChange: () => setContent(editorRef.current?.getHtml() || '') }, void 0), _jsx(RichTextViewer, { content: content, type: 'html' }, void 0)] }, void 0));
35
+ ], onChange: () => setContent(editorRef.current?.getHtml() || '') }), _jsx(RichTextViewer, { content: content, type: 'html' })] }));
36
36
  };
37
37
  export const RichTextViewerMDDemo = () => {
38
38
  const LinkComponent = ({ token }) => {
39
- return (_jsx(Link, { href: token.href, previewable: true, children: token.text }, void 0));
39
+ return (_jsx(Link, { href: token.href, previewable: true, children: token.text }));
40
40
  };
41
41
  const editorRef = useRef(null);
42
42
  const [content, setContent] = useState('');
@@ -56,11 +56,11 @@ export const RichTextViewerMDDemo = () => {
56
56
  markdown: `@${item.id}:${item.primary}:user:`,
57
57
  text: item.primary
58
58
  };
59
- }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, defaultValue: '# Try writing some of your own markdown and see how it renders!\n\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\n\nThere is built in support for #tags: as well!\n\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)', onChange: () => setContent(editorRef.current?.getPlainText() || '') }, void 0), _jsx(RichTextViewer, { content: content, type: 'markdown', interactionRenderers: [MentionButtonConfig, HashtagButtonConfig], markdownMap: {
59
+ }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, defaultValue: '# Try writing some of your own markdown and see how it renders!\n\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\n\nThere is built in support for #tags: as well!\n\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)', onChange: () => setContent(editorRef.current?.getPlainText() || '') }), _jsx(RichTextViewer, { content: content, type: 'markdown', interactionRenderers: [MentionButtonConfig, HashtagButtonConfig], markdownMap: {
60
60
  link: (linkToken) => {
61
61
  if (linkToken.href?.includes('www.pega.com'))
62
62
  return LinkComponent;
63
63
  }
64
- } }, void 0)] }, void 0));
64
+ } })] }));
65
65
  };
66
66
  //# sourceMappingURL=RichTextViewer.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextViewer.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,cAAc,EACd,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;CAClB,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,SAAS,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,KAAC,cAAc,IACb,GAAG,EAAE,SAAS,EACd,OAAO,EAAE;oBACP,gBAAgB;oBAChB,SAAS;oBACT,QAAQ;oBACR,OAAO;oBACP,OAAO;oBACP,gBAAgB;oBAChB,aAAa;iBACd,EACD,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,WAClE,EAEF,KAAC,cAAc,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,UAAU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UAAU,EACf,oBAAoB,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,EAChE,WAAW,EAAE;oBACX,IAAI,EAAE,CAAC,SAA2B,EAAE,EAAE;wBACpC,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC;4BAAE,OAAO,aAAa,CAAC;oBACrE,CAAC;iBACF,WACD,YACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextEditor,\n RichTextViewer,\n RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\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 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\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 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\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 <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\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 defaultValue={\n '# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\\n\\nThere is built in support for #tags: as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)'\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextViewer.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,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IACb,GAAG,EAAE,SAAS,EACd,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,EACrE,QAAQ,EAAE,WAAW,EACrB,wBAAwB,EAAE,CAAC,EAAU,EAAE,EAAE;oBACvC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;oBAE/D,IAAI,CAAC,IAAI;wBAAE,OAAO,SAAS,CAAC;oBAE5B,OAAO;wBACL,QAAQ,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,QAAQ;wBAC7C,IAAI,EAAE,IAAI,CAAC,OAAO;qBACnB,CAAC;gBACJ,CAAC,EACD,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,EACjD,SAAS,QACT,YAAY,QACZ,YAAY,EACV,kUAAkU,EAEpU,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,GACnE,EAEF,KAAC,cAAc,IACb,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,UAAU,EACf,oBAAoB,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,EAChE,WAAW,EAAE;oBACX,IAAI,EAAE,CAAC,SAA2B,EAAE,EAAE;wBACpC,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC;4BAAE,OAAO,aAAa,CAAC;oBACrE,CAAC;iBACF,GACD,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextEditor,\n RichTextViewer,\n RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\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 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\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 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\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 <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\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 defaultValue={\n '# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\\n\\nThere is built in support for #tags: as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)'\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}