@pega/cosmos-react-demos 4.1.1 → 5.0.0-dev.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (984) hide show
  1. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +1 -1
  2. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -1
  3. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -1
  4. package/jsx/condition-builder/ConditionBuilder/props.mock.d.ts +1 -1
  5. package/jsx/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  6. package/jsx/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  7. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts +1 -1
  8. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts.map +1 -1
  9. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.js.map +1 -1
  10. package/jsx/core/AIButton/AIButton.mocks.d.ts +1 -1
  11. package/jsx/core/AIButton/AIButton.mocks.d.ts.map +1 -1
  12. package/jsx/core/AIButton/AIButton.mocks.js.map +1 -1
  13. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.d.ts +2 -2
  14. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.d.ts.map +1 -1
  15. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.jsx +1 -1
  16. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.jsx.map +1 -1
  17. package/jsx/core/AppShell/AppShell.mocks.d.ts +1 -1
  18. package/jsx/core/AppShell/AppShell.mocks.d.ts.map +1 -1
  19. package/jsx/core/AppShell/AppShell.mocks.jsx.map +1 -1
  20. package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
  21. package/jsx/core/Avatar/Avatar.stories.jsx +1 -2
  22. package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
  23. package/jsx/core/Badges/Status.stories.jsx +2 -2
  24. package/jsx/core/Badges/Status.stories.jsx.map +1 -1
  25. package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.d.ts +2 -0
  26. package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.d.ts.map +1 -0
  27. package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.js +8 -0
  28. package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.js.map +1 -0
  29. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -1
  30. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  31. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx +39 -11
  32. package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx.map +1 -1
  33. package/jsx/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  34. package/jsx/core/Checkbox/Checkbox.stories.jsx +0 -3
  35. package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
  36. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  37. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx +4 -10
  38. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx.map +1 -1
  39. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +1 -2
  40. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  41. package/jsx/core/ComboBox/ComboBox.mocks.d.ts +3 -1
  42. package/jsx/core/ComboBox/ComboBox.mocks.d.ts.map +1 -1
  43. package/jsx/core/ComboBox/{ComboBox.mocks.js → ComboBox.mocks.jsx} +5 -1
  44. package/jsx/core/ComboBox/ComboBox.mocks.jsx.map +1 -0
  45. package/jsx/core/ComboBox/ComboBox.stories.d.ts +1 -0
  46. package/jsx/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
  47. package/jsx/core/ComboBox/ComboBox.stories.jsx +15 -13
  48. package/jsx/core/ComboBox/ComboBox.stories.jsx.map +1 -1
  49. package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts +1 -1
  50. package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts.map +1 -1
  51. package/jsx/core/CompositeInput/CompositeInput.mocks.jsx.map +1 -1
  52. package/jsx/core/CompositeInput/CompositeInput.stories.d.ts.map +1 -1
  53. package/jsx/core/CompositeInput/CompositeInput.stories.jsx +1 -3
  54. package/jsx/core/CompositeInput/CompositeInput.stories.jsx.map +1 -1
  55. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  56. package/jsx/core/CreditCard/CreditCard.stories.jsx +0 -1
  57. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -1
  58. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  59. package/jsx/core/Currency/Currency.stories.jsx +0 -1
  60. package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
  61. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  62. package/jsx/core/DateTime/DateTime.stories.jsx +0 -10
  63. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  64. package/jsx/core/DateTime/DateTimeDisplay.stories.d.ts.map +1 -1
  65. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx +10 -5
  66. package/jsx/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -1
  67. package/jsx/core/Dialog/FormDialog.mocks.d.ts +1 -1
  68. package/jsx/core/Dialog/FormDialog.mocks.d.ts.map +1 -1
  69. package/jsx/core/Dialog/FormDialog.mocks.jsx.map +1 -1
  70. package/jsx/core/Dialog/InfoDialog.mocks.d.ts.map +1 -1
  71. package/jsx/core/Dialog/InfoDialog.mocks.jsx.map +1 -1
  72. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  73. package/jsx/core/FieldGroup/FieldGroup.stories.jsx +6 -2
  74. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  75. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +1 -1
  76. package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  77. package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
  78. package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
  79. package/jsx/core/File/FileDisplay.stories.jsx +3 -1
  80. package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
  81. package/jsx/core/File/FileInput.stories.d.ts +1 -0
  82. package/jsx/core/File/FileInput.stories.d.ts.map +1 -1
  83. package/jsx/core/File/FileInput.stories.jsx +33 -6
  84. package/jsx/core/File/FileInput.stories.jsx.map +1 -1
  85. package/jsx/{work/CaseView → core/File}/FileService.mock.d.ts +2 -2
  86. package/jsx/core/File/FileService.mock.d.ts.map +1 -0
  87. package/jsx/core/File/FileService.mock.jsx.map +1 -0
  88. package/jsx/core/File/MockFileInput.d.ts +6 -0
  89. package/jsx/core/File/MockFileInput.d.ts.map +1 -0
  90. package/jsx/core/File/MockFileInput.jsx +24 -0
  91. package/jsx/core/File/MockFileInput.jsx.map +1 -0
  92. package/jsx/core/Form/Form.mocks.d.ts.map +1 -1
  93. package/jsx/core/Form/Form.mocks.jsx +64 -14
  94. package/jsx/core/Form/Form.mocks.jsx.map +1 -1
  95. package/jsx/core/Icon/Icon.mocks.d.ts +24 -1
  96. package/jsx/core/Icon/Icon.mocks.d.ts.map +1 -1
  97. package/jsx/core/Icon/Icon.mocks.jsx +23 -0
  98. package/jsx/core/Icon/Icon.mocks.jsx.map +1 -1
  99. package/jsx/core/Icon/Icon.stories.d.ts +11 -1
  100. package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
  101. package/jsx/core/Icon/Icon.stories.jsx +41 -7
  102. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  103. package/jsx/core/Input/Input.stories.d.ts.map +1 -1
  104. package/jsx/core/Input/Input.stories.jsx +0 -1
  105. package/jsx/core/Input/Input.stories.jsx.map +1 -1
  106. package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
  107. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts +3 -3
  108. package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  109. package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -1
  110. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +1 -0
  111. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  112. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +27 -4
  113. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  114. package/jsx/core/LiveLog/LiveLog.mocks.d.ts.map +1 -1
  115. package/jsx/core/LiveLog/LiveLog.mocks.jsx.map +1 -1
  116. package/jsx/core/Location/Location.stories.d.ts.map +1 -1
  117. package/jsx/core/Location/Location.stories.jsx +0 -1
  118. package/jsx/core/Location/Location.stories.jsx.map +1 -1
  119. package/jsx/core/Menu/Menu.mocks.d.ts +1 -1
  120. package/jsx/core/Menu/Menu.mocks.d.ts.map +1 -1
  121. package/jsx/core/Menu/Menu.mocks.js.map +1 -1
  122. package/jsx/core/Modal/Modal.stories.d.ts +1 -0
  123. package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
  124. package/jsx/core/Modal/Modal.stories.jsx +20 -3
  125. package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
  126. package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts +2 -2
  127. package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts.map +1 -1
  128. package/jsx/core/MultiStepForm/MultiStepForm.mocks.jsx.map +1 -1
  129. package/jsx/core/MultiStepForm/MultiStepForm.stories.d.ts +1 -1
  130. package/jsx/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -1
  131. package/jsx/core/MultiStepForm/MultiStepForm.stories.jsx.map +1 -1
  132. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  133. package/jsx/core/Number/Number.stories.jsx +6 -2
  134. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  135. package/jsx/core/PageTemplates/PageTemplates.mocks.d.ts +1 -1
  136. package/jsx/core/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  137. package/jsx/core/PageTemplates/PageTemplates.mocks.js.map +1 -1
  138. package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  139. package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -1
  140. package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  141. package/jsx/core/Phone/Phone.stories.d.ts.map +1 -1
  142. package/jsx/core/Phone/Phone.stories.jsx +0 -1
  143. package/jsx/core/Phone/Phone.stories.jsx.map +1 -1
  144. package/jsx/core/Popover/Popover.mocks.d.ts +1 -1
  145. package/jsx/core/Popover/Popover.mocks.d.ts.map +1 -1
  146. package/jsx/core/Popover/Popover.mocks.jsx.map +1 -1
  147. package/jsx/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  148. package/jsx/core/RadioButton/RadioButton.stories.jsx +0 -3
  149. package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
  150. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  151. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx +4 -10
  152. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -1
  153. package/jsx/core/Select/Select.stories.d.ts.map +1 -1
  154. package/jsx/core/Select/Select.stories.jsx +0 -1
  155. package/jsx/core/Select/Select.stories.jsx.map +1 -1
  156. package/jsx/core/Slider/Slider.stories.d.ts +1 -0
  157. package/jsx/core/Slider/Slider.stories.d.ts.map +1 -1
  158. package/jsx/core/Slider/Slider.stories.jsx +24 -4
  159. package/jsx/core/Slider/Slider.stories.jsx.map +1 -1
  160. package/jsx/core/SummaryList/SummaryList.mocks.d.ts +2 -2
  161. package/jsx/core/SummaryList/SummaryList.mocks.d.ts.map +1 -1
  162. package/jsx/core/SummaryList/SummaryList.mocks.jsx.map +1 -1
  163. package/jsx/core/TextArea/TextArea.stories.d.ts.map +1 -1
  164. package/jsx/core/TextArea/TextArea.stories.jsx +0 -1
  165. package/jsx/core/TextArea/TextArea.stories.jsx.map +1 -1
  166. package/jsx/core/Tree/Tree.mocks.js.map +1 -1
  167. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +1 -1
  168. package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -1
  169. package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -1
  170. package/jsx/dnd/StandardDragDropList/Demo.d.ts +1 -1
  171. package/jsx/dnd/StandardDragDropList/Demo.d.ts.map +1 -1
  172. package/jsx/dnd/StandardDragDropList/Demo.jsx.map +1 -1
  173. package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts +1 -1
  174. package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts.map +1 -1
  175. package/jsx/dnd/StandardDragDropList/GroupConfig.jsx.map +1 -1
  176. package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts +2 -2
  177. package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts.map +1 -1
  178. package/jsx/dnd/StandardDragDropList/ItemConfig.jsx.map +1 -1
  179. package/jsx/dnd/StandardDragDropList/Popover.d.ts +2 -2
  180. package/jsx/dnd/StandardDragDropList/Popover.d.ts.map +1 -1
  181. package/jsx/dnd/StandardDragDropList/Popover.jsx.map +1 -1
  182. package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts +3 -3
  183. package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts.map +1 -1
  184. package/jsx/dnd/StandardDragDropList/SelectionMenu.jsx.map +1 -1
  185. package/jsx/rte/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -2
  186. package/jsx/rte/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  187. package/jsx/rte/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  188. package/jsx/rte/DynamicContentEditor/FieldSelector.d.ts +3 -3
  189. package/jsx/rte/DynamicContentEditor/FieldSelector.d.ts.map +1 -1
  190. package/jsx/rte/DynamicContentEditor/FieldSelector.jsx.map +1 -1
  191. package/jsx/rte/Editor/Editor.mocks.d.ts +7 -1
  192. package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -1
  193. package/jsx/rte/Editor/Editor.mocks.jsx +0 -1
  194. package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -1
  195. package/jsx/rte/Editor/Editor.stories.d.ts +5 -1
  196. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  197. package/jsx/rte/Editor/Editor.stories.jsx +54 -9
  198. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  199. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.d.ts +1 -1
  200. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.d.ts.map +1 -1
  201. package/jsx/rte/RichTextEditor/RichTextEditor.mocks.jsx.map +1 -1
  202. package/jsx/social/Chat/Chat.mocks.d.ts +5 -17
  203. package/jsx/social/Chat/Chat.mocks.d.ts.map +1 -1
  204. package/jsx/social/Chat/Chat.mocks.js +1 -21
  205. package/jsx/social/Chat/Chat.mocks.js.map +1 -1
  206. package/jsx/social/Chat/Chat.stories.d.ts +4 -0
  207. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  208. package/jsx/social/Chat/Chat.stories.jsx +100 -42
  209. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  210. package/jsx/social/Email/Email.mocks.d.ts +5 -5
  211. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  212. package/jsx/social/Email/Email.mocks.jsx.map +1 -1
  213. package/jsx/social/Email/Email.stories.d.ts +4 -0
  214. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  215. package/jsx/social/Email/Email.stories.jsx +48 -21
  216. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  217. package/jsx/social/Feed/Feed.mocks.d.ts +4 -4
  218. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  219. package/jsx/social/Feed/Feed.mocks.jsx +24 -0
  220. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  221. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  222. package/jsx/social/Feed/Feed.stories.jsx +70 -16
  223. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  224. package/jsx/social/Feed/FeedNewPost.mocks.d.ts +1 -1
  225. package/jsx/social/Feed/FeedNewPost.mocks.d.ts.map +1 -1
  226. package/jsx/social/Feed/FeedNewPost.mocks.jsx.map +1 -1
  227. package/jsx/social/Feed/FeedPost.mocks.d.ts.map +1 -1
  228. package/jsx/social/Feed/FeedPost.mocks.jsx +32 -17
  229. package/jsx/social/Feed/FeedPost.mocks.jsx.map +1 -1
  230. package/jsx/social/Feed/FeedReply.mocks.d.ts.map +1 -1
  231. package/jsx/social/Feed/FeedReply.mocks.jsx +24 -17
  232. package/jsx/social/Feed/FeedReply.mocks.jsx.map +1 -1
  233. package/jsx/work/Article/Article.mocks.d.ts +4 -0
  234. package/jsx/work/Article/Article.mocks.d.ts.map +1 -1
  235. package/jsx/work/Article/Article.mocks.js +7 -3
  236. package/jsx/work/Article/Article.mocks.js.map +1 -1
  237. package/jsx/work/Article/Article.stories.d.ts +1 -0
  238. package/jsx/work/Article/Article.stories.d.ts.map +1 -1
  239. package/jsx/work/Article/Article.stories.jsx +77 -34
  240. package/jsx/work/Article/Article.stories.jsx.map +1 -1
  241. package/jsx/work/ArticleList/ArticleBuddy.stories.d.ts +11 -0
  242. package/jsx/work/ArticleList/ArticleBuddy.stories.d.ts.map +1 -0
  243. package/jsx/work/ArticleList/ArticleBuddy.stories.jsx +62 -0
  244. package/jsx/work/ArticleList/ArticleBuddy.stories.jsx.map +1 -0
  245. package/jsx/work/ArticleList/ArticleList.mocks.d.ts +39 -20
  246. package/jsx/work/ArticleList/ArticleList.mocks.d.ts.map +1 -1
  247. package/jsx/work/ArticleList/ArticleList.mocks.js +164 -78
  248. package/jsx/work/ArticleList/ArticleList.mocks.js.map +1 -1
  249. package/jsx/work/ArticleList/ArticleList.stories.d.ts +1 -0
  250. package/jsx/work/ArticleList/ArticleList.stories.d.ts.map +1 -1
  251. package/jsx/work/ArticleList/ArticleList.stories.jsx +219 -32
  252. package/jsx/work/ArticleList/ArticleList.stories.jsx.map +1 -1
  253. package/jsx/work/CaseView/Attachments.mocks.d.ts.map +1 -1
  254. package/jsx/work/CaseView/Attachments.mocks.jsx +1 -1
  255. package/jsx/work/CaseView/Attachments.mocks.jsx.map +1 -1
  256. package/jsx/work/CaseView/CaseView.mocks.d.ts +16 -6
  257. package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  258. package/jsx/work/CaseView/CaseView.mocks.jsx +69 -14
  259. package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
  260. package/jsx/work/CaseView/CaseView.stories.d.ts +1 -1
  261. package/jsx/work/CaseView/CaseView.stories.d.ts.map +1 -1
  262. package/jsx/work/CaseView/CaseView.stories.jsx +0 -9
  263. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  264. package/jsx/work/CaseView/Pulse.mocks.d.ts +1 -1
  265. package/jsx/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  266. package/jsx/work/CaseView/Pulse.mocks.jsx.map +1 -1
  267. package/jsx/work/Details/Details.stories.d.ts +2 -0
  268. package/jsx/work/Details/Details.stories.d.ts.map +1 -1
  269. package/jsx/work/Details/Details.stories.jsx +29 -5
  270. package/jsx/work/Details/Details.stories.jsx.map +1 -1
  271. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts +0 -1
  272. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  273. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx +2 -252
  274. package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  275. package/jsx/{cs → work}/InteractionNotification/InteractionNotification.stories.d.ts +1 -0
  276. package/jsx/work/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -0
  277. package/jsx/{cs → work}/InteractionNotification/InteractionNotification.stories.jsx +6 -4
  278. package/jsx/work/InteractionNotification/InteractionNotification.stories.jsx.map +1 -0
  279. package/jsx/work/SearchResults/SearchResults.mocks.d.ts +3 -3
  280. package/jsx/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  281. package/jsx/work/SearchResults/SearchResults.mocks.jsx.map +1 -1
  282. package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts +2 -2
  283. package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -1
  284. package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -1
  285. package/jsx/work/Timeline/Timeline.mocks.d.ts +1 -1
  286. package/jsx/work/Timeline/Timeline.mocks.d.ts.map +1 -1
  287. package/jsx/work/Timeline/Timeline.mocks.jsx.map +1 -1
  288. package/jsx/wss/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  289. package/jsx/wss/PageTemplates/PageTemplates.stories.jsx +4 -11
  290. package/jsx/wss/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  291. package/jsx/wss/QuickCreate/QuickCreate.stories.d.ts +4 -3
  292. package/jsx/wss/QuickCreate/QuickCreate.stories.d.ts.map +1 -1
  293. package/jsx/wss/QuickCreate/QuickCreate.stories.jsx +11 -20
  294. package/jsx/wss/QuickCreate/QuickCreate.stories.jsx.map +1 -1
  295. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +1 -1
  296. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -1
  297. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -1
  298. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts +1 -1
  299. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  300. package/lib/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  301. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts +1 -1
  302. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts.map +1 -1
  303. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.js.map +1 -1
  304. package/lib/core/AIButton/AIButton.mocks.d.ts +1 -1
  305. package/lib/core/AIButton/AIButton.mocks.d.ts.map +1 -1
  306. package/lib/core/AIButton/AIButton.mocks.js.map +1 -1
  307. package/lib/core/AdditionalInfo/AdditionalInfo.stories.d.ts +2 -2
  308. package/lib/core/AdditionalInfo/AdditionalInfo.stories.d.ts.map +1 -1
  309. package/lib/core/AdditionalInfo/AdditionalInfo.stories.js +1 -1
  310. package/lib/core/AdditionalInfo/AdditionalInfo.stories.js.map +1 -1
  311. package/lib/core/AppShell/AppShell.mocks.d.ts +1 -1
  312. package/lib/core/AppShell/AppShell.mocks.d.ts.map +1 -1
  313. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  314. package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
  315. package/lib/core/Avatar/Avatar.stories.js +1 -2
  316. package/lib/core/Avatar/Avatar.stories.js.map +1 -1
  317. package/lib/core/Badges/Status.stories.js +2 -2
  318. package/lib/core/Badges/Status.stories.js.map +1 -1
  319. package/lib/core/Breadcrumbs/Breadcrumbs.mocks.d.ts +2 -0
  320. package/lib/core/Breadcrumbs/Breadcrumbs.mocks.d.ts.map +1 -0
  321. package/lib/core/Breadcrumbs/Breadcrumbs.mocks.js +8 -0
  322. package/lib/core/Breadcrumbs/Breadcrumbs.mocks.js.map +1 -0
  323. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -1
  324. package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  325. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js +39 -11
  326. package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
  327. package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  328. package/lib/core/Checkbox/Checkbox.stories.js +0 -3
  329. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  330. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  331. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js +4 -10
  332. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  333. package/lib/core/ColorPicker/ColorPicker.stories.js +1 -2
  334. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  335. package/lib/core/ComboBox/ComboBox.mocks.d.ts +3 -1
  336. package/lib/core/ComboBox/ComboBox.mocks.d.ts.map +1 -1
  337. package/lib/core/ComboBox/ComboBox.mocks.js +3 -0
  338. package/lib/core/ComboBox/ComboBox.mocks.js.map +1 -1
  339. package/lib/core/ComboBox/ComboBox.stories.d.ts +1 -0
  340. package/lib/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
  341. package/lib/core/ComboBox/ComboBox.stories.js +15 -13
  342. package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
  343. package/lib/core/CompositeInput/CompositeInput.mocks.d.ts +1 -1
  344. package/lib/core/CompositeInput/CompositeInput.mocks.d.ts.map +1 -1
  345. package/lib/core/CompositeInput/CompositeInput.mocks.js.map +1 -1
  346. package/lib/core/CompositeInput/CompositeInput.stories.d.ts.map +1 -1
  347. package/lib/core/CompositeInput/CompositeInput.stories.js +1 -3
  348. package/lib/core/CompositeInput/CompositeInput.stories.js.map +1 -1
  349. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  350. package/lib/core/CreditCard/CreditCard.stories.js +0 -1
  351. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -1
  352. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  353. package/lib/core/Currency/Currency.stories.js +0 -1
  354. package/lib/core/Currency/Currency.stories.js.map +1 -1
  355. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  356. package/lib/core/DateTime/DateTime.stories.js +0 -10
  357. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  358. package/lib/core/DateTime/DateTimeDisplay.stories.d.ts.map +1 -1
  359. package/lib/core/DateTime/DateTimeDisplay.stories.js +10 -5
  360. package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
  361. package/lib/core/Dialog/FormDialog.mocks.d.ts +1 -1
  362. package/lib/core/Dialog/FormDialog.mocks.d.ts.map +1 -1
  363. package/lib/core/Dialog/FormDialog.mocks.js.map +1 -1
  364. package/lib/core/Dialog/InfoDialog.mocks.d.ts.map +1 -1
  365. package/lib/core/Dialog/InfoDialog.mocks.js.map +1 -1
  366. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  367. package/lib/core/FieldGroup/FieldGroup.stories.js +6 -2
  368. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  369. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +1 -1
  370. package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
  371. package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
  372. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
  373. package/lib/core/File/FileDisplay.stories.js +3 -1
  374. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  375. package/lib/core/File/FileInput.stories.d.ts +1 -0
  376. package/lib/core/File/FileInput.stories.d.ts.map +1 -1
  377. package/lib/core/File/FileInput.stories.js +20 -7
  378. package/lib/core/File/FileInput.stories.js.map +1 -1
  379. package/lib/{work/CaseView → core/File}/FileService.mock.d.ts +2 -2
  380. package/lib/core/File/FileService.mock.d.ts.map +1 -0
  381. package/lib/core/File/FileService.mock.js.map +1 -0
  382. package/lib/core/File/MockFileInput.d.ts +6 -0
  383. package/lib/core/File/MockFileInput.d.ts.map +1 -0
  384. package/lib/core/File/MockFileInput.js +25 -0
  385. package/lib/core/File/MockFileInput.js.map +1 -0
  386. package/lib/core/Form/Form.mocks.d.ts.map +1 -1
  387. package/lib/core/Form/Form.mocks.js +48 -3
  388. package/lib/core/Form/Form.mocks.js.map +1 -1
  389. package/lib/core/Icon/Icon.mocks.d.ts +24 -1
  390. package/lib/core/Icon/Icon.mocks.d.ts.map +1 -1
  391. package/lib/core/Icon/Icon.mocks.js +23 -0
  392. package/lib/core/Icon/Icon.mocks.js.map +1 -1
  393. package/lib/core/Icon/Icon.stories.d.ts +11 -1
  394. package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
  395. package/lib/core/Icon/Icon.stories.js +41 -7
  396. package/lib/core/Icon/Icon.stories.js.map +1 -1
  397. package/lib/core/Input/Input.stories.d.ts.map +1 -1
  398. package/lib/core/Input/Input.stories.js +0 -1
  399. package/lib/core/Input/Input.stories.js.map +1 -1
  400. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  401. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts +3 -3
  402. package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
  403. package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -1
  404. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +1 -0
  405. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  406. package/lib/core/ListToolbar/ListToolbar.stories.js +14 -5
  407. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  408. package/lib/core/LiveLog/LiveLog.mocks.d.ts.map +1 -1
  409. package/lib/core/LiveLog/LiveLog.mocks.js.map +1 -1
  410. package/lib/core/Location/Location.stories.d.ts.map +1 -1
  411. package/lib/core/Location/Location.stories.js +0 -1
  412. package/lib/core/Location/Location.stories.js.map +1 -1
  413. package/lib/core/Menu/Menu.mocks.d.ts +1 -1
  414. package/lib/core/Menu/Menu.mocks.d.ts.map +1 -1
  415. package/lib/core/Menu/Menu.mocks.js.map +1 -1
  416. package/lib/core/Modal/Modal.stories.d.ts +1 -0
  417. package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
  418. package/lib/core/Modal/Modal.stories.js +14 -3
  419. package/lib/core/Modal/Modal.stories.js.map +1 -1
  420. package/lib/core/MultiStepForm/MultiStepForm.mocks.d.ts +2 -2
  421. package/lib/core/MultiStepForm/MultiStepForm.mocks.d.ts.map +1 -1
  422. package/lib/core/MultiStepForm/MultiStepForm.mocks.js.map +1 -1
  423. package/lib/core/MultiStepForm/MultiStepForm.stories.d.ts +1 -1
  424. package/lib/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -1
  425. package/lib/core/MultiStepForm/MultiStepForm.stories.js.map +1 -1
  426. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  427. package/lib/core/Number/Number.stories.js +6 -2
  428. package/lib/core/Number/Number.stories.js.map +1 -1
  429. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts +1 -1
  430. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  431. package/lib/core/PageTemplates/PageTemplates.mocks.js.map +1 -1
  432. package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  433. package/lib/core/PageTemplates/PageTemplates.stories.js +1 -1
  434. package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
  435. package/lib/core/Phone/Phone.stories.d.ts.map +1 -1
  436. package/lib/core/Phone/Phone.stories.js +0 -1
  437. package/lib/core/Phone/Phone.stories.js.map +1 -1
  438. package/lib/core/Popover/Popover.mocks.d.ts +1 -1
  439. package/lib/core/Popover/Popover.mocks.d.ts.map +1 -1
  440. package/lib/core/Popover/Popover.mocks.js.map +1 -1
  441. package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  442. package/lib/core/RadioButton/RadioButton.stories.js +0 -3
  443. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  444. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  445. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +4 -10
  446. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  447. package/lib/core/Select/Select.stories.d.ts.map +1 -1
  448. package/lib/core/Select/Select.stories.js +0 -1
  449. package/lib/core/Select/Select.stories.js.map +1 -1
  450. package/lib/core/Slider/Slider.stories.d.ts +1 -0
  451. package/lib/core/Slider/Slider.stories.d.ts.map +1 -1
  452. package/lib/core/Slider/Slider.stories.js +11 -5
  453. package/lib/core/Slider/Slider.stories.js.map +1 -1
  454. package/lib/core/SummaryList/SummaryList.mocks.d.ts +2 -2
  455. package/lib/core/SummaryList/SummaryList.mocks.d.ts.map +1 -1
  456. package/lib/core/SummaryList/SummaryList.mocks.js.map +1 -1
  457. package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -1
  458. package/lib/core/TextArea/TextArea.stories.js +0 -1
  459. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  460. package/lib/core/Tree/Tree.mocks.js.map +1 -1
  461. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +1 -1
  462. package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -1
  463. package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -1
  464. package/lib/dnd/StandardDragDropList/Demo.d.ts +1 -1
  465. package/lib/dnd/StandardDragDropList/Demo.d.ts.map +1 -1
  466. package/lib/dnd/StandardDragDropList/Demo.js.map +1 -1
  467. package/lib/dnd/StandardDragDropList/GroupConfig.d.ts +1 -1
  468. package/lib/dnd/StandardDragDropList/GroupConfig.d.ts.map +1 -1
  469. package/lib/dnd/StandardDragDropList/GroupConfig.js.map +1 -1
  470. package/lib/dnd/StandardDragDropList/ItemConfig.d.ts +2 -2
  471. package/lib/dnd/StandardDragDropList/ItemConfig.d.ts.map +1 -1
  472. package/lib/dnd/StandardDragDropList/ItemConfig.js.map +1 -1
  473. package/lib/dnd/StandardDragDropList/Popover.d.ts +2 -2
  474. package/lib/dnd/StandardDragDropList/Popover.d.ts.map +1 -1
  475. package/lib/dnd/StandardDragDropList/Popover.js.map +1 -1
  476. package/lib/dnd/StandardDragDropList/SelectionMenu.d.ts +3 -3
  477. package/lib/dnd/StandardDragDropList/SelectionMenu.d.ts.map +1 -1
  478. package/lib/dnd/StandardDragDropList/SelectionMenu.js.map +1 -1
  479. package/lib/rte/DynamicContentEditor/DynamicContentEditor.stories.d.ts +2 -2
  480. package/lib/rte/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  481. package/lib/rte/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  482. package/lib/rte/DynamicContentEditor/FieldSelector.d.ts +3 -3
  483. package/lib/rte/DynamicContentEditor/FieldSelector.d.ts.map +1 -1
  484. package/lib/rte/DynamicContentEditor/FieldSelector.js.map +1 -1
  485. package/lib/rte/Editor/Editor.mocks.d.ts +7 -1
  486. package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -1
  487. package/lib/rte/Editor/Editor.mocks.js +0 -1
  488. package/lib/rte/Editor/Editor.mocks.js.map +1 -1
  489. package/lib/rte/Editor/Editor.stories.d.ts +5 -1
  490. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  491. package/lib/rte/Editor/Editor.stories.js +40 -9
  492. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  493. package/lib/rte/RichTextEditor/RichTextEditor.mocks.d.ts +1 -1
  494. package/lib/rte/RichTextEditor/RichTextEditor.mocks.d.ts.map +1 -1
  495. package/lib/rte/RichTextEditor/RichTextEditor.mocks.js.map +1 -1
  496. package/lib/social/Chat/Chat.mocks.d.ts +5 -17
  497. package/lib/social/Chat/Chat.mocks.d.ts.map +1 -1
  498. package/lib/social/Chat/Chat.mocks.js +1 -21
  499. package/lib/social/Chat/Chat.mocks.js.map +1 -1
  500. package/lib/social/Chat/Chat.stories.d.ts +4 -0
  501. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  502. package/lib/social/Chat/Chat.stories.js +101 -38
  503. package/lib/social/Chat/Chat.stories.js.map +1 -1
  504. package/lib/social/Email/Email.mocks.d.ts +5 -5
  505. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  506. package/lib/social/Email/Email.mocks.js.map +1 -1
  507. package/lib/social/Email/Email.stories.d.ts +4 -0
  508. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  509. package/lib/social/Email/Email.stories.js +48 -26
  510. package/lib/social/Email/Email.stories.js.map +1 -1
  511. package/lib/social/Feed/Feed.mocks.d.ts +4 -4
  512. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  513. package/lib/social/Feed/Feed.mocks.js +24 -0
  514. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  515. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  516. package/lib/social/Feed/Feed.stories.js +70 -16
  517. package/lib/social/Feed/Feed.stories.js.map +1 -1
  518. package/lib/social/Feed/FeedNewPost.mocks.d.ts +1 -1
  519. package/lib/social/Feed/FeedNewPost.mocks.d.ts.map +1 -1
  520. package/lib/social/Feed/FeedNewPost.mocks.js.map +1 -1
  521. package/lib/social/Feed/FeedPost.mocks.d.ts.map +1 -1
  522. package/lib/social/Feed/FeedPost.mocks.js +32 -17
  523. package/lib/social/Feed/FeedPost.mocks.js.map +1 -1
  524. package/lib/social/Feed/FeedReply.mocks.d.ts.map +1 -1
  525. package/lib/social/Feed/FeedReply.mocks.js +23 -16
  526. package/lib/social/Feed/FeedReply.mocks.js.map +1 -1
  527. package/lib/work/Article/Article.mocks.d.ts +4 -0
  528. package/lib/work/Article/Article.mocks.d.ts.map +1 -1
  529. package/lib/work/Article/Article.mocks.js +7 -3
  530. package/lib/work/Article/Article.mocks.js.map +1 -1
  531. package/lib/work/Article/Article.stories.d.ts +1 -0
  532. package/lib/work/Article/Article.stories.d.ts.map +1 -1
  533. package/lib/work/Article/Article.stories.js +78 -34
  534. package/lib/work/Article/Article.stories.js.map +1 -1
  535. package/lib/work/ArticleList/ArticleBuddy.stories.d.ts +11 -0
  536. package/lib/work/ArticleList/ArticleBuddy.stories.d.ts.map +1 -0
  537. package/lib/work/ArticleList/ArticleBuddy.stories.js +63 -0
  538. package/lib/work/ArticleList/ArticleBuddy.stories.js.map +1 -0
  539. package/lib/work/ArticleList/ArticleList.mocks.d.ts +39 -20
  540. package/lib/work/ArticleList/ArticleList.mocks.d.ts.map +1 -1
  541. package/lib/work/ArticleList/ArticleList.mocks.js +164 -78
  542. package/lib/work/ArticleList/ArticleList.mocks.js.map +1 -1
  543. package/lib/work/ArticleList/ArticleList.stories.d.ts +1 -0
  544. package/lib/work/ArticleList/ArticleList.stories.d.ts.map +1 -1
  545. package/lib/work/ArticleList/ArticleList.stories.js +219 -32
  546. package/lib/work/ArticleList/ArticleList.stories.js.map +1 -1
  547. package/lib/work/CaseView/Attachments.mocks.d.ts.map +1 -1
  548. package/lib/work/CaseView/Attachments.mocks.js +1 -1
  549. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  550. package/lib/work/CaseView/CaseView.mocks.d.ts +16 -6
  551. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  552. package/lib/work/CaseView/CaseView.mocks.js +67 -14
  553. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  554. package/lib/work/CaseView/CaseView.stories.d.ts +1 -1
  555. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -1
  556. package/lib/work/CaseView/CaseView.stories.js +0 -11
  557. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  558. package/lib/work/CaseView/Pulse.mocks.d.ts +1 -1
  559. package/lib/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  560. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  561. package/lib/work/Details/Details.stories.d.ts +2 -0
  562. package/lib/work/Details/Details.stories.d.ts.map +1 -1
  563. package/lib/work/Details/Details.stories.js +13 -5
  564. package/lib/work/Details/Details.stories.js.map +1 -1
  565. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts +0 -1
  566. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
  567. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js +3 -235
  568. package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  569. package/lib/{cs → work}/InteractionNotification/InteractionNotification.stories.d.ts +1 -0
  570. package/lib/work/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -0
  571. package/lib/{cs → work}/InteractionNotification/InteractionNotification.stories.js +6 -4
  572. package/lib/work/InteractionNotification/InteractionNotification.stories.js.map +1 -0
  573. package/lib/work/SearchResults/SearchResults.mocks.d.ts +3 -3
  574. package/lib/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  575. package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
  576. package/lib/work/Stakeholders/Stakeholders.mocks.d.ts +2 -2
  577. package/lib/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -1
  578. package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -1
  579. package/lib/work/Timeline/Timeline.mocks.d.ts +1 -1
  580. package/lib/work/Timeline/Timeline.mocks.d.ts.map +1 -1
  581. package/lib/work/Timeline/Timeline.mocks.js.map +1 -1
  582. package/lib/wss/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  583. package/lib/wss/PageTemplates/PageTemplates.stories.js +4 -3
  584. package/lib/wss/PageTemplates/PageTemplates.stories.js.map +1 -1
  585. package/lib/wss/QuickCreate/QuickCreate.stories.d.ts +4 -3
  586. package/lib/wss/QuickCreate/QuickCreate.stories.d.ts.map +1 -1
  587. package/lib/wss/QuickCreate/QuickCreate.stories.js +11 -18
  588. package/lib/wss/QuickCreate/QuickCreate.stories.js.map +1 -1
  589. package/package.json +16 -25
  590. package/jsx/build/AppShell/AppShell.mocks.d.ts +0 -44
  591. package/jsx/build/AppShell/AppShell.mocks.d.ts.map +0 -1
  592. package/jsx/build/AppShell/AppShell.mocks.jsx +0 -419
  593. package/jsx/build/AppShell/AppShell.mocks.jsx.map +0 -1
  594. package/jsx/build/AppShell/AppShell.stories.d.ts +0 -20
  595. package/jsx/build/AppShell/AppShell.stories.d.ts.map +0 -1
  596. package/jsx/build/AppShell/AppShell.stories.jsx +0 -201
  597. package/jsx/build/AppShell/AppShell.stories.jsx.map +0 -1
  598. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +0 -8
  599. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +0 -1
  600. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +0 -101
  601. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +0 -1
  602. package/jsx/build/DynamicContentEditor/FieldSelector.d.ts +0 -11
  603. package/jsx/build/DynamicContentEditor/FieldSelector.d.ts.map +0 -1
  604. package/jsx/build/DynamicContentEditor/FieldSelector.jsx +0 -80
  605. package/jsx/build/DynamicContentEditor/FieldSelector.jsx.map +0 -1
  606. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +0 -64
  607. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +0 -1
  608. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js +0 -599
  609. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +0 -1
  610. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +0 -29
  611. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +0 -1
  612. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx +0 -344
  613. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx.map +0 -1
  614. package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts +0 -45
  615. package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +0 -1
  616. package/jsx/build/FlowModeller/AddNodeUtils.mocks.js +0 -291
  617. package/jsx/build/FlowModeller/AddNodeUtils.mocks.js.map +0 -1
  618. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +0 -28
  619. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +0 -1
  620. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx +0 -559
  621. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +0 -1
  622. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +0 -11
  623. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +0 -1
  624. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +0 -501
  625. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +0 -1
  626. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +0 -2
  627. package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +0 -1
  628. package/jsx/build/FlowModeller/FlowModeller.styles.js +0 -8
  629. package/jsx/build/FlowModeller/FlowModeller.styles.js.map +0 -1
  630. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +0 -3
  631. package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +0 -1
  632. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +0 -45
  633. package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +0 -1
  634. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +0 -5
  635. package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +0 -1
  636. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx +0 -44
  637. package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +0 -1
  638. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts +0 -204
  639. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts.map +0 -1
  640. package/jsx/build/LifeCycle/LifeCycle.mocks.js +0 -1256
  641. package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +0 -1
  642. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +0 -11
  643. package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +0 -1
  644. package/jsx/build/LifeCycle/LifeCycle.stories.jsx +0 -873
  645. package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +0 -1
  646. package/jsx/build/LifeCycle/utils.d.ts +0 -123
  647. package/jsx/build/LifeCycle/utils.d.ts.map +0 -1
  648. package/jsx/build/LifeCycle/utils.js +0 -302
  649. package/jsx/build/LifeCycle/utils.js.map +0 -1
  650. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +0 -10
  651. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +0 -1
  652. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js +0 -20
  653. package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +0 -1
  654. package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts +0 -8
  655. package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts.map +0 -1
  656. package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.jsx +0 -38
  657. package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.jsx.map +0 -1
  658. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -7
  659. package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  660. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx +0 -78
  661. package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx.map +0 -1
  662. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +0 -64
  663. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +0 -1
  664. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +0 -397
  665. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +0 -1
  666. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +0 -8
  667. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +0 -1
  668. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +0 -258
  669. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +0 -1
  670. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts +0 -4
  671. package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts.map +0 -1
  672. package/jsx/build/ObjectSelect/ObjectSelect.styles.js +0 -27
  673. package/jsx/build/ObjectSelect/ObjectSelect.styles.js.map +0 -1
  674. package/jsx/build/PageBanner/PageBanner.stories.d.ts +0 -15
  675. package/jsx/build/PageBanner/PageBanner.stories.d.ts.map +0 -1
  676. package/jsx/build/PageBanner/PageBanner.stories.jsx +0 -41
  677. package/jsx/build/PageBanner/PageBanner.stories.jsx.map +0 -1
  678. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +0 -21
  679. package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +0 -1
  680. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +0 -24
  681. package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +0 -1
  682. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +0 -16
  683. package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +0 -1
  684. package/jsx/build/PageTemplates/GalleryPage.stories.jsx +0 -49
  685. package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +0 -1
  686. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +0 -17
  687. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +0 -1
  688. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +0 -144
  689. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +0 -1
  690. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +0 -21
  691. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +0 -1
  692. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +0 -255
  693. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +0 -1
  694. package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts +0 -17
  695. package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts.map +0 -1
  696. package/jsx/build/PageTemplates/ShowcasePage.stories.jsx +0 -42
  697. package/jsx/build/PageTemplates/ShowcasePage.stories.jsx.map +0 -1
  698. package/jsx/build/Workbench/Workbench.mocks.d.ts +0 -9
  699. package/jsx/build/Workbench/Workbench.mocks.d.ts.map +0 -1
  700. package/jsx/build/Workbench/Workbench.mocks.js +0 -67
  701. package/jsx/build/Workbench/Workbench.mocks.js.map +0 -1
  702. package/jsx/build/Workbench/Workbench.stories.d.ts +0 -11
  703. package/jsx/build/Workbench/Workbench.stories.d.ts.map +0 -1
  704. package/jsx/build/Workbench/Workbench.stories.jsx +0 -288
  705. package/jsx/build/Workbench/Workbench.stories.jsx.map +0 -1
  706. package/jsx/core/ComboBox/ComboBox.mocks.js.map +0 -1
  707. package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts +0 -90
  708. package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts.map +0 -1
  709. package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx +0 -432
  710. package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx.map +0 -1
  711. package/jsx/cs/CSAppShell/CSAppShell.stories.d.ts +0 -13
  712. package/jsx/cs/CSAppShell/CSAppShell.stories.d.ts.map +0 -1
  713. package/jsx/cs/CSAppShell/CSAppShell.stories.jsx +0 -173
  714. package/jsx/cs/CSAppShell/CSAppShell.stories.jsx.map +0 -1
  715. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts +0 -21
  716. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +0 -1
  717. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js +0 -252
  718. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js.map +0 -1
  719. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +0 -17
  720. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +0 -1
  721. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +0 -330
  722. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +0 -1
  723. package/jsx/cs/DialPad/DialPad.stories.d.ts +0 -9
  724. package/jsx/cs/DialPad/DialPad.stories.d.ts.map +0 -1
  725. package/jsx/cs/DialPad/DialPad.stories.jsx +0 -20
  726. package/jsx/cs/DialPad/DialPad.stories.jsx.map +0 -1
  727. package/jsx/cs/DialPad/DialPadKeyboardData.mock.d.ts +0 -11
  728. package/jsx/cs/DialPad/DialPadKeyboardData.mock.d.ts.map +0 -1
  729. package/jsx/cs/DialPad/DialPadKeyboardData.mock.js +0 -20
  730. package/jsx/cs/DialPad/DialPadKeyboardData.mock.js.map +0 -1
  731. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +0 -1
  732. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +0 -1
  733. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +0 -11
  734. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +0 -1
  735. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +0 -29
  736. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +0 -1
  737. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +0 -11
  738. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +0 -1
  739. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +0 -87
  740. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +0 -1
  741. package/jsx/cs/Picker/Picker.stories.d.ts +0 -11
  742. package/jsx/cs/Picker/Picker.stories.d.ts.map +0 -1
  743. package/jsx/cs/Picker/Picker.stories.jsx +0 -64
  744. package/jsx/cs/Picker/Picker.stories.jsx.map +0 -1
  745. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +0 -30
  746. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +0 -1
  747. package/jsx/cs/TaskManager/TaskManager.mocks.js +0 -228
  748. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +0 -1
  749. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +0 -15
  750. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +0 -1
  751. package/jsx/cs/TaskManager/TaskManager.stories.jsx +0 -420
  752. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +0 -1
  753. package/jsx/cs/TaskManager/TaskManager.styles.d.ts +0 -3
  754. package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +0 -1
  755. package/jsx/cs/TaskManager/TaskManager.styles.js +0 -9
  756. package/jsx/cs/TaskManager/TaskManager.styles.js.map +0 -1
  757. package/jsx/tools/Clipboard/Clipboard.mocks.d.ts +0 -6
  758. package/jsx/tools/Clipboard/Clipboard.mocks.d.ts.map +0 -1
  759. package/jsx/tools/Clipboard/Clipboard.mocks.jsx +0 -81
  760. package/jsx/tools/Clipboard/Clipboard.mocks.jsx.map +0 -1
  761. package/jsx/tools/Clipboard/Clipboard.stories.d.ts +0 -6
  762. package/jsx/tools/Clipboard/Clipboard.stories.d.ts.map +0 -1
  763. package/jsx/tools/Clipboard/Clipboard.stories.jsx +0 -67
  764. package/jsx/tools/Clipboard/Clipboard.stories.jsx.map +0 -1
  765. package/jsx/tools/DevTools/DevTools.mocks.d.ts +0 -3
  766. package/jsx/tools/DevTools/DevTools.mocks.d.ts.map +0 -1
  767. package/jsx/tools/DevTools/DevTools.mocks.js +0 -3
  768. package/jsx/tools/DevTools/DevTools.mocks.js.map +0 -1
  769. package/jsx/tools/DevTools/DevTools.stories.d.ts +0 -10
  770. package/jsx/tools/DevTools/DevTools.stories.d.ts.map +0 -1
  771. package/jsx/tools/DevTools/DevTools.stories.jsx +0 -33
  772. package/jsx/tools/DevTools/DevTools.stories.jsx.map +0 -1
  773. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts +0 -20
  774. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts.map +0 -1
  775. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx +0 -80
  776. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx.map +0 -1
  777. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts +0 -20
  778. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts.map +0 -1
  779. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx +0 -184
  780. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx.map +0 -1
  781. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts +0 -2
  782. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts.map +0 -1
  783. package/jsx/tools/PreviewShell/PreviewShell.styles.js +0 -6
  784. package/jsx/tools/PreviewShell/PreviewShell.styles.js.map +0 -1
  785. package/jsx/work/CaseView/FileService.mock.d.ts.map +0 -1
  786. package/jsx/work/CaseView/FileService.mock.jsx.map +0 -1
  787. package/lib/build/AppShell/AppShell.mocks.d.ts +0 -44
  788. package/lib/build/AppShell/AppShell.mocks.d.ts.map +0 -1
  789. package/lib/build/AppShell/AppShell.mocks.js +0 -419
  790. package/lib/build/AppShell/AppShell.mocks.js.map +0 -1
  791. package/lib/build/AppShell/AppShell.stories.d.ts +0 -20
  792. package/lib/build/AppShell/AppShell.stories.d.ts.map +0 -1
  793. package/lib/build/AppShell/AppShell.stories.js +0 -200
  794. package/lib/build/AppShell/AppShell.stories.js.map +0 -1
  795. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +0 -8
  796. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +0 -1
  797. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +0 -85
  798. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +0 -1
  799. package/lib/build/DynamicContentEditor/FieldSelector.d.ts +0 -14
  800. package/lib/build/DynamicContentEditor/FieldSelector.d.ts.map +0 -1
  801. package/lib/build/DynamicContentEditor/FieldSelector.js +0 -81
  802. package/lib/build/DynamicContentEditor/FieldSelector.js.map +0 -1
  803. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +0 -64
  804. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +0 -1
  805. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js +0 -599
  806. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +0 -1
  807. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +0 -29
  808. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +0 -1
  809. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js +0 -339
  810. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js.map +0 -1
  811. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts +0 -45
  812. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +0 -1
  813. package/lib/build/FlowModeller/AddNodeUtils.mocks.js +0 -291
  814. package/lib/build/FlowModeller/AddNodeUtils.mocks.js.map +0 -1
  815. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +0 -28
  816. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +0 -1
  817. package/lib/build/FlowModeller/FlowModeller.mocks.js +0 -536
  818. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
  819. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +0 -11
  820. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +0 -1
  821. package/lib/build/FlowModeller/FlowModeller.stories.js +0 -481
  822. package/lib/build/FlowModeller/FlowModeller.stories.js.map +0 -1
  823. package/lib/build/FlowModeller/FlowModeller.styles.d.ts +0 -2
  824. package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +0 -1
  825. package/lib/build/FlowModeller/FlowModeller.styles.js +0 -8
  826. package/lib/build/FlowModeller/FlowModeller.styles.js.map +0 -1
  827. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +0 -3
  828. package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +0 -1
  829. package/lib/build/ItemLibrary/LibraryPicker.mocks.js +0 -45
  830. package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +0 -1
  831. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +0 -5
  832. package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +0 -1
  833. package/lib/build/ItemLibrary/LibraryPicker.stories.js +0 -39
  834. package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +0 -1
  835. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +0 -204
  836. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +0 -1
  837. package/lib/build/LifeCycle/LifeCycle.mocks.js +0 -1256
  838. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +0 -1
  839. package/lib/build/LifeCycle/LifeCycle.stories.d.ts +0 -11
  840. package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +0 -1
  841. package/lib/build/LifeCycle/LifeCycle.stories.js +0 -870
  842. package/lib/build/LifeCycle/LifeCycle.stories.js.map +0 -1
  843. package/lib/build/LifeCycle/utils.d.ts +0 -123
  844. package/lib/build/LifeCycle/utils.d.ts.map +0 -1
  845. package/lib/build/LifeCycle/utils.js +0 -302
  846. package/lib/build/LifeCycle/utils.js.map +0 -1
  847. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +0 -10
  848. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +0 -1
  849. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js +0 -20
  850. package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +0 -1
  851. package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts +0 -8
  852. package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts.map +0 -1
  853. package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.js +0 -39
  854. package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.js.map +0 -1
  855. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -7
  856. package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
  857. package/lib/build/ObjectPreview/ObjectPreview.mocks.js +0 -74
  858. package/lib/build/ObjectPreview/ObjectPreview.mocks.js.map +0 -1
  859. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +0 -64
  860. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +0 -1
  861. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +0 -370
  862. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
  863. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +0 -8
  864. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +0 -1
  865. package/lib/build/ObjectSelect/ObjectSelect.stories.js +0 -240
  866. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +0 -1
  867. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts +0 -4
  868. package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts.map +0 -1
  869. package/lib/build/ObjectSelect/ObjectSelect.styles.js +0 -27
  870. package/lib/build/ObjectSelect/ObjectSelect.styles.js.map +0 -1
  871. package/lib/build/PageBanner/PageBanner.stories.d.ts +0 -15
  872. package/lib/build/PageBanner/PageBanner.stories.d.ts.map +0 -1
  873. package/lib/build/PageBanner/PageBanner.stories.js +0 -42
  874. package/lib/build/PageBanner/PageBanner.stories.js.map +0 -1
  875. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +0 -21
  876. package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +0 -1
  877. package/lib/build/PageTemplates/GalleryPage.mocks.js +0 -25
  878. package/lib/build/PageTemplates/GalleryPage.mocks.js.map +0 -1
  879. package/lib/build/PageTemplates/GalleryPage.stories.d.ts +0 -16
  880. package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +0 -1
  881. package/lib/build/PageTemplates/GalleryPage.stories.js +0 -50
  882. package/lib/build/PageTemplates/GalleryPage.stories.js.map +0 -1
  883. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +0 -17
  884. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +0 -1
  885. package/lib/build/PageTemplates/PageTemplates.mocks.js +0 -107
  886. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +0 -1
  887. package/lib/build/PageTemplates/PageTemplates.stories.d.ts +0 -21
  888. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +0 -1
  889. package/lib/build/PageTemplates/PageTemplates.stories.js +0 -246
  890. package/lib/build/PageTemplates/PageTemplates.stories.js.map +0 -1
  891. package/lib/build/PageTemplates/ShowcasePage.stories.d.ts +0 -17
  892. package/lib/build/PageTemplates/ShowcasePage.stories.d.ts.map +0 -1
  893. package/lib/build/PageTemplates/ShowcasePage.stories.js +0 -43
  894. package/lib/build/PageTemplates/ShowcasePage.stories.js.map +0 -1
  895. package/lib/build/Workbench/Workbench.mocks.d.ts +0 -9
  896. package/lib/build/Workbench/Workbench.mocks.d.ts.map +0 -1
  897. package/lib/build/Workbench/Workbench.mocks.js +0 -67
  898. package/lib/build/Workbench/Workbench.mocks.js.map +0 -1
  899. package/lib/build/Workbench/Workbench.stories.d.ts +0 -11
  900. package/lib/build/Workbench/Workbench.stories.d.ts.map +0 -1
  901. package/lib/build/Workbench/Workbench.stories.js +0 -273
  902. package/lib/build/Workbench/Workbench.stories.js.map +0 -1
  903. package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts +0 -90
  904. package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts.map +0 -1
  905. package/lib/cs/CSAppShell/CSAppShell.mocks.js +0 -385
  906. package/lib/cs/CSAppShell/CSAppShell.mocks.js.map +0 -1
  907. package/lib/cs/CSAppShell/CSAppShell.stories.d.ts +0 -13
  908. package/lib/cs/CSAppShell/CSAppShell.stories.d.ts.map +0 -1
  909. package/lib/cs/CSAppShell/CSAppShell.stories.js +0 -172
  910. package/lib/cs/CSAppShell/CSAppShell.stories.js.map +0 -1
  911. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts +0 -21
  912. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +0 -1
  913. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js +0 -252
  914. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js.map +0 -1
  915. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +0 -17
  916. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +0 -1
  917. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +0 -331
  918. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +0 -1
  919. package/lib/cs/DialPad/DialPad.stories.d.ts +0 -9
  920. package/lib/cs/DialPad/DialPad.stories.d.ts.map +0 -1
  921. package/lib/cs/DialPad/DialPad.stories.js +0 -19
  922. package/lib/cs/DialPad/DialPad.stories.js.map +0 -1
  923. package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts +0 -11
  924. package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts.map +0 -1
  925. package/lib/cs/DialPad/DialPadKeyboardData.mock.js +0 -20
  926. package/lib/cs/DialPad/DialPadKeyboardData.mock.js.map +0 -1
  927. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +0 -1
  928. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +0 -1
  929. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +0 -11
  930. package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +0 -1
  931. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +0 -29
  932. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +0 -1
  933. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +0 -11
  934. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +0 -1
  935. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +0 -88
  936. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +0 -1
  937. package/lib/cs/Picker/Picker.stories.d.ts +0 -11
  938. package/lib/cs/Picker/Picker.stories.d.ts.map +0 -1
  939. package/lib/cs/Picker/Picker.stories.js +0 -56
  940. package/lib/cs/Picker/Picker.stories.js.map +0 -1
  941. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +0 -30
  942. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +0 -1
  943. package/lib/cs/TaskManager/TaskManager.mocks.js +0 -228
  944. package/lib/cs/TaskManager/TaskManager.mocks.js.map +0 -1
  945. package/lib/cs/TaskManager/TaskManager.stories.d.ts +0 -15
  946. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +0 -1
  947. package/lib/cs/TaskManager/TaskManager.stories.js +0 -396
  948. package/lib/cs/TaskManager/TaskManager.stories.js.map +0 -1
  949. package/lib/cs/TaskManager/TaskManager.styles.d.ts +0 -3
  950. package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +0 -1
  951. package/lib/cs/TaskManager/TaskManager.styles.js +0 -9
  952. package/lib/cs/TaskManager/TaskManager.styles.js.map +0 -1
  953. package/lib/tools/Clipboard/Clipboard.mocks.d.ts +0 -6
  954. package/lib/tools/Clipboard/Clipboard.mocks.d.ts.map +0 -1
  955. package/lib/tools/Clipboard/Clipboard.mocks.js +0 -74
  956. package/lib/tools/Clipboard/Clipboard.mocks.js.map +0 -1
  957. package/lib/tools/Clipboard/Clipboard.stories.d.ts +0 -6
  958. package/lib/tools/Clipboard/Clipboard.stories.d.ts.map +0 -1
  959. package/lib/tools/Clipboard/Clipboard.stories.js +0 -74
  960. package/lib/tools/Clipboard/Clipboard.stories.js.map +0 -1
  961. package/lib/tools/DevTools/DevTools.mocks.d.ts +0 -3
  962. package/lib/tools/DevTools/DevTools.mocks.d.ts.map +0 -1
  963. package/lib/tools/DevTools/DevTools.mocks.js +0 -3
  964. package/lib/tools/DevTools/DevTools.mocks.js.map +0 -1
  965. package/lib/tools/DevTools/DevTools.stories.d.ts +0 -10
  966. package/lib/tools/DevTools/DevTools.stories.d.ts.map +0 -1
  967. package/lib/tools/DevTools/DevTools.stories.js +0 -29
  968. package/lib/tools/DevTools/DevTools.stories.js.map +0 -1
  969. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts +0 -20
  970. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts.map +0 -1
  971. package/lib/tools/PreviewShell/PreviewShell.mocks.js +0 -77
  972. package/lib/tools/PreviewShell/PreviewShell.mocks.js.map +0 -1
  973. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts +0 -20
  974. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts.map +0 -1
  975. package/lib/tools/PreviewShell/PreviewShell.stories.js +0 -181
  976. package/lib/tools/PreviewShell/PreviewShell.stories.js.map +0 -1
  977. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts +0 -2
  978. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts.map +0 -1
  979. package/lib/tools/PreviewShell/PreviewShell.styles.js +0 -6
  980. package/lib/tools/PreviewShell/PreviewShell.styles.js.map +0 -1
  981. package/lib/work/CaseView/FileService.mock.d.ts.map +0 -1
  982. package/lib/work/CaseView/FileService.mock.js.map +0 -1
  983. /package/jsx/{work/CaseView → core/File}/FileService.mock.jsx +0 -0
  984. /package/lib/{work/CaseView → core/File}/FileService.mock.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,IAAI,EACJ,MAAM,EACN,IAAI,EAEJ,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,aAAa,EACb,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAYjC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;CAExC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;;CAKxC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,EACf,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,cAAc,GAAG,IAAI,EACrB,QAAQ,EACR,QAAQ,EACK,EAAE,EAAE;IACjB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GAAG,MAAM,EAAE,C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AC3C,KAAC,MAAM,IAAC,SAAS,QAAC,OAAO,EAAE,QAAQ,YAChC,CAAC,CAAC,QAAQ,CAAC,GACL,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,YACxC,CAAC,CAAC,QAAQ,CAAC,GACL,IACE,CACd,EAEA,OAAO,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GAAI,IAC5D,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { ReactNode, useRef, useEffect, useMemo } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Popover as CorePopover,\n Flex,\n Button,\n Text,\n PopoverProps as CorePopoverProps,\n useI18n,\n useEscape,\n useOuterEvent,\n CardHeader,\n CardFooter,\n CardContent,\n Progress,\n useFocusTrap,\n useUID,\n getFocusables,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\n\ntype PopoverProps = {\n target: NonNullable<CorePopoverProps['target']>;\n loading?: boolean;\n heading: string;\n children?: ReactNode;\n displayHeading?: boolean;\n onCancel: () => void;\n onSubmit: () => void;\n};\n\nconst StyledContent = styled(CardContent)`\n overflow: auto;\n`;\n\nconst StyledPopover = styled(CorePopover)`\n position: relative;\n width: min(100vh, 60ch);\n min-height: 6rem;\n max-height: calc(100vh - 2rem);\n`;\n\nconst Popover = ({\n loading,\n heading,\n target,\n children,\n displayHeading = true,\n onCancel,\n onSubmit\n}: PopoverProps) => {\n const t = useI18n();\n const headingId = useUID();\n const ref = useRef<HTMLElement>(null);\n\n useOuterEvent('mousedown', [ref], onCancel);\n\n useEscape(onCancel);\n\n useFocusTrap(ref);\n\n useEffect(() => {\n getFocusables(ref)[0]?.focus();\n }, []);\n\n const header = useMemo(() => {\n if (loading) return;\n\n const h2 = (\n <Text variant='h2' id={headingId}>\n {displayHeading ? heading : <VisuallyHiddenText>{heading}</VisuallyHiddenText>}\n </Text>\n );\n\n return displayHeading ? <CardHeader>{h2}</CardHeader> : h2;\n }, [loading, heading, headingId, displayHeading]);\n\n return (\n <Flex\n role='dialog'\n aria-labelledby={headingId}\n container={{ direction: 'column' }}\n as={StyledPopover}\n target={target}\n arrow\n ref={ref}\n >\n {header}\n\n <Flex item={{ grow: 1 }} as={StyledContent}>\n {!loading && children}\n </Flex>\n\n {!loading && (\n <CardFooter container={{ justify: 'between' }}>\n <Button autoFocus onClick={onCancel}>\n {t('cancel')}\n </Button>\n <Button variant='primary' onClick={onSubmit}>\n {t('submit')}\n </Button>\n </CardFooter>\n )}\n\n {loading && <Progress placement='local' message={t('loading')} />}\n </Flex>\n );\n};\n\nexport default Popover;\n"]}
1
+ {"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/Popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,aAAa,EACb,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAajC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;CAExC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;;CAKxC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,EACf,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,cAAc,GAAG,IAAI,EACrB,QAAQ,EACR,QAAQ,EACK,EAAE,EAAE;IACjB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;I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KAAC,MAAM,IAAC,SAAS,QAAC,OAAO,EAAE,QAAQ,YAChC,CAAC,CAAC,QAAQ,CAAC,GACL,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,YACxC,CAAC,CAAC,QAAQ,CAAC,GACL,IACE,CACd,EAEA,OAAO,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GAAI,IAC5D,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { useRef, useEffect, useMemo } from 'react';\nimport type { ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Popover as CorePopover,\n Flex,\n Button,\n Text,\n useI18n,\n useEscape,\n useOuterEvent,\n CardHeader,\n CardFooter,\n CardContent,\n Progress,\n useFocusTrap,\n useUID,\n getFocusables,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport type { PopoverProps as CorePopoverProps } from '@pega/cosmos-react-core';\n\ntype PopoverProps = {\n target: NonNullable<CorePopoverProps['target']>;\n loading?: boolean;\n heading: string;\n children?: ReactNode;\n displayHeading?: boolean;\n onCancel: () => void;\n onSubmit: () => void;\n};\n\nconst StyledContent = styled(CardContent)`\n overflow: auto;\n`;\n\nconst StyledPopover = styled(CorePopover)`\n position: relative;\n width: min(100vh, 60ch);\n min-height: 6rem;\n max-height: calc(100vh - 2rem);\n`;\n\nconst Popover = ({\n loading,\n heading,\n target,\n children,\n displayHeading = true,\n onCancel,\n onSubmit\n}: PopoverProps) => {\n const t = useI18n();\n const headingId = useUID();\n const ref = useRef<HTMLElement>(null);\n\n useOuterEvent('mousedown', [ref], onCancel);\n\n useEscape(onCancel);\n\n useFocusTrap(ref);\n\n useEffect(() => {\n getFocusables(ref)[0]?.focus();\n }, []);\n\n const header = useMemo(() => {\n if (loading) return;\n\n const h2 = (\n <Text variant='h2' id={headingId}>\n {displayHeading ? heading : <VisuallyHiddenText>{heading}</VisuallyHiddenText>}\n </Text>\n );\n\n return displayHeading ? <CardHeader>{h2}</CardHeader> : h2;\n }, [loading, heading, headingId, displayHeading]);\n\n return (\n <Flex\n role='dialog'\n aria-labelledby={headingId}\n container={{ direction: 'column' }}\n as={StyledPopover}\n target={target}\n arrow\n ref={ref}\n >\n {header}\n\n <Flex item={{ grow: 1 }} as={StyledContent}>\n {!loading && children}\n </Flex>\n\n {!loading && (\n <CardFooter container={{ justify: 'between' }}>\n <Button autoFocus onClick={onCancel}>\n {t('cancel')}\n </Button>\n <Button variant='primary' onClick={onSubmit}>\n {t('submit')}\n </Button>\n </CardFooter>\n )}\n\n {loading && <Progress placement='local' message={t('loading')} />}\n </Flex>\n );\n};\n\nexport default Popover;\n"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { PopoverProps } from '@pega/cosmos-react-core';
3
- import { MultiSelectInputProps } from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types';
4
- import { ContentType, FieldType } from './mockData';
2
+ import type { PopoverProps } from '@pega/cosmos-react-core';
3
+ import type { MultiSelectInputProps } from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types';
4
+ import type { ContentType, FieldType } from './mockData';
5
5
  export interface SelectionMenuProps {
6
6
  target: NonNullable<PopoverProps['target']>;
7
7
  constraint?: {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionMenu.d.ts","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/SelectionMenu.tsx"],"names":[],"mappings":";AAGA,OAAO,EAML,YAAY,EAGb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yFAAyF,CAAC;AAEhI,OAAO,EAAE,WAAW,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAG/D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;QACtB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;KACxB,CAAC;IACF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,KAAK,IAAI,CAAC;CAC9E;AAeD,QAAA,MAAM,aAAa,wDAAyD,kBAAkB,gBAwI7F,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"SelectionMenu.d.ts","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/SelectionMenu.tsx"],"names":[],"mappings":";AAYA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yFAAyF,CAAC;AAGrI,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGzD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;QACtB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;KACxB,CAAC;IACF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,KAAK,IAAI,CAAC;CAC9E;AAeD,QAAA,MAAM,aAAa,wDAAyD,kBAAkB,gBAwI7F,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionMenu.js","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/SelectionMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,WAAW,EAAE,QAAQ,EAAE,M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c,EAAE,OAAO,IAAI,SAAS,EACpC,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,EAAE,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GAC1B,IACG,GACC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { ChangeEvent, useCallback, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Menu,\n menuHelpers,\n MenuItemProps,\n PopoverProps,\n useElement,\n useI18n\n} from '@pega/cosmos-react-core';\nimport MultiSelectInput from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput';\nimport { MultiSelectInputProps } from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types';\n\nimport { ContentType, FieldType, mockQuery } from './mockData';\nimport Popover from './Popover';\n\nexport interface SelectionMenuProps {\n target: NonNullable<PopoverProps['target']>;\n constraint?: {\n types?: ContentType[];\n subTypes?: FieldType[];\n };\n onCancel: () => void;\n onSubmit: (selected: NonNullable<MultiSelectInputProps['selected']>) => void;\n}\n\nconst StyledSelectionMenu: typeof Menu = styled(Menu)(({ theme }) => {\n return css`\n margin-inline: calc(-2 * ${theme.base.spacing});\n `;\n});\n\nStyledSelectionMenu.defaultProps = defaultThemeProp;\n\nconst rootMenuItems: MenuItemProps[] = [\n { id: 'fields', primary: 'Fields', items: [] },\n { id: 'views', primary: 'Views', items: [] }\n];\n\nconst SelectionMenu = ({ target, constraint, onCancel: onClose, onSubmit }: SelectionMenuProps) => {\n const t = useI18n();\n const [loading, setLoading] = useState(false);\n const [filterValue, setFilterValue] = useState('');\n const [inputEl, setInputEl] = useElement<HTMLElement>(null);\n\n const [menuItems, setMenuItems] = useState<MenuItemProps[]>(() => {\n if (constraint?.types) {\n const constrainedTypes = [];\n if (constraint.types.includes('Field')) {\n constrainedTypes.push(rootMenuItems[0]);\n }\n if (constraint.types.includes('View')) {\n constrainedTypes.push(rootMenuItems[1]);\n }\n\n return constrainedTypes;\n }\n\n return rootMenuItems;\n });\n\n const [selected, setSelected] = useState<NonNullable<MultiSelectInputProps['selected']>>(\n () => []\n );\n\n const onItemExpand = useCallback(\n async (id: MenuItemProps['id']) => {\n const expandedItem = menuHelpers.getItem(menuItems, id);\n if (!expandedItem || (expandedItem.items && expandedItem.items.length > 0)) {\n return;\n }\n\n setLoading(true);\n\n const subItems = await mockQuery({\n type: id === 'fields' ? 'Field' : 'View',\n delay: 1000\n });\n\n const newMenuItems = menuHelpers.mapItem(menuItems, id, item => {\n return {\n ...item,\n items: subItems.map(subItem => ({\n id: subItem.id,\n primary: subItem.label,\n selected: !!selected.find(s => s.id === subItem.id)\n }))\n };\n });\n\n setMenuItems(newMenuItems as MenuItemProps[]);\n setLoading(false);\n },\n [menuItems, selected]\n );\n\n const onFilter = useCallback(async (e: ChangeEvent<HTMLInputElement>) => {\n const val = e.currentTarget.value;\n setFilterValue(val);\n\n if (val) {\n setLoading(true);\n setMenuItems([]);\n\n const matchedItems = await mockQuery({\n filter: val,\n delay: 1000\n });\n\n setMenuItems(\n matchedItems.map(matchedItem => {\n return {\n id: matchedItem.id,\n primary: matchedItem.label,\n secondary: [matchedItem.subType ?? matchedItem.type],\n selected: !!selected.find(s => s.id === matchedItem.id)\n };\n })\n );\n\n setLoading(false);\n return;\n }\n\n setMenuItems(rootMenuItems);\n }, []);\n\n const onItemClick = useCallback(\n (id: MenuItemProps['id']) => {\n setSelected(cur => {\n if (cur.find(s => s.id === id)) {\n return cur.filter(sel => sel.id !== id);\n }\n\n return [\n ...cur,\n { id, text: (menuHelpers.getItem(menuItems, id) as MenuItemProps).primary }\n ];\n });\n\n setMenuItems(cur => menuHelpers.toggleSelected(cur, id) as MenuItemProps[]);\n },\n [menuItems]\n );\n\n return (\n <Popover\n target={target}\n heading='Content selection'\n onCancel={onClose}\n onSubmit={() => {\n onSubmit(selected);\n }}\n >\n <Flex container={{ direction: 'column', gap: 2, pad: [1, 0] }}>\n <MultiSelectInput\n ref={setInputEl}\n placeholder={t('search_placeholder_default')}\n value={filterValue}\n selected={selected}\n onChange={onFilter}\n onRemove={onItemClick}\n />\n <StyledSelectionMenu\n focusControlEl={inputEl ?? undefined}\n mode='multi-select'\n items={menuItems}\n scrollAt={10}\n loading={loading}\n onItemClick={onItemClick}\n onItemExpand={onItemExpand}\n />\n </Flex>\n </Popover>\n );\n};\n\nexport default SelectionMenu;\n"]}
1
+ {"version":3,"file":"SelectionMenu.js","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/SelectionMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,OAAO,EACR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,gBAAgB,MAAM,mFAAmF,CAAC;AAGjH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,OAAO,MAAM,WAAW,CAAC;AAYhC,MAAM,mBAAmB,GAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClE,OAAO,GAAG,CAAA;+BACmB,KAAK,CAAC,IAAI,CAAC,OAAO;GAC9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,aAAa,GAAoB;IACrC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9C,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;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,EAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,GAAG,EAAE;YACb,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC,YAED,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,aAC3D,KAAC,gBAAgB,IACf,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,CAAC,CAAC,4BAA4B,CAAC,EAC5C,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,WAAW,GACrB,EACF,KAAC,mBAAmB,IAClB,cAAc,EAAE,OAAO,IAAI,SAAS,EACpC,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,EAAE,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GAC1B,IACG,GACC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport type { ChangeEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n Flex,\n Menu,\n menuHelpers,\n useElement,\n useI18n\n} from '@pega/cosmos-react-core';\nimport type { MenuItemProps, PopoverProps } from '@pega/cosmos-react-core';\nimport MultiSelectInput from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput';\nimport type { MultiSelectInputProps } from '@pega/cosmos-react-core/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types';\n\nimport { mockQuery } from './mockData';\nimport type { ContentType, FieldType } from './mockData';\nimport Popover from './Popover';\n\nexport interface SelectionMenuProps {\n target: NonNullable<PopoverProps['target']>;\n constraint?: {\n types?: ContentType[];\n subTypes?: FieldType[];\n };\n onCancel: () => void;\n onSubmit: (selected: NonNullable<MultiSelectInputProps['selected']>) => void;\n}\n\nconst StyledSelectionMenu: typeof Menu = styled(Menu)(({ theme }) => {\n return css`\n margin-inline: calc(-2 * ${theme.base.spacing});\n `;\n});\n\nStyledSelectionMenu.defaultProps = defaultThemeProp;\n\nconst rootMenuItems: MenuItemProps[] = [\n { id: 'fields', primary: 'Fields', items: [] },\n { id: 'views', primary: 'Views', items: [] }\n];\n\nconst SelectionMenu = ({ target, constraint, onCancel: onClose, onSubmit }: SelectionMenuProps) => {\n const t = useI18n();\n const [loading, setLoading] = useState(false);\n const [filterValue, setFilterValue] = useState('');\n const [inputEl, setInputEl] = useElement<HTMLElement>(null);\n\n const [menuItems, setMenuItems] = useState<MenuItemProps[]>(() => {\n if (constraint?.types) {\n const constrainedTypes = [];\n if (constraint.types.includes('Field')) {\n constrainedTypes.push(rootMenuItems[0]);\n }\n if (constraint.types.includes('View')) {\n constrainedTypes.push(rootMenuItems[1]);\n }\n\n return constrainedTypes;\n }\n\n return rootMenuItems;\n });\n\n const [selected, setSelected] = useState<NonNullable<MultiSelectInputProps['selected']>>(\n () => []\n );\n\n const onItemExpand = useCallback(\n async (id: MenuItemProps['id']) => {\n const expandedItem = menuHelpers.getItem(menuItems, id);\n if (!expandedItem || (expandedItem.items && expandedItem.items.length > 0)) {\n return;\n }\n\n setLoading(true);\n\n const subItems = await mockQuery({\n type: id === 'fields' ? 'Field' : 'View',\n delay: 1000\n });\n\n const newMenuItems = menuHelpers.mapItem(menuItems, id, item => {\n return {\n ...item,\n items: subItems.map(subItem => ({\n id: subItem.id,\n primary: subItem.label,\n selected: !!selected.find(s => s.id === subItem.id)\n }))\n };\n });\n\n setMenuItems(newMenuItems as MenuItemProps[]);\n setLoading(false);\n },\n [menuItems, selected]\n );\n\n const onFilter = useCallback(async (e: ChangeEvent<HTMLInputElement>) => {\n const val = e.currentTarget.value;\n setFilterValue(val);\n\n if (val) {\n setLoading(true);\n setMenuItems([]);\n\n const matchedItems = await mockQuery({\n filter: val,\n delay: 1000\n });\n\n setMenuItems(\n matchedItems.map(matchedItem => {\n return {\n id: matchedItem.id,\n primary: matchedItem.label,\n secondary: [matchedItem.subType ?? matchedItem.type],\n selected: !!selected.find(s => s.id === matchedItem.id)\n };\n })\n );\n\n setLoading(false);\n return;\n }\n\n setMenuItems(rootMenuItems);\n }, []);\n\n const onItemClick = useCallback(\n (id: MenuItemProps['id']) => {\n setSelected(cur => {\n if (cur.find(s => s.id === id)) {\n return cur.filter(sel => sel.id !== id);\n }\n\n return [\n ...cur,\n { id, text: (menuHelpers.getItem(menuItems, id) as MenuItemProps).primary }\n ];\n });\n\n setMenuItems(cur => menuHelpers.toggleSelected(cur, id) as MenuItemProps[]);\n },\n [menuItems]\n );\n\n return (\n <Popover\n target={target}\n heading='Content selection'\n onCancel={onClose}\n onSubmit={() => {\n onSubmit(selected);\n }}\n >\n <Flex container={{ direction: 'column', gap: 2, pad: [1, 0] }}>\n <MultiSelectInput\n ref={setInputEl}\n placeholder={t('search_placeholder_default')}\n value={filterValue}\n selected={selected}\n onChange={onFilter}\n onRemove={onItemClick}\n />\n <StyledSelectionMenu\n focusControlEl={inputEl ?? undefined}\n mode='multi-select'\n items={menuItems}\n scrollAt={10}\n loading={loading}\n onItemClick={onItemClick}\n onItemExpand={onItemExpand}\n />\n </Flex>\n </Popover>\n );\n};\n\nexport default SelectionMenu;\n"]}
@@ -1,5 +1,5 @@
1
- import { StoryFn } from '@storybook/react';
2
- import { DynamicContentEditorProps } from '@pega/cosmos-react-rte';
1
+ import type { StoryFn } from '@storybook/react';
2
+ import type { DynamicContentEditorProps } from '@pega/cosmos-react-rte';
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
4
4
  export default _default;
5
5
  export interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAejD,OAAO,EAAwB,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;;AAMzF,wBAGU;AAEV,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;CAAG;AAEpF,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAoIrF,CAAC"}
1
+ {"version":3,"file":"DynamicContentEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,OAAO,KAAK,EAAE,yBAAyB,EAAyB,MAAM,wBAAwB,CAAC;;AAK/F,wBAGU;AAEV,MAAM,WAAW,8BAA+B,SAAQ,yBAAyB;CAAG;AAEpF,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAoIrF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.stories.js","sourceRoot":"","sources":["../../../src/rte/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAA6B,MAAM,wBAAwB,CAAC;AAGzF,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,eAAe;IACb,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,oBAAoB;CAC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IAAI,EACX,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACtC,UAAU,QACV,GAAG,EAAE,eAAe,GACpB,GACU,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,oBAAoB,IACnB,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,EACvC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,wBAAwB,EAC9B,OAAO,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EACtE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EACrD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,EACpE,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,UAAU,EACzC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,GAC/B,EACF,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,YACzB,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,0BAAoB,GACtD,IACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, StoryFn } from '@storybook/react';\nimport { useRef, useState, useCallback } from 'react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n TextArea,\n useAutoResize,\n useConsolidatedRef,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { DynamicContentEditor, DynamicContentEditorProps } from '@pega/cosmos-react-rte';\nimport type { EditorState, ItemType } from '@pega/cosmos-react-rte';\n\nimport FieldSelector from './FieldSelector';\nimport type { FieldSelectorProps } from './FieldSelector';\n\nexport default {\n title: 'RTE/DynamicContentEditor',\n component: DynamicContentEditor\n} as Meta;\n\nexport interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {}\n\nexport const DynamicContentEditorDemo: StoryFn<Partial<DynamicContentEditorStoryProps>> = (\n args: Partial<DynamicContentEditorStoryProps>\n) => {\n const [html, setHtml] = useState(\n '<p>Hi <pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"CustomerName\" data-rule-namespace=\"XCompass\">CustomerName</pega-reference><p>please check this <a href=\"https://google.com\">link</a></p></p>'\n );\n const rteRef = useRef<EditorState>(null);\n\n const fieldItems: DynamicContentEditorProps['fieldItems'] = [\n {\n id: 'CustomerName',\n primary: 'CustomerName',\n namespace: 'XCompass',\n items: [\n {\n id: 'Locale',\n primary: 'Locale',\n namespace: 'XCompass'\n },\n {\n id: 'Response Type',\n primary: 'Response Type',\n items: [\n {\n id: 'B',\n label: 'B',\n items: [{ id: 'Reply to', primary: 'Reply to' }]\n },\n { id: 'Forward to', primary: 'Forward to' }\n ]\n }\n ]\n },\n { id: 'Address', primary: 'Address', namespace: 'PegaPlatform' },\n { id: 'Locality', primary: 'Locality', namespace: 'PegaPlatform' },\n { id: 'Country', primary: 'Country', namespace: 'XCompass' },\n { id: 'Region', primary: 'Region', namespace: 'PegaPlatform' },\n { id: 'Occupation', primary: 'Occupation', namespace: 'PegaPlatform' },\n { id: 'City', primary: 'City' },\n { id: 'Colony', primary: 'Colony' },\n { id: 'Lastname', primary: 'Lastname' },\n { id: 'Preference', primary: 'Preference' },\n { id: 'Currency', primary: 'Currency' },\n { id: 'Iconname', primary: 'Iconname' }\n ];\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n const [textAreaRef, resizeTextArea] = useAutoResize<HTMLTextAreaElement>(undefined, 100);\n const ref = useRef(null);\n const consolidatedRef = useConsolidatedRef(textAreaRef, ref);\n const handleShowHtml = () => {\n resizeTextArea();\n setHtml(rteRef.current?.getHtml() || '');\n };\n const t = useI18n();\n const [selectedField, setSelectedField] = useState<ItemType>({\n id: '',\n text: ''\n });\n\n const updateSelection: FieldSelectorProps['updateSelection'] = (selectedItem: ItemType) => {\n setSelectedField(selectedItem);\n };\n const onSubmit = useCallback(\n (insertField: (selectedField: ItemType) => void) => {\n insertField(selectedField);\n },\n [selectedField]\n );\n\n const dynamicContentPicker = (\n <Flex\n container={{\n gap: 2,\n direction: 'column'\n }}\n >\n <FieldSelector\n itemList={[\n { id: 'CustomerName', text: 'CustomerName', namespace: 'XCompass' },\n { id: 'Address', text: 'Address', namespace: 'PegaPlatform' },\n { id: 'Locality', text: 'Locality', namespace: 'PegaPlatform' },\n { id: 'Country', text: 'Country', namespace: 'XCompass' },\n { id: 'Region', text: 'Region', namespace: 'PegaPlatform' },\n { id: 'Occupation', text: 'Occupation', namespace: 'PegaPlatform' }\n ]}\n key={selectedField?.id}\n label='Field'\n updateSelection={updateSelection}\n placeholder={t('select')}\n defaultSelection={selectedField}\n />\n </Flex>\n );\n const onActiveFieldChange = (field: ItemType) => setSelectedField(field);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea\n value={html}\n onChange={e => setHtml(e.target.value)}\n autoResize\n ref={consolidatedRef}\n />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <DynamicContentEditor\n defaultValue={args.defaultValue || html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Dynamic content editor'\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n form={args.form || { onSubmit, dynamicContentPicker }}\n onActiveFieldChange={args.onActiveFieldChange || onActiveFieldChange}\n fieldItems={args.fieldItems || fieldItems}\n onBlur={action('Editor onBlur')}\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => handleShowHtml()}>Show HTML</Button>\n </Flex>\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"DynamicContentEditor.stories.js","sourceRoot":"","sources":["../../../src/rte/DynamicContentEditor/DynamicContentEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,eAAe;IACb,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,oBAAoB;CACxB,CAAC;AAIV,MAAM,CAAC,MAAM,wBAAwB,GAAqD,CACxF,IAA6C,EAC7C,EAAE;IACF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAC9B,+OAA+O,CAChP,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAEzC,MAAM,UAAU,GAA4C;QAC1D;YACE,EAAE,EAAE,cAAc;YAClB,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE;gBACL;oBACE,EAAE,EAAE,QAAQ;oBACZ,OAAO,EAAE,QAAQ;oBACjB,SAAS,EAAE,UAAU;iBACtB;gBACD;oBACE,EAAE,EAAE,eAAe;oBACnB,OAAO,EAAE,eAAe;oBACxB,KAAK,EAAE;wBACL;4BACE,EAAE,EAAE,GAAG;4BACP,KAAK,EAAE,GAAG;4BACV,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,OA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EAAE,EACrD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,EACpE,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,UAAU,EACzC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,GAC/B,EACF,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,YACzB,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,0BAAoB,GACtD,IACF,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport { useRef, useState, useCallback } from 'react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n TextArea,\n useAutoResize,\n useConsolidatedRef,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { DynamicContentEditor } from '@pega/cosmos-react-rte';\nimport type { DynamicContentEditorProps, EditorState, ItemType } from '@pega/cosmos-react-rte';\n\nimport FieldSelector from './FieldSelector';\nimport type { FieldSelectorProps } from './FieldSelector';\n\nexport default {\n title: 'RTE/DynamicContentEditor',\n component: DynamicContentEditor\n} as Meta;\n\nexport interface DynamicContentEditorStoryProps extends DynamicContentEditorProps {}\n\nexport const DynamicContentEditorDemo: StoryFn<Partial<DynamicContentEditorStoryProps>> = (\n args: Partial<DynamicContentEditorStoryProps>\n) => {\n const [html, setHtml] = useState(\n '<p>Hi <pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"CustomerName\" data-rule-namespace=\"XCompass\">CustomerName</pega-reference><p>please check this <a href=\"https://google.com\">link</a></p></p>'\n );\n const rteRef = useRef<EditorState>(null);\n\n const fieldItems: DynamicContentEditorProps['fieldItems'] = [\n {\n id: 'CustomerName',\n primary: 'CustomerName',\n namespace: 'XCompass',\n items: [\n {\n id: 'Locale',\n primary: 'Locale',\n namespace: 'XCompass'\n },\n {\n id: 'Response Type',\n primary: 'Response Type',\n items: [\n {\n id: 'B',\n label: 'B',\n items: [{ id: 'Reply to', primary: 'Reply to' }]\n },\n { id: 'Forward to', primary: 'Forward to' }\n ]\n }\n ]\n },\n { id: 'Address', primary: 'Address', namespace: 'PegaPlatform' },\n { id: 'Locality', primary: 'Locality', namespace: 'PegaPlatform' },\n { id: 'Country', primary: 'Country', namespace: 'XCompass' },\n { id: 'Region', primary: 'Region', namespace: 'PegaPlatform' },\n { id: 'Occupation', primary: 'Occupation', namespace: 'PegaPlatform' },\n { id: 'City', primary: 'City' },\n { id: 'Colony', primary: 'Colony' },\n { id: 'Lastname', primary: 'Lastname' },\n { id: 'Preference', primary: 'Preference' },\n { id: 'Currency', primary: 'Currency' },\n { id: 'Iconname', primary: 'Iconname' }\n ];\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n const [textAreaRef, resizeTextArea] = useAutoResize<HTMLTextAreaElement>(undefined, 100);\n const ref = useRef(null);\n const consolidatedRef = useConsolidatedRef(textAreaRef, ref);\n const handleShowHtml = () => {\n resizeTextArea();\n setHtml(rteRef.current?.getHtml() || '');\n };\n const t = useI18n();\n const [selectedField, setSelectedField] = useState<ItemType>({\n id: '',\n text: ''\n });\n\n const updateSelection: FieldSelectorProps['updateSelection'] = (selectedItem: ItemType) => {\n setSelectedField(selectedItem);\n };\n const onSubmit = useCallback(\n (insertField: (selectedField: ItemType) => void) => {\n insertField(selectedField);\n },\n [selectedField]\n );\n\n const dynamicContentPicker = (\n <Flex\n container={{\n gap: 2,\n direction: 'column'\n }}\n >\n <FieldSelector\n itemList={[\n { id: 'CustomerName', text: 'CustomerName', namespace: 'XCompass' },\n { id: 'Address', text: 'Address', namespace: 'PegaPlatform' },\n { id: 'Locality', text: 'Locality', namespace: 'PegaPlatform' },\n { id: 'Country', text: 'Country', namespace: 'XCompass' },\n { id: 'Region', text: 'Region', namespace: 'PegaPlatform' },\n { id: 'Occupation', text: 'Occupation', namespace: 'PegaPlatform' }\n ]}\n key={selectedField?.id}\n label='Field'\n updateSelection={updateSelection}\n placeholder={t('select')}\n defaultSelection={selectedField}\n />\n </Flex>\n );\n const onActiveFieldChange = (field: ItemType) => setSelectedField(field);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea\n value={html}\n onChange={e => setHtml(e.target.value)}\n autoResize\n ref={consolidatedRef}\n />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <DynamicContentEditor\n defaultValue={args.defaultValue || html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Dynamic content editor'\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n form={args.form || { onSubmit, dynamicContentPicker }}\n onActiveFieldChange={args.onActiveFieldChange || onActiveFieldChange}\n fieldItems={args.fieldItems || fieldItems}\n onBlur={action('Editor onBlur')}\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => handleShowHtml()}>Show HTML</Button>\n </Flex>\n </Flex>\n );\n};\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ComboBoxProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- import { ItemType } from '@pega/cosmos-react-rte/lib/components/DynamicContentEditor/DynamicContentEditor.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ComboBoxProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import type { ItemType } from '@pega/cosmos-react-rte/lib/components/DynamicContentEditor/DynamicContentEditor.types';
4
4
  export interface FieldSelectorProps extends NoChildrenProp {
5
5
  /** Array of values for the combobox options. */
6
6
  itemList: ItemType[];
@@ -1 +1 @@
1
- {"version":3,"file":"FieldSelector.d.ts","sourceRoot":"","sources":["../../../src/rte/DynamicContentEditor/FieldSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAkC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,EAAE;QAC5B,OAAO,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,aAAa,GAAkB;QACnC,KAAK;QACL,WAAW;QACX,IAAI;QACJ,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,QAAQ;YAChB,CAAC,CAAC;gBACE,KAAK,EAAE;oBACL,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,IAAI,EAAE,QAAQ,CAAC,OAAO;iBACvB;aACF;YACH,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE,CAAC,CAAgC,EAAE,EAAE;YAC7C,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK;gBAAE,cAAc,EAAE,CAAC;YACrC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAI,EAAE;YACJ,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,UAAU;YACvB,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC;SACzB;QACD,QAAQ;KACT,CAAC;IACF,OAAO,KAAC,QAAQ,OAAK,aAAa,GAAI,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { ChangeEvent, FunctionComponent, useMemo, useState, useCallback } from 'react';\n\nimport {\n ComboBox,\n ComboBoxProps,\n createStringMatcher,\n MenuItemProps,\n NoChildrenProp,\n useI18n\n} from '@pega/cosmos-react-core';\nimport { ItemType } from '@pega/cosmos-react-rte/lib/components/DynamicContentEditor/DynamicContentEditor.types';\n\nexport interface FieldSelectorProps extends NoChildrenProp {\n /** Array of values for the combobox options. */\n itemList: ItemType[];\n /** Return selected item */\n updateSelection: (selectedItem: ItemType, label: ComboBoxProps['label']) => void;\n /** Default selected item */\n defaultSelection?: ItemType;\n}\n\nconst FieldSelector: FunctionComponent<\n FieldSelectorProps & Pick<ComboBoxProps, 'label' | 'mode' | 'required' | 'placeholder'>\n> = ({\n itemList,\n label,\n mode = 'single-select',\n required = false,\n updateSelection,\n placeholder,\n defaultSelection\n}) => {\n const t = useI18n();\n\n const [filterValue, setFilterValue] = useState('');\n const [items, setItems] = useState(() => {\n return itemList.map(item => {\n return {\n id: item.id,\n primary: item.text,\n namespace: item.namespace ?? '',\n selected: defaultSelection ? defaultSelection.id === item.id : false\n };\n });\n });\n\n const filterRegex = createStringMatcher(filterValue, 'contains');\n const itemsToRender = useMemo(() => {\n return filterRegex ? items.filter(({ primary }) => filterRegex.test(primary)) : items;\n }, [filterValue, items]);\n\n const clearSelection = () => {\n setItems(curr => {\n return curr?.map(item => {\n return {\n ...item,\n selected: false\n };\n });\n });\n };\n\n const selectItem = useCallback(\n (id: MenuItemProps['id']) => {\n setFilterValue('');\n setItems(curr =>\n curr?.map(item => {\n if (item.id === id) {\n return {\n ...item,\n selected: true\n };\n }\n return { ...item, selected: false };\n })\n );\n const selectedItem = items?.find(item => item.id === id);\n if (selectedItem?.id)\n updateSelection(\n {\n id: selectedItem.id,\n text: selectedItem.primary,\n namespace: selectedItem.namespace\n },\n label\n );\n },\n [filterValue, items]\n );\n\n const selected = useMemo(() => {\n return items?.find(item => item.selected);\n }, [items]);\n\n const comboBoxProps: ComboBoxProps = {\n label,\n placeholder,\n mode,\n value: filterValue,\n selected: selected\n ? {\n items: {\n id: selected.id,\n text: selected.primary\n }\n }\n : undefined,\n onChange: (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.value) clearSelection();\n setFilterValue(e.target.value);\n },\n onBlur: () => setFilterValue(''),\n menu: {\n items: itemsToRender,\n accent: filterRegex,\n onItemClick: selectItem,\n emptyText: t('no_items')\n },\n required\n };\n return <ComboBox {...comboBoxProps} />;\n};\n\nexport default FieldSelector;\n"]}
1
+ {"version":3,"file":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,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,aAAa,GAAkB;QACnC,KAAK;QACL,WAAW;QACX,IAAI;QACJ,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,QAAQ;YAChB,CAAC,CAAC;gBACE,KAAK,EAAE;oBACL,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,IAAI,EAAE,QAAQ,CAAC,OAAO;iBACvB;aACF;YACH,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE,CAAC,CAAgC,EAAE,EAAE;YAC7C,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK;gBAAE,cAAc,EAAE,CAAC;YACrC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAI,EAAE;YACJ,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,UAAU;YACvB,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC;SACzB;QACD,QAAQ;KACT,CAAC;IACF,OAAO,KAAC,QAAQ,OAAK,aAAa,GAAI,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useMemo, useState, useCallback } from 'react';\nimport type { ChangeEvent, FunctionComponent } from 'react';\n\nimport { ComboBox, createStringMatcher, useI18n } from '@pega/cosmos-react-core';\nimport type { ComboBoxProps, MenuItemProps, NoChildrenProp } from '@pega/cosmos-react-core';\nimport type { ItemType } from '@pega/cosmos-react-rte/lib/components/DynamicContentEditor/DynamicContentEditor.types';\n\nexport interface FieldSelectorProps extends NoChildrenProp {\n /** Array of values for the combobox options. */\n itemList: ItemType[];\n /** Return selected item */\n updateSelection: (selectedItem: ItemType, label: ComboBoxProps['label']) => void;\n /** Default selected item */\n defaultSelection?: ItemType;\n}\n\nconst FieldSelector: FunctionComponent<\n FieldSelectorProps & Pick<ComboBoxProps, 'label' | 'mode' | 'required' | 'placeholder'>\n> = ({\n itemList,\n label,\n mode = 'single-select',\n required = false,\n updateSelection,\n placeholder,\n defaultSelection\n}) => {\n const t = useI18n();\n\n const [filterValue, setFilterValue] = useState('');\n const [items, setItems] = useState(() => {\n return itemList.map(item => {\n return {\n id: item.id,\n primary: item.text,\n namespace: item.namespace ?? '',\n selected: defaultSelection ? defaultSelection.id === item.id : false\n };\n });\n });\n\n const filterRegex = createStringMatcher(filterValue, 'contains');\n const itemsToRender = useMemo(() => {\n return filterRegex ? items.filter(({ primary }) => filterRegex.test(primary)) : items;\n }, [filterValue, items]);\n\n const clearSelection = () => {\n setItems(curr => {\n return curr?.map(item => {\n return {\n ...item,\n selected: false\n };\n });\n });\n };\n\n const selectItem = useCallback(\n (id: MenuItemProps['id']) => {\n setFilterValue('');\n setItems(curr =>\n curr?.map(item => {\n if (item.id === id) {\n return {\n ...item,\n selected: true\n };\n }\n return { ...item, selected: false };\n })\n );\n const selectedItem = items?.find(item => item.id === id);\n if (selectedItem?.id)\n updateSelection(\n {\n id: selectedItem.id,\n text: selectedItem.primary,\n namespace: selectedItem.namespace\n },\n label\n );\n },\n [filterValue, items]\n );\n\n const selected = useMemo(() => {\n return items?.find(item => item.selected);\n }, [items]);\n\n const comboBoxProps: ComboBoxProps = {\n label,\n placeholder,\n mode,\n value: filterValue,\n selected: selected\n ? {\n items: {\n id: selected.id,\n text: selected.primary\n }\n }\n : undefined,\n onChange: (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.value) clearSelection();\n setFilterValue(e.target.value);\n },\n onBlur: () => setFilterValue(''),\n menu: {\n items: itemsToRender,\n accent: filterRegex,\n onItemClick: selectItem,\n emptyText: t('no_items')\n },\n required\n };\n return <ComboBox {...comboBoxProps} />;\n};\n\nexport default FieldSelector;\n"]}
@@ -1,4 +1,3 @@
1
- export declare const label = "Form field label";
2
1
  export declare const createPegaCustomElement: (win: typeof globalThis) => {
3
2
  new (): {
4
3
  removeElements(): void;
@@ -18,11 +17,15 @@ export declare const createPegaCustomElement: (win: typeof globalThis) => {
18
17
  readonly offsetTop: number;
19
18
  readonly offsetWidth: number;
20
19
  outerText: string;
20
+ popover: string | null;
21
21
  spellcheck: boolean;
22
22
  title: string;
23
23
  translate: boolean;
24
24
  attachInternals(): ElementInternals;
25
25
  click(): void;
26
+ hidePopover(): void;
27
+ showPopover(): void;
28
+ togglePopover(force?: boolean | undefined): void;
26
29
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
27
30
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
28
31
  removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
@@ -56,6 +59,7 @@ export declare const createPegaCustomElement: (win: typeof globalThis) => {
56
59
  closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
57
60
  closest<K_4 extends keyof MathMLElementTagNameMap>(selector: K_4): MathMLElementTagNameMap[K_4] | null;
58
61
  closest<E extends Element = Element>(selectors: string): E | null;
62
+ computedStyleMap(): StylePropertyMapReadOnly;
59
63
  getAttribute(qualifiedName: string): string | null;
60
64
  getAttributeNS(namespace: string | null, localName: string): string | null;
61
65
  getAttributeNames(): string[];
@@ -213,6 +217,7 @@ export declare const createPegaCustomElement: (win: typeof globalThis) => {
213
217
  querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
214
218
  replaceChildren(...nodes: (string | Node)[]): void;
215
219
  readonly assignedSlot: HTMLSlotElement | null;
220
+ readonly attributeStyleMap: StylePropertyMap;
216
221
  readonly style: CSSStyleDeclaration;
217
222
  contentEditable: string;
218
223
  enterKeyHint: string;
@@ -285,6 +290,7 @@ export declare const createPegaCustomElement: (win: typeof globalThis) => {
285
290
  onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
286
291
  onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
287
292
  onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
293
+ onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
288
294
  onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
289
295
  onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
290
296
  onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
@@ -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,eAAO,MAAM,uBAAuB,QAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB7D,CAAC"}
1
+ {"version":3,"file":"Editor.mocks.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB,QAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB7D,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ReactDOM from 'react-dom';
3
- export const label = 'Form field label';
4
3
  const PegaCustom = ({ children }) => {
5
4
  return (_jsx("p", { style: { color: 'blue', textTransform: 'uppercase' },
6
5
  // eslint-disable-next-line react/no-danger
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.mocks.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,YACE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE;QACpD,2CAA2C;QAC3C,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAC7C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,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,KAAC,UAAU,cAAE,KAAK,GAAc,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
+ {"version":3,"file":"Editor.mocks.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACxD,OAAO,CACL,YACE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE;QACpD,2CAA2C;QAC3C,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAC7C,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,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,KAAC,UAAU,cAAE,KAAK,GAAc,EAAE,UAAU,CAAC,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\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,7 +1,11 @@
1
1
  import type { StoryFn } from '@storybook/react';
2
+ import type { EditorProps } from '@pega/cosmos-react-rte';
2
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
3
4
  export default _default;
4
- export declare const EditorDemo: StoryFn;
5
+ interface EditorStoryProps extends EditorProps {
6
+ showAdditionalInfo?: boolean;
7
+ }
8
+ export declare const EditorDemo: StoryFn<EditorStoryProps>;
5
9
  export declare const EmptyEditorDemo: StoryFn;
6
10
  export declare const ReadonlyFormField: StoryFn;
7
11
  export declare const CustomComponentDemo: StoryFn;
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;;AAmBtD,wBAGU;AAEV,eAAO,MAAM,UAAU,EAAE,OAoBxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAmB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAc/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OA6BjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAkCpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,OA8B3C,CAAC"}
1
+ {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,wBAAwB,CAAC;;AAIvE,wBAGU;AAEV,UAAU,gBAAiB,SAAQ,WAAW;IAC5C,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAwDhD,CAAC;AA2BF,eAAO,MAAM,eAAe,EAAE,OAmB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,OAc/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OA6BjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OAkCpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,OA8B3C,CAAC"}
@@ -1,20 +1,51 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useRef } from 'react';
3
3
  import { action } from '@storybook/addon-actions';
4
- import { Button, Card, CardContent, CardFooter, Flex, Text, TextArea } from '@pega/cosmos-react-core';
4
+ import { Button, Card, CardContent, CardFooter, Flex, Link, Text, TextArea } from '@pega/cosmos-react-core';
5
5
  import { Editor } from '@pega/cosmos-react-rte';
6
- import { createPegaCustomElement, label } from './Editor.mocks';
6
+ import { createPegaCustomElement } from './Editor.mocks';
7
7
  export default {
8
8
  title: 'RTE/Editor',
9
9
  component: Editor
10
10
  };
11
- export const EditorDemo = () => {
11
+ export const EditorDemo = (args) => {
12
12
  const editorRef = useRef(null);
13
13
  const onImageAdded = (image, id) => {
14
14
  const src = URL.createObjectURL(image);
15
- editorRef.current?.appendImage({ src, alt: image.name }, id);
15
+ editorRef.current?.appendImage({
16
+ src,
17
+ alt: image.name,
18
+ attachmentId: 'sample-id'
19
+ }, id);
16
20
  };
17
- return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onFocus: action('Editor focused'), onBlur: action('Editor blurred'), onChange: action('Editor changed'), 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>' }));
21
+ return (_jsx(Editor, { ref: editorRef, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onFocus: action('Editor focused'), onBlur: action('Editor blurred'), onChange: action('Editor changed'), 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>', additionalInfo: args.showAdditionalInfo
22
+ ? {
23
+ content: (_jsxs(Flex, { container: { direction: 'column', alignItems: 'start', gap: 2 }, children: [_jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur it, sed do tempor incididunt ut labore magna aliqua. Nibh praesent tristique magna sit amet. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida." }), _jsx("p", { children: "Pharetra pharetra massa massa ultricies mi quis hendrerit dolor. Est velit egestas dui id ornare arcu odio ut. Varius sit amet mattis vulputate enim nulla aliquet porttitor lacus." }), _jsx(Link, { href: '/', target: '_blank', children: "Neque vitae" })] }))
24
+ }
25
+ : undefined }));
26
+ };
27
+ EditorDemo.args = {
28
+ showAdditionalInfo: false,
29
+ label: 'Form field label',
30
+ labelHidden: false,
31
+ info: 'Enter some value',
32
+ status: undefined,
33
+ required: false,
34
+ disabled: false,
35
+ readOnly: false
36
+ };
37
+ EditorDemo.argTypes = {
38
+ showAdditionalInfo: { control: { type: 'boolean' } },
39
+ label: { control: { type: 'text' } },
40
+ labelHidden: { control: { type: 'boolean' } },
41
+ info: { control: { type: 'text', label: 'Helper text' } },
42
+ status: {
43
+ options: [undefined, 'success', 'warning', 'error', 'pending'],
44
+ control: { type: 'select' }
45
+ },
46
+ required: { control: { type: 'boolean' } },
47
+ disabled: { control: { type: 'boolean' } },
48
+ readOnly: { control: { type: 'boolean' } }
18
49
  };
19
50
  export const EmptyEditorDemo = () => {
20
51
  const editorRef = useRef(null);
@@ -22,10 +53,10 @@ export const EmptyEditorDemo = () => {
22
53
  const src = URL.createObjectURL(image);
23
54
  editorRef.current?.appendImage({ src, alt: image.name }, id);
24
55
  };
25
- return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onImageAdded: onImageAdded, onFocus: action('Editor has focus'), onBlur: action('Editor has blurred'), placeholder: 'Type some stuff in here' }));
56
+ return (_jsx(Editor, { ref: editorRef, label: 'Form field label', toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onImageAdded: onImageAdded, onFocus: action('Editor has focus'), onBlur: action('Editor has blurred'), placeholder: 'Type some stuff in here' }));
26
57
  };
27
58
  export const ReadonlyFormField = () => {
28
- return (_jsx(Editor, { label: label, readOnly: true, defaultValue: `<article class="main-page-content" lang="en-US"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href="/en-US/docs/Web/CSS">CSS</a>) or functionality/behavior (<a href="/en-US/docs/Web/JavaScript">JavaScript</a>).</p>
59
+ return (_jsx(Editor, { label: 'Form field label', readOnly: true, defaultValue: `<article class="main-page-content" lang="en-US"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href="/en-US/docs/Web/CSS">CSS</a>) or functionality/behavior (<a href="/en-US/docs/Web/JavaScript">JavaScript</a>).</p>
29
60
  <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>
30
61
  <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>
31
62
  <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>
@@ -39,7 +70,7 @@ export const CustomComponentDemo = () => {
39
70
  const onCustomAction = () => {
40
71
  editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');
41
72
  };
42
- return (_jsx(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: [
73
+ return (_jsx(Editor, { ref: editorRef, label: 'Form field 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: [
43
74
  {
44
75
  icon: 'pega',
45
76
  text: 'Insert a custom element',
@@ -75,6 +106,6 @@ export const RichTextEditorHtmlParsingDemo = () => {
75
106
  const src = URL.createObjectURL(image);
76
107
  rteRef.current?.appendImage({ src, alt: image.name }, id);
77
108
  };
78
- return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }) }), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }) })] }), _jsx(Editor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: label, toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'] })] }));
109
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, children: [_jsxs(Card, { children: [_jsx(CardContent, { children: _jsx(TextArea, { value: html, onChange: e => setHtml(e.target.value) }) }), _jsx(CardFooter, { children: _jsx(Button, { onClick: () => rteRef.current?.insertHtml(html.trim(), true), children: "Overwrite RTE with new HTML" }) })] }), _jsx(Editor, { defaultValue: html, onImageAdded: onImageAdded, ref: rteRef, label: 'Form field label', toolbar: ['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation'] })] }));
79
110
  };
80
111
  //# sourceMappingURL=Editor.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;A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AQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,eACH,KAAC,WAAW,cACV,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,GACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,GAC3F,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport type { 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 { Editor } from '@pega/cosmos-react-rte';\nimport type { EditorState } 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: StoryFn = () => {\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 onChange={action('Editor changed')}\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: StoryFn = () => {\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: StoryFn = () => {\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: StoryFn = () => {\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: StoryFn = () => {\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: StoryFn = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"Editor.stories.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAMV,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,IAAsB,EAAE,EAAE;IAC9E,MAAM,SAAS,GAAG,MAAM,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,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,GACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,GAC3F,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport type { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Link,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { Editor } from '@pega/cosmos-react-rte';\nimport type { EditorProps, EditorState } from '@pega/cosmos-react-rte';\n\nimport { createPegaCustomElement } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\ninterface EditorStoryProps extends EditorProps {\n showAdditionalInfo?: boolean;\n}\n\nexport const EditorDemo: StoryFn<EditorStoryProps> = (args: EditorStoryProps) => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage(\n {\n src,\n alt: image.name,\n attachmentId: 'sample-id'\n },\n id\n );\n };\n\n return (\n <Editor\n ref={editorRef}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onChange={action('Editor changed')}\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 additionalInfo={\n args.showAdditionalInfo\n ? {\n content: (\n <Flex container={{ direction: 'column', alignItems: 'start', gap: 2 }}>\n <p>\n Lorem ipsum dolor sit amet, consectetur it, sed do tempor incididunt ut labore\n magna aliqua. Nibh praesent tristique magna sit amet. Nec tincidunt praesent\n semper feugiat nibh sed pulvinar proin gravida.\n </p>\n <p>\n Pharetra pharetra massa massa ultricies mi quis hendrerit dolor. Est velit\n egestas dui id ornare arcu odio ut. Varius sit amet mattis vulputate enim nulla\n aliquet porttitor lacus.\n </p>\n <Link href='/' target='_blank'>\n Neque vitae\n </Link>\n </Flex>\n )\n }\n : undefined\n }\n />\n );\n};\n\nEditorDemo.args = {\n showAdditionalInfo: false,\n label: 'Form field label',\n labelHidden: false,\n info: 'Enter some value',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n};\n\nEditorDemo.argTypes = {\n showAdditionalInfo: { control: { type: 'boolean' } },\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text', label: 'Helper text' } },\n status: {\n options: [undefined, 'success', 'warning', 'error', 'pending'],\n control: { type: 'select' }\n },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n};\n\nexport const EmptyEditorDemo: StoryFn = () => {\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='Form field 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: StoryFn = () => {\n return (\n <Editor\n label='Form field 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: StoryFn = () => {\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='Form field 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: StoryFn = () => {\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: StoryFn = () => {\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='Form field label'\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
@@ -1,3 +1,3 @@
1
- import { MenuItemProps } from '@pega/cosmos-react-core';
1
+ import type { MenuItemProps } from '@pega/cosmos-react-core';
2
2
  export declare const demoUsers: MenuItemProps[];
3
3
  //# sourceMappingURL=RichTextEditor.mocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.mocks.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGhE,eAAO,MAAM,SAAS,EAAE,aAAa,EA+BpC,CAAC"}
1
+ {"version":3,"file":"RichTextEditor.mocks.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,eAAO,MAAM,SAAS,EAAE,aAAa,EA+BpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.mocks.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,yBAAyB,CAAC;AAEhE,iBAAiB;AACjB,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,eAAe,GAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;KAChD;CACF,CAAC","sourcesContent":["import { Avatar, MenuItemProps } from '@pega/cosmos-react-core';\n\n// cspell:disable\nexport const demoUsers: MenuItemProps[] = [\n {\n id: 'turnc',\n primary: 'Cindy Turner',\n secondary: ['Lead Engineer'],\n visual: <Avatar size='l' name='Cindy Turner' />\n },\n {\n id: 'deans',\n primary: 'Seth DeAngelo',\n secondary: ['Senior Software Engineer', 'Backend Developer'],\n visual: <Avatar size='l' name='Seth DeAngelo' />\n },\n {\n id: 'moorj',\n primary: 'Janet Moore',\n secondary: ['Backend Developer'],\n visual: <Avatar size='l' name='Janet Moore' />\n },\n {\n id: 'thomd',\n primary: 'Dean Thomas',\n secondary: ['Designer'],\n visual: <Avatar size='l' name='Dean Thomas' />\n },\n {\n id: 'hathb',\n primary: 'Bob Hathoway',\n secondary: ['Lead Designer', 'Product Owner'],\n visual: <Avatar size='l' name='Bob Hathoway' />\n }\n];\n// cspell:enable\n"]}
1
+ {"version":3,"file":"RichTextEditor.mocks.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD,iBAAiB;AACjB,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QAC5D,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,eAAe,GAAG;KACjD;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,mBAAmB,CAAC;QAChC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,aAAa,GAAG;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;QAC7C,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG;KAChD;CACF,CAAC","sourcesContent":["import { Avatar } from '@pega/cosmos-react-core';\nimport type { MenuItemProps } from '@pega/cosmos-react-core';\n\n// cspell:disable\nexport const demoUsers: MenuItemProps[] = [\n {\n id: 'turnc',\n primary: 'Cindy Turner',\n secondary: ['Lead Engineer'],\n visual: <Avatar size='l' name='Cindy Turner' />\n },\n {\n id: 'deans',\n primary: 'Seth DeAngelo',\n secondary: ['Senior Software Engineer', 'Backend Developer'],\n visual: <Avatar size='l' name='Seth DeAngelo' />\n },\n {\n id: 'moorj',\n primary: 'Janet Moore',\n secondary: ['Backend Developer'],\n visual: <Avatar size='l' name='Janet Moore' />\n },\n {\n id: 'thomd',\n primary: 'Dean Thomas',\n secondary: ['Designer'],\n visual: <Avatar size='l' name='Dean Thomas' />\n },\n {\n id: 'hathb',\n primary: 'Bob Hathoway',\n secondary: ['Lead Designer', 'Product Owner'],\n visual: <Avatar size='l' name='Bob Hathoway' />\n }\n];\n// cspell:enable\n"]}
@@ -1,25 +1,13 @@
1
- import { FieldValueListProps, MenuProps } from '@pega/cosmos-react-core';
2
- import { ChatBodyProps } from '@pega/cosmos-react-social';
1
+ import type { FieldValueListProps, FileUploadItemProps, MenuProps } from '@pega/cosmos-react-core';
2
+ import type { ChatBodyListItemProps, ChatBodyProps, SuggestedReply } from '@pega/cosmos-react-social';
3
3
  export declare const BotConversation: ChatBodyProps['liveChat'];
4
4
  export declare const ClaimsAgentConversation: ChatBodyProps['liveChat'];
5
5
  export declare const LiveChatConversation: ChatBodyProps['liveChat'];
6
6
  export declare const SimulatedConversation: ChatBodyProps['liveChat'];
7
7
  export declare const ChatMockData: {
8
- chatMessages: import("@pega/cosmos-react-social").ChatBodyListItemProps[];
9
- defaultAttachments: ({
10
- name: string;
11
- progress: number;
12
- onDelete: () => void;
13
- } | {
14
- name: string;
15
- onDelete: () => void;
16
- progress?: undefined;
17
- })[];
18
- suggestedReplies: {
19
- id: string;
20
- message: string;
21
- confidence: number;
22
- }[];
8
+ chatMessages: ChatBodyListItemProps[];
9
+ defaultAttachments: FileUploadItemProps[];
10
+ suggestedReplies: SuggestedReply[];
23
11
  };
24
12
  export declare const phrasesDisplayNames: MenuProps['items'];
25
13
  export declare const phrasesMessages: {
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/Chat.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,UAAU,CAwGrD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,UAAU,CAqG7D,CAAC;AACF,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,UAAU,CAqG1D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,UAAU,CA2N3D,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAyCxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,OAAO,CAyDlD,CAAC;AAEF,eAAO,MAAM,eAAe;;;GAqC3B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4DxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,mBAAmB,CAAC,QAAQ,CAyBtD,CAAC"}
1
+ {"version":3,"file":"Chat.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/Chat.mocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC,eAAO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