@pega/cosmos-react-demos 3.0.0-dev.9.0 → 3.0.0-rc.2

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 (987) hide show
  1. package/jsx/build/AppHeader/AppHeader.stories.d.ts +1 -1
  2. package/jsx/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
  3. package/jsx/build/AppHeader/AppHeader.stories.jsx +102 -81
  4. package/jsx/build/AppHeader/AppHeader.stories.jsx.map +1 -1
  5. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +1 -1
  6. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  7. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +22 -1
  8. package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
  9. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +60 -0
  10. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +1 -0
  11. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js +523 -0
  12. package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +1 -0
  13. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +26 -0
  14. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +1 -0
  15. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx +339 -0
  16. package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx.map +1 -0
  17. package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts +4 -4
  18. package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +1 -1
  19. package/jsx/build/FlowModeller/AddNodeUtils.mocks.js.map +1 -1
  20. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +4 -2
  21. package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  22. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx +118 -33
  23. package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -1
  24. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +7 -2
  25. package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  26. package/jsx/build/FlowModeller/FlowModeller.stories.jsx +246 -63
  27. package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
  28. package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  29. package/jsx/build/LifeCycle/LifeCycle.mocks.js +40 -0
  30. package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  31. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +25 -8
  32. package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  33. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +129 -68
  34. package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -1
  35. package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  36. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +115 -26
  37. package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
  38. package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  39. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +4 -4
  40. package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -1
  41. package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  42. package/jsx/build/PageTemplates/PageTemplates.stories.jsx +3 -3
  43. package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
  44. package/jsx/build/Workbench/Workbench.stories.d.ts +1 -0
  45. package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
  46. package/jsx/build/Workbench/Workbench.stories.jsx +201 -4
  47. package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
  48. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +1 -1
  49. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -1
  50. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +3 -1
  51. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -1
  52. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +2 -1
  53. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  54. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +47 -16
  55. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
  56. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +1 -1
  57. package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -1
  58. package/jsx/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  59. package/jsx/condition-builder/ConditionBuilder/props.mock.js +132 -31
  60. package/jsx/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  61. package/jsx/condition-builder/ConditionInput/ConditionInput.stories.d.ts +10 -0
  62. package/jsx/condition-builder/ConditionInput/ConditionInput.stories.d.ts.map +1 -0
  63. package/jsx/condition-builder/ConditionInput/ConditionInput.stories.jsx +40 -0
  64. package/jsx/condition-builder/ConditionInput/ConditionInput.stories.jsx.map +1 -0
  65. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts +4 -0
  66. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts.map +1 -0
  67. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.js +181 -0
  68. package/jsx/condition-builder/PromotedFilters/PromotedFilters.mocks.js.map +1 -0
  69. package/jsx/condition-builder/PromotedFilters/PromotedFilters.stories.d.ts +8 -0
  70. package/jsx/condition-builder/PromotedFilters/PromotedFilters.stories.d.ts.map +1 -0
  71. package/jsx/condition-builder/PromotedFilters/PromotedFilters.stories.jsx +31 -0
  72. package/jsx/condition-builder/PromotedFilters/PromotedFilters.stories.jsx.map +1 -0
  73. package/jsx/condition-builder/PromotedFilters/PromotedFilters.styles.d.ts +9 -0
  74. package/jsx/condition-builder/PromotedFilters/PromotedFilters.styles.d.ts.map +1 -0
  75. package/jsx/condition-builder/PromotedFilters/PromotedFilters.styles.js +35 -0
  76. package/jsx/condition-builder/PromotedFilters/PromotedFilters.styles.js.map +1 -0
  77. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.d.ts +9 -0
  78. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.d.ts.map +1 -0
  79. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.jsx +25 -0
  80. package/jsx/core/AdditionalInfo/AdditionalInfo.stories.jsx.map +1 -0
  81. package/jsx/core/AppShell/AppShell.mocks.d.ts +1 -1
  82. package/jsx/core/AppShell/AppShell.mocks.jsx +5 -5
  83. package/jsx/core/AppShell/AppShell.mocks.jsx.map +1 -1
  84. package/jsx/core/AppShell/AppShell.stories.d.ts +2 -0
  85. package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
  86. package/jsx/core/AppShell/AppShell.stories.jsx +47 -13
  87. package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
  88. package/jsx/core/Banner/Banner.stories.d.ts +0 -1
  89. package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
  90. package/jsx/core/Banner/Banner.stories.jsx +2 -10
  91. package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
  92. package/jsx/core/Checkbox/Checkbox.stories.d.ts +6 -2
  93. package/jsx/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  94. package/jsx/core/Checkbox/Checkbox.stories.jsx +26 -7
  95. package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
  96. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts +6 -2
  97. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  98. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx +46 -5
  99. package/jsx/core/CheckboxGroup/CheckboxGroup.stories.jsx.map +1 -1
  100. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts +4 -1
  101. package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  102. package/jsx/core/ColorPicker/ColorPicker.stories.jsx +10 -3
  103. package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
  104. package/jsx/core/ComboBox/ComboBox.stories.d.ts +1 -0
  105. package/jsx/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
  106. package/jsx/core/ComboBox/ComboBox.stories.jsx +40 -8
  107. package/jsx/core/ComboBox/ComboBox.stories.jsx.map +1 -1
  108. package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts +8 -0
  109. package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts.map +1 -0
  110. package/jsx/core/CompositeInput/CompositeInput.mocks.jsx +8 -0
  111. package/jsx/core/CompositeInput/CompositeInput.mocks.jsx.map +1 -0
  112. package/jsx/core/CompositeInput/CompositeInput.stories.d.ts +9 -0
  113. package/jsx/core/CompositeInput/CompositeInput.stories.d.ts.map +1 -0
  114. package/jsx/core/CompositeInput/CompositeInput.stories.jsx +54 -0
  115. package/jsx/core/CompositeInput/CompositeInput.stories.jsx.map +1 -0
  116. package/jsx/core/CreditCard/CreditCard.stories.d.ts +4 -1
  117. package/jsx/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  118. package/jsx/core/CreditCard/CreditCard.stories.jsx +11 -4
  119. package/jsx/core/CreditCard/CreditCard.stories.jsx.map +1 -1
  120. package/jsx/core/Currency/Currency.stories.d.ts +6 -1
  121. package/jsx/core/Currency/Currency.stories.d.ts.map +1 -1
  122. package/jsx/core/Currency/Currency.stories.jsx +30 -7
  123. package/jsx/core/Currency/Currency.stories.jsx.map +1 -1
  124. package/jsx/core/DateTime/DateTime.stories.d.ts +41 -10
  125. package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
  126. package/jsx/core/DateTime/DateTime.stories.jsx +188 -17
  127. package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
  128. package/jsx/core/DateTime/DateTimePicker.stories.d.ts.map +1 -1
  129. package/jsx/core/DateTime/DateTimePicker.stories.jsx +1 -1
  130. package/jsx/core/DateTime/DateTimePicker.stories.jsx.map +1 -1
  131. package/jsx/core/Dialog/Dialog.stories.d.ts +6 -0
  132. package/jsx/core/Dialog/Dialog.stories.d.ts.map +1 -0
  133. package/jsx/core/Dialog/Dialog.stories.jsx +79 -0
  134. package/jsx/core/Dialog/Dialog.stories.jsx.map +1 -0
  135. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  136. package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  137. package/jsx/core/FieldGroup/FieldGroup.stories.jsx +12 -4
  138. package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
  139. package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  140. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +4 -0
  141. package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
  142. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts +1 -0
  143. package/jsx/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  144. package/jsx/core/FieldValueList/FieldValueList.stories.jsx +34 -2
  145. package/jsx/core/FieldValueList/FieldValueList.stories.jsx.map +1 -1
  146. package/jsx/core/FieldValueList/FieldValueList.styles.d.ts +2 -0
  147. package/jsx/core/FieldValueList/FieldValueList.styles.d.ts.map +1 -0
  148. package/jsx/core/FieldValueList/FieldValueList.styles.js +8 -0
  149. package/jsx/core/FieldValueList/FieldValueList.styles.js.map +1 -0
  150. package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
  151. package/jsx/core/File/FileDisplay.stories.jsx +10 -5
  152. package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
  153. package/jsx/core/Form/Form.mocks.d.ts +6 -0
  154. package/jsx/core/Form/Form.mocks.d.ts.map +1 -1
  155. package/jsx/core/Form/Form.mocks.jsx +84 -7
  156. package/jsx/core/Form/Form.mocks.jsx.map +1 -1
  157. package/jsx/core/Form/Form.stories.d.ts +1 -0
  158. package/jsx/core/Form/Form.stories.d.ts.map +1 -1
  159. package/jsx/core/Form/Form.stories.jsx +4 -1
  160. package/jsx/core/Form/Form.stories.jsx.map +1 -1
  161. package/jsx/core/HTML/HTML.stories.jsx +1 -1
  162. package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
  163. package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
  164. package/jsx/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
  165. package/jsx/core/IconPicker/IconPicker.stories.jsx +6 -9
  166. package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
  167. package/jsx/core/Input/Input.stories.d.ts +2 -0
  168. package/jsx/core/Input/Input.stories.d.ts.map +1 -1
  169. package/jsx/core/Input/Input.stories.jsx +78 -2
  170. package/jsx/core/Input/Input.stories.jsx.map +1 -1
  171. package/jsx/core/Lightbox/Lightbox.stories.jsx +1 -1
  172. package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
  173. package/jsx/core/Link/Link.stories.d.ts +1 -0
  174. package/jsx/core/Link/Link.stories.d.ts.map +1 -1
  175. package/jsx/core/Link/Link.stories.jsx +12 -1
  176. package/jsx/core/Link/Link.stories.jsx.map +1 -1
  177. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +7 -1
  178. package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  179. package/jsx/core/ListToolbar/ListToolbar.stories.jsx +21 -6
  180. package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -1
  181. package/jsx/core/Location/Location.stories.d.ts +4 -1
  182. package/jsx/core/Location/Location.stories.d.ts.map +1 -1
  183. package/jsx/core/Location/Location.stories.jsx +13 -6
  184. package/jsx/core/Location/Location.stories.jsx.map +1 -1
  185. package/jsx/core/Location/locationTestUtils.d.ts +3 -0
  186. package/jsx/core/Location/locationTestUtils.d.ts.map +1 -0
  187. package/jsx/core/Location/locationTestUtils.js +29 -0
  188. package/jsx/core/Location/locationTestUtils.js.map +1 -0
  189. package/jsx/core/Menu/Menu.stories.d.ts.map +1 -1
  190. package/jsx/core/Menu/Menu.stories.jsx +7 -6
  191. package/jsx/core/Menu/Menu.stories.jsx.map +1 -1
  192. package/jsx/core/Modal/Modal.stories.d.ts +10 -1
  193. package/jsx/core/Modal/Modal.stories.d.ts.map +1 -1
  194. package/jsx/core/Modal/Modal.stories.jsx +49 -26
  195. package/jsx/core/Modal/Modal.stories.jsx.map +1 -1
  196. package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts +34 -0
  197. package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts.map +1 -0
  198. package/jsx/core/MultiStepForm/MultiStepForm.mocks.jsx +124 -0
  199. package/jsx/core/MultiStepForm/MultiStepForm.mocks.jsx.map +1 -0
  200. package/jsx/core/{MultiStep/MultiStep.stories.d.ts → MultiStepForm/MultiStepForm.stories.d.ts} +2 -2
  201. package/jsx/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -0
  202. package/jsx/core/MultiStepForm/MultiStepForm.stories.jsx +208 -0
  203. package/jsx/core/MultiStepForm/MultiStepForm.stories.jsx.map +1 -0
  204. package/jsx/core/Number/Number.stories.d.ts +5 -2
  205. package/jsx/core/Number/Number.stories.d.ts.map +1 -1
  206. package/jsx/core/Number/Number.stories.jsx +204 -24
  207. package/jsx/core/Number/Number.stories.jsx.map +1 -1
  208. package/jsx/core/PageTemplates/PageTemplates.mocks.d.ts +1 -1
  209. package/jsx/core/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  210. package/jsx/core/Phone/Phone.stories.d.ts +4 -1
  211. package/jsx/core/Phone/Phone.stories.d.ts.map +1 -1
  212. package/jsx/core/Phone/Phone.stories.jsx +10 -3
  213. package/jsx/core/Phone/Phone.stories.jsx.map +1 -1
  214. package/jsx/core/Popover/Popover.stories.jsx +6 -6
  215. package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
  216. package/jsx/core/RadioButton/RadioButton.stories.d.ts +6 -2
  217. package/jsx/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  218. package/jsx/core/RadioButton/RadioButton.stories.jsx +22 -5
  219. package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
  220. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +6 -2
  221. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  222. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx +46 -5
  223. package/jsx/core/RadioButtonGroup/RadioButtonGroup.stories.jsx.map +1 -1
  224. package/jsx/core/SearchInput/SearchInput.mocks.d.ts +12 -0
  225. package/jsx/core/SearchInput/SearchInput.mocks.d.ts.map +1 -0
  226. package/jsx/core/SearchInput/SearchInput.mocks.js +25 -0
  227. package/jsx/core/SearchInput/SearchInput.mocks.js.map +1 -0
  228. package/jsx/core/SearchInput/SearchInput.stories.d.ts +1 -4
  229. package/jsx/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  230. package/jsx/core/SearchInput/SearchInput.stories.jsx +29 -17
  231. package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
  232. package/jsx/core/Select/Select.stories.d.ts +1 -0
  233. package/jsx/core/Select/Select.stories.d.ts.map +1 -1
  234. package/jsx/core/Select/Select.stories.jsx +10 -3
  235. package/jsx/core/Select/Select.stories.jsx.map +1 -1
  236. package/jsx/core/SkipLinks/SkipLinks.stories.d.ts +6 -0
  237. package/jsx/core/SkipLinks/SkipLinks.stories.d.ts.map +1 -0
  238. package/jsx/core/SkipLinks/SkipLinks.stories.jsx +29 -0
  239. package/jsx/core/SkipLinks/SkipLinks.stories.jsx.map +1 -0
  240. package/jsx/core/SkipLinks/SkipLinks.styles.d.ts +2 -0
  241. package/jsx/core/SkipLinks/SkipLinks.styles.d.ts.map +1 -0
  242. package/jsx/core/SkipLinks/SkipLinks.styles.js +16 -0
  243. package/jsx/core/SkipLinks/SkipLinks.styles.js.map +1 -0
  244. package/jsx/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  245. package/jsx/core/SummaryList/SummaryList.stories.jsx +4 -4
  246. package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
  247. package/jsx/core/Tabs/Tabs.stories.jsx +1 -1
  248. package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
  249. package/jsx/core/TextArea/TextArea.stories.d.ts +4 -1
  250. package/jsx/core/TextArea/TextArea.stories.d.ts.map +1 -1
  251. package/jsx/core/TextArea/TextArea.stories.jsx +10 -3
  252. package/jsx/core/TextArea/TextArea.stories.jsx.map +1 -1
  253. package/jsx/core/Toaster/Toaster.stories.jsx +3 -3
  254. package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
  255. package/jsx/core/Tree/Tree.mocks.d.ts +1 -1
  256. package/jsx/core/Tree/Tree.mocks.d.ts.map +1 -1
  257. package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
  258. package/jsx/core/Tree/Tree.stories.jsx +14 -0
  259. package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
  260. package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  261. package/jsx/cs/ArticleList/ArticleList.stories.jsx +1 -1
  262. package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
  263. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts +7 -2
  264. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +1 -1
  265. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js +151 -9
  266. package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js.map +1 -1
  267. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +5 -2
  268. package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  269. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +208 -90
  270. package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
  271. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +2 -2
  272. package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
  273. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +1 -0
  274. package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  275. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +6 -6
  276. package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
  277. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +5 -5
  278. package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -1
  279. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +1 -0
  280. package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  281. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +33 -14
  282. package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
  283. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +12 -0
  284. package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  285. package/jsx/cs/TaskManager/TaskManager.mocks.js +86 -0
  286. package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  287. package/jsx/cs/TaskManager/TaskManager.stories.d.ts +2 -1
  288. package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  289. package/jsx/cs/TaskManager/TaskManager.stories.jsx +103 -25
  290. package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
  291. package/jsx/cs/TaskManager/TaskManager.styles.js +2 -1
  292. package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -1
  293. package/jsx/dnd/StandardDragDropList/Demo.d.ts +7 -0
  294. package/jsx/dnd/StandardDragDropList/Demo.d.ts.map +1 -0
  295. package/jsx/dnd/StandardDragDropList/Demo.jsx +158 -0
  296. package/jsx/dnd/StandardDragDropList/Demo.jsx.map +1 -0
  297. package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts +10 -0
  298. package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts.map +1 -0
  299. package/jsx/dnd/StandardDragDropList/GroupConfig.jsx +26 -0
  300. package/jsx/dnd/StandardDragDropList/GroupConfig.jsx.map +1 -0
  301. package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts +12 -0
  302. package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts.map +1 -0
  303. package/jsx/dnd/StandardDragDropList/ItemConfig.jsx +21 -0
  304. package/jsx/dnd/StandardDragDropList/ItemConfig.jsx.map +1 -0
  305. package/jsx/dnd/StandardDragDropList/Popover.d.ts +14 -0
  306. package/jsx/dnd/StandardDragDropList/Popover.d.ts.map +1 -0
  307. package/jsx/dnd/StandardDragDropList/Popover.jsx +51 -0
  308. package/jsx/dnd/StandardDragDropList/Popover.jsx.map +1 -0
  309. package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts +16 -0
  310. package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts.map +1 -0
  311. package/jsx/dnd/StandardDragDropList/SelectionMenu.jsx +104 -0
  312. package/jsx/dnd/StandardDragDropList/SelectionMenu.jsx.map +1 -0
  313. package/jsx/dnd/StandardDragDropList/StandardDragDropList.stories.d.ts +5 -0
  314. package/jsx/dnd/StandardDragDropList/StandardDragDropList.stories.d.ts.map +1 -0
  315. package/jsx/dnd/StandardDragDropList/StandardDragDropList.stories.jsx +15 -0
  316. package/jsx/dnd/StandardDragDropList/StandardDragDropList.stories.jsx.map +1 -0
  317. package/jsx/dnd/StandardDragDropList/mockData.d.ts +26 -0
  318. package/jsx/dnd/StandardDragDropList/mockData.d.ts.map +1 -0
  319. package/jsx/dnd/StandardDragDropList/mockData.js +77 -0
  320. package/jsx/dnd/StandardDragDropList/mockData.js.map +1 -0
  321. package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
  322. package/jsx/rte/Editor/Editor.stories.jsx +1 -1
  323. package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
  324. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +4 -1
  325. package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  326. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx +11 -4
  327. package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
  328. package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  329. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +2 -2
  330. package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
  331. package/jsx/social/Chat/Chat.mocks.d.ts +15 -2
  332. package/jsx/social/Chat/Chat.mocks.d.ts.map +1 -1
  333. package/jsx/social/Chat/Chat.mocks.js +5 -6
  334. package/jsx/social/Chat/Chat.mocks.js.map +1 -1
  335. package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
  336. package/jsx/social/Chat/Chat.stories.jsx +91 -11
  337. package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
  338. package/jsx/social/Email/Email.mocks.d.ts +70 -9
  339. package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
  340. package/jsx/social/Email/Email.mocks.jsx +386 -55
  341. package/jsx/social/Email/Email.mocks.jsx.map +1 -1
  342. package/jsx/social/Email/Email.stories.d.ts +50 -11
  343. package/jsx/social/Email/Email.stories.d.ts.map +1 -1
  344. package/jsx/social/Email/Email.stories.jsx +851 -323
  345. package/jsx/social/Email/Email.stories.jsx.map +1 -1
  346. package/jsx/social/Email/Email.styles.d.ts +0 -1
  347. package/jsx/social/Email/Email.styles.d.ts.map +1 -1
  348. package/jsx/social/Email/Email.styles.js +0 -3
  349. package/jsx/social/Email/Email.styles.js.map +1 -1
  350. package/jsx/social/Feed/Feed.mocks.d.ts +13 -18
  351. package/jsx/social/Feed/Feed.mocks.d.ts.map +1 -1
  352. package/jsx/social/Feed/Feed.mocks.jsx +10 -5
  353. package/jsx/social/Feed/Feed.mocks.jsx.map +1 -1
  354. package/jsx/social/Feed/Feed.stories.d.ts +3 -2
  355. package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
  356. package/jsx/social/Feed/Feed.stories.jsx +12 -7
  357. package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
  358. package/jsx/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  359. package/jsx/social/Feed/FeedNewPost.stories.jsx +4 -3
  360. package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
  361. package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
  362. package/jsx/social/Feed/FeedPost.stories.jsx +12 -11
  363. package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
  364. package/jsx/social/Feed/FeedReply.stories.d.ts +1 -1
  365. package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
  366. package/jsx/social/Feed/FeedReply.stories.jsx +7 -7
  367. package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
  368. package/jsx/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  369. package/jsx/social/Feed/FeedReplyInput.stories.jsx +4 -3
  370. package/jsx/social/Feed/FeedReplyInput.stories.jsx.map +1 -1
  371. package/jsx/tools/Clipboard/Clipboard.mocks.d.ts +6 -0
  372. package/jsx/tools/Clipboard/Clipboard.mocks.d.ts.map +1 -0
  373. package/jsx/tools/Clipboard/Clipboard.mocks.jsx +81 -0
  374. package/jsx/tools/Clipboard/Clipboard.mocks.jsx.map +1 -0
  375. package/jsx/tools/Clipboard/Clipboard.stories.d.ts +6 -0
  376. package/jsx/tools/Clipboard/Clipboard.stories.d.ts.map +1 -0
  377. package/jsx/tools/Clipboard/Clipboard.stories.jsx +69 -0
  378. package/jsx/tools/Clipboard/Clipboard.stories.jsx.map +1 -0
  379. package/jsx/tools/DevTools/DevTools.mocks.d.ts +3 -0
  380. package/jsx/tools/DevTools/DevTools.mocks.d.ts.map +1 -0
  381. package/jsx/tools/DevTools/DevTools.mocks.js +3 -0
  382. package/jsx/tools/DevTools/DevTools.mocks.js.map +1 -0
  383. package/jsx/tools/DevTools/DevTools.stories.d.ts +10 -0
  384. package/jsx/tools/DevTools/DevTools.stories.d.ts.map +1 -0
  385. package/jsx/tools/DevTools/DevTools.stories.jsx +35 -0
  386. package/jsx/tools/DevTools/DevTools.stories.jsx.map +1 -0
  387. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts +9 -0
  388. package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts.map +1 -0
  389. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx +58 -0
  390. package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx.map +1 -0
  391. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts +16 -0
  392. package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts.map +1 -0
  393. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx +153 -0
  394. package/jsx/tools/PreviewShell/PreviewShell.stories.jsx.map +1 -0
  395. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts +3 -0
  396. package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts.map +1 -0
  397. package/jsx/tools/PreviewShell/PreviewShell.styles.js +7 -0
  398. package/jsx/tools/PreviewShell/PreviewShell.styles.js.map +1 -0
  399. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
  400. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx +5 -4
  401. package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx.map +1 -1
  402. package/jsx/work/CaseView/Attachments.mocks.jsx +5 -6
  403. package/jsx/work/CaseView/Attachments.mocks.jsx.map +1 -1
  404. package/jsx/work/CaseView/CaseView.mocks.d.ts +72 -2
  405. package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  406. package/jsx/work/CaseView/CaseView.mocks.jsx +201 -11
  407. package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
  408. package/jsx/work/CaseView/CaseView.stories.d.ts +4 -22
  409. package/jsx/work/CaseView/CaseView.stories.d.ts.map +1 -1
  410. package/jsx/work/CaseView/CaseView.stories.jsx +55 -230
  411. package/jsx/work/CaseView/CaseView.stories.jsx.map +1 -1
  412. package/jsx/work/CaseView/Pulse.mocks.d.ts +4 -3
  413. package/jsx/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  414. package/jsx/work/CaseView/Pulse.mocks.jsx +2 -2
  415. package/jsx/work/CaseView/Pulse.mocks.jsx.map +1 -1
  416. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  417. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +1 -0
  418. package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
  419. package/jsx/work/Confirmation/Confirmation.stories.d.ts +3 -0
  420. package/jsx/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  421. package/jsx/work/Confirmation/Confirmation.stories.jsx +12 -8
  422. package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
  423. package/jsx/work/Details/Details.stories.d.ts.map +1 -1
  424. package/jsx/work/Details/Details.stories.jsx +67 -64
  425. package/jsx/work/Details/Details.stories.jsx.map +1 -1
  426. package/jsx/work/SearchResults/SearchResults.mocks.d.ts +6 -0
  427. package/jsx/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  428. package/jsx/work/SearchResults/SearchResults.mocks.jsx +39 -38
  429. package/jsx/work/SearchResults/SearchResults.mocks.jsx.map +1 -1
  430. package/jsx/work/SearchResults/SearchResults.stories.d.ts +1 -0
  431. package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  432. package/jsx/work/SearchResults/SearchResults.stories.jsx +74 -44
  433. package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
  434. package/jsx/work/Stages/Stages.mocks.d.ts +14 -0
  435. package/jsx/work/Stages/Stages.mocks.d.ts.map +1 -0
  436. package/jsx/work/Stages/Stages.mocks.jsx +40 -0
  437. package/jsx/work/Stages/Stages.mocks.jsx.map +1 -0
  438. package/jsx/work/Stages/Stages.stories.d.ts +1 -1
  439. package/jsx/work/Stages/Stages.stories.d.ts.map +1 -1
  440. package/jsx/work/Stages/Stages.stories.jsx +12 -46
  441. package/jsx/work/Stages/Stages.stories.jsx.map +1 -1
  442. package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  443. package/jsx/work/Stakeholders/Stakeholders.stories.jsx +1 -0
  444. package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
  445. package/jsx/work/Tasks/TaskList.stories.d.ts.map +1 -1
  446. package/jsx/work/Tasks/TaskList.stories.jsx +3 -1
  447. package/jsx/work/Tasks/TaskList.stories.jsx.map +1 -1
  448. package/jsx/work/Tasks/Tasks.stories.d.ts +4 -0
  449. package/jsx/work/Tasks/Tasks.stories.d.ts.map +1 -1
  450. package/jsx/work/Tasks/Tasks.stories.jsx +20 -10
  451. package/jsx/work/Tasks/Tasks.stories.jsx.map +1 -1
  452. package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
  453. package/jsx/work/Timeline/Timeline.stories.jsx +2 -1
  454. package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
  455. package/jsx/wss/AppShell/AppShell.mocks.d.ts +35 -0
  456. package/jsx/wss/AppShell/AppShell.mocks.d.ts.map +1 -0
  457. package/jsx/wss/AppShell/AppShell.mocks.jsx +75 -0
  458. package/jsx/wss/AppShell/AppShell.mocks.jsx.map +1 -0
  459. package/jsx/wss/AppShell/AppShell.stories.d.ts +19 -0
  460. package/jsx/wss/AppShell/AppShell.stories.d.ts.map +1 -0
  461. package/jsx/wss/AppShell/AppShell.stories.jsx +68 -0
  462. package/jsx/wss/AppShell/AppShell.stories.jsx.map +1 -0
  463. package/jsx/wss/AppShell/AppShell.styles.d.ts +2 -0
  464. package/jsx/wss/AppShell/AppShell.styles.d.ts.map +1 -0
  465. package/jsx/wss/AppShell/AppShell.styles.js +5 -0
  466. package/jsx/wss/AppShell/AppShell.styles.js.map +1 -0
  467. package/jsx/wss/CaseView/CaseView.mocks.d.ts +13 -0
  468. package/jsx/wss/CaseView/CaseView.mocks.d.ts.map +1 -0
  469. package/jsx/wss/CaseView/CaseView.mocks.jsx +34 -0
  470. package/jsx/wss/CaseView/CaseView.mocks.jsx.map +1 -0
  471. package/jsx/wss/CaseView/CaseView.stories.d.ts +12 -0
  472. package/jsx/wss/CaseView/CaseView.stories.d.ts.map +1 -0
  473. package/jsx/wss/CaseView/CaseView.stories.jsx +69 -0
  474. package/jsx/wss/CaseView/CaseView.stories.jsx.map +1 -0
  475. package/jsx/wss/PageTemplates/PageTemplates.stories.d.ts +15 -0
  476. package/jsx/wss/PageTemplates/PageTemplates.stories.d.ts.map +1 -0
  477. package/jsx/wss/PageTemplates/PageTemplates.stories.jsx +48 -0
  478. package/jsx/wss/PageTemplates/PageTemplates.stories.jsx.map +1 -0
  479. package/jsx/wss/QuickCreate/QuickCreate.stories.d.ts +10 -0
  480. package/jsx/wss/QuickCreate/QuickCreate.stories.d.ts.map +1 -0
  481. package/jsx/wss/QuickCreate/QuickCreate.stories.jsx +37 -0
  482. package/jsx/wss/QuickCreate/QuickCreate.stories.jsx.map +1 -0
  483. package/lib/build/AppHeader/AppHeader.stories.d.ts +1 -1
  484. package/lib/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
  485. package/lib/build/AppHeader/AppHeader.stories.js +100 -81
  486. package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
  487. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +1 -1
  488. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
  489. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +22 -1
  490. package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
  491. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +60 -0
  492. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +1 -0
  493. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js +524 -0
  494. package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +1 -0
  495. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +26 -0
  496. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +1 -0
  497. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js +336 -0
  498. package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js.map +1 -0
  499. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts +4 -4
  500. package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +1 -1
  501. package/lib/build/FlowModeller/AddNodeUtils.mocks.js.map +1 -1
  502. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +4 -2
  503. package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
  504. package/lib/build/FlowModeller/FlowModeller.mocks.js +117 -31
  505. package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
  506. package/lib/build/FlowModeller/FlowModeller.stories.d.ts +7 -2
  507. package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
  508. package/lib/build/FlowModeller/FlowModeller.stories.js +244 -64
  509. package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
  510. package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +1 -1
  511. package/lib/build/LifeCycle/LifeCycle.mocks.js +40 -0
  512. package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
  513. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +25 -8
  514. package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
  515. package/lib/build/ObjectSelect/ObjectSelect.mocks.js +122 -61
  516. package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
  517. package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
  518. package/lib/build/ObjectSelect/ObjectSelect.stories.js +116 -25
  519. package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
  520. package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  521. package/lib/build/PageTemplates/PageTemplates.mocks.js +4 -4
  522. package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -1
  523. package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
  524. package/lib/build/PageTemplates/PageTemplates.stories.js +3 -3
  525. package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
  526. package/lib/build/Workbench/Workbench.stories.d.ts +1 -0
  527. package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
  528. package/lib/build/Workbench/Workbench.stories.js +196 -4
  529. package/lib/build/Workbench/Workbench.stories.js.map +1 -1
  530. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +1 -1
  531. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -1
  532. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +3 -1
  533. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -1
  534. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +2 -1
  535. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
  536. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +29 -15
  537. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
  538. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +1 -1
  539. package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -1
  540. package/lib/condition-builder/ConditionBuilder/props.mock.d.ts.map +1 -1
  541. package/lib/condition-builder/ConditionBuilder/props.mock.js +132 -31
  542. package/lib/condition-builder/ConditionBuilder/props.mock.js.map +1 -1
  543. package/lib/condition-builder/ConditionInput/ConditionInput.stories.d.ts +10 -0
  544. package/lib/condition-builder/ConditionInput/ConditionInput.stories.d.ts.map +1 -0
  545. package/lib/condition-builder/ConditionInput/ConditionInput.stories.js +41 -0
  546. package/lib/condition-builder/ConditionInput/ConditionInput.stories.js.map +1 -0
  547. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts +4 -0
  548. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.d.ts.map +1 -0
  549. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.js +181 -0
  550. package/lib/condition-builder/PromotedFilters/PromotedFilters.mocks.js.map +1 -0
  551. package/lib/condition-builder/PromotedFilters/PromotedFilters.stories.d.ts +8 -0
  552. package/lib/condition-builder/PromotedFilters/PromotedFilters.stories.d.ts.map +1 -0
  553. package/lib/condition-builder/PromotedFilters/PromotedFilters.stories.js +24 -0
  554. package/lib/condition-builder/PromotedFilters/PromotedFilters.stories.js.map +1 -0
  555. package/lib/condition-builder/PromotedFilters/PromotedFilters.styles.d.ts +9 -0
  556. package/lib/condition-builder/PromotedFilters/PromotedFilters.styles.d.ts.map +1 -0
  557. package/lib/condition-builder/PromotedFilters/PromotedFilters.styles.js +35 -0
  558. package/lib/condition-builder/PromotedFilters/PromotedFilters.styles.js.map +1 -0
  559. package/lib/core/AdditionalInfo/AdditionalInfo.stories.d.ts +9 -0
  560. package/lib/core/AdditionalInfo/AdditionalInfo.stories.d.ts.map +1 -0
  561. package/lib/core/AdditionalInfo/AdditionalInfo.stories.js +16 -0
  562. package/lib/core/AdditionalInfo/AdditionalInfo.stories.js.map +1 -0
  563. package/lib/core/AppShell/AppShell.mocks.d.ts +1 -1
  564. package/lib/core/AppShell/AppShell.mocks.js +5 -5
  565. package/lib/core/AppShell/AppShell.mocks.js.map +1 -1
  566. package/lib/core/AppShell/AppShell.stories.d.ts +2 -0
  567. package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
  568. package/lib/core/AppShell/AppShell.stories.js +47 -13
  569. package/lib/core/AppShell/AppShell.stories.js.map +1 -1
  570. package/lib/core/Banner/Banner.stories.d.ts +0 -1
  571. package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
  572. package/lib/core/Banner/Banner.stories.js +2 -13
  573. package/lib/core/Banner/Banner.stories.js.map +1 -1
  574. package/lib/core/Checkbox/Checkbox.stories.d.ts +6 -2
  575. package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
  576. package/lib/core/Checkbox/Checkbox.stories.js +26 -7
  577. package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
  578. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts +6 -2
  579. package/lib/core/CheckboxGroup/CheckboxGroup.stories.d.ts.map +1 -1
  580. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js +40 -4
  581. package/lib/core/CheckboxGroup/CheckboxGroup.stories.js.map +1 -1
  582. package/lib/core/ColorPicker/ColorPicker.stories.d.ts +4 -1
  583. package/lib/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
  584. package/lib/core/ColorPicker/ColorPicker.stories.js +10 -3
  585. package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
  586. package/lib/core/ComboBox/ComboBox.stories.d.ts +1 -0
  587. package/lib/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
  588. package/lib/core/ComboBox/ComboBox.stories.js +40 -8
  589. package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
  590. package/lib/core/CompositeInput/CompositeInput.mocks.d.ts +8 -0
  591. package/lib/core/CompositeInput/CompositeInput.mocks.d.ts.map +1 -0
  592. package/lib/core/CompositeInput/CompositeInput.mocks.js +6 -0
  593. package/lib/core/CompositeInput/CompositeInput.mocks.js.map +1 -0
  594. package/lib/core/CompositeInput/CompositeInput.stories.d.ts +9 -0
  595. package/lib/core/CompositeInput/CompositeInput.stories.d.ts.map +1 -0
  596. package/lib/core/CompositeInput/CompositeInput.stories.js +55 -0
  597. package/lib/core/CompositeInput/CompositeInput.stories.js.map +1 -0
  598. package/lib/core/CreditCard/CreditCard.stories.d.ts +4 -1
  599. package/lib/core/CreditCard/CreditCard.stories.d.ts.map +1 -1
  600. package/lib/core/CreditCard/CreditCard.stories.js +11 -4
  601. package/lib/core/CreditCard/CreditCard.stories.js.map +1 -1
  602. package/lib/core/Currency/Currency.stories.d.ts +6 -1
  603. package/lib/core/Currency/Currency.stories.d.ts.map +1 -1
  604. package/lib/core/Currency/Currency.stories.js +30 -7
  605. package/lib/core/Currency/Currency.stories.js.map +1 -1
  606. package/lib/core/DateTime/DateTime.stories.d.ts +41 -10
  607. package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
  608. package/lib/core/DateTime/DateTime.stories.js +188 -17
  609. package/lib/core/DateTime/DateTime.stories.js.map +1 -1
  610. package/lib/core/DateTime/DateTimePicker.stories.d.ts.map +1 -1
  611. package/lib/core/DateTime/DateTimePicker.stories.js +1 -1
  612. package/lib/core/DateTime/DateTimePicker.stories.js.map +1 -1
  613. package/lib/core/Dialog/Dialog.stories.d.ts +6 -0
  614. package/lib/core/Dialog/Dialog.stories.d.ts.map +1 -0
  615. package/lib/core/Dialog/Dialog.stories.js +47 -0
  616. package/lib/core/Dialog/Dialog.stories.js.map +1 -0
  617. package/lib/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
  618. package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
  619. package/lib/core/FieldGroup/FieldGroup.stories.js +11 -3
  620. package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
  621. package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
  622. package/lib/core/FieldGroup/FieldGroupList.stories.js +4 -0
  623. package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
  624. package/lib/core/FieldValueList/FieldValueList.stories.d.ts +1 -0
  625. package/lib/core/FieldValueList/FieldValueList.stories.d.ts.map +1 -1
  626. package/lib/core/FieldValueList/FieldValueList.stories.js +32 -2
  627. package/lib/core/FieldValueList/FieldValueList.stories.js.map +1 -1
  628. package/lib/core/FieldValueList/FieldValueList.styles.d.ts +2 -0
  629. package/lib/core/FieldValueList/FieldValueList.styles.d.ts.map +1 -0
  630. package/lib/core/FieldValueList/FieldValueList.styles.js +8 -0
  631. package/lib/core/FieldValueList/FieldValueList.styles.js.map +1 -0
  632. package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
  633. package/lib/core/File/FileDisplay.stories.js +10 -5
  634. package/lib/core/File/FileDisplay.stories.js.map +1 -1
  635. package/lib/core/Form/Form.mocks.d.ts +6 -0
  636. package/lib/core/Form/Form.mocks.d.ts.map +1 -1
  637. package/lib/core/Form/Form.mocks.js +28 -5
  638. package/lib/core/Form/Form.mocks.js.map +1 -1
  639. package/lib/core/Form/Form.stories.d.ts +1 -0
  640. package/lib/core/Form/Form.stories.d.ts.map +1 -1
  641. package/lib/core/Form/Form.stories.js +4 -1
  642. package/lib/core/Form/Form.stories.js.map +1 -1
  643. package/lib/core/HTML/HTML.stories.js +1 -1
  644. package/lib/core/HTML/HTML.stories.js.map +1 -1
  645. package/lib/core/Icon/Icon.stories.js.map +1 -1
  646. package/lib/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
  647. package/lib/core/IconPicker/IconPicker.stories.js +6 -9
  648. package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
  649. package/lib/core/Input/Input.stories.d.ts +2 -0
  650. package/lib/core/Input/Input.stories.d.ts.map +1 -1
  651. package/lib/core/Input/Input.stories.js +78 -2
  652. package/lib/core/Input/Input.stories.js.map +1 -1
  653. package/lib/core/Lightbox/Lightbox.stories.js +1 -1
  654. package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
  655. package/lib/core/Link/Link.stories.d.ts +1 -0
  656. package/lib/core/Link/Link.stories.d.ts.map +1 -1
  657. package/lib/core/Link/Link.stories.js +5 -1
  658. package/lib/core/Link/Link.stories.js.map +1 -1
  659. package/lib/core/ListToolbar/ListToolbar.stories.d.ts +7 -1
  660. package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -1
  661. package/lib/core/ListToolbar/ListToolbar.stories.js +21 -6
  662. package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -1
  663. package/lib/core/Location/Location.stories.d.ts +4 -1
  664. package/lib/core/Location/Location.stories.d.ts.map +1 -1
  665. package/lib/core/Location/Location.stories.js +13 -6
  666. package/lib/core/Location/Location.stories.js.map +1 -1
  667. package/lib/core/Location/locationTestUtils.d.ts +3 -0
  668. package/lib/core/Location/locationTestUtils.d.ts.map +1 -0
  669. package/lib/core/Location/locationTestUtils.js +30 -0
  670. package/lib/core/Location/locationTestUtils.js.map +1 -0
  671. package/lib/core/Menu/Menu.stories.d.ts.map +1 -1
  672. package/lib/core/Menu/Menu.stories.js +7 -6
  673. package/lib/core/Menu/Menu.stories.js.map +1 -1
  674. package/lib/core/Modal/Modal.stories.d.ts +10 -1
  675. package/lib/core/Modal/Modal.stories.d.ts.map +1 -1
  676. package/lib/core/Modal/Modal.stories.js +49 -26
  677. package/lib/core/Modal/Modal.stories.js.map +1 -1
  678. package/lib/core/MultiStepForm/MultiStepForm.mocks.d.ts +34 -0
  679. package/lib/core/MultiStepForm/MultiStepForm.mocks.d.ts.map +1 -0
  680. package/lib/core/MultiStepForm/MultiStepForm.mocks.js +75 -0
  681. package/lib/core/MultiStepForm/MultiStepForm.mocks.js.map +1 -0
  682. package/lib/core/{MultiStep/MultiStep.stories.d.ts → MultiStepForm/MultiStepForm.stories.d.ts} +2 -2
  683. package/lib/core/MultiStepForm/MultiStepForm.stories.d.ts.map +1 -0
  684. package/lib/core/MultiStepForm/MultiStepForm.stories.js +187 -0
  685. package/lib/core/MultiStepForm/MultiStepForm.stories.js.map +1 -0
  686. package/lib/core/Number/Number.stories.d.ts +5 -2
  687. package/lib/core/Number/Number.stories.d.ts.map +1 -1
  688. package/lib/core/Number/Number.stories.js +204 -24
  689. package/lib/core/Number/Number.stories.js.map +1 -1
  690. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts +1 -1
  691. package/lib/core/PageTemplates/PageTemplates.mocks.d.ts.map +1 -1
  692. package/lib/core/Phone/Phone.stories.d.ts +4 -1
  693. package/lib/core/Phone/Phone.stories.d.ts.map +1 -1
  694. package/lib/core/Phone/Phone.stories.js +10 -3
  695. package/lib/core/Phone/Phone.stories.js.map +1 -1
  696. package/lib/core/Popover/Popover.stories.js +1 -1
  697. package/lib/core/Popover/Popover.stories.js.map +1 -1
  698. package/lib/core/RadioButton/RadioButton.stories.d.ts +6 -2
  699. package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
  700. package/lib/core/RadioButton/RadioButton.stories.js +22 -5
  701. package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
  702. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts +6 -2
  703. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -1
  704. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js +40 -4
  705. package/lib/core/RadioButtonGroup/RadioButtonGroup.stories.js.map +1 -1
  706. package/lib/core/SearchInput/SearchInput.mocks.d.ts +12 -0
  707. package/lib/core/SearchInput/SearchInput.mocks.d.ts.map +1 -0
  708. package/lib/core/SearchInput/SearchInput.mocks.js +25 -0
  709. package/lib/core/SearchInput/SearchInput.mocks.js.map +1 -0
  710. package/lib/core/SearchInput/SearchInput.stories.d.ts +1 -4
  711. package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
  712. package/lib/core/SearchInput/SearchInput.stories.js +29 -15
  713. package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
  714. package/lib/core/Select/Select.stories.d.ts +1 -0
  715. package/lib/core/Select/Select.stories.d.ts.map +1 -1
  716. package/lib/core/Select/Select.stories.js +10 -3
  717. package/lib/core/Select/Select.stories.js.map +1 -1
  718. package/lib/core/SkipLinks/SkipLinks.stories.d.ts +6 -0
  719. package/lib/core/SkipLinks/SkipLinks.stories.d.ts.map +1 -0
  720. package/lib/core/SkipLinks/SkipLinks.stories.js +28 -0
  721. package/lib/core/SkipLinks/SkipLinks.stories.js.map +1 -0
  722. package/lib/core/SkipLinks/SkipLinks.styles.d.ts +2 -0
  723. package/lib/core/SkipLinks/SkipLinks.styles.d.ts.map +1 -0
  724. package/lib/core/SkipLinks/SkipLinks.styles.js +16 -0
  725. package/lib/core/SkipLinks/SkipLinks.styles.js.map +1 -0
  726. package/lib/core/SummaryList/SummaryList.stories.d.ts.map +1 -1
  727. package/lib/core/SummaryList/SummaryList.stories.js +4 -4
  728. package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
  729. package/lib/core/Tabs/Tabs.stories.js +1 -1
  730. package/lib/core/Tabs/Tabs.stories.js.map +1 -1
  731. package/lib/core/TextArea/TextArea.stories.d.ts +4 -1
  732. package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -1
  733. package/lib/core/TextArea/TextArea.stories.js +10 -3
  734. package/lib/core/TextArea/TextArea.stories.js.map +1 -1
  735. package/lib/core/Toaster/Toaster.stories.js +3 -3
  736. package/lib/core/Toaster/Toaster.stories.js.map +1 -1
  737. package/lib/core/Tree/Tree.mocks.d.ts +1 -1
  738. package/lib/core/Tree/Tree.mocks.d.ts.map +1 -1
  739. package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
  740. package/lib/core/Tree/Tree.stories.js +16 -0
  741. package/lib/core/Tree/Tree.stories.js.map +1 -1
  742. package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
  743. package/lib/cs/ArticleList/ArticleList.stories.js +1 -1
  744. package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
  745. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts +7 -2
  746. package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +1 -1
  747. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js +151 -9
  748. package/lib/cs/CallControlPanel/CallControlPanel.mocks.js.map +1 -1
  749. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +5 -2
  750. package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
  751. package/lib/cs/CallControlPanel/CallControlPanel.stories.js +208 -94
  752. package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
  753. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +2 -2
  754. package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
  755. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +1 -0
  756. package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
  757. package/lib/cs/InteractionNotification/InteractionNotification.stories.js +24 -22
  758. package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
  759. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +5 -5
  760. package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -1
  761. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +1 -0
  762. package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
  763. package/lib/cs/InteractionTimer/InteractionTimer.stories.js +33 -14
  764. package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
  765. package/lib/cs/TaskManager/TaskManager.mocks.d.ts +12 -0
  766. package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
  767. package/lib/cs/TaskManager/TaskManager.mocks.js +86 -0
  768. package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
  769. package/lib/cs/TaskManager/TaskManager.stories.d.ts +2 -1
  770. package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
  771. package/lib/cs/TaskManager/TaskManager.stories.js +103 -25
  772. package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
  773. package/lib/cs/TaskManager/TaskManager.styles.js +2 -1
  774. package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -1
  775. package/lib/dnd/StandardDragDropList/Demo.d.ts +7 -0
  776. package/lib/dnd/StandardDragDropList/Demo.d.ts.map +1 -0
  777. package/lib/dnd/StandardDragDropList/Demo.js +151 -0
  778. package/lib/dnd/StandardDragDropList/Demo.js.map +1 -0
  779. package/lib/dnd/StandardDragDropList/GroupConfig.d.ts +10 -0
  780. package/lib/dnd/StandardDragDropList/GroupConfig.d.ts.map +1 -0
  781. package/lib/dnd/StandardDragDropList/GroupConfig.js +18 -0
  782. package/lib/dnd/StandardDragDropList/GroupConfig.js.map +1 -0
  783. package/lib/dnd/StandardDragDropList/ItemConfig.d.ts +12 -0
  784. package/lib/dnd/StandardDragDropList/ItemConfig.d.ts.map +1 -0
  785. package/lib/dnd/StandardDragDropList/ItemConfig.js +20 -0
  786. package/lib/dnd/StandardDragDropList/ItemConfig.js.map +1 -0
  787. package/lib/dnd/StandardDragDropList/Popover.d.ts +14 -0
  788. package/lib/dnd/StandardDragDropList/Popover.d.ts.map +1 -0
  789. package/lib/dnd/StandardDragDropList/Popover.js +33 -0
  790. package/lib/dnd/StandardDragDropList/Popover.js.map +1 -0
  791. package/lib/dnd/StandardDragDropList/SelectionMenu.d.ts +16 -0
  792. package/lib/dnd/StandardDragDropList/SelectionMenu.d.ts.map +1 -0
  793. package/lib/dnd/StandardDragDropList/SelectionMenu.js +100 -0
  794. package/lib/dnd/StandardDragDropList/SelectionMenu.js.map +1 -0
  795. package/lib/dnd/StandardDragDropList/StandardDragDropList.stories.d.ts +5 -0
  796. package/lib/dnd/StandardDragDropList/StandardDragDropList.stories.d.ts.map +1 -0
  797. package/lib/dnd/StandardDragDropList/StandardDragDropList.stories.js +13 -0
  798. package/lib/dnd/StandardDragDropList/StandardDragDropList.stories.js.map +1 -0
  799. package/lib/dnd/StandardDragDropList/mockData.d.ts +26 -0
  800. package/lib/dnd/StandardDragDropList/mockData.d.ts.map +1 -0
  801. package/lib/dnd/StandardDragDropList/mockData.js +78 -0
  802. package/lib/dnd/StandardDragDropList/mockData.js.map +1 -0
  803. package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
  804. package/lib/rte/Editor/Editor.stories.js +1 -1
  805. package/lib/rte/Editor/Editor.stories.js.map +1 -1
  806. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +4 -1
  807. package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
  808. package/lib/rte/RichTextEditor/RichTextEditor.stories.js +11 -4
  809. package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
  810. package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
  811. package/lib/rte/RichTextEditor/RichTextViewer.stories.js +2 -2
  812. package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
  813. package/lib/social/Chat/Chat.mocks.d.ts +15 -2
  814. package/lib/social/Chat/Chat.mocks.d.ts.map +1 -1
  815. package/lib/social/Chat/Chat.mocks.js +5 -6
  816. package/lib/social/Chat/Chat.mocks.js.map +1 -1
  817. package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
  818. package/lib/social/Chat/Chat.stories.js +70 -8
  819. package/lib/social/Chat/Chat.stories.js.map +1 -1
  820. package/lib/social/Email/Email.mocks.d.ts +70 -9
  821. package/lib/social/Email/Email.mocks.d.ts.map +1 -1
  822. package/lib/social/Email/Email.mocks.js +386 -55
  823. package/lib/social/Email/Email.mocks.js.map +1 -1
  824. package/lib/social/Email/Email.stories.d.ts +50 -11
  825. package/lib/social/Email/Email.stories.d.ts.map +1 -1
  826. package/lib/social/Email/Email.stories.js +822 -348
  827. package/lib/social/Email/Email.stories.js.map +1 -1
  828. package/lib/social/Email/Email.styles.d.ts +0 -1
  829. package/lib/social/Email/Email.styles.d.ts.map +1 -1
  830. package/lib/social/Email/Email.styles.js +0 -3
  831. package/lib/social/Email/Email.styles.js.map +1 -1
  832. package/lib/social/Feed/Feed.mocks.d.ts +13 -18
  833. package/lib/social/Feed/Feed.mocks.d.ts.map +1 -1
  834. package/lib/social/Feed/Feed.mocks.js +10 -5
  835. package/lib/social/Feed/Feed.mocks.js.map +1 -1
  836. package/lib/social/Feed/Feed.stories.d.ts +3 -2
  837. package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
  838. package/lib/social/Feed/Feed.stories.js +12 -7
  839. package/lib/social/Feed/Feed.stories.js.map +1 -1
  840. package/lib/social/Feed/FeedNewPost.stories.d.ts.map +1 -1
  841. package/lib/social/Feed/FeedNewPost.stories.js +4 -3
  842. package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
  843. package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
  844. package/lib/social/Feed/FeedPost.stories.js +12 -11
  845. package/lib/social/Feed/FeedPost.stories.js.map +1 -1
  846. package/lib/social/Feed/FeedReply.stories.d.ts +1 -1
  847. package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
  848. package/lib/social/Feed/FeedReply.stories.js +7 -7
  849. package/lib/social/Feed/FeedReply.stories.js.map +1 -1
  850. package/lib/social/Feed/FeedReplyInput.stories.d.ts.map +1 -1
  851. package/lib/social/Feed/FeedReplyInput.stories.js +4 -3
  852. package/lib/social/Feed/FeedReplyInput.stories.js.map +1 -1
  853. package/lib/tools/Clipboard/Clipboard.mocks.d.ts +6 -0
  854. package/lib/tools/Clipboard/Clipboard.mocks.d.ts.map +1 -0
  855. package/lib/tools/Clipboard/Clipboard.mocks.js +75 -0
  856. package/lib/tools/Clipboard/Clipboard.mocks.js.map +1 -0
  857. package/lib/tools/Clipboard/Clipboard.stories.d.ts +6 -0
  858. package/lib/tools/Clipboard/Clipboard.stories.d.ts.map +1 -0
  859. package/lib/tools/Clipboard/Clipboard.stories.js +78 -0
  860. package/lib/tools/Clipboard/Clipboard.stories.js.map +1 -0
  861. package/lib/tools/DevTools/DevTools.mocks.d.ts +3 -0
  862. package/lib/tools/DevTools/DevTools.mocks.d.ts.map +1 -0
  863. package/lib/tools/DevTools/DevTools.mocks.js +3 -0
  864. package/lib/tools/DevTools/DevTools.mocks.js.map +1 -0
  865. package/lib/tools/DevTools/DevTools.stories.d.ts +10 -0
  866. package/lib/tools/DevTools/DevTools.stories.d.ts.map +1 -0
  867. package/lib/tools/DevTools/DevTools.stories.js +31 -0
  868. package/lib/tools/DevTools/DevTools.stories.js.map +1 -0
  869. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts +9 -0
  870. package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts.map +1 -0
  871. package/lib/tools/PreviewShell/PreviewShell.mocks.js +57 -0
  872. package/lib/tools/PreviewShell/PreviewShell.mocks.js.map +1 -0
  873. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts +16 -0
  874. package/lib/tools/PreviewShell/PreviewShell.stories.d.ts.map +1 -0
  875. package/lib/tools/PreviewShell/PreviewShell.stories.js +154 -0
  876. package/lib/tools/PreviewShell/PreviewShell.stories.js.map +1 -0
  877. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts +3 -0
  878. package/lib/tools/PreviewShell/PreviewShell.styles.d.ts.map +1 -0
  879. package/lib/tools/PreviewShell/PreviewShell.styles.js +7 -0
  880. package/lib/tools/PreviewShell/PreviewShell.styles.js.map +1 -0
  881. package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
  882. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +5 -4
  883. package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
  884. package/lib/work/CaseView/Attachments.mocks.js +5 -6
  885. package/lib/work/CaseView/Attachments.mocks.js.map +1 -1
  886. package/lib/work/CaseView/CaseView.mocks.d.ts +72 -2
  887. package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
  888. package/lib/work/CaseView/CaseView.mocks.js +191 -11
  889. package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
  890. package/lib/work/CaseView/CaseView.stories.d.ts +4 -22
  891. package/lib/work/CaseView/CaseView.stories.d.ts.map +1 -1
  892. package/lib/work/CaseView/CaseView.stories.js +50 -240
  893. package/lib/work/CaseView/CaseView.stories.js.map +1 -1
  894. package/lib/work/CaseView/Pulse.mocks.d.ts +4 -3
  895. package/lib/work/CaseView/Pulse.mocks.d.ts.map +1 -1
  896. package/lib/work/CaseView/Pulse.mocks.js +2 -2
  897. package/lib/work/CaseView/Pulse.mocks.js.map +1 -1
  898. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
  899. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +1 -0
  900. package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
  901. package/lib/work/Confirmation/Confirmation.stories.d.ts +3 -0
  902. package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
  903. package/lib/work/Confirmation/Confirmation.stories.js +12 -8
  904. package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
  905. package/lib/work/Details/Details.stories.d.ts.map +1 -1
  906. package/lib/work/Details/Details.stories.js +14 -59
  907. package/lib/work/Details/Details.stories.js.map +1 -1
  908. package/lib/work/SearchResults/SearchResults.mocks.d.ts +6 -0
  909. package/lib/work/SearchResults/SearchResults.mocks.d.ts.map +1 -1
  910. package/lib/work/SearchResults/SearchResults.mocks.js +39 -38
  911. package/lib/work/SearchResults/SearchResults.mocks.js.map +1 -1
  912. package/lib/work/SearchResults/SearchResults.stories.d.ts +1 -0
  913. package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
  914. package/lib/work/SearchResults/SearchResults.stories.js +74 -44
  915. package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
  916. package/lib/work/Stages/Stages.mocks.d.ts +14 -0
  917. package/lib/work/Stages/Stages.mocks.d.ts.map +1 -0
  918. package/lib/work/Stages/Stages.mocks.js +39 -0
  919. package/lib/work/Stages/Stages.mocks.js.map +1 -0
  920. package/lib/work/Stages/Stages.stories.d.ts +1 -1
  921. package/lib/work/Stages/Stages.stories.d.ts.map +1 -1
  922. package/lib/work/Stages/Stages.stories.js +12 -44
  923. package/lib/work/Stages/Stages.stories.js.map +1 -1
  924. package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
  925. package/lib/work/Stakeholders/Stakeholders.stories.js +1 -0
  926. package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
  927. package/lib/work/Tasks/TaskList.stories.d.ts.map +1 -1
  928. package/lib/work/Tasks/TaskList.stories.js +3 -1
  929. package/lib/work/Tasks/TaskList.stories.js.map +1 -1
  930. package/lib/work/Tasks/Tasks.stories.d.ts +4 -0
  931. package/lib/work/Tasks/Tasks.stories.d.ts.map +1 -1
  932. package/lib/work/Tasks/Tasks.stories.js +20 -8
  933. package/lib/work/Tasks/Tasks.stories.js.map +1 -1
  934. package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
  935. package/lib/work/Timeline/Timeline.stories.js +2 -1
  936. package/lib/work/Timeline/Timeline.stories.js.map +1 -1
  937. package/lib/wss/AppShell/AppShell.mocks.d.ts +35 -0
  938. package/lib/wss/AppShell/AppShell.mocks.d.ts.map +1 -0
  939. package/lib/wss/AppShell/AppShell.mocks.js +70 -0
  940. package/lib/wss/AppShell/AppShell.mocks.js.map +1 -0
  941. package/lib/wss/AppShell/AppShell.stories.d.ts +19 -0
  942. package/lib/wss/AppShell/AppShell.stories.d.ts.map +1 -0
  943. package/lib/wss/AppShell/AppShell.stories.js +70 -0
  944. package/lib/wss/AppShell/AppShell.stories.js.map +1 -0
  945. package/lib/wss/AppShell/AppShell.styles.d.ts +2 -0
  946. package/lib/wss/AppShell/AppShell.styles.d.ts.map +1 -0
  947. package/lib/wss/AppShell/AppShell.styles.js +5 -0
  948. package/lib/wss/AppShell/AppShell.styles.js.map +1 -0
  949. package/lib/wss/CaseView/CaseView.mocks.d.ts +13 -0
  950. package/lib/wss/CaseView/CaseView.mocks.d.ts.map +1 -0
  951. package/lib/wss/CaseView/CaseView.mocks.js +35 -0
  952. package/lib/wss/CaseView/CaseView.mocks.js.map +1 -0
  953. package/lib/wss/CaseView/CaseView.stories.d.ts +12 -0
  954. package/lib/wss/CaseView/CaseView.stories.d.ts.map +1 -0
  955. package/lib/wss/CaseView/CaseView.stories.js +70 -0
  956. package/lib/wss/CaseView/CaseView.stories.js.map +1 -0
  957. package/lib/wss/PageTemplates/PageTemplates.stories.d.ts +15 -0
  958. package/lib/wss/PageTemplates/PageTemplates.stories.d.ts.map +1 -0
  959. package/lib/wss/PageTemplates/PageTemplates.stories.js +41 -0
  960. package/lib/wss/PageTemplates/PageTemplates.stories.js.map +1 -0
  961. package/lib/wss/QuickCreate/QuickCreate.stories.d.ts +10 -0
  962. package/lib/wss/QuickCreate/QuickCreate.stories.d.ts.map +1 -0
  963. package/lib/wss/QuickCreate/QuickCreate.stories.js +36 -0
  964. package/lib/wss/QuickCreate/QuickCreate.stories.js.map +1 -0
  965. package/package.json +11 -12
  966. package/jsx/core/MultiStep/MultiStep.stories.d.ts.map +0 -1
  967. package/jsx/core/MultiStep/MultiStep.stories.jsx +0 -56
  968. package/jsx/core/MultiStep/MultiStep.stories.jsx.map +0 -1
  969. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +0 -11
  970. package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +0 -1
  971. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +0 -248
  972. package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +0 -1
  973. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +0 -66
  974. package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +0 -1
  975. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx +0 -253
  976. package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +0 -1
  977. package/lib/core/MultiStep/MultiStep.stories.d.ts.map +0 -1
  978. package/lib/core/MultiStep/MultiStep.stories.js +0 -36
  979. package/lib/core/MultiStep/MultiStep.stories.js.map +0 -1
  980. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +0 -11
  981. package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +0 -1
  982. package/lib/cs/CSCaseView/CSAppShell.stories.js +0 -227
  983. package/lib/cs/CSCaseView/CSAppShell.stories.js.map +0 -1
  984. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +0 -66
  985. package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +0 -1
  986. package/lib/cs/CSCaseView/CSCaseView.mocks.js +0 -240
  987. package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
@@ -0,0 +1,78 @@
1
+ import { createUID } from '@pega/cosmos-react-core';
2
+ const getRandomInt = (min, max) => {
3
+ min = Math.ceil(min);
4
+ max = Math.floor(max);
5
+ return Math.floor(Math.random() * (max - min + 1)) + min;
6
+ };
7
+ const fieldTypes = [
8
+ 'Text (single line)',
9
+ 'Text (paragraph)',
10
+ 'Integer',
11
+ 'Decimal',
12
+ 'Currency',
13
+ 'Boolean',
14
+ 'Date & time',
15
+ 'Date only',
16
+ 'Time only',
17
+ 'Email',
18
+ 'Phone',
19
+ 'URL',
20
+ 'Picklist'
21
+ ];
22
+ export const contentTypes = [...fieldTypes, 'View', 'Group'];
23
+ export const mockFields = Array.from({ length: 500 }, (_, i) => {
24
+ return {
25
+ id: createUID(),
26
+ label: `Field-${i + 1}`,
27
+ type: 'Field',
28
+ subType: fieldTypes[getRandomInt(0, fieldTypes.length - 1)]
29
+ };
30
+ });
31
+ export const mockViews = Array.from({ length: 50 }, (_, i) => {
32
+ return {
33
+ id: createUID(),
34
+ label: `View-${i + 1}`,
35
+ type: 'View'
36
+ };
37
+ });
38
+ export const mockGroups = Array.from({ length: 3 }, (_, i) => {
39
+ return {
40
+ id: createUID(),
41
+ label: `Group-${i + 1}`,
42
+ type: 'Group',
43
+ items: i === 0 ? mockFields.slice(-3) : mockFields.slice((i + 1) * -3, i * -3)
44
+ };
45
+ });
46
+ // Simulated query functionality to assist with loading states and fetching specifc content item types.
47
+ export const mockQuery = ({ id, filter, type, subType, limit = 100, offset = 0, delay = 0 } = {}) => {
48
+ return new Promise(resolve => {
49
+ setTimeout(() => {
50
+ let contentItems = [];
51
+ if (id) {
52
+ resolve([...mockFields, ...mockViews, ...mockGroups].filter(item => {
53
+ return Array.isArray(id) ? id.includes(item.id) : item.id === id;
54
+ }));
55
+ return;
56
+ }
57
+ if (type) {
58
+ if (type === 'Field') {
59
+ contentItems = subType ? mockFields.filter(f => f.subType === subType) : mockFields;
60
+ }
61
+ else if (type === 'View') {
62
+ contentItems = mockViews;
63
+ }
64
+ else if (type === 'Group') {
65
+ contentItems = mockGroups;
66
+ }
67
+ }
68
+ else {
69
+ contentItems = [...mockFields, ...mockViews, ...mockGroups];
70
+ }
71
+ if (filter) {
72
+ contentItems = contentItems.filter(item => item.label.includes(filter));
73
+ }
74
+ resolve(contentItems.slice(offset, limit));
75
+ }, delay);
76
+ });
77
+ };
78
+ //# sourceMappingURL=mockData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../../src/dnd/StandardDragDropList/mockData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAyBpD,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAChD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,oBAAoB;IACpB,kBAAkB;IAClB,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,aAAa;IACb,WAAW;IACX,WAAW;IACX,OAAO;IACP,OAAO;IACP,KAAK;IACL,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAEtE,MAAM,CAAC,MAAM,UAAU,GAAkB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,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CAAC,CAAC;QAC7C,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { createUID } from '@pega/cosmos-react-core';\n\nexport type ContentType = 'Field' | 'View' | 'Group';\nexport type FieldType = typeof fieldTypes[number];\n\n// A simple mock of an object type before it is transformed to a ContentItem\nexport interface MockRawItem {\n id: string;\n label: string;\n type: ContentType;\n subType?: FieldType;\n items?: MockRawItem[];\n}\n\n// Used as the arg type to the simulated query function.\nexport interface MockQueryParams {\n id?: MockRawItem['id'] | MockRawItem['id'][];\n filter?: string;\n type?: ContentType;\n subType?: FieldType;\n limit?: number;\n offset?: number;\n delay?: number;\n}\n\nconst getRandomInt = (min: number, max: number) => {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n};\n\nconst fieldTypes = [\n 'Text (single line)',\n 'Text (paragraph)',\n 'Integer',\n 'Decimal',\n 'Currency',\n 'Boolean',\n 'Date & time',\n 'Date only',\n 'Time only',\n 'Email',\n 'Phone',\n 'URL',\n 'Picklist'\n] as const;\n\nexport const contentTypes = [...fieldTypes, 'View', 'Group'] as const;\n\nexport const mockFields: MockRawItem[] = Array.from({ length: 500 }, (_, i) => {\n return {\n id: createUID(),\n label: `Field-${i + 1}`,\n type: 'Field',\n subType: fieldTypes[getRandomInt(0, fieldTypes.length - 1)]\n };\n});\n\nexport const mockViews: MockRawItem[] = Array.from({ length: 50 }, (_, i) => {\n return {\n id: createUID(),\n label: `View-${i + 1}`,\n type: 'View'\n };\n});\n\nexport const mockGroups: MockRawItem[] = Array.from({ length: 3 }, (_, i) => {\n return {\n id: createUID(),\n label: `Group-${i + 1}`,\n type: 'Group',\n items: i === 0 ? mockFields.slice(-3) : mockFields.slice((i + 1) * -3, i * -3)\n };\n});\n\n// Simulated query functionality to assist with loading states and fetching specifc content item types.\nexport const mockQuery = ({\n id,\n filter,\n type,\n subType,\n limit = 100,\n offset = 0,\n delay = 0\n}: MockQueryParams = {}): Promise<MockRawItem[]> => {\n return new Promise(resolve => {\n setTimeout(() => {\n let contentItems: MockRawItem[] = [];\n\n if (id) {\n resolve(\n [...mockFields, ...mockViews, ...mockGroups].filter(item => {\n return Array.isArray(id) ? id.includes(item.id) : item.id === id;\n })\n );\n return;\n }\n\n if (type) {\n if (type === 'Field') {\n contentItems = subType ? mockFields.filter(f => f.subType === subType) : mockFields;\n } else if (type === 'View') {\n contentItems = mockViews;\n } else if (type === 'Group') {\n contentItems = mockGroups;\n }\n } else {\n contentItems = [...mockFields, ...mockViews, ...mockGroups];\n }\n\n if (filter) {\n contentItems = contentItems.filter(item => item.label.includes(filter));\n }\n\n resolve(contentItems.slice(offset, limit));\n }, delay);\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAkB/C,wBAGU;AAEV,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA6BjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAkCpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KA8B3C,CAAC"}
1
+ {"version":3,"file":"Editor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAkB/C,wBAGU;AAEV,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA6BjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAkCpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KA8B3C,CAAC"}
@@ -14,7 +14,7 @@ export const EditorDemo = () => {
14
14
  const src = URL.createObjectURL(image);
15
15
  editorRef.current?.appendImage({ src, alt: image.name }, id);
16
16
  };
17
- return (_jsx(Editor, { ref: editorRef, label: label, toolbar: ['inline-styling', 'lists', 'indentation', 'images', 'links'], onFocus: action('Editor focused'), onBlur: action('Editor blurred'), onImageAdded: onImageAdded, defaultValue: '<body><p>Hi mom <a href="https://google.com">link</a></p><img alt="Example alt text" src="http://via.placeholder.com/640x360"/></body>' }));
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>' }));
18
18
  };
19
19
  export const EmptyEditorDemo = () => {
20
20
  const editorRef = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.stories.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EA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EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,GAC3F,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nimport { createPegaCustomElement, label } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nexport const EditorDemo: Story = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n onImageAdded={onImageAdded}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><img alt=\"Example alt text\" src=\"http://via.placeholder.com/640x360\"/></body>'\n />\n );\n};\n\nexport const EmptyEditorDemo: Story = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField: Story = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code>&lt;head&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code>&lt;title&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code>&lt;body&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code>&lt;header&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code>&lt;footer&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code>&lt;article&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code>&lt;section&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code>&lt;p&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code>&lt;div&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code>&lt;span&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code>&lt;img&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code>&lt;aside&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code>&lt;audio&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code>&lt;canvas&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code>&lt;datalist&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code>&lt;details&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code>&lt;embed&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code>&lt;nav&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code>&lt;output&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code>&lt;progress&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code>&lt;video&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code>&lt;ul&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code>&lt;ol&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code>&lt;li&gt;</code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code>&lt;</code>\" and \"<code>&gt;</code>\".&nbsp; The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code>&lt;title&gt;</code> tag can be written as <code>&lt;Title&gt;</code>, <code>&lt;TITLE&gt;</code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nexport const CustomComponentDemo: Story = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ createCustomElement: createPegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"Editor.stories.js","sourceRoot":"","sources":["../../../src/rte/Editor/Editor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAe,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,MAAM;CACV,CAAC;AAEV,MAAM,CAAC,MAAM,UAAU,GAAU,GAAG,EAAE;IACpC,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,EACtE,OAAO,EAA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AM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,eACH,KAAC,WAAW,cACV,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,GACrD,EACd,KAAC,UAAU,cACT,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,MAAM,IACL,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,GAC3F,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\nimport { action } from '@storybook/addon-actions';\nimport { Editor as TinymceEditor } from 'tinymce';\n\nimport {\n Button,\n Card,\n CardContent,\n CardFooter,\n Flex,\n Text,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { EditorState, Editor } from '@pega/cosmos-react-rte';\n\nimport { createPegaCustomElement, label } from './Editor.mocks';\n\nexport default {\n title: 'RTE/Editor',\n component: Editor\n} as Meta;\n\nexport const EditorDemo: Story = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onFocus={action('Editor focused')}\n onBlur={action('Editor blurred')}\n 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: Story = () => {\n const editorRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'images', 'links']}\n onImageAdded={onImageAdded}\n onFocus={action('Editor has focus')}\n onBlur={action('Editor has blurred')}\n placeholder='Type some stuff in here'\n />\n );\n};\n\nexport const ReadonlyFormField: Story = () => {\n return (\n <Editor\n label={label}\n readOnly\n defaultValue={`<article class=\"main-page-content\" lang=\"en-US\"><h1>HTML: HyperText Markup Language</h1><div><p><strong>HTML</strong> (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (<a href=\"/en-US/docs/Web/CSS\">CSS</a>) or functionality/behavior (<a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a>).</p>\n <p>\"Hypertext\" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.</p>\n <p>HTML uses \"markup\" to annotate text, images, and other content for display in a Web browser. HTML markup includes special \"elements\" such as <a href=\"/en-US/docs/Web/HTML/Element/head\"><code>&lt;head&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/title\"><code>&lt;title&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/body\"><code>&lt;body&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/header\"><code>&lt;header&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/footer\"><code>&lt;footer&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/article\"><code>&lt;article&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/section\"><code>&lt;section&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/p\"><code>&lt;p&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/div\"><code>&lt;div&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/span\"><code>&lt;span&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/img\"><code>&lt;img&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/aside\"><code>&lt;aside&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/audio\"><code>&lt;audio&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/canvas\"><code>&lt;canvas&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/datalist\"><code>&lt;datalist&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/details\"><code>&lt;details&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/embed\"><code>&lt;embed&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/nav\"><code>&lt;nav&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/output\"><code>&lt;output&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/progress\"><code>&lt;progress&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/video\"><code>&lt;video&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ul\"><code>&lt;ul&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/ol\"><code>&lt;ol&gt;</code></a>, <a href=\"/en-US/docs/Web/HTML/Element/li\"><code>&lt;li&gt;</code></a> and many others.</p>\n <p>An HTML element is set off from other text in a document by \"tags\", which consist of the element name surrounded by \"<code>&lt;</code>\" and \"<code>&gt;</code>\".&nbsp; The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <code>&lt;title&gt;</code> tag can be written as <code>&lt;Title&gt;</code>, <code>&lt;TITLE&gt;</code>, or in any other way.</p>\n\n <div id=\"on-github\" class=\"on-github\"><h3>Found a problem with this page?</h3><ul><li><a href=\"https://github.com/mdn/content/edit/main/files/en-us/web/html/index.md\" title=\"You're going to need to sign in to GitHub first (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Edit on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/blob/main/files/en-us/web/html/index.md\" title=\"Folder: en-us/web/html (Opens in a new tab)\" target=\"_blank\" rel=\"noopener noreferrer\">Source on <b>GitHub</b></a></li><li><a href=\"https://github.com/mdn/content/issues/new?body=MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A%0A%23%23%23%23+What+information+was+incorrect%2C+unhelpful%2C+or+incomplete%3F%0A%0A%0A%23%23%23%23+Specific+section+or+headline%3F%0A%0A%0A%23%23%23%23+What+did+you+expect+to+see%3F%0A%0A%0A%23%23%23%23+Did+you+test+this%3F+If+so%2C+how%3F%0A%0A%0A%3C%21--+Do+not+make+changes+below+this+line+--%3E%0A%3Cdetails%3E%0A%3Csummary%3EMDN+Content+page+report+details%3C%2Fsummary%3E%0A%0A*+Folder%3A+%60en-us%2Fweb%2Fhtml%60%0A*+MDN+URL%3A+https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTML%0A*+GitHub+URL%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fblob%2Fmain%2Ffiles%2Fen-us%2Fweb%2Fhtml%2Findex.md%0A*+Last+commit%3A+https%3A%2F%2Fgithub.com%2Fmdn%2Fcontent%2Fcommit%2F775662998e66813a612e3ff27e02f2ada867bc17%0A*+Document+last+modified%3A+2021-10-03T00%3A01%3A51.000Z%0A%0A%3C%2Fdetails%3E&amp;title=Issue+with+%22HTML%3A+HyperText+Markup+Language%22%3A+%28short+summary+here+please%29&amp;labels=needs-triage%2CContent%3AHTML\" title=\"This will take you to https://github.com/mdn/content to file a new issue\" target=\"_blank\" rel=\"noopener noreferrer\">Report a problem with this content on <b>GitHub</b></a></li><li>Want to fix the problem yourself? See <a href=\"https://github.com/mdn/content/blob/main/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">our Contribution guide</a>.</li></ul></div>\n `}\n />\n );\n};\n\nexport const CustomComponentDemo: Story = () => {\n const editorRef = useRef<EditorState>(null);\n const [editor, setEditor] = useState({} as TinymceEditor);\n\n const onCustomAction = () => {\n editor.insertContent('<pega-custom>Inserted from toolbar</pega-custom>');\n };\n\n return (\n <Editor\n ref={editorRef}\n label={label}\n toolbar={['inline-styling', 'lists', 'indentation', 'links', 'images']}\n defaultValue='<body><p>Hi mom <a href=\"https://google.com\">link</a></p><p>hi <pega-custom>Hello from custom element.</pega-custom></p></body>'\n customComponents={[{ createCustomElement: createPegaCustomElement, name: 'pega-custom' }]}\n customActions={[\n {\n icon: 'pega',\n text: 'Insert a custom element',\n onMouseDown: () => {\n onCustomAction();\n }\n }\n ]}\n onInit={initializedEditor => {\n setEditor(initializedEditor);\n }}\n />\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<EditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Editor\n ref={editorRef}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<EditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <Editor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label={label}\n toolbar={['inline-styling', 'headers', 'tables', 'links', 'images', 'lists', 'indentation']}\n />\n </Flex>\n );\n};\n"]}
@@ -2,7 +2,10 @@ import { Meta, Story } from '@storybook/react';
2
2
  import { RichTextEditorProps } from '@pega/cosmos-react-rte';
3
3
  declare const _default: Meta<import("@storybook/react").Args>;
4
4
  export default _default;
5
- export declare const RichTextEditorDemo: Story<RichTextEditorProps>;
5
+ interface RichTextEditorStoryProps extends RichTextEditorProps {
6
+ showAdditionalInfo?: boolean;
7
+ }
8
+ export declare const RichTextEditorDemo: Story<RichTextEditorStoryProps>;
6
9
  export declare const RichTextEditorWithLogs: Story;
7
10
  export declare const RichTextEditorMDDemo: Story<RichTextEditorProps>;
8
11
  export declare const RichTextEditorHtmlParsingDemo: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAAkB,mBAAmB,EAAuB,MAAM,wBAAwB,CAAC;;AAIlG,wBAqBU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,mBAAmB,CAkDzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA2CpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,mBAAmB,CAuC3D,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAuC3C,CAAC"}
1
+ {"version":3,"file":"RichTextEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAAkB,mBAAmB,EAAuB,MAAM,wBAAwB,CAAC;;AAIlG,wBAuBU;AAEV,UAAU,wBAAyB,SAAQ,mBAAmB;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,CA6D9D,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA2CpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,mBAAmB,CAsC3D,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAuC3C,CAAC"}
@@ -13,7 +13,8 @@ export default {
13
13
  status: undefined,
14
14
  required: false,
15
15
  disabled: false,
16
- readOnly: false
16
+ readOnly: false,
17
+ showAdditionalInfo: true
17
18
  },
18
19
  argTypes: {
19
20
  label: { control: { type: 'text' } },
@@ -22,7 +23,8 @@ export default {
22
23
  status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },
23
24
  required: { control: { type: 'boolean' } },
24
25
  disabled: { control: { type: 'boolean' } },
25
- readOnly: { control: { type: 'boolean' } }
26
+ readOnly: { control: { type: 'boolean' } },
27
+ showAdditionalInfo: { control: { type: 'boolean' } }
26
28
  }
27
29
  };
28
30
  export const RichTextEditorDemo = (args) => {
@@ -46,7 +48,12 @@ export const RichTextEditorDemo = (args) => {
46
48
  'lists',
47
49
  'cut-copy-paste',
48
50
  'indentation'
49
- ], onImageAdded: onImageAdded, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly, defaultValue: '<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>' }), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: overwriteText, children: "Overwrite RTE value with 'Hello world!' HTML" }), _jsx(Button, { onClick: insertText, label: 'RTE Must be focused for insert text to work', children: "Insert 'Hi mom!'" })] })] }));
51
+ ], onImageAdded: onImageAdded, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly, additionalInfo: args.showAdditionalInfo
52
+ ? {
53
+ heading: 'Additional Info',
54
+ content: 'A rich text editor allows you to write, edit, and format styled and rich text'
55
+ }
56
+ : undefined, defaultValue: '<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>' }), _jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Button, { onClick: overwriteText, children: "Overwrite RTE value with 'Hello world!' HTML" }), _jsx(Button, { onClick: insertText, label: 'RTE Must be focused for insert text to work', children: "Insert 'Hi mom!'" })] })] }));
50
57
  };
51
58
  export const RichTextEditorWithLogs = () => {
52
59
  const editorRef = useRef(null);
@@ -91,7 +98,7 @@ export const RichTextEditorMDDemo = (args) => {
91
98
  markdown: `@${item.id}:${item.primary}:user:`,
92
99
  text: item.primary
93
100
  };
94
- }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly }));
101
+ }, menu: users.length ? { items: users } : undefined, markdownOnly: true, label: args.label, labelHidden: args.labelHidden, info: args.info, status: args.status, required: args.required, disabled: args.disabled, readOnly: args.readOnly }));
95
102
  };
96
103
  export const RichTextEditorHtmlParsingDemo = () => {
97
104
  const [html, setHtml] = useState('<p>Hello world!</p>');
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,wBAAwB,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE;QACJ,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACpC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;QAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE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AAE,OAAO,CAAC,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEjD,MAAM,YAAY,GAAG,CAAC,KAAW,EAAE,EAAU,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,MAAC,IAAI,eACH,KAAC,WAAW,cACV,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,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,cAAc,IACb,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE;oBACP,gBAAgB;oBAChB,SAAS;oBACT,QAAQ;oBACR,OAAO;oBACP,QAAQ;oBACR,OAAO;oBACP,gBAAgB;oBAChB,aAAa;iBACd,GACD,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n }\n} as Meta;\n\nexport const RichTextEditorDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const editorRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with &#39;Hello world!&#39; HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert &#39;Hi mom!&#39;\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextEditor.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAA4C,MAAM,wBAAwB,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE;QACJ,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE,SAA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GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,4CAE3D,GACE,IACR,EACP,KAAC,cAAc,IACb,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,EACX,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE;oBACP,gBAAgB;oBAChB,SAAS;oBACT,QAAQ;oBACR,OAAO;oBACP,QAAQ;oBACR,OAAO;oBACP,gBAAgB;oBAChB,aAAa;iBACd,GACD,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState, useRef } from 'react';\n\nimport {\n Button,\n Flex,\n MenuItemProps,\n Text,\n Card,\n CardContent,\n CardFooter,\n TextArea\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorProps, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextEditor',\n component: RichTextEditor,\n args: {\n label: 'Rich text editor',\n labelHidden: false,\n info: 'The rich text editor can be used in forms, comments, and documents',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false,\n showAdditionalInfo: true\n },\n argTypes: {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } },\n showAdditionalInfo: { control: { type: 'boolean' } }\n }\n} as Meta;\n\ninterface RichTextEditorStoryProps extends RichTextEditorProps {\n showAdditionalInfo?: boolean;\n}\n\nexport const RichTextEditorDemo: Story<RichTextEditorStoryProps> = (\n args: RichTextEditorStoryProps\n) => {\n const editorRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const overwriteText = () => {\n editorRef.current?.insertHtml('<p>Hello world!</p>', true);\n };\n\n const insertText = () => {\n editorRef.current?.insertText('Hi mom!');\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n additionalInfo={\n args.showAdditionalInfo\n ? {\n heading: 'Additional Info',\n content:\n 'A rich text editor allows you to write, edit, and format styled and rich text'\n }\n : undefined\n }\n defaultValue='<body><!-- I will break the RTE --><p> Life is stress free.</p><p> Life is stress free.</p></body>'\n />\n <Flex container={{ gap: 1 }}>\n <Button onClick={overwriteText}>\n Overwrite RTE value with &#39;Hello world!&#39; HTML\n </Button>\n <Button onClick={insertText} label='RTE Must be focused for insert text to work'>\n Insert &#39;Hi mom!&#39;\n </Button>\n </Flex>\n </Flex>\n );\n};\n\nexport const RichTextEditorWithLogs: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState<string | undefined>();\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n const showContent = (type: 'html' | 'plain_text' | 'rich_text') => {\n if (type === 'html') setContent(editorRef.current?.getHtml());\n else if (type === 'plain_text') setContent(editorRef.current?.getPlainText());\n else if (type === 'rich_text') setContent(editorRef.current?.getRichText());\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n label='Rich text editor with logs'\n info='Click on the buttons below to show the different formatted outputs of the RTE'\n />\n\n <Flex container={{ gap: 1 }}>\n <Button onClick={() => showContent('html')}>Show HTML</Button>\n <Button onClick={() => showContent('plain_text')}>Show plain text</Button>\n <Button onClick={() => showContent('rich_text')}>Show rich text</Button>\n </Flex>\n\n <Text>{content}</Text>\n </Flex>\n );\n};\n\nexport const RichTextEditorMDDemo: Story<RichTextEditorProps> = (args: RichTextEditorProps) => {\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <RichTextEditor\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n markdownOnly\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n />\n );\n};\n\nexport const RichTextEditorHtmlParsingDemo: Story = () => {\n const [html, setHtml] = useState('<p>Hello world!</p>');\n const rteRef = useRef<RichTextEditorState>(null);\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n rteRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <Card>\n <CardContent>\n <TextArea value={html} onChange={e => setHtml(e.target.value)} />\n </CardContent>\n <CardFooter>\n <Button onClick={() => rteRef.current?.insertHtml(html.trim(), true)}>\n Overwrite RTE with new HTML\n </Button>\n </CardFooter>\n </Card>\n <RichTextEditor\n defaultValue={html}\n onImageAdded={onImageAdded}\n ref={rteRef}\n label='Rich text editor'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n />\n </Flex>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextViewer.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAc/C,wBAGU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAuBhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAuBpC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,KA0B5C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA4DlC,CAAC"}
1
+ {"version":3,"file":"RichTextViewer.stories.d.ts","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAc/C,wBAGU;AAEV,eAAO,MAAM,kBAAkB,EAAE,KAuBhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAuBpC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,KA0B5C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA2DlC,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState } from 'react';
3
3
  import { Flex, Link } from '@pega/cosmos-react-core';
4
4
  import { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';
5
- import { RichTextViewer, Editor as RichTextEditor } from '@pega/cosmos-react-rte';
5
+ import { RichTextViewer, RichTextEditor } from '@pega/cosmos-react-rte';
6
6
  import { demoUsers } from './RichTextEditor.mocks';
7
7
  export default {
8
8
  title: 'RTE/RichTextViewer',
@@ -69,7 +69,7 @@ export const RichTextViewerMDDemo = () => {
69
69
  markdown: `@${item.id}:${item.primary}:user:`,
70
70
  text: item.primary
71
71
  };
72
- }, menu: users.length ? { items: users } : undefined, autoFocus: true, markdownOnly: true, defaultValue: '# Try writing some of your own markdown and see how it renders!\n\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\n\nThere is built in support for #tags: as well!\n\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)', onChange: () => setContent(editorRef.current?.getPlainText() || '') }), _jsx(RichTextViewer, { content: content, type: 'markdown', interactionRenderers: [MentionButtonConfig, HashtagButtonConfig], markdownMap: {
72
+ }, menu: users.length ? { items: users } : undefined, markdownOnly: true, defaultValue: "# Try writing some of your own markdown and see how it renders!\n\nYou can interact with mentions such as <pega-mention id='deans' text='Seth DeAngelo' type='user'/>\n\nThere is built in support for <pega-tag tag='tags'/> as well!\n\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)", onChange: () => setContent(editorRef.current?.getPlainText() || '') }), _jsx(RichTextViewer, { content: content, type: 'markdown', interactionRenderers: [MentionButtonConfig, HashtagButtonConfig], markdownMap: {
73
73
  link: (linkToken) => {
74
74
  if (linkToken.href?.includes('www.pega.com'))
75
75
  return LinkComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextViewer.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,cAAc,EACd,MAAM,IAAI,cAAc,EAGzB,MAAM,wBAAwB,CAAC;AAE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AAS,EACjD,SAAS,QACT,YAAY,QACZ,YAAY,EACV,kUAAkU,EAEpU,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,GACnE,EAEF,KAAC,cAAc,IACb,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,UAAU,EACf,oBAAoB,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,EAChE,WAAW,EAAE;oBACX,IAAI,EAAE,CAAC,SAA2B,EAAE,EAAE;wBACpC,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC;4BAAE,OAAO,aAAa,CAAC;oBACrE,CAAC;iBACF,GACD,IACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextViewer,\n Editor as RichTextEditor,\n EditorState as RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLOverflowDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState(\n () => \"<p style='background-color: green; width: 110%; height: 100px;'>hi</p>\"\n );\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n defaultValue={content}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo: Story = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n autoFocus\n markdownOnly\n defaultValue={\n '# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as @deans:Seth DeAngelo:user:\\n\\nThere is built in support for #tags: as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)'\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextViewer.stories.js","sourceRoot":"","sources":["../../../src/rte/RichTextEditor/RichTextViewer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAiB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,cAAc,EACd,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;CAClB,CAAC;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAU,GAAG,EAAE;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,KAAC,cAAc,IACb,GAAG,EAAE,SAAS,EACd,OAAO,EAAE;oBACP,gBAAgB;oBAChB,SAAS;oBACT,QAAQ;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{ useRef, useState } from 'react';\n\nimport { Flex, Link, MenuItemProps } from '@pega/cosmos-react-core';\nimport { HashtagButtonConfig, MentionButtonConfig } from '@pega/cosmos-react-social';\nimport {\n RichTextViewer,\n RichTextEditor,\n RichTextEditorState,\n TokenMap\n} from '@pega/cosmos-react-rte';\n\nimport { demoUsers } from './RichTextEditor.mocks';\n\nexport default {\n title: 'RTE/RichTextViewer',\n component: RichTextViewer\n} as Meta;\n\nexport const RichTextViewerDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('[]');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getRichText() || '')}\n />\n\n <RichTextViewer content={content} type='richtext' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerHTMLOverflowDemo: Story = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState(\n () => \"<p style='background-color: green; width: 110%; height: 100px;'>hi</p>\"\n );\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n defaultValue={content}\n onChange={() => setContent(editorRef.current?.getHtml() || '')}\n />\n\n <RichTextViewer content={content} type='html' />\n </Flex>\n );\n};\n\nexport const RichTextViewerMDDemo: Story = () => {\n const LinkComponent = ({ token }: { token: TokenMap['link'] }) => {\n return (\n <Link href={token.href} previewable>\n {token.text}\n </Link>\n );\n };\n\n const editorRef = useRef<RichTextEditorState>(null);\n const [content, setContent] = useState('');\n const [users, setUsers] = useState<MenuItemProps[]>(demoUsers);\n\n const searchUsers = (event: { search: string; trigger: string }) => {\n if (event.trigger === '@') {\n setUsers(\n demoUsers.filter(user => {\n return user.primary.toLowerCase().includes(event.search.toLowerCase());\n })\n );\n }\n };\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <RichTextEditor\n ref={editorRef}\n searchTriggers={[{ trigger: '@', regex: '[a-zA-Z]*(?: [a-zA-Z]*)?' }]}\n onSearch={searchUsers}\n getSearchItemReplacement={(id: string) => {\n const item = demoUsers.find(({ id: itemId }) => itemId === id);\n\n if (!item) return undefined;\n\n return {\n markdown: `@${item.id}:${item.primary}:user:`,\n text: item.primary\n };\n }}\n menu={users.length ? { items: users } : undefined}\n markdownOnly\n defaultValue={\n \"# Try writing some of your own markdown and see how it renders!\\n\\nYou can interact with mentions such as <pega-mention id='deans' text='Seth DeAngelo' type='user'/>\\n\\nThere is built in support for <pega-tag tag='tags'/> as well!\\n\\nComponent renderings can also be conditionally overwritten: [Link](https://www.google.com) -- [Link with preview](https://www.pega.com)\"\n }\n onChange={() => setContent(editorRef.current?.getPlainText() || '')}\n />\n\n <RichTextViewer\n content={content}\n type='markdown'\n interactionRenderers={[MentionButtonConfig, HashtagButtonConfig]}\n markdownMap={{\n link: (linkToken: TokenMap['link']) => {\n if (linkToken.href?.includes('www.pega.com')) return LinkComponent;\n }\n }}\n />\n </Flex>\n );\n};\n"]}
@@ -203,8 +203,8 @@ export declare const ChatMockData: {
203
203
  };
204
204
  message: string;
205
205
  timeStamp: string;
206
- status: string;
207
206
  ariaLabel: string;
207
+ status?: undefined;
208
208
  attachments?: undefined;
209
209
  pagePushLinks?: undefined;
210
210
  messagePrivacy?: undefined;
@@ -312,7 +312,6 @@ export declare const ChatMockData: {
312
312
  name: string;
313
313
  imageSrc?: undefined;
314
314
  };
315
- message: string;
316
315
  timeStamp: string;
317
316
  attachments: {
318
317
  id: string;
@@ -321,6 +320,7 @@ export declare const ChatMockData: {
321
320
  meta: string;
322
321
  }[];
323
322
  ariaLabel: string;
323
+ message?: undefined;
324
324
  status?: undefined;
325
325
  pagePushLinks?: undefined;
326
326
  messagePrivacy?: undefined;
@@ -369,6 +369,19 @@ export declare const ChatMockData: {
369
369
  attachments?: undefined;
370
370
  pagePushLinks?: undefined;
371
371
  messagePrivacy?: undefined;
372
+ } | {
373
+ id: string;
374
+ type: string;
375
+ variant: string;
376
+ direction: string;
377
+ message: string;
378
+ timeStamp: string;
379
+ ariaLabel: string;
380
+ status: string;
381
+ avatarInfo?: undefined;
382
+ attachments?: undefined;
383
+ pagePushLinks?: undefined;
384
+ messagePrivacy?: undefined;
372
385
  })[];
373
386
  defaultAttachments: {
374
387
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/Chat.mocks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwpBxB,CAAC"}
1
+ {"version":3,"file":"Chat.mocks.d.ts","sourceRoot":"","sources":["../../../src/social/Chat/Chat.mocks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAupBxB,CAAC"}
@@ -258,7 +258,7 @@ export const ChatMockData = {
258
258
  },
259
259
  message: 'Hi, Welcome to u-plus. How can I help you ?',
260
260
  timeStamp: '1:44 PM',
261
- status: 'Opened',
261
+ status: 'sent',
262
262
  attachments: [
263
263
  {
264
264
  id: '2499167340',
@@ -337,7 +337,6 @@ export const ChatMockData = {
337
337
  },
338
338
  message: 'Great, our CSR will help you with that',
339
339
  timeStamp: '1:46 PM',
340
- status: 'Delivered',
341
340
  ariaLabel: 'Pegasystems said Great, our CSR will help you with that at 1:46 PM'
342
341
  },
343
342
  {
@@ -351,7 +350,7 @@ export const ChatMockData = {
351
350
  },
352
351
  message: 'Sure',
353
352
  timeStamp: '1:48 PM',
354
- status: 'Delivered',
353
+ status: 'delivered',
355
354
  ariaLabel: 'John Brown said Sure at 1:48 PM via Public Tweet'
356
355
  },
357
356
  {
@@ -448,7 +447,6 @@ export const ChatMockData = {
448
447
  avatarInfo: {
449
448
  name: 'Sara Davis'
450
449
  },
451
- message: '5588-8899-45-89',
452
450
  timeStamp: '1:50 PM',
453
451
  attachments: [
454
452
  {
@@ -469,7 +467,7 @@ export const ChatMockData = {
469
467
  name: 'John Brown'
470
468
  },
471
469
  message: 'Let me pick your details',
472
- status: 'Delivered',
470
+ status: 'delivered',
473
471
  ariaLabel: 'John Brown said Let me pick your details '
474
472
  },
475
473
  {
@@ -576,7 +574,8 @@ export const ChatMockData = {
576
574
  direction: 'out',
577
575
  message: 'Thanks for contacting us, have a great day',
578
576
  timeStamp: '1:53 PM',
579
- ariaLabel: 'You said Thanks for contacting us, have a great day at 1:53 PM'
577
+ ariaLabel: 'You said Thanks for contacting us, have a great day at 1:53 PM',
578
+ status: 'undelivered'
580
579
  },
581
580
  {
582
581
  id: '2965626280',