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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (753) hide show
  1. package/jsx/build/AppShell/AppShell.mocks.d.ts +17 -0
  2. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  3. package/jsx/build/AppShell/AppShell.mocks.js +15 -0
  4. package/jsx/build/AppShell/AppShell.mocks.js.map +1 -1
  5. package/jsx/build/AppShell/AppShell.stories.d.ts +2 -0
  6. package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
  7. package/jsx/build/AppShell/AppShell.stories.jsx +2 -17
  8. package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
  9. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  10. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +2 -1
  11. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  12. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  13. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  14. package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +77 -13
  15. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
  16. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  17. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  18. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
  19. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  20. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  21. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  22. package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
  23. package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  24. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +1 -5
  25. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -1
  26. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +5 -10
  27. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -1
  28. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  29. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  30. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  31. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts +3 -0
  32. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  33. package/jsx/build/LifeCycle/LifeCycle.mocks.js +106 -18
  34. package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  35. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  36. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  37. package/jsx/build/LifeCycle/LifeCycle.stories.jsx +111 -27
  38. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  39. package/jsx/build/LifeCycle/utils.d.ts.map +1 -1
  40. package/jsx/build/LifeCycle/utils.js +5 -4
  41. package/jsx/build/LifeCycle/utils.js.map +1 -1
  42. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  43. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  44. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
  45. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
  46. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  47. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  48. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +5 -180
  49. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  50. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  51. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  52. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
  53. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
  54. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  55. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  56. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
  57. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
  58. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  59. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  60. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
  61. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
  62. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  63. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  64. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
  65. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  66. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  67. package/jsx/build/Workbench/Workbench.stories.jsx +1 -9
  68. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  69. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  70. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  71. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  72. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  73. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  74. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  75. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
  76. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
  77. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  78. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  79. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  80. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  81. package/jsx/core/Button/Button.stories.jsx +6 -6
  82. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  83. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  84. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
  85. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  86. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  87. package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  88. package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
  89. package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  90. package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
  91. package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  92. package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
  93. package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
  94. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  95. package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
  96. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  97. package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
  98. package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
  99. package/jsx/core/Configuration/Configuration.styles.js +12 -0
  100. package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
  101. package/jsx/core/CreditCard/CreditCard.stories.d.ts +10 -0
  102. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -0
  103. package/jsx/core/CreditCard/CreditCard.stories.jsx +10 -0
  104. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -0
  105. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  106. package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
  107. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  108. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  109. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  110. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +69 -1
  111. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  112. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  113. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +2 -70
  114. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  115. package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
  116. package/jsx/core/HTML/HTML.stories.jsx +1 -1
  117. package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
  118. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  119. package/jsx/core/Icon/Icon.stories.jsx +5 -27
  120. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  121. package/jsx/core/Icon/Icon.styles.d.ts +4 -0
  122. package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
  123. package/jsx/core/Icon/Icon.styles.js +25 -0
  124. package/jsx/core/Icon/Icon.styles.js.map +1 -0
  125. package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
  126. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  127. package/jsx/core/Link/Link.stories.d.ts +1 -11
  128. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  129. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  130. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  131. package/jsx/core/Number/Number.stories.jsx +2 -0
  132. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  133. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  134. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
  135. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  136. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  137. package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  138. package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
  139. package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  140. package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
  141. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  142. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  143. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  144. package/jsx/core/Tree/Tree.stories.jsx +2 -2
  145. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  146. package/jsx/cs/Article/Article.stories.d.ts +2 -10
  147. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  148. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  149. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  150. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  151. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  152. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  153. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  154. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
  155. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
  156. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  157. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  158. package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
  159. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
  160. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  161. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  162. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
  163. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  164. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  165. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  166. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
  167. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  168. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  169. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  170. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
  171. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  172. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  173. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  174. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  175. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  176. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  177. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  178. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
  179. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  180. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  181. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  182. package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
  183. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  184. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  185. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  186. package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
  187. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  188. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  189. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  190. package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
  191. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
  192. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  193. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  194. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
  195. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
  196. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  197. package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  198. package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
  199. package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
  200. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  201. package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  202. package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
  203. package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  204. package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
  205. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
  206. package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
  207. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
  208. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  209. package/jsx/rte/Editor/Editor.stories.jsx +1 -19
  210. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  211. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.jsx.map +1 -1
  212. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  213. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  214. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  215. package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
  216. package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  217. package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
  218. package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
  219. package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
  220. package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  221. package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
  222. package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
  223. package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
  224. package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  225. package/jsx/social/Chat/RepeatingView.styles.js +22 -0
  226. package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
  227. package/jsx/social/Email/Email.mocks.d.ts +155 -2
  228. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  229. package/jsx/social/Email/Email.mocks.jsx +766 -0
  230. package/jsx/social/Email/Email.mocks.jsx.map +1 -0
  231. package/jsx/social/Email/Email.stories.d.ts +14 -14
  232. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  233. package/jsx/social/Email/Email.stories.jsx +108 -435
  234. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  235. package/jsx/social/Email/Email.styles.d.ts +4 -0
  236. package/jsx/social/Email/Email.styles.d.ts.map +1 -0
  237. package/jsx/social/Email/Email.styles.js +14 -0
  238. package/jsx/social/Email/Email.styles.js.map +1 -0
  239. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  240. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  241. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  242. package/jsx/social/Feed/Feed.stories.jsx +23 -18
  243. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  244. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  245. package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
  246. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  247. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  248. package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
  249. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  250. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  251. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  252. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  253. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  254. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  255. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
  256. package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
  257. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  258. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  259. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
  260. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  261. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  262. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  263. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  264. package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  265. package/jsx/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  266. package/jsx/work/Glimpse/Glimpse.stories.jsx.map +1 -1
  267. package/lib/build/AppHeader/AppHeader.stories.js +1 -1
  268. package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
  269. package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
  270. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  271. package/lib/build/AppShell/AppShell.mocks.js +16 -0
  272. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  273. package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
  274. package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
  275. package/lib/build/AppShell/AppShell.stories.js +7 -22
  276. package/lib/build/AppShell/AppShell.stories.js.map +1 -1
  277. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  278. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +3 -2
  279. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  280. package/lib/build/DynamicContentEditor/FieldSelector.js +1 -1
  281. package/lib/build/DynamicContentEditor/FieldSelector.js.map +1 -1
  282. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
  283. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  284. package/lib/build/FlowModeller/FlowModeller.mocks.js +64 -12
  285. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  286. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
  287. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  288. package/lib/build/FlowModeller/FlowModeller.stories.js +19 -94
  289. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  290. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
  291. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
  292. package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
  293. package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
  294. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +1 -5
  295. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -1
  296. package/lib/build/ItemLibrary/LibraryPicker.mocks.js +5 -10
  297. package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -1
  298. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
  299. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  300. package/lib/build/ItemLibrary/LibraryPicker.stories.js +1 -1
  301. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  302. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +3 -0
  303. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  304. package/lib/build/LifeCycle/LifeCycle.mocks.js +106 -18
  305. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  306. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
  307. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  308. package/lib/build/LifeCycle/LifeCycle.stories.js +115 -31
  309. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  310. package/lib/build/LifeCycle/utils.d.ts.map +1 -1
  311. package/lib/build/LifeCycle/utils.js +5 -4
  312. package/lib/build/LifeCycle/utils.js.map +1 -1
  313. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +24 -0
  314. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  315. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
  316. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  317. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
  318. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  319. package/lib/build/ObjectSelect/ObjectSelect.stories.js +16 -140
  320. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  321. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
  322. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
  323. package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
  324. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
  325. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
  326. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
  327. package/lib/build/PageTemplates/GalleryPage.stories.js +4 -80
  328. package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
  329. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
  330. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
  331. package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
  332. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
  333. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
  334. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  335. package/lib/build/PageTemplates/PageTemplates.stories.js +19 -109
  336. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  337. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  338. package/lib/build/Workbench/Workbench.stories.js +12 -20
  339. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  340. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
  341. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
  342. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
  343. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
  344. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
  345. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  346. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +59 -57
  347. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  348. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
  349. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
  350. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
  351. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
  352. package/lib/core/AppShell/AppShell.mocks.js +5 -5
  353. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  354. package/lib/core/AppShell/AppShell.stories.js +8 -8
  355. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  356. package/lib/core/Avatar/Avatar.stories.js +6 -6
  357. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  358. package/lib/core/Backdrop/Backdrop.stories.js +2 -2
  359. package/lib/core/Backdrop/Backdrop.stories.js.map +1 -1
  360. package/lib/core/Badges/Alert.stories.js +1 -1
  361. package/lib/core/Badges/Alert.stories.js.map +1 -1
  362. package/lib/core/Badges/Count.stories.js +1 -1
  363. package/lib/core/Badges/Count.stories.js.map +1 -1
  364. package/lib/core/Badges/Selection.stories.js +1 -1
  365. package/lib/core/Badges/Selection.stories.js.map +1 -1
  366. package/lib/core/Badges/Status.stories.js +2 -2
  367. package/lib/core/Badges/Status.stories.js.map +1 -1
  368. package/lib/core/Badges/Tag.stories.js +1 -1
  369. package/lib/core/Badges/Tag.stories.js.map +1 -1
  370. package/lib/core/Banner/Banner.mocks.js +1 -1
  371. package/lib/core/Banner/Banner.mocks.js.map +1 -1
  372. package/lib/core/Banner/Banner.stories.js +11 -11
  373. package/lib/core/Banner/Banner.stories.js.map +1 -1
  374. package/lib/core/Boolean/BooleanDisplay.stories.js +1 -1
  375. package/lib/core/Boolean/BooleanDisplay.stories.js.map +1 -1
  376. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js +2 -2
  377. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  378. package/lib/core/Button/Button.stories.js +8 -8
  379. package/lib/core/Button/Button.stories.js.map +1 -1
  380. package/lib/core/Card/Card.stories.js +4 -4
  381. package/lib/core/Card/Card.stories.js.map +1 -1
  382. package/lib/core/Checkbox/Checkbox.stories.js +3 -3
  383. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  384. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js +3 -3
  385. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  386. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  387. package/lib/core/ColorPicker/ColorPicker.stories.js +7 -15
  388. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  389. package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
  390. package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
  391. package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
  392. package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
  393. package/lib/core/ComboBox/ComboBox.stories.js +6 -6
  394. package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
  395. package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
  396. package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
  397. package/lib/core/Configuration/Configuration.mocks.js +6 -0
  398. package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
  399. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  400. package/lib/core/Configuration/Configuration.stories.js +13 -25
  401. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  402. package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
  403. package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
  404. package/lib/core/Configuration/Configuration.styles.js +12 -0
  405. package/lib/core/Configuration/Configuration.styles.js.map +1 -0
  406. package/lib/core/CreditCard/CreditCard.stories.d.ts +10 -0
  407. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -0
  408. package/lib/core/CreditCard/CreditCard.stories.js +11 -0
  409. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -0
  410. package/lib/core/Currency/Currency.stories.js +2 -2
  411. package/lib/core/Currency/Currency.stories.js.map +1 -1
  412. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  413. package/lib/core/DateTime/DateTime.stories.js +11 -9
  414. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  415. package/lib/core/DateTime/DateTimeDisplay.stories.js +2 -2
  416. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  417. package/lib/core/DateTime/DateTimePicker.stories.js +2 -2
  418. package/lib/core/DateTime/DateTimePicker.stories.js.map +1 -1
  419. package/lib/core/Drawer/Drawer.stories.js +4 -4
  420. package/lib/core/Drawer/Drawer.stories.js.map +1 -1
  421. package/lib/core/Email/EmailDisplay.stories.js +1 -1
  422. package/lib/core/Email/EmailDisplay.stories.js.map +1 -1
  423. package/lib/core/EmojiPicker/EmojiPicker.stories.js +3 -3
  424. package/lib/core/EmojiPicker/EmojiPicker.stories.js.map +1 -1
  425. package/lib/core/EmptyState/EmptyState.stories.js +1 -1
  426. package/lib/core/EmptyState/EmptyState.stories.js.map +1 -1
  427. package/lib/core/ErrorState/ErrorState.stories.js +1 -1
  428. package/lib/core/ErrorState/ErrorState.stories.js.map +1 -1
  429. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js +2 -2
  430. package/lib/core/ExpandCollapse/ExpandCollapse.stories.js.map +1 -1
  431. package/lib/core/FieldGroup/FieldGroup.stories.js +1 -1
  432. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  433. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
  434. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  435. package/lib/core/FieldGroup/FieldGroupList.mocks.js +46 -2
  436. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  437. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  438. package/lib/core/FieldGroup/FieldGroupList.stories.js +13 -57
  439. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  440. package/lib/core/FieldValueList/FieldValueList.stories.js +4 -4
  441. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  442. package/lib/core/File/FileDisplay.stories.js +10 -10
  443. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  444. package/lib/core/File/FileInput.stories.js +2 -2
  445. package/lib/core/File/FileInput.stories.js.map +1 -1
  446. package/lib/core/Flex/FlexContainer.stories.js +7 -7
  447. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  448. package/lib/core/Flex/FlexItem.stories.js +3 -3
  449. package/lib/core/Flex/FlexItem.stories.js.map +1 -1
  450. package/lib/core/Form/Form.mocks.js +3 -3
  451. package/lib/core/Form/Form.mocks.js.map +1 -1
  452. package/lib/core/Form/Form.stories.js +8 -8
  453. package/lib/core/Form/Form.stories.js.map +1 -1
  454. package/lib/core/Grid/GridContainer.stories.js +9 -9
  455. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  456. package/lib/core/Grid/GridItem.stories.js +3 -3
  457. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  458. package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
  459. package/lib/core/HTML/HTML.stories.js +1 -1
  460. package/lib/core/HTML/HTML.stories.js.map +1 -1
  461. package/lib/core/Icon/Icon.mocks.js +1 -1
  462. package/lib/core/Icon/Icon.mocks.js.map +1 -1
  463. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  464. package/lib/core/Icon/Icon.stories.js +12 -35
  465. package/lib/core/Icon/Icon.stories.js.map +1 -1
  466. package/lib/core/Icon/Icon.styles.d.ts +4 -0
  467. package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
  468. package/lib/core/Icon/Icon.styles.js +25 -0
  469. package/lib/core/Icon/Icon.styles.js.map +1 -0
  470. package/lib/core/IconPicker/IconPicker.stories.js +2 -2
  471. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  472. package/lib/core/Image/Image.stories.js +1 -1
  473. package/lib/core/Image/Image.stories.js.map +1 -1
  474. package/lib/core/Input/Input.stories.js +2 -2
  475. package/lib/core/Input/Input.stories.js.map +1 -1
  476. package/lib/core/Label/Label.stories.js +2 -2
  477. package/lib/core/Label/Label.stories.js.map +1 -1
  478. package/lib/core/Lightbox/Lightbox.stories.js +3 -3
  479. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  480. package/lib/core/Link/Link.stories.d.ts +1 -11
  481. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  482. package/lib/core/Link/Link.stories.js +3 -3
  483. package/lib/core/Link/Link.stories.js.map +1 -1
  484. package/lib/core/List/CommaSeparatedList.stories.js +1 -1
  485. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  486. package/lib/core/List/OrderedList.stories.js +1 -1
  487. package/lib/core/List/OrderedList.stories.js.map +1 -1
  488. package/lib/core/List/UnorderedList.stories.js +1 -1
  489. package/lib/core/List/UnorderedList.stories.js.map +1 -1
  490. package/lib/core/ListToolbar/ListToolbar.mocks.js +5 -5
  491. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -1
  492. package/lib/core/ListToolbar/ListToolbar.stories.js +2 -2
  493. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  494. package/lib/core/Location/Location.stories.js +4 -4
  495. package/lib/core/Location/Location.stories.js.map +1 -1
  496. package/lib/core/Menu/Menu.stories.js +5 -5
  497. package/lib/core/Menu/Menu.stories.js.map +1 -1
  498. package/lib/core/MenuButton/MenuButton.stories.js +9 -9
  499. package/lib/core/MenuButton/MenuButton.stories.js.map +1 -1
  500. package/lib/core/MetaList/MetaList.stories.js +3 -3
  501. package/lib/core/MetaList/MetaList.stories.js.map +1 -1
  502. package/lib/core/Modal/Modal.mocks.js +8 -8
  503. package/lib/core/Modal/Modal.mocks.js.map +1 -1
  504. package/lib/core/Modal/Modal.stories.js +29 -29
  505. package/lib/core/Modal/Modal.stories.js.map +1 -1
  506. package/lib/core/MultiStep/MultiStep.stories.js +3 -3
  507. package/lib/core/MultiStep/MultiStep.stories.js.map +1 -1
  508. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  509. package/lib/core/Number/Number.stories.js +5 -3
  510. package/lib/core/Number/Number.stories.js.map +1 -1
  511. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  512. package/lib/core/PageTemplates/PageTemplates.stories.js +28 -38
  513. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  514. package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
  515. package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
  516. package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
  517. package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
  518. package/lib/core/Pagination/Pagination.stories.js +1 -1
  519. package/lib/core/Pagination/Pagination.stories.js.map +1 -1
  520. package/lib/core/Paragraph/ParagraphDisplay.stories.js +1 -1
  521. package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
  522. package/lib/core/Phone/Phone.stories.js +2 -2
  523. package/lib/core/Phone/Phone.stories.js.map +1 -1
  524. package/lib/core/Popover/Popover.stories.js +2 -2
  525. package/lib/core/Popover/Popover.stories.js.map +1 -1
  526. package/lib/core/Progress/Progress.stories.js +3 -3
  527. package/lib/core/Progress/Progress.stories.js.map +1 -1
  528. package/lib/core/RadioButton/RadioButton.stories.js +3 -3
  529. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  530. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +3 -3
  531. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  532. package/lib/core/Rating/Rating.stories.js +2 -2
  533. package/lib/core/Rating/Rating.stories.js.map +1 -1
  534. package/lib/core/SearchInput/SearchInput.stories.js +2 -2
  535. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  536. package/lib/core/Select/Select.stories.js +2 -2
  537. package/lib/core/Select/Select.stories.js.map +1 -1
  538. package/lib/core/Sentiment/Sentiment.stories.js +2 -2
  539. package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
  540. package/lib/core/Slider/Slider.stories.js +1 -1
  541. package/lib/core/Slider/Slider.stories.js.map +1 -1
  542. package/lib/core/SummaryItem/SummaryItem.stories.js +4 -4
  543. package/lib/core/SummaryItem/SummaryItem.stories.js.map +1 -1
  544. package/lib/core/SummaryList/SummaryList.mocks.js +2 -2
  545. package/lib/core/SummaryList/SummaryList.mocks.js.map +1 -1
  546. package/lib/core/SummaryList/SummaryList.stories.js +5 -5
  547. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  548. package/lib/core/Switch/Switch.stories.js +3 -3
  549. package/lib/core/Switch/Switch.stories.js.map +1 -1
  550. package/lib/core/Table/Table.mocks.js +1 -1
  551. package/lib/core/Table/Table.mocks.js.map +1 -1
  552. package/lib/core/Table/Table.stories.js +9 -9
  553. package/lib/core/Table/Table.stories.js.map +1 -1
  554. package/lib/core/Tabs/Tabs.stories.js +3 -3
  555. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  556. package/lib/core/Text/Text.stories.js +2 -2
  557. package/lib/core/Text/Text.stories.js.map +1 -1
  558. package/lib/core/TextArea/TextArea.stories.js +2 -2
  559. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  560. package/lib/core/Toaster/Toaster.stories.js +2 -2
  561. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  562. package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
  563. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  564. package/lib/core/Tooltip/Tooltip.stories.js +2 -2
  565. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  566. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  567. package/lib/core/Tree/Tree.stories.js +5 -5
  568. package/lib/core/Tree/Tree.stories.js.map +1 -1
  569. package/lib/core/URL/URL.stories.js +1 -1
  570. package/lib/core/URL/URL.stories.js.map +1 -1
  571. package/lib/cs/Article/Article.stories.d.ts +2 -10
  572. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  573. package/lib/cs/Article/Article.stories.js +9 -9
  574. package/lib/cs/Article/Article.stories.js.map +1 -1
  575. package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
  576. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  577. package/lib/cs/ArticleList/ArticleList.stories.js +11 -11
  578. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  579. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
  580. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
  581. package/lib/cs/CSCaseView/CSAppShell.stories.js +15 -28
  582. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
  583. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
  584. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
  585. package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
  586. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
  587. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
  588. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  589. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +6 -6
  590. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  591. package/lib/cs/DialPad/DialPad.stories.js +1 -1
  592. package/lib/cs/DialPad/DialPad.stories.js.map +1 -1
  593. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
  594. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  595. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +18 -18
  596. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  597. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
  598. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  599. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
  600. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  601. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
  602. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
  603. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
  604. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
  605. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
  606. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  607. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +7 -31
  608. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  609. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
  610. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  611. package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
  612. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  613. package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
  614. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  615. package/lib/cs/TaskManager/TaskManager.stories.js +33 -37
  616. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  617. package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
  618. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
  619. package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
  620. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
  621. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
  622. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
  623. package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
  624. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
  625. package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
  626. package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
  627. package/lib/dnd/DragDropList/DragDropList.stories.js +16 -87
  628. package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
  629. package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
  630. package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
  631. package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
  632. package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
  633. package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
  634. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
  635. package/lib/rte/Editor/Editor.mocks.js +23 -0
  636. package/lib/rte/Editor/Editor.mocks.js.map +1 -0
  637. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  638. package/lib/rte/Editor/Editor.stories.js +7 -27
  639. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  640. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js +5 -5
  641. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js.map +1 -1
  642. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
  643. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  644. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +5 -5
  645. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  646. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +5 -5
  647. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  648. package/lib/social/Chat/Chat.stories.js +27 -27
  649. package/lib/social/Chat/Chat.stories.js.map +1 -1
  650. package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
  651. package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
  652. package/lib/social/Chat/RepeatingView.mocks.js +11 -0
  653. package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
  654. package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
  655. package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
  656. package/lib/social/Chat/RepeatingView.stories.js +18 -48
  657. package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
  658. package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
  659. package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
  660. package/lib/social/Chat/RepeatingView.styles.js +22 -0
  661. package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
  662. package/lib/social/Email/Email.mocks.d.ts +155 -2
  663. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  664. package/lib/social/Email/Email.mocks.js +372 -0
  665. package/lib/social/Email/Email.mocks.js.map +1 -1
  666. package/lib/social/Email/Email.stories.d.ts +14 -14
  667. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  668. package/lib/social/Email/Email.stories.js +120 -460
  669. package/lib/social/Email/Email.stories.js.map +1 -1
  670. package/lib/social/Email/Email.styles.d.ts +4 -0
  671. package/lib/social/Email/Email.styles.d.ts.map +1 -0
  672. package/lib/social/Email/Email.styles.js +14 -0
  673. package/lib/social/Email/Email.styles.js.map +1 -0
  674. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  675. package/lib/social/Feed/Feed.mocks.js +40 -40
  676. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  677. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  678. package/lib/social/Feed/Feed.stories.js +29 -24
  679. package/lib/social/Feed/Feed.stories.js.map +1 -1
  680. package/lib/social/Feed/FeedNewPost.stories.js +2 -2
  681. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  682. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  683. package/lib/social/Feed/FeedPost.stories.js +37 -27
  684. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  685. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  686. package/lib/social/Feed/FeedReply.stories.js +25 -20
  687. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  688. package/lib/social/Feed/FeedReplyInput.stories.js +2 -2
  689. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  690. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +1 -1
  691. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
  692. package/lib/work/CaseView/Attachments.mocks.js +15 -15
  693. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  694. package/lib/work/CaseView/CaseView.mocks.js +7 -7
  695. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  696. package/lib/work/CaseView/CaseView.stories.js +21 -21
  697. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  698. package/lib/work/CaseView/Details.mocks.js +1 -1
  699. package/lib/work/CaseView/Details.mocks.js.map +1 -1
  700. package/lib/work/CaseView/FileService.mock.js +1 -1
  701. package/lib/work/CaseView/FileService.mock.js.map +1 -1
  702. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
  703. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  704. package/lib/work/CaseView/MobileCaseView.stories.js +1 -1
  705. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  706. package/lib/work/CaseView/Pulse.mocks.js +2 -2
  707. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  708. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
  709. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
  710. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
  711. package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
  712. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
  713. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  714. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +4 -174
  715. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  716. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
  717. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
  718. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
  719. package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
  720. package/lib/work/Confirmation/Confirmation.stories.js +2 -2
  721. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  722. package/lib/work/Details/Details.stories.js +15 -15
  723. package/lib/work/Details/Details.stories.js.map +1 -1
  724. package/lib/work/Glimpse/Glimpse.stories.d.ts.map +1 -1
  725. package/lib/work/Glimpse/Glimpse.stories.js +3 -3
  726. package/lib/work/Glimpse/Glimpse.stories.js.map +1 -1
  727. package/lib/work/SearchResults/SearchResults.mocks.js +4 -4
  728. package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
  729. package/lib/work/SearchResults/SearchResults.stories.js +11 -11
  730. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  731. package/lib/work/Stages/Stages.stories.js +2 -2
  732. package/lib/work/Stages/Stages.stories.js.map +1 -1
  733. package/lib/work/Stakeholders/Stakeholders.mocks.js +2 -2
  734. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
  735. package/lib/work/Stakeholders/Stakeholders.stories.js +1 -1
  736. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  737. package/lib/work/Tags/Tags.stories.js +1 -1
  738. package/lib/work/Tags/Tags.stories.js.map +1 -1
  739. package/lib/work/Tasks/TaskList.stories.js +3 -3
  740. package/lib/work/Tasks/TaskList.stories.js.map +1 -1
  741. package/lib/work/Tasks/Tasks.stories.js +11 -11
  742. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  743. package/lib/work/Timeline/Timeline.mocks.js +8 -8
  744. package/lib/work/Timeline/Timeline.mocks.js.map +1 -1
  745. package/lib/work/Timeline/Timeline.stories.js +2 -2
  746. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  747. package/package.json +10 -11
  748. package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  749. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
  750. package/jsx/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
  751. package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
  752. package/jsx/social/Email/Email.mocks.js +0 -395
  753. package/jsx/social/Email/Email.mocks.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
3
  import { action } from '@storybook/addon-actions';
4
- import { optionsKnob } from '@storybook/addon-knobs';
5
- import styled from 'styled-components';
6
- import { Button, Flex, createUID } from '@pega/cosmos-react-core';
4
+ import { Button, Flex } from '@pega/cosmos-react-core';
7
5
  import { DragDropManager, DragDropList } from '@pega/cosmos-react-dnd';
6
+ import { StyledDemoDragDropList } from './DragDropList.styles';
7
+ import { createMockDataArray, DemoListItem, EmptyItem, itemType, mockDataArrayA, mockDataArrayB, sort } from './DragDropList.mocks';
8
8
  export default {
9
9
  title: 'DnD/DragDropList',
10
10
  component: DragDropList,
@@ -12,102 +12,31 @@ export default {
12
12
  layout: 'fullscreen'
13
13
  }
14
14
  };
15
- // Helper function to create demo arrays
16
- const createMockDataArray = (length, type, listId) => {
17
- return Array.from({ length }, (_, i) => {
18
- const id = `${i}`;
19
- return {
20
- type,
21
- id: createUID(),
22
- data: {
23
- content: `Item ${listId}:${id}`,
24
- color: `hsl(${(i * 360) / length}deg, 100%, 66%)`
25
- }
26
- };
27
- });
28
- };
29
- // styled demo list component
30
- const StyledEmptyItem = styled.li `
31
- display: grid;
32
- padding: 1rem;
33
- gap: 1rem;
34
- `;
35
- // Demo component used to render list items
36
- const EmptyItem = () => {
37
- return _jsx(StyledEmptyItem, { children: "No Items" }, void 0);
38
- };
39
- // styled demo list component
40
- const StyledDemoDragDropList = styled.ul `
41
- list-style: none;
42
- position: relative;
43
- display: flex;
44
- flex-direction: column;
45
- flex-grow: 1;
46
- padding: 0.5rem;
47
- `;
48
- // styled demo list item component
49
- const StyledDemoDragDropListItem = styled.li `
50
- border: 0.0625rem dashed gray;
51
- margin: 0.5rem;
52
- padding: 0.5rem;
53
- background: white;
54
- cursor: ${({ useDragHandle }) => (useDragHandle ? 'auto' : 'move')};
55
- transition: transform 0.3s;
56
-
57
- .handle {
58
- background: pink;
59
- width: 1rem;
60
- height: 1rem;
61
- display: inline-block;
62
- margin-right: 0.0625rem;
63
- cursor: move;
64
- }
65
- `;
66
- // Demo component used to render list items
67
- const DemoListItem = ({ id, type, dragRef, data, isDragging, ...restProps }) => {
68
- return (_jsx(StyledDemoDragDropListItem, { ref: dragRef, style: {
69
- opacity: isDragging ? '0.5' : undefined,
70
- backgroundColor: data?.color ?? 'white'
71
- }, ...restProps, children: data?.content }, void 0));
72
- };
73
- const pullModes = {
74
- remove: 'remove',
75
- clone: 'clone'
76
- };
77
- const pushModes = {
78
- insert: 'insert',
79
- prepend: 'prepend',
80
- append: 'append',
81
- sort: 'sort'
82
- };
83
- const sort = (a, b) => {
84
- return a.data.content.localeCompare(b.data.content);
85
- };
86
- const itemType = Symbol('');
87
- const mockDataArrayA = createMockDataArray(10, itemType, 'A');
88
- const mockDataArrayB = createMockDataArray(4, itemType, 'B');
89
- // -----------------------------------------------------------------------------
90
- // DragDropList
91
- // -----------------------------------------------------------------------------
92
- export const DragDropListDemo = () => {
93
- const pullMode = optionsKnob('Pull Mode', pullModes, 'remove', { display: 'inline-radio' });
94
- const pushMode = optionsKnob('Push Mode', pushModes, 'insert', { display: 'inline-radio' });
15
+ export const DragDropListDemo = (args) => {
95
16
  const [arrayA, setArrayA] = useState(mockDataArrayA);
96
17
  const [arrayB, setArrayB] = useState(mockDataArrayB);
97
18
  return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: useCallback(() => {
98
19
  setArrayA(items => {
99
20
  return [...items, ...createMockDataArray(1, itemType, 'A-new')];
100
21
  });
101
- }, []), children: "Add to List A" }, void 0), _jsx(Button, { onClick: useCallback(() => {
22
+ }, []), children: "Add to List A" }), _jsx(Button, { onClick: useCallback(() => {
102
23
  setArrayB(items => {
103
24
  return [...items, ...createMockDataArray(1, itemType, 'B-new')];
104
25
  });
105
- }, []), children: "Add to List B" }, void 0), _jsx(DragDropManager, { children: _jsxs(Flex, { container: true, style: { minHeight: '100vh' }, children: [_jsx(DragDropList, { as: StyledDemoDragDropList, id: 'list1', accept: itemType, pullMode: pullMode, pushMode: pushMode === 'sort' ? sort : pushMode, items: arrayA, itemRenderer: DemoListItem, emptyRenderer: EmptyItem, onChange: newArray => {
26
+ }, []), children: "Add to List B" }), _jsx(DragDropManager, { children: _jsxs(Flex, { container: true, style: { minHeight: '100vh' }, children: [_jsx(DragDropList, { as: StyledDemoDragDropList, id: 'list1', accept: itemType, pullMode: args.pullMode, pushMode: args.pushMode === 'sort' ? sort : args.pushMode, items: arrayA, itemRenderer: DemoListItem, emptyRenderer: EmptyItem, onChange: newArray => {
106
27
  setArrayA(newArray);
107
28
  action('List A changed')(newArray);
108
- }, style: { background: 'palegreen' } }, void 0), _jsx(DragDropList, { as: StyledDemoDragDropList, id: 'list2', accept: itemType, pullMode: pullMode, pushMode: pushMode === 'sort' ? sort : pushMode, items: arrayB, itemRenderer: DemoListItem, emptyRenderer: EmptyItem, onChange: newArray => {
29
+ }, style: { background: 'palegreen' } }), _jsx(DragDropList, { as: StyledDemoDragDropList, id: 'list2', accept: itemType, pullMode: args.pullMode, pushMode: args.pushMode === 'sort' ? sort : args.pushMode, items: arrayB, itemRenderer: DemoListItem, emptyRenderer: EmptyItem, onChange: newArray => {
109
30
  setArrayB(newArray);
110
31
  action('List B changed')(newArray);
111
- }, style: { background: 'lightblue' } }, void 0)] }, void 0) }, void 0)] }, void 0));
32
+ }, style: { background: 'lightblue' } })] }) })] }));
33
+ };
34
+ DragDropListDemo.args = {
35
+ pullMode: 'remove',
36
+ pushMode: 'insert'
37
+ };
38
+ DragDropListDemo.argTypes = {
39
+ pullMode: { options: ['remove', 'clone'], control: { type: 'select' } },
40
+ pushMode: { options: ['insert', 'prepend', 'append', 'sort'], control: { type: 'select' } }
112
41
  };
113
42
  //# sourceMappingURL=DragDropList.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DragDropList.stories.js","sourceRoot":"","sources":["../../../src/dnd/DragDropList/DragDropList.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EACL,eAAe,EAGf,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAEhC,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAOF,wCAAwC;AACxC,MAAM,mBAAmB,GAAG,CAC1B,MAAc,EACd,IAA4B,EAC5B,MAAc,EACa,EAAE;IAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO;YACL,IAAI;YACJ,EAAE,EAAE,SAAS,EAAE;YACf,IAAI,EAAE;gBACJ,OAAO,EAAE,QAAQ,MAAM,IAAI,EAAE,EAAE;gBAC/B,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,MAAM,iBAAiB;aAClD;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,6BAA6B;AAC7B,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA;;;;CAIhC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,SAAS,GAAG,GAAG,EAAE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AAS,QAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,aAC3C,KAAC,YAAY,IACX,EAAE,EAAE,sBAAsB,EAC1B,EAAE,EAAC,OAAO,EACV,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAC/C,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,QAAQ,CAAC,EAAE;gCACnB,SAAS,CAAC,QAAQ,CAAC,CAAC;gCACpB,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;4BACrC,CAAC,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,WAClC,EAEF,KAAC,YAAY,IACX,EAAE,EAAE,sBAAsB,EAC1B,EAAE,EAAC,OAAO,EACV,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAC/C,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,QAAQ,CAAC,EAAE;gCACnB,SAAS,CAAC,QAAQ,CAAC,CAAC;gCACpB,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;4BACrC,CAAC,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,WAClC,YACG,WACS,YACjB,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { optionsKnob } from '@storybook/addon-knobs';\nimport styled from 'styled-components';\n\nimport { Button, Flex, createUID } from '@pega/cosmos-react-core';\nimport {\n DragDropManager,\n DraggableItem,\n DraggableProps,\n DragDropList,\n ItemRendererProps\n} from '@pega/cosmos-react-dnd';\n\nexport default {\n title: 'DnD/DragDropList',\n component: DragDropList,\n parameters: {\n layout: 'fullscreen'\n }\n};\n\ninterface ItemData {\n content: string;\n color: string;\n}\n\n// Helper function to create demo arrays\nconst createMockDataArray = (\n length: number,\n type: DraggableProps['type'],\n listId: string\n): DraggableItem<ItemData>[] => {\n return Array.from({ length }, (_, i) => {\n const id = `${i}`;\n return {\n type,\n id: createUID(),\n data: {\n content: `Item ${listId}:${id}`,\n color: `hsl(${(i * 360) / length}deg, 100%, 66%)`\n }\n };\n });\n};\n\n// styled demo list component\nconst StyledEmptyItem = styled.li`\n display: grid;\n padding: 1rem;\n gap: 1rem;\n`;\n\n// Demo component used to render list items\nconst EmptyItem = () => {\n return <StyledEmptyItem>No Items</StyledEmptyItem>;\n};\n\n// styled demo list component\nconst StyledDemoDragDropList = styled.ul`\n list-style: none;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding: 0.5rem;\n`;\n\n// styled demo list item component\nconst StyledDemoDragDropListItem = styled.li<{ [key: string]: any }>`\n border: 0.0625rem dashed gray;\n margin: 0.5rem;\n padding: 0.5rem;\n background: white;\n cursor: ${({ useDragHandle }) => (useDragHandle ? 'auto' : 'move')};\n transition: transform 0.3s;\n\n .handle {\n background: pink;\n width: 1rem;\n height: 1rem;\n display: inline-block;\n margin-right: 0.0625rem;\n cursor: move;\n }\n`;\n\n// Demo component used to render list items\nconst DemoListItem = ({\n id,\n type,\n dragRef,\n data,\n isDragging,\n ...restProps\n}: ItemRendererProps<ItemData>) => {\n return (\n <StyledDemoDragDropListItem\n ref={dragRef}\n style={{\n opacity: isDragging ? '0.5' : undefined,\n backgroundColor: data?.color ?? 'white'\n }}\n {...restProps}\n >\n {data?.content}\n </StyledDemoDragDropListItem>\n );\n};\n\nconst pullModes = {\n remove: 'remove',\n clone: 'clone'\n} as const;\n\nconst pushModes = {\n insert: 'insert',\n prepend: 'prepend',\n append: 'append',\n sort: 'sort'\n} as const;\n\nconst sort = (a: DraggableItem<ItemData>, b: DraggableItem<ItemData>): number => {\n return a.data!.content.localeCompare(b.data!.content);\n};\n\nconst itemType = Symbol('');\nconst mockDataArrayA = createMockDataArray(10, itemType, 'A');\nconst mockDataArrayB = createMockDataArray(4, itemType, 'B');\n\n// -----------------------------------------------------------------------------\n// DragDropList\n// -----------------------------------------------------------------------------\nexport const DragDropListDemo = () => {\n const pullMode = optionsKnob('Pull Mode', pullModes, 'remove', { display: 'inline-radio' });\n const pushMode = optionsKnob('Push Mode', pushModes, 'insert', { display: 'inline-radio' });\n\n const [arrayA, setArrayA] = useState(mockDataArrayA);\n const [arrayB, setArrayB] = useState(mockDataArrayB);\n\n return (\n <>\n <Button\n onClick={useCallback(() => {\n setArrayA(items => {\n return [...items, ...createMockDataArray(1, itemType, 'A-new')];\n });\n }, [])}\n >\n Add to List A\n </Button>\n <Button\n onClick={useCallback(() => {\n setArrayB(items => {\n return [...items, ...createMockDataArray(1, itemType, 'B-new')];\n });\n }, [])}\n >\n Add to List B\n </Button>\n <DragDropManager>\n <Flex container style={{ minHeight: '100vh' }}>\n <DragDropList\n as={StyledDemoDragDropList}\n id='list1'\n accept={itemType}\n pullMode={pullMode}\n pushMode={pushMode === 'sort' ? sort : pushMode}\n items={arrayA}\n itemRenderer={DemoListItem}\n emptyRenderer={EmptyItem}\n onChange={newArray => {\n setArrayA(newArray);\n action('List A changed')(newArray);\n }}\n style={{ background: 'palegreen' }}\n />\n\n <DragDropList\n as={StyledDemoDragDropList}\n id='list2'\n accept={itemType}\n pullMode={pullMode}\n pushMode={pushMode === 'sort' ? sort : pushMode}\n items={arrayB}\n itemRenderer={DemoListItem}\n emptyRenderer={EmptyItem}\n onChange={newArray => {\n setArrayB(newArray);\n action('List B changed')(newArray);\n }}\n style={{ background: 'lightblue' }}\n />\n </Flex>\n </DragDropManager>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"DragDropList.stories.js","source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AE,UAAU,EAAE,WAAW,EAAE,GAClC,IACG,GACS,IACjB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,IAAI,GAAG;IACtB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,gBAAgB,CAAC,QAAQ,GAAG;IAC1B,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACvE,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CAC5F,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Meta, Story } from '@storybook/react';\n\nimport { Button, Flex } from '@pega/cosmos-react-core';\nimport { DragDropManager, DragDropList, DragDropListProps } from '@pega/cosmos-react-dnd';\n\nimport { StyledDemoDragDropList } from './DragDropList.styles';\nimport {\n createMockDataArray,\n DemoListItem,\n EmptyItem,\n itemType,\n mockDataArrayA,\n mockDataArrayB,\n sort\n} from './DragDropList.mocks';\n\nexport default {\n title: 'DnD/DragDropList',\n component: DragDropList,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\ninterface DragDropListDemoProps {\n pullMode?: DragDropListProps['pullMode'];\n pushMode?: DragDropListProps['pushMode'] | 'sort';\n}\n\nexport const DragDropListDemo: Story<DragDropListDemoProps> = (args: DragDropListDemoProps) => {\n const [arrayA, setArrayA] = useState(mockDataArrayA);\n const [arrayB, setArrayB] = useState(mockDataArrayB);\n\n return (\n <>\n <Button\n onClick={useCallback(() => {\n setArrayA(items => {\n return [...items, ...createMockDataArray(1, itemType, 'A-new')];\n });\n }, [])}\n >\n Add to List A\n </Button>\n <Button\n onClick={useCallback(() => {\n setArrayB(items => {\n return [...items, ...createMockDataArray(1, itemType, 'B-new')];\n });\n }, [])}\n >\n Add to List B\n </Button>\n <DragDropManager>\n <Flex container style={{ minHeight: '100vh' }}>\n <DragDropList\n as={StyledDemoDragDropList}\n id='list1'\n accept={itemType}\n pullMode={args.pullMode}\n pushMode={args.pushMode === 'sort' ? sort : args.pushMode}\n items={arrayA}\n itemRenderer={DemoListItem}\n emptyRenderer={EmptyItem}\n onChange={newArray => {\n setArrayA(newArray);\n action('List A changed')(newArray);\n }}\n style={{ background: 'palegreen' }}\n />\n\n <DragDropList\n as={StyledDemoDragDropList}\n id='list2'\n accept={itemType}\n pullMode={args.pullMode}\n pushMode={args.pushMode === 'sort' ? sort : args.pushMode}\n items={arrayB}\n itemRenderer={DemoListItem}\n emptyRenderer={EmptyItem}\n onChange={newArray => {\n setArrayB(newArray);\n action('List B changed')(newArray);\n }}\n style={{ background: 'lightblue' }}\n />\n </Flex>\n </DragDropManager>\n </>\n );\n};\n\nDragDropListDemo.args = {\n pullMode: 'remove',\n pushMode: 'insert'\n};\n\nDragDropListDemo.argTypes = {\n pullMode: { options: ['remove', 'clone'], control: { type: 'select' } },\n pushMode: { options: ['insert', 'prepend', 'append', 'sort'], control: { type: 'select' } }\n};\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const StyledEmptyItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledDemoDragDropList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledDemoDragDropListItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {
4
+ [key: string]: any;
5
+ }, never>;
6
+ //# sourceMappingURL=DragDropList.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragDropList.styles.d.ts","sourceRoot":"","sources":["../../../src/dnd/DragDropList/DragDropList.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,wGAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,wGAOlC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;SAgBtC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import styled from 'styled-components';
2
+ export const StyledEmptyItem = styled.li `
3
+ display: grid;
4
+ padding: 1rem;
5
+ gap: 1rem;
6
+ `;
7
+ export const StyledDemoDragDropList = styled.ul `
8
+ list-style: none;
9
+ position: relative;
10
+ display: flex;
11
+ flex-direction: column;
12
+ flex-grow: 1;
13
+ padding: 0.5rem;
14
+ `;
15
+ export const StyledDemoDragDropListItem = styled.li `
16
+ border: 0.0625rem dashed gray;
17
+ margin: 0.5rem;
18
+ padding: 0.5rem;
19
+ background: white;
20
+ cursor: ${({ useDragHandle }) => (useDragHandle ? 'auto' : 'move')};
21
+ transition: transform 0.3s;
22
+
23
+ .handle {
24
+ background: pink;
25
+ width: 1rem;
26
+ height: 1rem;
27
+ display: inline-block;
28
+ margin-right: 0.0625rem;
29
+ cursor: move;
30
+ }
31
+ `;
32
+ //# sourceMappingURL=DragDropList.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragDropList.styles.js","sourceRoot":"","sources":["../../../src/dnd/DragDropList/DragDropList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA;;;;CAIvC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;CAO9C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,EAAE,CAAwB;;;;;YAK/D,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;;;;;;;CAWnE,CAAC","sourcesContent":["import styled from 'styled-components';\n\nexport const StyledEmptyItem = styled.li`\n display: grid;\n padding: 1rem;\n gap: 1rem;\n`;\n\nexport const StyledDemoDragDropList = styled.ul`\n list-style: none;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding: 0.5rem;\n`;\n\nexport const StyledDemoDragDropListItem = styled.li<{ [key: string]: any }>`\n border: 0.0625rem dashed gray;\n margin: 0.5rem;\n padding: 0.5rem;\n background: white;\n cursor: ${({ useDragHandle }) => (useDragHandle ? 'auto' : 'move')};\n transition: transform 0.3s;\n\n .handle {\n background: pink;\n width: 1rem;\n height: 1rem;\n display: inline-block;\n margin-right: 0.0625rem;\n cursor: move;\n }\n`;\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const label = "Form field label";
2
+ export declare class PegaCustomElement extends HTMLElement {
3
+ removeElements(): void;
4
+ connectedCallback(): void;
5
+ }
6
+ //# sourceMappingURL=Editor.mocks.d.ts.map
@@ -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,CAA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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,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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CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,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