@pega/cosmos-react-demos 3.0.0-dev.7.0 → 3.0.0-dev.9.1

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 (449) hide show
  1. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  2. package/jsx/build/AppShell/AppShell.mocks.jsx +9 -13
  3. package/jsx/build/AppShell/AppShell.mocks.jsx.map +1 -1
  4. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -3
  5. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  6. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  7. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +15 -15
  8. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  9. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx +49 -46
  10. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -1
  11. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +3 -4
  12. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  13. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +132 -58
  14. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  15. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -3
  16. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  17. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
  18. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +5 -6
  19. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  20. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
  21. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  22. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +7 -3
  23. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -1
  24. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +1 -2
  25. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  26. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +1 -1
  27. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  28. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +6 -0
  29. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  30. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +145 -2
  31. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -1
  32. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +4 -8
  33. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  34. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +24 -137
  35. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  36. package/jsx/core/Badges/Keyboard.stories.d.ts +6 -0
  37. package/jsx/core/Badges/Keyboard.stories.d.ts.map +1 -0
  38. package/jsx/core/Badges/Keyboard.stories.jsx +17 -0
  39. package/jsx/core/Badges/Keyboard.stories.jsx.map +1 -0
  40. package/jsx/core/Badges/Selection.stories.d.ts +2 -3
  41. package/jsx/core/Badges/Selection.stories.d.ts.map +1 -1
  42. package/jsx/core/Badges/Selection.stories.jsx.map +1 -1
  43. package/jsx/core/Badges/Tag.stories.d.ts +2 -3
  44. package/jsx/core/Badges/Tag.stories.d.ts.map +1 -1
  45. package/jsx/core/Badges/Tag.stories.jsx.map +1 -1
  46. package/jsx/core/Banner/Banner.stories.d.ts +7 -18
  47. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  48. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  49. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -4
  50. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  51. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx.map +1 -1
  52. package/jsx/core/Button/Button.stories.d.ts +2 -3
  53. package/jsx/core/Button/Button.stories.d.ts.map +1 -1
  54. package/jsx/core/Button/Button.stories.jsx.map +1 -1
  55. package/jsx/core/Card/Card.stories.d.ts +1 -2
  56. package/jsx/core/Card/Card.stories.d.ts.map +1 -1
  57. package/jsx/core/Card/Card.stories.jsx.map +1 -1
  58. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts +3 -3
  59. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  60. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx.map +1 -1
  61. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts +1 -2
  62. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  63. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  64. package/jsx/core/Configuration/Configuration.stories.d.ts +2 -3
  65. package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
  66. package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
  67. package/jsx/core/CreditCard/CreditCard.stories.d.ts +3 -2
  68. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  69. package/jsx/core/CreditCard/CreditCard.stories.jsx +41 -6
  70. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -1
  71. package/jsx/core/Currency/Currency.stories.d.ts +2 -2
  72. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  73. package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
  74. package/jsx/core/DateTime/DateTime.stories.jsx +1 -1
  75. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  76. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +6 -6
  77. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  78. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  79. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts +2 -2
  80. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  81. package/jsx/core/FieldValueList/FieldValueList.stories.jsx.map +1 -1
  82. package/jsx/core/Flex/FlexContainer.stories.d.ts +1 -2
  83. package/jsx/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  84. package/jsx/core/Flex/FlexContainer.stories.jsx.map +1 -1
  85. package/jsx/core/Grid/GridContainer.stories.d.ts +4 -5
  86. package/jsx/core/Grid/GridContainer.stories.d.ts.map +1 -1
  87. package/jsx/core/Grid/GridContainer.stories.jsx.map +1 -1
  88. package/jsx/core/Grid/GridItem.stories.d.ts +1 -2
  89. package/jsx/core/Grid/GridItem.stories.d.ts.map +1 -1
  90. package/jsx/core/Grid/GridItem.stories.jsx.map +1 -1
  91. package/jsx/core/Icon/Icon.stories.d.ts +5 -6
  92. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  93. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  94. package/jsx/core/Image/Image.stories.d.ts +2 -3
  95. package/jsx/core/Image/Image.stories.d.ts.map +1 -1
  96. package/jsx/core/Image/Image.stories.jsx.map +1 -1
  97. package/jsx/core/List/CommaSeparatedList.stories.d.ts +2 -2
  98. package/jsx/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  99. package/jsx/core/List/CommaSeparatedList.stories.jsx.map +1 -1
  100. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +3 -4
  101. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  102. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  103. package/jsx/core/MenuButton/MenuButton.stories.d.ts +6 -6
  104. package/jsx/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  105. package/jsx/core/MenuButton/MenuButton.stories.jsx.map +1 -1
  106. package/jsx/core/Modal/Modal.stories.d.ts +10 -5
  107. package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
  108. package/jsx/core/Modal/Modal.stories.jsx +6 -1
  109. package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
  110. package/jsx/core/MultiStep/MultiStep.stories.d.ts +2 -3
  111. package/jsx/core/MultiStep/MultiStep.stories.d.ts.map +1 -1
  112. package/jsx/core/MultiStep/MultiStep.stories.jsx.map +1 -1
  113. package/jsx/core/Number/Number.stories.d.ts +7 -3
  114. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  115. package/jsx/core/Number/Number.stories.jsx +22 -6
  116. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  117. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  118. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +20 -32
  119. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  120. package/jsx/core/Phone/Phone.stories.d.ts.map +1 -1
  121. package/jsx/core/Phone/Phone.stories.jsx +3 -1
  122. package/jsx/core/Phone/Phone.stories.jsx.map +1 -1
  123. package/jsx/core/Popover/Popover.stories.d.ts +1 -1
  124. package/jsx/core/Popover/Popover.stories.d.ts.map +1 -1
  125. package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
  126. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -3
  127. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  128. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -1
  129. package/jsx/core/Slider/Slider.stories.d.ts +4 -3
  130. package/jsx/core/Slider/Slider.stories.d.ts.map +1 -1
  131. package/jsx/core/Slider/Slider.stories.jsx +1 -1
  132. package/jsx/core/Slider/Slider.stories.jsx.map +1 -1
  133. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts +5 -5
  134. package/jsx/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  135. package/jsx/core/SummaryItem/SummaryItem.stories.jsx.map +1 -1
  136. package/jsx/core/SummaryList/SummaryList.stories.d.ts +2 -2
  137. package/jsx/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  138. package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
  139. package/jsx/core/Tabs/Tabs.stories.d.ts +5 -2
  140. package/jsx/core/Tabs/Tabs.stories.d.ts.map +1 -1
  141. package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
  142. package/jsx/core/Toaster/Toaster.stories.d.ts +2 -3
  143. package/jsx/core/Toaster/Toaster.stories.d.ts.map +1 -1
  144. package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
  145. package/jsx/core/Tooltip/Tooltip.stories.d.ts +1 -2
  146. package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  147. package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
  148. package/jsx/core/Tree/Tree.stories.d.ts +1 -2
  149. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  150. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  151. package/jsx/cs/Article/Article.stories.d.ts +3 -4
  152. package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
  153. package/jsx/cs/Article/Article.stories.jsx.map +1 -1
  154. package/jsx/cs/ArticleList/ArticleList.stories.d.ts +3 -4
  155. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  156. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  157. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +3 -4
  158. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  159. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  160. package/jsx/rte/Editor/Editor.mocks.d.ts +307 -4
  161. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -1
  162. package/jsx/rte/Editor/Editor.mocks.jsx +16 -13
  163. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -1
  164. package/jsx/rte/Editor/Editor.stories.d.ts +7 -8
  165. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  166. package/jsx/rte/Editor/Editor.stories.jsx +3 -3
  167. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  168. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +5 -5
  169. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  170. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +18 -1
  171. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
  172. package/jsx/social/Chat/Chat.stories.d.ts +6 -7
  173. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  174. package/jsx/social/Chat/Chat.stories.jsx +5 -3
  175. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  176. package/jsx/social/Email/Email.stories.d.ts +5 -11
  177. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  178. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  179. package/jsx/social/Feed/Feed.stories.d.ts +6 -11
  180. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  181. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  182. package/jsx/social/Feed/FeedNewPost.stories.d.ts +7 -14
  183. package/jsx/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  184. package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
  185. package/jsx/social/Feed/FeedPost.stories.d.ts +4 -5
  186. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  187. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  188. package/jsx/social/Feed/FeedReply.stories.d.ts +10 -10
  189. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  190. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  191. package/jsx/social/Feed/FeedReplyInput.stories.d.ts +7 -12
  192. package/jsx/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  193. package/jsx/social/Feed/FeedReplyInput.stories.jsx.map +1 -1
  194. package/jsx/work/CaseView/CaseView.stories.d.ts +4 -11
  195. package/jsx/work/CaseView/CaseView.stories.d.ts.map +1 -1
  196. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  197. package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -3
  198. package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  199. package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
  200. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -3
  201. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  202. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  203. package/jsx/work/Confirmation/Confirmation.stories.jsx +1 -1
  204. package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
  205. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +2 -3
  206. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  207. package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
  208. package/jsx/work/Tasks/Tasks.stories.jsx +1 -1
  209. package/jsx/work/Tasks/Tasks.stories.jsx.map +1 -1
  210. package/jsx/work/Timeline/Timeline.stories.d.ts +1 -2
  211. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  212. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  213. package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
  214. package/lib/build/AppShell/AppShell.mocks.js +7 -11
  215. package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
  216. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -3
  217. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  218. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  219. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +15 -15
  220. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  221. package/lib/build/FlowModeller/FlowModeller.mocks.js +21 -34
  222. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  223. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +3 -4
  224. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  225. package/lib/build/FlowModeller/FlowModeller.stories.js +123 -54
  226. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  227. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -3
  228. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
  229. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
  230. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +5 -6
  231. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
  232. package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
  233. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  234. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +7 -3
  235. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  236. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +1 -2
  237. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  238. package/lib/build/ObjectSelect/ObjectSelect.stories.js +1 -1
  239. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  240. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +6 -0
  241. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  242. package/lib/build/PageTemplates/PageTemplates.mocks.js +143 -2
  243. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -1
  244. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +4 -8
  245. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  246. package/lib/build/PageTemplates/PageTemplates.stories.js +24 -135
  247. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  248. package/lib/core/Badges/Keyboard.stories.d.ts +6 -0
  249. package/lib/core/Badges/Keyboard.stories.d.ts.map +1 -0
  250. package/lib/core/Badges/Keyboard.stories.js +16 -0
  251. package/lib/core/Badges/Keyboard.stories.js.map +1 -0
  252. package/lib/core/Badges/Selection.stories.d.ts +2 -3
  253. package/lib/core/Badges/Selection.stories.d.ts.map +1 -1
  254. package/lib/core/Badges/Selection.stories.js.map +1 -1
  255. package/lib/core/Badges/Tag.stories.d.ts +2 -3
  256. package/lib/core/Badges/Tag.stories.d.ts.map +1 -1
  257. package/lib/core/Badges/Tag.stories.js.map +1 -1
  258. package/lib/core/Banner/Banner.stories.d.ts +7 -18
  259. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  260. package/lib/core/Banner/Banner.stories.js.map +1 -1
  261. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -4
  262. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  263. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  264. package/lib/core/Button/Button.stories.d.ts +2 -3
  265. package/lib/core/Button/Button.stories.d.ts.map +1 -1
  266. package/lib/core/Button/Button.stories.js.map +1 -1
  267. package/lib/core/Card/Card.stories.d.ts +1 -2
  268. package/lib/core/Card/Card.stories.d.ts.map +1 -1
  269. package/lib/core/Card/Card.stories.js.map +1 -1
  270. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts +3 -3
  271. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  272. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  273. package/lib/core/ColorPicker/ColorPicker.stories.d.ts +1 -2
  274. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  275. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  276. package/lib/core/Configuration/Configuration.stories.d.ts +2 -3
  277. package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
  278. package/lib/core/Configuration/Configuration.stories.js.map +1 -1
  279. package/lib/core/CreditCard/CreditCard.stories.d.ts +3 -2
  280. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  281. package/lib/core/CreditCard/CreditCard.stories.js +41 -6
  282. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -1
  283. package/lib/core/Currency/Currency.stories.d.ts +2 -2
  284. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  285. package/lib/core/Currency/Currency.stories.js.map +1 -1
  286. package/lib/core/DateTime/DateTime.stories.js +1 -1
  287. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  288. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +6 -6
  289. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  290. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  291. package/lib/core/FieldValueList/FieldValueList.stories.d.ts +2 -2
  292. package/lib/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  293. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  294. package/lib/core/Flex/FlexContainer.stories.d.ts +1 -2
  295. package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -1
  296. package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
  297. package/lib/core/Grid/GridContainer.stories.d.ts +4 -5
  298. package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -1
  299. package/lib/core/Grid/GridContainer.stories.js.map +1 -1
  300. package/lib/core/Grid/GridItem.stories.d.ts +1 -2
  301. package/lib/core/Grid/GridItem.stories.d.ts.map +1 -1
  302. package/lib/core/Grid/GridItem.stories.js.map +1 -1
  303. package/lib/core/Icon/Icon.stories.d.ts +5 -6
  304. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  305. package/lib/core/Icon/Icon.stories.js.map +1 -1
  306. package/lib/core/Image/Image.stories.d.ts +2 -3
  307. package/lib/core/Image/Image.stories.d.ts.map +1 -1
  308. package/lib/core/Image/Image.stories.js.map +1 -1
  309. package/lib/core/List/CommaSeparatedList.stories.d.ts +2 -2
  310. package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
  311. package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
  312. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +3 -4
  313. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  314. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  315. package/lib/core/MenuButton/MenuButton.stories.d.ts +6 -6
  316. package/lib/core/MenuButton/MenuButton.stories.d.ts.map +1 -1
  317. package/lib/core/MenuButton/MenuButton.stories.js.map +1 -1
  318. package/lib/core/Modal/Modal.stories.d.ts +10 -5
  319. package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
  320. package/lib/core/Modal/Modal.stories.js +6 -1
  321. package/lib/core/Modal/Modal.stories.js.map +1 -1
  322. package/lib/core/MultiStep/MultiStep.stories.d.ts +2 -3
  323. package/lib/core/MultiStep/MultiStep.stories.d.ts.map +1 -1
  324. package/lib/core/MultiStep/MultiStep.stories.js.map +1 -1
  325. package/lib/core/Number/Number.stories.d.ts +7 -3
  326. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  327. package/lib/core/Number/Number.stories.js +22 -6
  328. package/lib/core/Number/Number.stories.js.map +1 -1
  329. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  330. package/lib/core/PageTemplates/PageTemplates.stories.js +15 -27
  331. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  332. package/lib/core/Phone/Phone.stories.d.ts.map +1 -1
  333. package/lib/core/Phone/Phone.stories.js +3 -1
  334. package/lib/core/Phone/Phone.stories.js.map +1 -1
  335. package/lib/core/Popover/Popover.stories.d.ts +1 -1
  336. package/lib/core/Popover/Popover.stories.d.ts.map +1 -1
  337. package/lib/core/Popover/Popover.stories.js.map +1 -1
  338. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +3 -3
  339. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  340. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  341. package/lib/core/Slider/Slider.stories.d.ts +4 -3
  342. package/lib/core/Slider/Slider.stories.d.ts.map +1 -1
  343. package/lib/core/Slider/Slider.stories.js +1 -1
  344. package/lib/core/Slider/Slider.stories.js.map +1 -1
  345. package/lib/core/SummaryItem/SummaryItem.stories.d.ts +5 -5
  346. package/lib/core/SummaryItem/SummaryItem.stories.d.ts.map +1 -1
  347. package/lib/core/SummaryItem/SummaryItem.stories.js.map +1 -1
  348. package/lib/core/SummaryList/SummaryList.stories.d.ts +2 -2
  349. package/lib/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  350. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  351. package/lib/core/Tabs/Tabs.stories.d.ts +5 -2
  352. package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -1
  353. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  354. package/lib/core/Toaster/Toaster.stories.d.ts +2 -3
  355. package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -1
  356. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  357. package/lib/core/Tooltip/Tooltip.stories.d.ts +1 -2
  358. package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
  359. package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
  360. package/lib/core/Tree/Tree.stories.d.ts +1 -2
  361. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  362. package/lib/core/Tree/Tree.stories.js.map +1 -1
  363. package/lib/cs/Article/Article.stories.d.ts +3 -4
  364. package/lib/cs/Article/Article.stories.d.ts.map +1 -1
  365. package/lib/cs/Article/Article.stories.js.map +1 -1
  366. package/lib/cs/ArticleList/ArticleList.stories.d.ts +3 -4
  367. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  368. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  369. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +3 -4
  370. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  371. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  372. package/lib/rte/Editor/Editor.mocks.d.ts +307 -4
  373. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -1
  374. package/lib/rte/Editor/Editor.mocks.js +16 -13
  375. package/lib/rte/Editor/Editor.mocks.js.map +1 -1
  376. package/lib/rte/Editor/Editor.stories.d.ts +7 -8
  377. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  378. package/lib/rte/Editor/Editor.stories.js +3 -3
  379. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  380. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +5 -5
  381. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  382. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +14 -1
  383. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  384. package/lib/social/Chat/Chat.stories.d.ts +6 -7
  385. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  386. package/lib/social/Chat/Chat.stories.js +3 -3
  387. package/lib/social/Chat/Chat.stories.js.map +1 -1
  388. package/lib/social/Email/Email.stories.d.ts +5 -11
  389. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  390. package/lib/social/Email/Email.stories.js.map +1 -1
  391. package/lib/social/Feed/Feed.stories.d.ts +6 -11
  392. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  393. package/lib/social/Feed/Feed.stories.js.map +1 -1
  394. package/lib/social/Feed/FeedNewPost.stories.d.ts +7 -14
  395. package/lib/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  396. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  397. package/lib/social/Feed/FeedPost.stories.d.ts +4 -5
  398. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  399. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  400. package/lib/social/Feed/FeedReply.stories.d.ts +10 -10
  401. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  402. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  403. package/lib/social/Feed/FeedReplyInput.stories.d.ts +7 -12
  404. package/lib/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  405. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  406. package/lib/work/CaseView/CaseView.stories.d.ts +4 -11
  407. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -1
  408. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  409. package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -3
  410. package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
  411. package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
  412. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -3
  413. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  414. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  415. package/lib/work/Confirmation/Confirmation.stories.js +1 -1
  416. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  417. package/lib/work/Stakeholders/Stakeholders.stories.d.ts +2 -3
  418. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  419. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  420. package/lib/work/Tasks/Tasks.stories.js +1 -1
  421. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  422. package/lib/work/Timeline/Timeline.stories.d.ts +1 -2
  423. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  424. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  425. package/package.json +14 -9
  426. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -4
  427. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  428. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx +0 -9
  429. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx.map +0 -1
  430. package/jsx/build/ObjectPreview/ObjectPreview.stories.d.ts +0 -8
  431. package/jsx/build/ObjectPreview/ObjectPreview.stories.d.ts.map +0 -1
  432. package/jsx/build/ObjectPreview/ObjectPreview.stories.jsx +0 -93
  433. package/jsx/build/ObjectPreview/ObjectPreview.stories.jsx.map +0 -1
  434. package/jsx/build/ObjectPreview/ObjectPreview.styles.d.ts +0 -3
  435. package/jsx/build/ObjectPreview/ObjectPreview.styles.d.ts.map +0 -1
  436. package/jsx/build/ObjectPreview/ObjectPreview.styles.js +0 -22
  437. package/jsx/build/ObjectPreview/ObjectPreview.styles.js.map +0 -1
  438. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -4
  439. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  440. package/lib/build/ObjectPreview/ObjectPreview.mocks.js +0 -8
  441. package/lib/build/ObjectPreview/ObjectPreview.mocks.js.map +0 -1
  442. package/lib/build/ObjectPreview/ObjectPreview.stories.d.ts +0 -8
  443. package/lib/build/ObjectPreview/ObjectPreview.stories.d.ts.map +0 -1
  444. package/lib/build/ObjectPreview/ObjectPreview.stories.js +0 -90
  445. package/lib/build/ObjectPreview/ObjectPreview.stories.js.map +0 -1
  446. package/lib/build/ObjectPreview/ObjectPreview.styles.d.ts +0 -3
  447. package/lib/build/ObjectPreview/ObjectPreview.styles.d.ts.map +0 -1
  448. package/lib/build/ObjectPreview/ObjectPreview.styles.js +0 -22
  449. package/lib/build/ObjectPreview/ObjectPreview.styles.js.map +0 -1
@@ -1,6 +1,309 @@
1
1
  export declare const label = "Form field label";
2
- export declare class PegaCustomElement extends HTMLElement {
3
- removeElements(): void;
4
- connectedCallback(): void;
5
- }
2
+ export declare const createPegaCustomElement: (win: typeof globalThis) => {
3
+ new (): {
4
+ removeElements(): void;
5
+ connectedCallback(): void;
6
+ accessKey: string;
7
+ readonly accessKeyLabel: string;
8
+ autocapitalize: string;
9
+ dir: string;
10
+ draggable: boolean;
11
+ hidden: boolean;
12
+ innerText: string;
13
+ lang: string;
14
+ readonly offsetHeight: number;
15
+ readonly offsetLeft: number;
16
+ readonly offsetParent: Element | null;
17
+ readonly offsetTop: number;
18
+ readonly offsetWidth: number;
19
+ outerText: string;
20
+ spellcheck: boolean;
21
+ title: string;
22
+ translate: boolean;
23
+ attachInternals(): ElementInternals;
24
+ click(): void;
25
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
26
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
27
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
28
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
29
+ readonly attributes: NamedNodeMap;
30
+ readonly classList: DOMTokenList;
31
+ className: string;
32
+ readonly clientHeight: number;
33
+ readonly clientLeft: number;
34
+ readonly clientTop: number;
35
+ readonly clientWidth: number;
36
+ id: string;
37
+ readonly localName: string;
38
+ readonly namespaceURI: string | null;
39
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
40
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
41
+ outerHTML: string;
42
+ readonly ownerDocument: Document;
43
+ readonly part: DOMTokenList;
44
+ readonly prefix: string | null;
45
+ readonly scrollHeight: number;
46
+ scrollLeft: number;
47
+ scrollTop: number;
48
+ readonly scrollWidth: number;
49
+ readonly shadowRoot: ShadowRoot | null;
50
+ slot: string;
51
+ readonly tagName: string;
52
+ attachShadow(init: ShadowRootInit): ShadowRoot;
53
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
54
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
55
+ closest<E extends Element = Element>(selectors: string): E | null;
56
+ getAttribute(qualifiedName: string): string | null;
57
+ getAttributeNS(namespace: string | null, localName: string): string | null;
58
+ getAttributeNames(): string[];
59
+ getAttributeNode(qualifiedName: string): Attr | null;
60
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
61
+ getBoundingClientRect(): DOMRect;
62
+ getClientRects(): DOMRectList;
63
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
64
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
65
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
66
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
67
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
68
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
69
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
70
+ hasAttribute(qualifiedName: string): boolean;
71
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
72
+ hasAttributes(): boolean;
73
+ hasPointerCapture(pointerId: number): boolean;
74
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
75
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
76
+ insertAdjacentText(where: InsertPosition, data: string): void;
77
+ matches(selectors: string): boolean;
78
+ releasePointerCapture(pointerId: number): void;
79
+ removeAttribute(qualifiedName: string): void;
80
+ removeAttributeNS(namespace: string | null, localName: string): void;
81
+ removeAttributeNode(attr: Attr): Attr;
82
+ requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
83
+ requestPointerLock(): void;
84
+ scroll(options?: ScrollToOptions | undefined): void;
85
+ scroll(x: number, y: number): void;
86
+ scrollBy(options?: ScrollToOptions | undefined): void;
87
+ scrollBy(x: number, y: number): void;
88
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
89
+ scrollTo(options?: ScrollToOptions | undefined): void;
90
+ scrollTo(x: number, y: number): void;
91
+ setAttribute(qualifiedName: string, value: string): void;
92
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
93
+ setAttributeNode(attr: Attr): Attr | null;
94
+ setAttributeNodeNS(attr: Attr): Attr | null;
95
+ setPointerCapture(pointerId: number): void;
96
+ toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
97
+ webkitMatchesSelector(selectors: string): boolean;
98
+ readonly baseURI: string;
99
+ readonly childNodes: NodeListOf<ChildNode>;
100
+ readonly firstChild: ChildNode | null;
101
+ readonly isConnected: boolean;
102
+ readonly lastChild: ChildNode | null;
103
+ readonly nextSibling: ChildNode | null;
104
+ readonly nodeName: string;
105
+ readonly nodeType: number;
106
+ nodeValue: string | null;
107
+ readonly parentElement: HTMLElement | null;
108
+ readonly parentNode: ParentNode | null;
109
+ readonly previousSibling: ChildNode | null;
110
+ textContent: string | null;
111
+ appendChild<T extends Node>(node: T): T;
112
+ cloneNode(deep?: boolean | undefined): Node;
113
+ compareDocumentPosition(other: Node): number;
114
+ contains(other: Node | null): boolean;
115
+ getRootNode(options?: GetRootNodeOptions | undefined): Node;
116
+ hasChildNodes(): boolean;
117
+ insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
118
+ isDefaultNamespace(namespace: string | null): boolean;
119
+ isEqualNode(otherNode: Node | null): boolean;
120
+ isSameNode(otherNode: Node | null): boolean;
121
+ lookupNamespaceURI(prefix: string | null): string | null;
122
+ lookupPrefix(namespace: string | null): string | null;
123
+ normalize(): void;
124
+ removeChild<T_2 extends Node>(child: T_2): T_2;
125
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
126
+ readonly ATTRIBUTE_NODE: number;
127
+ readonly CDATA_SECTION_NODE: number;
128
+ readonly COMMENT_NODE: number;
129
+ readonly DOCUMENT_FRAGMENT_NODE: number;
130
+ readonly DOCUMENT_NODE: number;
131
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
132
+ readonly DOCUMENT_POSITION_CONTAINS: number;
133
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
134
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
135
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
136
+ readonly DOCUMENT_POSITION_PRECEDING: number;
137
+ readonly DOCUMENT_TYPE_NODE: number;
138
+ readonly ELEMENT_NODE: number;
139
+ readonly ENTITY_NODE: number;
140
+ readonly ENTITY_REFERENCE_NODE: number;
141
+ readonly NOTATION_NODE: number;
142
+ readonly PROCESSING_INSTRUCTION_NODE: number;
143
+ readonly TEXT_NODE: number;
144
+ dispatchEvent(event: Event): boolean;
145
+ ariaAtomic: string | null;
146
+ ariaAutoComplete: string | null;
147
+ ariaBusy: string | null;
148
+ ariaChecked: string | null;
149
+ ariaColCount: string | null;
150
+ ariaColIndex: string | null;
151
+ ariaColSpan: string | null;
152
+ ariaCurrent: string | null;
153
+ ariaDisabled: string | null;
154
+ ariaExpanded: string | null;
155
+ ariaHasPopup: string | null;
156
+ ariaHidden: string | null;
157
+ ariaKeyShortcuts: string | null;
158
+ ariaLabel: string | null;
159
+ ariaLevel: string | null;
160
+ ariaLive: string | null;
161
+ ariaModal: string | null;
162
+ ariaMultiLine: string | null;
163
+ ariaMultiSelectable: string | null;
164
+ ariaOrientation: string | null;
165
+ ariaPlaceholder: string | null;
166
+ ariaPosInSet: string | null;
167
+ ariaPressed: string | null;
168
+ ariaReadOnly: string | null;
169
+ ariaRequired: string | null;
170
+ ariaRoleDescription: string | null;
171
+ ariaRowCount: string | null;
172
+ ariaRowIndex: string | null;
173
+ ariaRowSpan: string | null;
174
+ ariaSelected: string | null;
175
+ ariaSetSize: string | null;
176
+ ariaSort: string | null;
177
+ ariaValueMax: string | null;
178
+ ariaValueMin: string | null;
179
+ ariaValueNow: string | null;
180
+ ariaValueText: string | null;
181
+ animate(keyframes: PropertyIndexedKeyframes | Keyframe[] | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
182
+ getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
183
+ after(...nodes: (string | Node)[]): void;
184
+ before(...nodes: (string | Node)[]): void;
185
+ remove(): void;
186
+ replaceWith(...nodes: (string | Node)[]): void;
187
+ innerHTML: string;
188
+ readonly nextElementSibling: Element | null;
189
+ readonly previousElementSibling: Element | null;
190
+ readonly childElementCount: number;
191
+ readonly children: HTMLCollection;
192
+ readonly firstElementChild: Element | null;
193
+ readonly lastElementChild: Element | null;
194
+ append(...nodes: (string | Node)[]): void;
195
+ prepend(...nodes: (string | Node)[]): void;
196
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
197
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
198
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
199
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
200
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
201
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
202
+ replaceChildren(...nodes: (string | Node)[]): void;
203
+ readonly assignedSlot: HTMLSlotElement | null;
204
+ oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
205
+ oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
206
+ onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
207
+ readonly style: CSSStyleDeclaration;
208
+ contentEditable: string;
209
+ enterKeyHint: string;
210
+ inputMode: string;
211
+ readonly isContentEditable: boolean;
212
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
213
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
214
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
215
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
216
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
217
+ onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
218
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
219
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
220
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
221
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
222
+ onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
223
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
224
+ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
225
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
226
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
227
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
228
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
229
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
230
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
231
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
232
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
233
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
234
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
235
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
236
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
237
+ onerror: OnErrorEventHandler;
238
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
239
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
240
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
241
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
243
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
244
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
245
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
246
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
247
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
248
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
249
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
250
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
251
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
252
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
253
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
254
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
255
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
256
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
257
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
258
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
259
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
260
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
261
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
262
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
263
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
265
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
267
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
268
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
269
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
270
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
273
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
275
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
276
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
282
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
283
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
+ ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
286
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
287
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
288
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
289
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
290
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
291
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
292
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
293
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
294
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
300
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
301
+ autofocus: boolean;
302
+ readonly dataset: DOMStringMap;
303
+ nonce?: string | undefined;
304
+ tabIndex: number;
305
+ blur(): void;
306
+ focus(options?: FocusOptions | undefined): void;
307
+ };
308
+ };
6
309
  //# sourceMappingURL=Editor.mocks.d.ts.map
@@ -1 +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"}
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,eAAO,MAAM,uBAAuB,QAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB7D,CAAC"}
@@ -3,18 +3,21 @@ export const label = 'Form field label';
3
3
  const PegaCustom = ({ children }) => {
4
4
  return (<p style={{ color: 'blue', textTransform: 'uppercase' }} dangerouslySetInnerHTML={{ __html: children }}/>);
5
5
  };
6
- export class PegaCustomElement extends HTMLElement {
7
- removeElements() {
8
- while (this.firstChild) {
9
- this.removeChild(this.firstChild);
6
+ export const createPegaCustomElement = (win) => {
7
+ const HtmlElement = win.HTMLElement;
8
+ return class PegaCustomElement extends HtmlElement {
9
+ removeElements() {
10
+ while (this.firstChild) {
11
+ this.removeChild(this.firstChild);
12
+ }
10
13
  }
11
- }
12
- connectedCallback() {
13
- const inner = this.innerHTML;
14
- this.removeElements();
15
- const mountPoint = document.createElement('span');
16
- this.appendChild(mountPoint);
17
- ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
18
- }
19
- }
14
+ connectedCallback() {
15
+ const inner = this.innerHTML;
16
+ this.removeElements();
17
+ const mountPoint = document.createElement('span');
18
+ this.appendChild(mountPoint);
19
+ ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);
20
+ }
21
+ };
22
+ };
20
23
  //# sourceMappingURL=Editor.mocks.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,CAAC,CACA,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAErD,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC9C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACnC;IACH,CAAC;IAED,iBAAiB;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7B,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;CACF","sourcesContent":["import ReactDOM from 'react-dom';\n\nexport const label = 'Form field label';\n\nconst PegaCustom = ({ children }: { children: string }) => {\n return (\n <p\n style={{ color: 'blue', textTransform: 'uppercase' }}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: children }}\n />\n );\n};\n\nexport class PegaCustomElement extends HTMLElement {\n removeElements() {\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n }\n\n connectedCallback() {\n const inner = this.innerHTML;\n this.removeElements();\n const mountPoint = document.createElement('span');\n this.appendChild(mountPoint);\n ReactDOM.render(<PegaCustom>{inner}</PegaCustom>, mountPoint);\n }\n}\n"]}
1
+ {"version":3,"file":"Editor.mocks.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,CAAC,CACA,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAErD,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC9C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAsB,EAAE,EAAE;IAChE,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IACpC,OAAO,MAAM,iBAAkB,SAAQ,WAAW;QAChD,cAAc;YACZ,OAAO,IAAI,CAAC,UAAU,EAAE;gBACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACnC;QACH,CAAC;QAED,iBAAiB;YACf,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;YAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAC7B,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","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 const createPegaCustomElement = (win: typeof globalThis) => {\n const HtmlElement = win.HTMLElement;\n return 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};\n"]}
@@ -1,11 +1,10 @@
1
- /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
1
+ import { Meta, Story } from '@storybook/react';
3
2
  declare const _default: Meta<import("@storybook/react").Args>;
4
3
  export default _default;
5
- export declare const EditorDemo: () => JSX.Element;
6
- export declare const EmptyEditorDemo: () => JSX.Element;
7
- export declare const ReadonlyFormField: () => JSX.Element;
8
- export declare const CustomComponentDemo: () => JSX.Element;
9
- export declare const RichTextEditorWithLogs: () => JSX.Element;
10
- export declare const RichTextEditorHtmlParsingDemo: () => JSX.Element;
4
+ export declare const EditorDemo: Story;
5
+ export declare const EmptyEditorDemo: Story;
6
+ export declare const ReadonlyFormField: Story;
7
+ export declare const CustomComponentDemo: Story;
8
+ export declare const RichTextEditorWithLogs: Story;
9
+ export declare const RichTextEditorHtmlParsingDemo: Story;
11
10
  //# sourceMappingURL=Editor.stories.d.ts.map
@@ -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;;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
+ {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAkB/C,wBAGU;AAEV,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA6BjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAkCpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KA8B3C,CAAC"}
@@ -2,7 +2,7 @@ import { useState, useRef } from 'react';
2
2
  import { action } from '@storybook/addon-actions';
3
3
  import { Button, Card, CardContent, CardFooter, Flex, Text, TextArea } from '@pega/cosmos-react-core';
4
4
  import { Editor } from '@pega/cosmos-react-rte';
5
- import { label, PegaCustomElement } from './Editor.mocks';
5
+ import { createPegaCustomElement, label } from './Editor.mocks';
6
6
  export default {
7
7
  title: 'RTE/Editor',
8
8
  component: Editor
@@ -13,7 +13,7 @@ export const EditorDemo = () => {
13
13
  const src = URL.createObjectURL(image);
14
14
  editorRef.current?.appendImage({ src, alt: image.name }, id);
15
15
  };
16
- return (<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>'/>);
16
+ return (<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="Example alt text" src="http://via.placeholder.com/640x360"/></body>'/>);
17
17
  };
18
18
  export const EmptyEditorDemo = () => {
19
19
  const editorRef = useRef(null);
@@ -38,7 +38,7 @@ export const CustomComponentDemo = () => {
38
38
  const onCustomAction = () => {
39
39
  editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');
40
40
  };
41
- return (<Editor ref={editorRef} label={label} toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']} 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>' customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]} customActions={[
41
+ return (<Editor ref={editorRef} label={label} toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']} 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>' customComponents={[{ createCustomElement: createPegaCustomElement, name: 'pega-custom' }]} customActions={[
42
42
  {
43
43
  icon: 'pega',
44
44
  text: 'Insert a custom element',
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,CAAC,MAAM,U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I,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC/C;MAAA,CAAC,IAAI,CACH;QAAA,CAAC,WAAW,CACV;UAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAChE;QAAA,EAAE,WAAW,CACb;QAAA,CAAC,UAAU,CACT;UAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,CACL,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAEhG;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nimport { label, PegaCustomElement } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nexport const EditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><img alt=\"placeholder\" src=\"http://via.placeholder.com/640x360\"/></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code>&lt;head&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code>&lt;title&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code>&lt;body&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code>&lt;header&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code>&lt;footer&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code>&lt;article&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code>&lt;section&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code>&lt;p&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code>&lt;div&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code>&lt;span&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code>&lt;img&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code>&lt;aside&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code>&lt;audio&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code>&lt;canvas&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code>&lt;datalist&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code>&lt;details&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code>&lt;embed&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code>&lt;nav&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code>&lt;output&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code>&lt;progress&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code>&lt;video&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code>&lt;ul&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code>&lt;ol&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code>&lt;li&gt;</code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code>&lt;</code>\" and \"<code>&gt;</code>\".&nbsp; The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code>&lt;title&gt;</code> tag can be written as <code>&lt;Title&gt;</code>, <code>&lt;TITLE&gt;</code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nexport const CustomComponentDemo = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ customElement: PegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"Editor.stories.jsx","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC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,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC/C;MAAA,CAAC,IAAI,CACH;QAAA,CAAC,WAAW,CACV;UAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAChE;QAAA,EAAE,WAAW,CACb;QAAA,CAAC,UAAU,CACT;UAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE;;UACF,EAAE,MAAM,CACV;QAAA,EAAE,UAAU,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,MAAM,CACL,YAAY,CAAC,CAAC,IAAI,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAEhG;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } 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 { createPegaCustomElement, label } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nexport const EditorDemo: Story = () => {\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=\"Example alt text\" src=\"http://via.placeholder.com/640x360\"/></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo: Story = () => {\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: Story = () => {\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: Story = () => {\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={[{ createCustomElement: createPegaCustomElement, 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: Story = () => {\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: Story = () => {\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,8 +1,8 @@
1
- /// <reference types="react" />
2
- import { Meta } from '@storybook/react';
1
+ import { Meta, Story } from '@storybook/react';
3
2
  declare const _default: Meta<import("@storybook/react").Args>;
4
3
  export default _default;
5
- export declare const RichTextViewerDemo: () => JSX.Element;
6
- export declare const RichTextViewerHTMLDemo: () => JSX.Element;
7
- export declare const RichTextViewerMDDemo: () => JSX.Element;
4
+ export declare const RichTextViewerDemo: Story;
5
+ export declare const RichTextViewerHTMLDemo: Story;
6
+ export declare const RichTextViewerHTMLOverflowDemo: Story;
7
+ export declare const RichTextViewerMDDemo: Story;
8
8
  //# sourceMappingURL=RichTextViewer.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextViewer.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AAcxC,wBAGU;AAEV,eAAO,MAAM,kBAAkB,mBAuB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAuBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,mBA4DhC,CAAC"}
1
+ {"version":3,"file":"RichTextViewer.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAc/C,wBAGU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAuBhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAuBpC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,KA0B5C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA4DlC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { useRef, useState } from 'react';
2
2
  import { Flex, Link } from '@pega/cosmos-react-core';
3
3
  import { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';
4
- import { RichTextEditor, RichTextViewer } from '@pega/cosmos-react-rte';
4
+ import { RichTextViewer, Editor as RichTextEditor } from '@pega/cosmos-react-rte';
5
5
  import { demoUsers } from './RichTextEditor.mocks';
6
6
  export default {
7
7
  title: 'RTE/RichTextViewer',
@@ -41,6 +41,23 @@ export const RichTextViewerHTMLDemo = () => {
41
41
  <RichTextViewer content={content} type='html'/>
42
42
  </Flex>);
43
43
  };
44
+ export const RichTextViewerHTMLOverflowDemo = () => {
45
+ const editorRef = useRef(null);
46
+ const [content, setContent] = useState(() => "<p style='background-color: green; width: 110%; height: 100px;'>hi</p>");
47
+ return (<Flex container={{ direction: 'column', gap: 2 }}>
48
+ <RichTextEditor ref={editorRef} toolbar={[
49
+ 'inline-styling',
50
+ 'headers',
51
+ 'tables',
52
+ 'links',
53
+ 'lists',
54
+ 'cut-copy-paste',
55
+ 'indentation'
56
+ ]} defaultValue={content} onChange={() => setContent(editorRef.current?.getHtml() || '')}/>
57
+
58
+ <RichTextViewer content={content} type='html'/>
59
+ </Flex>);
60
+ };
44
61
  export const RichTextViewerMDDemo = () => {
45
62
  const LinkComponent = ({ token }) => {
46
63
  return (<Link href={token.href} previewable>
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextViewer.stories.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,cAAc,EACd,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;CAClB,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,SAAS,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC/C;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E,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;YAE/D,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,CAAC;YAE5B,OAAO;gBACL,QAAQ,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,QAAQ;gBAC7C,IAAI,EAAE,IAAI,CAAC,OAAO;aACnB,CAAC;QACJ,CAAC,CAAC,CACF,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAClD,SAAS,CACT,YAAY,CACZ,YAAY,CAAC,CACX,kUAAkU,CACnU,CACD,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAGtE;;MAAA,CAAC,cAAc,CACb,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,UAAU,CACf,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CACjE,WAAW,CAAC,CAAC;YACX,IAAI,EAAE,CAAC,SAA2B,EAAE,EAAE;gBACpC,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC;oBAAE,OAAO,aAAa,CAAC;YACrE,CAAC;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextEditor,\n RichTextViewer,\n RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n defaultValue={\n '# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\\n\\nThere is built in support for #tags: as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)'\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextViewer.stories.jsx","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,cAAc,EACd,MAAM,IAAI,cAAc,EAGzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;CAClB,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAU,GAAG,EAAE;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAC/C;MAAA,CAAC,cAAc,CACb,GA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,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAGtE;;MAAA,CAAC,cAAc,CACb,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,CAAC,UAAU,CACf,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CACjE,WAAW,CAAC,CAAC;YACX,IAAI,EAAE,CAAC,SAA2B,EAAE,EAAE;gBACpC,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC;oBAAE,OAAO,aAAa,CAAC;YACrE,CAAC;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextViewer,\n Editor as RichTextEditor,\n EditorState as RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLOverflowDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState(\n () => \"<p style='background-color: green; width: 110%; height: 100px;'>hi</p>\"\n );\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n defaultValue={content}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo: Story = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n defaultValue={\n '# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\\n\\nThere is built in support for #tags: as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)'\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}