@pega/cosmos-react-social 5.0.0-dev.4.7 → 5.0.0-dev.4.9

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 (237) hide show
  1. package/package.json +4 -4
  2. package/lib/components/Autopilot/Autopilot.d.ts +0 -15
  3. package/lib/components/Autopilot/Autopilot.d.ts.map +0 -1
  4. package/lib/components/Autopilot/Autopilot.js +0 -50
  5. package/lib/components/Autopilot/Autopilot.js.map +0 -1
  6. package/lib/components/Autopilot/AutopilotAvatar.d.ts +0 -8
  7. package/lib/components/Autopilot/AutopilotAvatar.d.ts.map +0 -1
  8. package/lib/components/Autopilot/AutopilotAvatar.js +0 -11
  9. package/lib/components/Autopilot/AutopilotAvatar.js.map +0 -1
  10. package/lib/components/Autopilot/AutopilotGlimpse.d.ts +0 -9
  11. package/lib/components/Autopilot/AutopilotGlimpse.d.ts.map +0 -1
  12. package/lib/components/Autopilot/AutopilotGlimpse.js +0 -24
  13. package/lib/components/Autopilot/AutopilotGlimpse.js.map +0 -1
  14. package/lib/components/Autopilot/index.d.ts +0 -4
  15. package/lib/components/Autopilot/index.d.ts.map +0 -1
  16. package/lib/components/Autopilot/index.js +0 -3
  17. package/lib/components/Autopilot/index.js.map +0 -1
  18. package/lib/components/Chat/Chat.d.ts +0 -29
  19. package/lib/components/Chat/Chat.d.ts.map +0 -1
  20. package/lib/components/Chat/Chat.js +0 -64
  21. package/lib/components/Chat/Chat.js.map +0 -1
  22. package/lib/components/Chat/Chat.types.d.ts +0 -136
  23. package/lib/components/Chat/Chat.types.d.ts.map +0 -1
  24. package/lib/components/Chat/Chat.types.js +0 -10
  25. package/lib/components/Chat/Chat.types.js.map +0 -1
  26. package/lib/components/Chat/ChatBody.d.ts +0 -7
  27. package/lib/components/Chat/ChatBody.d.ts.map +0 -1
  28. package/lib/components/Chat/ChatBody.js +0 -292
  29. package/lib/components/Chat/ChatBody.js.map +0 -1
  30. package/lib/components/Chat/ChatComposer.d.ts +0 -50
  31. package/lib/components/Chat/ChatComposer.d.ts.map +0 -1
  32. package/lib/components/Chat/ChatComposer.js +0 -221
  33. package/lib/components/Chat/ChatComposer.js.map +0 -1
  34. package/lib/components/Chat/ChatHeader.d.ts +0 -29
  35. package/lib/components/Chat/ChatHeader.d.ts.map +0 -1
  36. package/lib/components/Chat/ChatHeader.js +0 -44
  37. package/lib/components/Chat/ChatHeader.js.map +0 -1
  38. package/lib/components/Chat/ChatSettingsPanel.d.ts +0 -7
  39. package/lib/components/Chat/ChatSettingsPanel.d.ts.map +0 -1
  40. package/lib/components/Chat/ChatSettingsPanel.js +0 -15
  41. package/lib/components/Chat/ChatSettingsPanel.js.map +0 -1
  42. package/lib/components/Chat/ChatSettingsPanel.styles.d.ts +0 -16
  43. package/lib/components/Chat/ChatSettingsPanel.styles.d.ts.map +0 -1
  44. package/lib/components/Chat/ChatSettingsPanel.styles.js +0 -47
  45. package/lib/components/Chat/ChatSettingsPanel.styles.js.map +0 -1
  46. package/lib/components/Chat/Message.d.ts +0 -6
  47. package/lib/components/Chat/Message.d.ts.map +0 -1
  48. package/lib/components/Chat/Message.js +0 -98
  49. package/lib/components/Chat/Message.js.map +0 -1
  50. package/lib/components/Chat/Message.styles.d.ts +0 -43
  51. package/lib/components/Chat/Message.styles.d.ts.map +0 -1
  52. package/lib/components/Chat/Message.styles.js +0 -270
  53. package/lib/components/Chat/Message.styles.js.map +0 -1
  54. package/lib/components/Chat/SuggestedReplyPicker.d.ts +0 -42
  55. package/lib/components/Chat/SuggestedReplyPicker.d.ts.map +0 -1
  56. package/lib/components/Chat/SuggestedReplyPicker.js +0 -143
  57. package/lib/components/Chat/SuggestedReplyPicker.js.map +0 -1
  58. package/lib/components/Chat/SystemMessage.d.ts +0 -8
  59. package/lib/components/Chat/SystemMessage.d.ts.map +0 -1
  60. package/lib/components/Chat/SystemMessage.js +0 -50
  61. package/lib/components/Chat/SystemMessage.js.map +0 -1
  62. package/lib/components/Chat/TypeIndicator.d.ts +0 -6
  63. package/lib/components/Chat/TypeIndicator.d.ts.map +0 -1
  64. package/lib/components/Chat/TypeIndicator.js +0 -12
  65. package/lib/components/Chat/TypeIndicator.js.map +0 -1
  66. package/lib/components/Chat/index.d.ts +0 -15
  67. package/lib/components/Chat/index.d.ts.map +0 -1
  68. package/lib/components/Chat/index.js +0 -10
  69. package/lib/components/Chat/index.js.map +0 -1
  70. package/lib/components/Email/ContextMenuPopover.d.ts +0 -5
  71. package/lib/components/Email/ContextMenuPopover.d.ts.map +0 -1
  72. package/lib/components/Email/ContextMenuPopover.js +0 -53
  73. package/lib/components/Email/ContextMenuPopover.js.map +0 -1
  74. package/lib/components/Email/Email.d.ts +0 -7
  75. package/lib/components/Email/Email.d.ts.map +0 -1
  76. package/lib/components/Email/Email.js +0 -244
  77. package/lib/components/Email/Email.js.map +0 -1
  78. package/lib/components/Email/Email.styles.d.ts +0 -67
  79. package/lib/components/Email/Email.styles.d.ts.map +0 -1
  80. package/lib/components/Email/Email.styles.js +0 -392
  81. package/lib/components/Email/Email.styles.js.map +0 -1
  82. package/lib/components/Email/Email.types.d.ts +0 -394
  83. package/lib/components/Email/Email.types.d.ts.map +0 -1
  84. package/lib/components/Email/Email.types.js +0 -2
  85. package/lib/components/Email/Email.types.js.map +0 -1
  86. package/lib/components/Email/EmailCaseView.d.ts +0 -6
  87. package/lib/components/Email/EmailCaseView.d.ts.map +0 -1
  88. package/lib/components/Email/EmailCaseView.js +0 -36
  89. package/lib/components/Email/EmailCaseView.js.map +0 -1
  90. package/lib/components/Email/EmailComposer.d.ts +0 -10
  91. package/lib/components/Email/EmailComposer.d.ts.map +0 -1
  92. package/lib/components/Email/EmailComposer.js +0 -255
  93. package/lib/components/Email/EmailComposer.js.map +0 -1
  94. package/lib/components/Email/EmailConversation.d.ts +0 -17
  95. package/lib/components/Email/EmailConversation.d.ts.map +0 -1
  96. package/lib/components/Email/EmailConversation.js +0 -174
  97. package/lib/components/Email/EmailConversation.js.map +0 -1
  98. package/lib/components/Email/EmailEntity.d.ts +0 -11
  99. package/lib/components/Email/EmailEntity.d.ts.map +0 -1
  100. package/lib/components/Email/EmailEntity.js +0 -51
  101. package/lib/components/Email/EmailEntity.js.map +0 -1
  102. package/lib/components/Email/EmailManager.d.ts +0 -6
  103. package/lib/components/Email/EmailManager.d.ts.map +0 -1
  104. package/lib/components/Email/EmailManager.js +0 -21
  105. package/lib/components/Email/EmailManager.js.map +0 -1
  106. package/lib/components/Email/EmailNotificationPanel.d.ts +0 -7
  107. package/lib/components/Email/EmailNotificationPanel.d.ts.map +0 -1
  108. package/lib/components/Email/EmailNotificationPanel.js +0 -15
  109. package/lib/components/Email/EmailNotificationPanel.js.map +0 -1
  110. package/lib/components/Email/EmailSelector.d.ts +0 -22
  111. package/lib/components/Email/EmailSelector.d.ts.map +0 -1
  112. package/lib/components/Email/EmailSelector.js +0 -121
  113. package/lib/components/Email/EmailSelector.js.map +0 -1
  114. package/lib/components/Email/EmailShell.d.ts +0 -6
  115. package/lib/components/Email/EmailShell.d.ts.map +0 -1
  116. package/lib/components/Email/EmailShell.js +0 -46
  117. package/lib/components/Email/EmailShell.js.map +0 -1
  118. package/lib/components/Email/EmailSummaryItem.d.ts +0 -11
  119. package/lib/components/Email/EmailSummaryItem.d.ts.map +0 -1
  120. package/lib/components/Email/EmailSummaryItem.js +0 -118
  121. package/lib/components/Email/EmailSummaryItem.js.map +0 -1
  122. package/lib/components/Email/EmailSummaryList.d.ts +0 -6
  123. package/lib/components/Email/EmailSummaryList.d.ts.map +0 -1
  124. package/lib/components/Email/EmailSummaryList.js +0 -95
  125. package/lib/components/Email/EmailSummaryList.js.map +0 -1
  126. package/lib/components/Email/EntityList.d.ts +0 -6
  127. package/lib/components/Email/EntityList.d.ts.map +0 -1
  128. package/lib/components/Email/EntityList.js +0 -74
  129. package/lib/components/Email/EntityList.js.map +0 -1
  130. package/lib/components/Email/index.d.ts +0 -13
  131. package/lib/components/Email/index.d.ts.map +0 -1
  132. package/lib/components/Email/index.js +0 -12
  133. package/lib/components/Email/index.js.map +0 -1
  134. package/lib/components/Email/utils/EntityHighlighter.d.ts +0 -10
  135. package/lib/components/Email/utils/EntityHighlighter.d.ts.map +0 -1
  136. package/lib/components/Email/utils/EntityHighlighter.js +0 -260
  137. package/lib/components/Email/utils/EntityHighlighter.js.map +0 -1
  138. package/lib/components/Feed/Feed.context.d.ts +0 -51
  139. package/lib/components/Feed/Feed.context.d.ts.map +0 -1
  140. package/lib/components/Feed/Feed.context.js +0 -10
  141. package/lib/components/Feed/Feed.context.js.map +0 -1
  142. package/lib/components/Feed/Feed.d.ts +0 -6
  143. package/lib/components/Feed/Feed.d.ts.map +0 -1
  144. package/lib/components/Feed/Feed.js +0 -149
  145. package/lib/components/Feed/Feed.js.map +0 -1
  146. package/lib/components/Feed/Feed.types.d.ts +0 -334
  147. package/lib/components/Feed/Feed.types.d.ts.map +0 -1
  148. package/lib/components/Feed/Feed.types.js +0 -2
  149. package/lib/components/Feed/Feed.types.js.map +0 -1
  150. package/lib/components/Feed/FeedAnnouncer.d.ts +0 -6
  151. package/lib/components/Feed/FeedAnnouncer.d.ts.map +0 -1
  152. package/lib/components/Feed/FeedAnnouncer.js +0 -11
  153. package/lib/components/Feed/FeedAnnouncer.js.map +0 -1
  154. package/lib/components/Feed/FeedAttachments.d.ts +0 -8
  155. package/lib/components/Feed/FeedAttachments.d.ts.map +0 -1
  156. package/lib/components/Feed/FeedAttachments.js +0 -97
  157. package/lib/components/Feed/FeedAttachments.js.map +0 -1
  158. package/lib/components/Feed/FeedButton.d.ts +0 -5
  159. package/lib/components/Feed/FeedButton.d.ts.map +0 -1
  160. package/lib/components/Feed/FeedButton.js +0 -15
  161. package/lib/components/Feed/FeedButton.js.map +0 -1
  162. package/lib/components/Feed/FeedContent.d.ts +0 -6
  163. package/lib/components/Feed/FeedContent.d.ts.map +0 -1
  164. package/lib/components/Feed/FeedContent.js +0 -46
  165. package/lib/components/Feed/FeedContent.js.map +0 -1
  166. package/lib/components/Feed/FeedContentFooter.d.ts +0 -5
  167. package/lib/components/Feed/FeedContentFooter.d.ts.map +0 -1
  168. package/lib/components/Feed/FeedContentFooter.js +0 -34
  169. package/lib/components/Feed/FeedContentFooter.js.map +0 -1
  170. package/lib/components/Feed/FeedContentHeader.d.ts +0 -5
  171. package/lib/components/Feed/FeedContentHeader.d.ts.map +0 -1
  172. package/lib/components/Feed/FeedContentHeader.js +0 -107
  173. package/lib/components/Feed/FeedContentHeader.js.map +0 -1
  174. package/lib/components/Feed/FeedEditRegion.d.ts +0 -6
  175. package/lib/components/Feed/FeedEditRegion.d.ts.map +0 -1
  176. package/lib/components/Feed/FeedEditRegion.js +0 -57
  177. package/lib/components/Feed/FeedEditRegion.js.map +0 -1
  178. package/lib/components/Feed/FeedInputRegion.d.ts +0 -8
  179. package/lib/components/Feed/FeedInputRegion.d.ts.map +0 -1
  180. package/lib/components/Feed/FeedInputRegion.js +0 -86
  181. package/lib/components/Feed/FeedInputRegion.js.map +0 -1
  182. package/lib/components/Feed/FeedLikeButton.d.ts +0 -7
  183. package/lib/components/Feed/FeedLikeButton.d.ts.map +0 -1
  184. package/lib/components/Feed/FeedLikeButton.js +0 -102
  185. package/lib/components/Feed/FeedLikeButton.js.map +0 -1
  186. package/lib/components/Feed/FeedModalList.d.ts +0 -5
  187. package/lib/components/Feed/FeedModalList.d.ts.map +0 -1
  188. package/lib/components/Feed/FeedModalList.js +0 -39
  189. package/lib/components/Feed/FeedModalList.js.map +0 -1
  190. package/lib/components/Feed/FeedNewPost.d.ts +0 -7
  191. package/lib/components/Feed/FeedNewPost.d.ts.map +0 -1
  192. package/lib/components/Feed/FeedNewPost.js +0 -30
  193. package/lib/components/Feed/FeedNewPost.js.map +0 -1
  194. package/lib/components/Feed/FeedNewPostTypeMenu.d.ts +0 -6
  195. package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +0 -1
  196. package/lib/components/Feed/FeedNewPostTypeMenu.js +0 -375
  197. package/lib/components/Feed/FeedNewPostTypeMenu.js.map +0 -1
  198. package/lib/components/Feed/FeedPost.d.ts +0 -8
  199. package/lib/components/Feed/FeedPost.d.ts.map +0 -1
  200. package/lib/components/Feed/FeedPost.js +0 -85
  201. package/lib/components/Feed/FeedPost.js.map +0 -1
  202. package/lib/components/Feed/FeedReply.d.ts +0 -7
  203. package/lib/components/Feed/FeedReply.d.ts.map +0 -1
  204. package/lib/components/Feed/FeedReply.js +0 -36
  205. package/lib/components/Feed/FeedReply.js.map +0 -1
  206. package/lib/components/Feed/FeedReplyInput.d.ts +0 -7
  207. package/lib/components/Feed/FeedReplyInput.d.ts.map +0 -1
  208. package/lib/components/Feed/FeedReplyInput.js +0 -21
  209. package/lib/components/Feed/FeedReplyInput.js.map +0 -1
  210. package/lib/components/Feed/FeedRichText.d.ts +0 -6
  211. package/lib/components/Feed/FeedRichText.d.ts.map +0 -1
  212. package/lib/components/Feed/FeedRichText.js +0 -163
  213. package/lib/components/Feed/FeedRichText.js.map +0 -1
  214. package/lib/components/Feed/index.d.ts +0 -7
  215. package/lib/components/Feed/index.d.ts.map +0 -1
  216. package/lib/components/Feed/index.js +0 -6
  217. package/lib/components/Feed/index.js.map +0 -1
  218. package/lib/components/HashtagButton/HashtagButton.d.ts +0 -23
  219. package/lib/components/HashtagButton/HashtagButton.d.ts.map +0 -1
  220. package/lib/components/HashtagButton/HashtagButton.js +0 -44
  221. package/lib/components/HashtagButton/HashtagButton.js.map +0 -1
  222. package/lib/components/HashtagButton/index.d.ts +0 -3
  223. package/lib/components/HashtagButton/index.d.ts.map +0 -1
  224. package/lib/components/HashtagButton/index.js +0 -3
  225. package/lib/components/HashtagButton/index.js.map +0 -1
  226. package/lib/components/MentionButton/MentionButton.d.ts +0 -35
  227. package/lib/components/MentionButton/MentionButton.d.ts.map +0 -1
  228. package/lib/components/MentionButton/MentionButton.js +0 -94
  229. package/lib/components/MentionButton/MentionButton.js.map +0 -1
  230. package/lib/components/MentionButton/index.d.ts +0 -3
  231. package/lib/components/MentionButton/index.d.ts.map +0 -1
  232. package/lib/components/MentionButton/index.js +0 -3
  233. package/lib/components/MentionButton/index.js.map +0 -1
  234. package/lib/index.d.ts +0 -12
  235. package/lib/index.d.ts.map +0 -1
  236. package/lib/index.js +0 -13
  237. package/lib/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatComposer.js","sourceRoot":"","sources":["../../../src/components/Chat/ChatComposer.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EAKV,QAAQ,EACR,SAAS,EACT,WAAW,EAEX,mBAAmB,EACnB,MAAM,EAGP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,WAAW,EAEX,OAAO,EACP,OAAO,EACP,UAAU,EACV,gBAAgB,EAGhB,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,cAAc,EAEd,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAC1F,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAEnG,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;AAyCtD,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA,EAAE,CAAC;AAKtD,MAAM,gCAAgC,GAAG,MAAM,CAAC,GAAG,CACjD,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACtB,OAAO,CACL,QAAQ;QACR,GAAG,CAAA;;wBAEe,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;;OAIxC,CACF,CAAC;AACJ,CAAC,CACF,CAAC;AACF,MAAM,mBAAmB,GA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AClB,SAAS,EAAC,WAAW,EACrB,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE,IAAI;qBACd;iBACF,YAED,KAAC,WAAW,IAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,GAAI,GACrD,IACT,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n Ref,\n PropsWithoutRef,\n ReactNode,\n useState,\n useEffect,\n useCallback,\n ChangeEvent,\n useImperativeHandle,\n useRef,\n RefObject,\n KeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n TextArea,\n Button,\n Icon,\n registerIcon,\n Popover,\n EmojiPicker,\n EmojiPickerProps,\n hasProp,\n useI18n,\n useElement,\n defaultThemeProp,\n PropsWithDefaults,\n ForwardProps,\n Tooltip,\n useOuterEvent,\n VisuallyHiddenText,\n FileUploadItem,\n FileUploadItemProps,\n Grid\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\nimport * as faceHappyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/face-happy.icon';\nimport * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';\n\nregisterIcon(timesIcon, faceHappyIcon, paperClipIcon);\n\nexport type SpecialKeysConfig = {\n /** Collection of specialKeys */\n keys: string[];\n /** onSpecialKey is fired when a special key is typed in Textarea */\n onSpecialKey: (e: KeyboardEvent<HTMLTextAreaElement>, key: string) => void;\n};\n\nexport interface ChatComposerProps {\n /** Place holder */\n placeholder?: string;\n /** Default message to populate on load */\n defaultMessage?: string;\n /** Max character limit */\n maxLength?: number;\n /** Callback when send button is clicked */\n onSend: (message: string) => void;\n /** Enter / Return key sends message */\n enterKeySendsMessage?: boolean;\n /** Max number of attachments to be allowed in chat composer.\n * If zero is passed, add attachments icon will be hidden. same rule applies if prop is not passed.\n * If attachments added are >= maxAttachments, add attachments icon will be disabled.\n */\n maxAttachments?: number;\n /** show/hide emoji */\n showEmoji?: boolean;\n /** Attachments list */\n attachments?: FileUploadItemProps[];\n /** Callback when attachment icon is clicked */\n onAddAttachment?: () => void;\n /** Special Keys configuration */\n specialKeysConfig?: SpecialKeysConfig;\n /** Disables the composer area */\n disabled?: boolean;\n /** Children */\n children?: ReactNode;\n /** Ref to the Imperative handle */\n ref?: Ref<ChatComposerImperativeHandleProps>;\n}\n\nconst StyledAttachmentItem = styled(FileUploadItem)``;\n\ninterface DisableAttachmentProps {\n disabled?: boolean;\n}\nconst StyledAttachmentElementContainer = styled.div<DisableAttachmentProps>(\n ({ disabled, theme }) => {\n return (\n disabled &&\n css`\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n border-radius: 50%;\n outline: none;\n }\n `\n );\n }\n);\nconst StyledPreviewButton = styled(BareButton)``;\nconst StyledDeleteButton = styled(BareButton)``;\n\nconst StyledChatComposer = styled.footer<PropsWithDefaults<ChatComposerProps, 'disabled'>>(\n ({\n theme,\n disabled,\n theme: {\n base: { 'disabled-opacity': transparentBg, spacing }\n }\n }) => {\n return css`\n padding: calc(2 * ${spacing});\n background-color: ${theme.base.palette['secondary-background']};\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n textarea {\n border-radius: ${theme.base['border-radius']};\n height: 5rem;\n border: 0.0625rem solid ${theme.base.colors.gray['extra-light']};\n max-width: 100%;\n }\n ${StyledAttachmentItem} {\n ${disabled &&\n css`\n pointer-events: none;\n opacity: ${transparentBg};\n `}\n }\n\n ${StyledAttachmentElementContainer} {\n ${disabled &&\n css`\n pointer-events: none;\n `}\n }\n\n ${StyledPreviewButton} {\n color: ${theme.base.palette.interactive};\n font-weight: bold;\n &:hover {\n text-decoration: underline;\n }\n }\n\n ${StyledDeleteButton} {\n color: ${theme.base.palette.interactive};\n }\n `;\n }\n);\n\nStyledChatComposer.defaultProps = defaultThemeProp;\nStyledAttachmentElementContainer.defaultProps = defaultThemeProp;\n\nexport const StyledAttachmentsListContainer = styled.div(({ theme }) => {\n return css`\n max-height: 5rem;\n overflow-y: auto;\n\n &:focus-within {\n box-shadow: ${theme.base.shadow['focus-group']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n }\n `;\n});\n\nexport interface ChatComposerImperativeHandleProps {\n /** Function to append a message */\n appendToMessage: (\n appendMessage: string,\n position?: 'cursor' | 'start' | 'end' | 'specialKey'\n ) => void;\n /** Actual ref to Chat composer component */\n chatComposerRef: RefObject<HTMLDivElement | undefined>;\n textAreaRef: RefObject<HTMLTextAreaElement | undefined>;\n}\n\nconst ChatComposer: FunctionComponent<ChatComposerProps & ForwardProps> = forwardRef(\n function ChatComposer(props: PropsWithoutRef<ChatComposerProps>, ref: ChatComposerProps['ref']) {\n const {\n children,\n attachments = [],\n maxAttachments = 0,\n onAddAttachment,\n maxLength,\n placeholder: defaultPlaceHolder,\n defaultMessage = '',\n onSend,\n specialKeysConfig,\n disabled = false,\n enterKeySendsMessage = true,\n showEmoji,\n ...restProps\n } = props;\n const [message, setMessage] = useState(defaultMessage);\n useEffect(() => {\n setMessage(defaultMessage);\n }, [defaultMessage]);\n\n const t = useI18n();\n\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const [showEmojiPicker, setShowEmojiPicker] = useState(false);\n const [emojiBtnEl, setEmojiBtnEl] = useElement();\n const [attachmentsBtnEl, setAttachmentsBtnEl] = useElement();\n const [announcement, setAnnouncement] = useState('');\n\n const lastEnteredSpecialKey = useRef<string | null>(null);\n\n const appendToMessage = useCallback(\n (\n appendMessage: string,\n position?: 'cursor' | 'start' | 'end' | 'specialKey',\n selectText: boolean = true\n ) => {\n let selectionStart;\n let selectionEnd;\n if (textAreaRef.current) {\n if (position === 'start') {\n textAreaRef.current.value = appendMessage + textAreaRef.current.value;\n selectionStart = 0;\n selectionEnd = appendMessage.length;\n } else if (position === 'end') {\n const initialEnd = textAreaRef.current.value.length;\n textAreaRef.current.value += appendMessage;\n selectionStart = initialEnd;\n selectionEnd = initialEnd + appendMessage.length;\n } else if (position === 'specialKey' && lastEnteredSpecialKey.current) {\n const replaceChars = lastEnteredSpecialKey.current.length;\n const currentSelectionStart = textAreaRef.current.selectionStart;\n textAreaRef.current.value =\n textAreaRef.current.value.substring(\n 0,\n textAreaRef.current.selectionStart - replaceChars\n ) +\n appendMessage +\n textAreaRef.current.value.substring(\n textAreaRef.current.selectionStart,\n textAreaRef.current.value.length\n );\n selectionStart = currentSelectionStart - replaceChars;\n selectionEnd = currentSelectionStart + appendMessage.length - replaceChars;\n lastEnteredSpecialKey.current = null;\n } else {\n const currentSelectionStart = textAreaRef.current.selectionStart;\n textAreaRef.current.value =\n textAreaRef.current.value.substring(0, textAreaRef.current.selectionStart) +\n appendMessage +\n textAreaRef.current.value.substring(\n textAreaRef.current.selectionStart,\n textAreaRef.current.value.length\n );\n selectionStart = currentSelectionStart;\n selectionEnd = currentSelectionStart + appendMessage.length;\n }\n textAreaRef.current.selectionStart = selectText ? selectionStart : selectionEnd;\n textAreaRef.current.selectionEnd = selectionEnd;\n textAreaRef.current.focus();\n setMessage(textAreaRef.current.value);\n }\n },\n [setMessage, textAreaRef.current]\n );\n\n const chatComposerRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => ({ appendToMessage, chatComposerRef, textAreaRef }), [\n appendToMessage,\n chatComposerRef.current,\n textAreaRef.current\n ]);\n\n const sendMessage = useCallback(\n (newMessage: string) => {\n if (onSend) {\n onSend(newMessage);\n setMessage('');\n }\n },\n [onSend]\n );\n\n const handleEnterKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (enterKeySendsMessage && e.keyCode === 13 && !e.shiftKey) {\n if (!maxLength || message.length <= maxLength) {\n sendMessage(message);\n setAnnouncement(t('message_sent'));\n }\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [onSend, message, maxLength]\n );\n\n const handleTextAreaChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement>) => {\n setMessage(e.currentTarget.value);\n setAnnouncement('');\n },\n [setMessage]\n );\n\n const handleSpecialKey = useCallback(\n (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (!specialKeysConfig) return;\n const { keys, onSpecialKey } = specialKeysConfig;\n if (specialKeysConfig && keys.length > 0) {\n const composerValue = e.currentTarget.value.substring(0, e.currentTarget.selectionStart);\n const specialKey = keys.find(key => composerValue.endsWith(key));\n if (specialKey) {\n lastEnteredSpecialKey.current = specialKey;\n onSpecialKey(e, specialKey);\n }\n }\n },\n [specialKeysConfig]\n );\n\n const toggleEmoji = () => {\n setShowEmojiPicker(!showEmojiPicker);\n };\n const onEmojiSelect: EmojiPickerProps['onSelect'] = emojiElem => {\n // Check that it is not a custom emoji\n if (hasProp(emojiElem, 'native')) {\n appendToMessage(emojiElem.native, 'cursor', false);\n }\n setShowEmojiPicker(false);\n };\n\n const EmojiPickerRef = useRef<HTMLDivElement>(null);\n\n useOuterEvent('mousedown', [emojiBtnEl, EmojiPickerRef], () => {\n setShowEmojiPicker(false);\n });\n\n return (\n <>\n <Flex\n as={StyledChatComposer}\n disabled={disabled}\n container={{\n direction: 'column',\n gap: 2\n }}\n item={{\n shrink: 0\n }}\n {...restProps}\n ref={chatComposerRef}\n >\n <Flex\n container={{\n direction: 'column',\n gap: 0.5\n }}\n >\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(12rem, 1fr))',\n gap: 1\n }}\n role='group'\n aria-label={`${t('attachments')}`}\n as={StyledAttachmentsListContainer}\n >\n {attachments.map((attachment, idx) => {\n if (disabled) {\n const attachmentProps = {\n ...attachment,\n onDelete: undefined,\n onDownload: undefined,\n onPreview: undefined,\n onEdit: undefined,\n onCancel: undefined\n };\n return <StyledAttachmentItem {...attachmentProps} key={attachmentProps.name} />;\n }\n return (\n <div\n aria-label={`${t('attachments_x_of_y', [idx + 1, attachments.length])}`}\n key={attachment.name}\n >\n <StyledAttachmentItem {...attachment} />\n </div>\n );\n })}\n </Grid>\n <TextArea\n ref={textAreaRef}\n maxLength={maxLength}\n displayCharCount={maxLength !== undefined}\n hardStop={false}\n placeholder={defaultPlaceHolder}\n value={message}\n disabled={disabled}\n onKeyUp={handleSpecialKey}\n onKeyDown={handleEnterKeyDown}\n onChange={handleTextAreaChange}\n onFocus={handleTextAreaChange}\n aria-label={t('enter_message')}\n autoResize={false}\n />\n </Flex>\n <Flex container={{ gap: 0.5 }}>\n {showEmoji && (\n <Button\n ref={setEmojiBtnEl}\n onClick={toggleEmoji}\n variant='simple'\n disabled={disabled}\n icon\n aria-label={t('add_emoji')}\n >\n <Icon name='face-happy' />\n </Button>\n )}\n {maxAttachments > 0 && (\n <StyledAttachmentElementContainer\n disabled={attachments.length >= maxAttachments}\n ref={setAttachmentsBtnEl}\n tabIndex={attachments.length >= maxAttachments ? 0 : undefined}\n role='button'\n >\n <Button\n onClick={onAddAttachment}\n variant='simple'\n disabled={!!(disabled || attachments.length >= maxAttachments)}\n icon\n aria-label={\n attachments.length >= maxAttachments\n ? t('email_disable_attachment', [maxAttachments])\n : t('email_add_attachment', [maxAttachments])\n }\n >\n <Icon name='paper-clip' />\n </Button>\n {attachments.length >= maxAttachments && (\n <Tooltip\n target={attachmentsBtnEl}\n showDelay='none'\n hideDelay='none'\n {...restProps}\n >\n {t('email_disable_attachment', [maxAttachments])}\n </Tooltip>\n )}\n </StyledAttachmentElementContainer>\n )}\n <Flex item={{ grow: 1 }}>{children}</Flex>\n <Button\n variant='primary'\n disabled={disabled || (!!maxLength && message.length > maxLength)}\n onClick={() => {\n sendMessage(message);\n setAnnouncement(t('message_sent'));\n }}\n >\n {t('send')}\n </Button>\n {announcement && (\n <VisuallyHiddenText aria-live='assertive'>{announcement}</VisuallyHiddenText>\n )}\n </Flex>\n </Flex>\n <Popover\n show={showEmojiPicker}\n target={emojiBtnEl}\n placement='top-start'\n modifiers={[\n {\n name: 'flip',\n enabled: true\n }\n ]}\n >\n <EmojiPicker ref={EmojiPickerRef} onSelect={onEmojiSelect} />\n </Popover>\n </>\n );\n }\n);\n\nexport default ChatComposer;\n"]}
@@ -1,29 +0,0 @@
1
- import { FunctionComponent, Ref, MouseEvent } from 'react';
2
- import { ForwardProps, NoChildrenProp, SentimentProps, FieldValueListItemProps, MenuItemProps } from '@pega/cosmos-react-core';
3
- export interface ChatHeaderProps extends NoChildrenProp {
4
- /** ref to the element */
5
- ref?: Ref<HTMLElement>;
6
- /** Title: Used to show channel || group name */
7
- title: string;
8
- /** Icon: Used to show the channel icons, pass the icon name from the cosmos library to render */
9
- icon?: string;
10
- /** Used to show customer name || handle */
11
- customer: string;
12
- /** Authentication status of the customer
13
- * @default false
14
- */
15
- authenticated?: boolean;
16
- /** Sentiment */
17
- sentiment?: SentimentProps;
18
- /** Contextual information */
19
- context?: {
20
- loading?: boolean;
21
- onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
22
- items: FieldValueListItemProps[];
23
- };
24
- /** Used to show frequent user actions to be performed */
25
- actions?: MenuItemProps[];
26
- }
27
- declare const ChatHeader: FunctionComponent<ChatHeaderProps & ForwardProps>;
28
- export default ChatHeader;
29
- //# sourceMappingURL=ChatHeader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ChatHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,GAAG,EAAmB,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxF,OAAO,EAKL,YAAY,EACZ,cAAc,EACd,cAAc,EAEd,uBAAuB,EAQvB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,yBAAyB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,iGAAiG;IACjG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB;IAChB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,6BAA6B;IAC7B,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;QACrD,KAAK,EAAE,uBAAuB,EAAE,CAAC;KAClC,CAAC;IACF,yDAAyD;IACzD,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B;AA2BD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAgGjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { Text, Flex, Icon, defaultThemeProp, Sentiment, Button, useElement, InfoDialog, FieldValueList, useI18n, registerIcon, MenuButton } from '@pega/cosmos-react-core';
5
- import * as userCheckIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/user-check.icon';
6
- import * as userQuestionMarkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/user-question-mark.icon';
7
- registerIcon(userCheckIcon, userQuestionMarkIcon);
8
- const StyledChatHeader = styled.header(({ theme: { base: { spacing, palette: { 'border-line': borderLine } } } }) => {
9
- return css `
10
- padding: ${spacing};
11
- border-block-end: 0.0625rem solid ${borderLine};
12
- `;
13
- });
14
- StyledChatHeader.defaultProps = defaultThemeProp;
15
- const StyledContextContainer = styled.div `
16
- min-height: 2rem;
17
- `;
18
- const StyledInfoDialog = styled(InfoDialog) `
19
- min-width: 50ch;
20
- `;
21
- const ChatHeader = forwardRef(function ChatHeader(props, ref) {
22
- const { title, actions = [], icon, customer, authenticated = false, sentiment, context, ...restProps } = props;
23
- const t = useI18n();
24
- const [target, setTarget] = useElement(null);
25
- return (_jsxs(Flex, { ...restProps, ref: ref, as: StyledChatHeader, container: { alignItems: 'start' }, item: {
26
- shrink: 0
27
- }, children: [_jsxs(Flex, { item: {
28
- grow: 1
29
- }, container: {
30
- gap: 0.5,
31
- alignItems: 'start',
32
- direction: 'column'
33
- }, children: [_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [icon && _jsx(Icon, { name: icon }), _jsx(Text, { variant: 'h2', children: title })] }), _jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Icon, { role: 'img', name: authenticated ? 'user-check' : 'user-question-mark', "aria-label": authenticated ? t('authenticated') : t('not_authenticated') }), _jsx(Text, { variant: 'secondary', children: customer }), sentiment && _jsx(Sentiment, { ...sentiment, labelHidden: true })] })] }), _jsxs(Flex, { item: {
34
- grow: 1
35
- }, container: {
36
- alignItems: 'center',
37
- justify: 'end'
38
- }, children: [context && (_jsx(Button, { variant: 'simple', onClick: (e) => {
39
- context.onClick?.(e);
40
- setTarget(e.currentTarget);
41
- }, children: t('context') })), _jsx(MenuButton, { text: t('actions'), iconOnly: true, icon: 'more', variant: 'simple', menu: { items: actions } })] }), target && context && (_jsx(StyledInfoDialog, { heading: t('chat_context'), target: target, onDismiss: () => setTarget(null), placement: 'bottom-end', progress: context.loading, children: _jsx(Flex, { as: StyledContextContainer, container: true, children: _jsx(FieldValueList, { fields: context.items }) }) }))] }));
42
- });
43
- export default ChatHeader;
44
- //# sourceMappingURL=ChatHeader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatHeader.js","sourceRoot":"","sources":["../../../src/components/Chat/ChatHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuD,MAAM,OAAO,CAAC;AACxF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,E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AAC,SAAS,CAAC,GACN,CACV,EAED,KAAC,UAAU,IACT,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,EAClB,QAAQ,QACR,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,QAAQ,EAChB,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GACxB,IACG,EACN,MAAM,IAAI,OAAO,IAAI,CACpB,KAAC,gBAAgB,IACf,OAAO,EAAE,CAAC,CAAC,cAAc,CAAC,EAC1B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAChC,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,OAAO,CAAC,OAAO,YAEzB,KAAC,IAAI,IAAC,EAAE,EAAE,sBAAsB,EAAE,SAAS,kBACzC,KAAC,cAAc,IAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAI,GACpC,GACU,CACpB,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref, PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Text,\n Flex,\n Icon,\n defaultThemeProp,\n ForwardProps,\n NoChildrenProp,\n SentimentProps,\n Sentiment,\n FieldValueListItemProps,\n Button,\n useElement,\n InfoDialog,\n FieldValueList,\n useI18n,\n registerIcon,\n MenuButton,\n MenuItemProps\n} from '@pega/cosmos-react-core';\nimport * as userCheckIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/user-check.icon';\nimport * as userQuestionMarkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/user-question-mark.icon';\n\nregisterIcon(userCheckIcon, userQuestionMarkIcon);\n\nexport interface ChatHeaderProps extends NoChildrenProp {\n /** ref to the element */\n ref?: Ref<HTMLElement>;\n /** Title: Used to show channel || group name */\n title: string;\n /** Icon: Used to show the channel icons, pass the icon name from the cosmos library to render */\n icon?: string;\n /** Used to show customer name || handle */\n customer: string;\n /** Authentication status of the customer\n * @default false\n */\n authenticated?: boolean;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Contextual information */\n context?: {\n loading?: boolean;\n onClick?: (e: MouseEvent<HTMLButtonElement>) => void;\n items: FieldValueListItemProps[];\n };\n /** Used to show frequent user actions to be performed */\n actions?: MenuItemProps[];\n}\n\nconst StyledChatHeader = styled.header(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n padding: ${spacing};\n border-block-end: 0.0625rem solid ${borderLine};\n `;\n }\n);\nStyledChatHeader.defaultProps = defaultThemeProp;\n\nconst StyledContextContainer = styled.div`\n min-height: 2rem;\n`;\n\nconst StyledInfoDialog = styled(InfoDialog)`\n min-width: 50ch;\n`;\n\nconst ChatHeader: FunctionComponent<ChatHeaderProps & ForwardProps> = forwardRef(\n function ChatHeader(props: PropsWithoutRef<ChatHeaderProps>, ref: ChatHeaderProps['ref']) {\n const {\n title,\n actions = [],\n icon,\n customer,\n authenticated = false,\n sentiment,\n context,\n ...restProps\n } = props;\n\n const t = useI18n();\n const [target, setTarget] = useElement<HTMLButtonElement>(null);\n\n return (\n <Flex\n {...restProps}\n ref={ref}\n as={StyledChatHeader}\n container={{ alignItems: 'start' }}\n item={{\n shrink: 0\n }}\n >\n <Flex\n item={{\n grow: 1\n }}\n container={{\n gap: 0.5,\n alignItems: 'start',\n direction: 'column'\n }}\n >\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n {icon && <Icon name={icon} />}\n <Text variant='h2'>{title}</Text>\n </Flex>\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Icon\n role='img'\n name={authenticated ? 'user-check' : 'user-question-mark'}\n aria-label={authenticated ? t('authenticated') : t('not_authenticated')}\n />\n <Text variant='secondary'>{customer}</Text>\n {sentiment && <Sentiment {...sentiment} labelHidden />}\n </Flex>\n </Flex>\n\n <Flex\n item={{\n grow: 1\n }}\n container={{\n alignItems: 'center',\n justify: 'end'\n }}\n >\n {context && (\n <Button\n variant='simple'\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n context.onClick?.(e);\n setTarget(e.currentTarget);\n }}\n >\n {t('context')}\n </Button>\n )}\n\n <MenuButton\n text={t('actions')}\n iconOnly\n icon='more'\n variant='simple'\n menu={{ items: actions }}\n />\n </Flex>\n {target && context && (\n <StyledInfoDialog\n heading={t('chat_context')}\n target={target}\n onDismiss={() => setTarget(null)}\n placement='bottom-end'\n progress={context.loading}\n >\n <Flex as={StyledContextContainer} container>\n <FieldValueList fields={context.items} />\n </Flex>\n </StyledInfoDialog>\n )}\n </Flex>\n );\n }\n);\n\nexport default ChatHeader;\n"]}
@@ -1,7 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps, OmitStrict } from '@pega/cosmos-react-core';
3
- import type { ChatSettingsPanelProps } from './Chat.types';
4
- export declare const ChatControlPanelIcon: FunctionComponent<OmitStrict<ChatSettingsPanelProps, 'onClick'> & ForwardProps>;
5
- declare const ChatSettingsPanel: FunctionComponent<ChatSettingsPanelProps & ForwardProps>;
6
- export default ChatSettingsPanel;
7
- //# sourceMappingURL=ChatSettingsPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ChatSettingsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,YAAY,EAEZ,UAAU,EAKX,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAS3D,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAClD,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,YAAY,CAa7D,CAAC;AAEF,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAc/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Icon, registerIcon, StyledAvatar, useI18n, VisuallyHiddenText } from '@pega/cosmos-react-core';
3
- import * as chatIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/chat.icon';
4
- import { NavigationListItem } from '@pega/cosmos-react-core/lib/components/AppShell/NavigationList';
5
- import { StyledChatControlPanelIcon, StyledUserStatusIcon, userAvailabilityTheme } from './ChatSettingsPanel.styles';
6
- registerIcon(chatIcon);
7
- export const ChatControlPanelIcon = ({ status, label, ...restProps }) => {
8
- return (_jsxs(StyledChatControlPanelIcon, { as: StyledAvatar, ...restProps, size: 'm', userStatus: status, children: [_jsx(Icon, { name: 'chat' }), status && userAvailabilityTheme[status].icon && (_jsx(StyledUserStatusIcon, { userStatus: status, children: _jsx(Icon, { name: userAvailabilityTheme[status].icon }) })), _jsx(VisuallyHiddenText, { children: label })] }));
9
- };
10
- const ChatSettingsPanel = ({ status, label, onClick, ...restProps }) => {
11
- const t = useI18n();
12
- return (_jsx(NavigationListItem, { primary: status ? `${label} (${t(status)})` : label, visual: _jsx(ChatControlPanelIcon, { status: status, label: label, ...restProps }), onClick: onClick }));
13
- };
14
- export default ChatSettingsPanel;
15
- //# sourceMappingURL=ChatSettingsPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSettingsPanel.js","sourceRoot":"","sources":["../../../src/components/Chat/ChatSettingsPanel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,IAAI,EAEJ,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAGpG,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,CAAC,MAAM,oBAAoB,GAE7B,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;IACtC,OAAO,CACL,MAAC,0BAA0B,IAAC,EAAE,EAAE,YAAY,KAAM,SAAS,EAAE,IAAI,EAAC,GAAG,EAAC,UAAU,EAAE,MAAM,aACtF,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACnB,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAC/C,KAAC,oBAAoB,IAAC,UAAU,EAAE,MAAM,YACtC,KAAC,IAAI,IAAC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC,IAAK,GAAI,GAC9B,CACxB,EACD,KAAC,kBAAkB,cAAE,KAAK,GAAsB,IACrB,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAA6D,CAAC,EACnF,MAAM,EACN,KAAK,EACL,OAAO,EACP,GAAG,SAAS,EACb,EAAE,EAAE;IACH,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,OAAO,CACL,KAAC,kBAAkB,IACjB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EACnD,MAAM,EAAE,KAAC,oBAAoB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAM,SAAS,GAAI,EAC7E,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport {\n ForwardProps,\n Icon,\n OmitStrict,\n registerIcon,\n StyledAvatar,\n useI18n,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\nimport * as chatIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/chat.icon';\nimport { NavigationListItem } from '@pega/cosmos-react-core/lib/components/AppShell/NavigationList';\n\nimport type { ChatSettingsPanelProps } from './Chat.types';\nimport {\n StyledChatControlPanelIcon,\n StyledUserStatusIcon,\n userAvailabilityTheme\n} from './ChatSettingsPanel.styles';\n\nregisterIcon(chatIcon);\n\nexport const ChatControlPanelIcon: FunctionComponent<\n OmitStrict<ChatSettingsPanelProps, 'onClick'> & ForwardProps\n> = ({ status, label, ...restProps }) => {\n return (\n <StyledChatControlPanelIcon as={StyledAvatar} {...restProps} size='m' userStatus={status}>\n <Icon name='chat' />\n {status && userAvailabilityTheme[status].icon && (\n <StyledUserStatusIcon userStatus={status}>\n <Icon name={userAvailabilityTheme[status].icon!} />\n </StyledUserStatusIcon>\n )}\n <VisuallyHiddenText>{label}</VisuallyHiddenText>\n </StyledChatControlPanelIcon>\n );\n};\n\nconst ChatSettingsPanel: FunctionComponent<ChatSettingsPanelProps & ForwardProps> = ({\n status,\n label,\n onClick,\n ...restProps\n}) => {\n const t = useI18n();\n return (\n <NavigationListItem\n primary={status ? `${label} (${t(status)})` : label}\n visual={<ChatControlPanelIcon status={status} label={label} {...restProps} />}\n onClick={onClick}\n />\n );\n};\n\nexport default ChatSettingsPanel;\n"]}
@@ -1,16 +0,0 @@
1
- import { IconName } from '@pega/cosmos-react-core';
2
- import { ColorTheme, UserAvailability } from './Chat.types';
3
- export declare const userAvailabilityTheme: Record<UserAvailability, {
4
- icon?: IconName;
5
- color: ColorTheme;
6
- }>;
7
- export declare const StyledStatusIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
- userStatus: UserAvailability;
9
- }, never>;
10
- export declare const StyledUserStatusIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
11
- userStatus: UserAvailability;
12
- }, never>;
13
- export declare const StyledChatControlPanelIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
14
- userStatus: UserAvailability;
15
- }, never>;
16
- //# sourceMappingURL=ChatSettingsPanel.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSettingsPanel.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ChatSettingsPanel.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,QAAQ,EAA4B,MAAM,yBAAyB,CAAC;AAI/F,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAI5D,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,gBAAgB,EAChB;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAKvC,CAAC;AAEF,eAAO,MAAM,gBAAgB;gBACf,gBAAgB;SAkB7B,CAAC;AAIF,eAAO,MAAM,oBAAoB;gBAtBnB,gBAAgB;SAiC5B,CAAC;AAIH,eAAO,MAAM,0BAA0B;gBArCzB,gBAAgB;SA8C7B,CAAC"}
@@ -1,47 +0,0 @@
1
- import styled, { css } from 'styled-components';
2
- import { readableColor } from 'polished';
3
- import { defaultThemeProp, registerIcon, StyledIcon } from '@pega/cosmos-react-core';
4
- import * as minus from '@pega/cosmos-react-core/lib/components/Icon/icons/minus.icon';
5
- import * as clock from '@pega/cosmos-react-core/lib/components/Icon/icons/clock.icon';
6
- registerIcon(minus, clock);
7
- export const userAvailabilityTheme = {
8
- available: { color: ['green', 'light'] },
9
- unavailable: { icon: 'minus', color: ['red', 'medium'] },
10
- temporarilyUnavailable: { icon: 'clock', color: ['orange', 'light'] }
11
- };
12
- export const StyledStatusIcon = styled.div(({ theme: { base: { colors } }, userStatus }) => {
13
- const [colorName, colorVariant] = userStatus
14
- ? userAvailabilityTheme[userStatus].color
15
- : ['slate', 'light'];
16
- const bgColor = colors[colorName][colorVariant];
17
- const fgColor = readableColor(bgColor);
18
- return css `
19
- background-color: ${bgColor};
20
- color: ${fgColor};
21
- `;
22
- });
23
- StyledStatusIcon.defaultProps = defaultThemeProp;
24
- export const StyledUserStatusIcon = styled(StyledStatusIcon)(({ theme }) => {
25
- return css `
26
- border-radius: 50%;
27
- border: 0.0625rem solid ${theme.components['app-shell'].nav['background-color']};
28
-
29
- ${StyledIcon} {
30
- display: block;
31
- width: 100%;
32
- margin: 0 auto;
33
- }
34
- `;
35
- });
36
- StyledUserStatusIcon.defaultProps = defaultThemeProp;
37
- export const StyledChatControlPanelIcon = styled(StyledStatusIcon) `
38
- ${StyledUserStatusIcon} {
39
- position: absolute;
40
- width: 0.875rem;
41
- height: 0.875rem;
42
- z-index: 1;
43
- inset-block-start: -0.25rem;
44
- inset-inline-end: -0.25rem;
45
- }
46
- `;
47
- //# sourceMappingURL=ChatSettingsPanel.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChatSettingsPanel.styles.js","sourceRoot":"","sources":["../../../src/components/Chat/ChatSettingsPanel.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAY,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,KAAK,KAAK,MAAM,8DAA8D,CAAC;AACtF,OAAO,KAAK,KAAK,MAAM,8DAA8D,CAAC;AAItF,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;IACxC,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;IACxD,sBAAsB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAGxC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,MAAM,EAAE,EACjB,EACD,UAAU,EACX,EAAE,EAAE;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAe,UAAU;QACtD,CAAC,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,KAAK;QACzC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,GAAG,CAAA;0BACY,OAAO;eAClB,OAAO;KACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzE,OAAO,GAAG,CAAA;;8BAEkB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC;;MAE7E,UAAU;;;;;GAKb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAC9D,oBAAoB;;;;;;;;CAQvB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { defaultThemeProp, IconName, registerIcon, StyledIcon } from '@pega/cosmos-react-core';\nimport * as minus from '@pega/cosmos-react-core/lib/components/Icon/icons/minus.icon';\nimport * as clock from '@pega/cosmos-react-core/lib/components/Icon/icons/clock.icon';\n\nimport { ColorTheme, UserAvailability } from './Chat.types';\n\nregisterIcon(minus, clock);\n\nexport const userAvailabilityTheme: Record<\n UserAvailability,\n { icon?: IconName; color: ColorTheme }\n> = {\n available: { color: ['green', 'light'] },\n unavailable: { icon: 'minus', color: ['red', 'medium'] },\n temporarilyUnavailable: { icon: 'clock', color: ['orange', 'light'] }\n};\n\nexport const StyledStatusIcon = styled.div<{\n userStatus: UserAvailability;\n}>(\n ({\n theme: {\n base: { colors }\n },\n userStatus\n }) => {\n const [colorName, colorVariant]: ColorTheme = userStatus\n ? userAvailabilityTheme[userStatus].color\n : ['slate', 'light'];\n const bgColor = colors[colorName][colorVariant];\n const fgColor = readableColor(bgColor);\n return css`\n background-color: ${bgColor};\n color: ${fgColor};\n `;\n }\n);\n\nStyledStatusIcon.defaultProps = defaultThemeProp;\n\nexport const StyledUserStatusIcon = styled(StyledStatusIcon)(({ theme }) => {\n return css`\n border-radius: 50%;\n border: 0.0625rem solid ${theme.components['app-shell'].nav['background-color']};\n\n ${StyledIcon} {\n display: block;\n width: 100%;\n margin: 0 auto;\n }\n `;\n});\n\nStyledUserStatusIcon.defaultProps = defaultThemeProp;\n\nexport const StyledChatControlPanelIcon = styled(StyledStatusIcon)`\n ${StyledUserStatusIcon} {\n position: absolute;\n width: 0.875rem;\n height: 0.875rem;\n z-index: 1;\n inset-block-start: -0.25rem;\n inset-inline-end: -0.25rem;\n }\n`;\n"]}
@@ -1,6 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { MessageProps } from './Chat.types';
4
- declare const Message: FunctionComponent<MessageProps & ForwardProps>;
5
- export default Message;
6
- //# sourceMappingURL=Message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAUL,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA4F5C,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAyN1D,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -1,98 +0,0 @@
1
- import { createElement as _createElement } from "react";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { forwardRef, useEffect, useMemo, useRef } from 'react';
4
- import { Avatar, Flex, Icon, registerIcon, SummaryItem, Image, EmojiDisplay, useI18n, Actions, Tooltip, useTheme, useElement } from '@pega/cosmos-react-core';
5
- import * as documentDocIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/document-doc.icon';
6
- import * as chainUpIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/chain-up.icon';
7
- import * as flagWaveSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/flag-wave-solid.icon';
8
- import { StyledMessageContainer, StyledMessageMain, StyledMessageBubble, StyledMessageBubbleContent, StyledMediaList, StyledMediaListItem, StyledMediaThumbNail, StyledSummaryItem, StyledMediaLink, StyledMetaInfoContainer, StyledMetaInfo, StyledBlinkingDot, StyledMediaButton, StyledMessageHeader, StyledMessageHeaderContent, StyledMessageHeaderMeta, StyledUndeliveredIcon, StyledStatusInfo, StyledHeadset, getMessageColors, StyledFlagIcon, StyledHeadsetIconBackground } from './Message.styles';
9
- registerIcon(documentDocIcon, chainUpIcon, flagWaveSolidIcon);
10
- const Attachment = (props) => {
11
- const { id, icon, name, meta, actions = [], onPreview, thumbnail } = props;
12
- const actionRef = useRef(null);
13
- useEffect(() => {
14
- const listener = (e) => {
15
- if (e.target?.getAttribute('aria-expanded') === 'true' &&
16
- ['ArrowLeft', 'ArrowRight', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
17
- e.stopPropagation();
18
- }
19
- };
20
- actionRef.current?.addEventListener('keydown', listener);
21
- return () => {
22
- actionRef.current?.removeEventListener('keydown', listener);
23
- };
24
- }, [actions]);
25
- return (_jsxs(Flex, { as: StyledMediaListItem, container: {
26
- direction: 'column'
27
- }, children: [thumbnail && (_jsx(Image, { as: StyledMediaThumbNail, src: thumbnail, onClick: (e) => {
28
- e.preventDefault();
29
- e.stopPropagation();
30
- onPreview?.(id);
31
- }, alt: name })), _jsx(SummaryItem, { as: StyledSummaryItem, primary: _jsx(StyledMediaButton, { onClick: (e) => {
32
- e.preventDefault();
33
- e.stopPropagation();
34
- onPreview?.(id);
35
- }, children: name }), secondary: meta, visual: _jsx(Icon, { name: icon || 'document-doc' }), actions: _jsx(Actions, { ref: actionRef, items: actions, iconOnly: true }) })] }, id));
36
- };
37
- const Message = forwardRef(function Message(props, ref) {
38
- const { message, direction, avatarInfo, timestamp, attachments = [], mediaPageLinks = [], status, typing, messageHeader, senderType, senderId, agentVariant, ...restProps } = props;
39
- const t = useI18n();
40
- const theme = useTheme();
41
- const [avatarRef, setAvatarRef] = useElement();
42
- const { content: messageBubbleBackgroundColor } = useMemo(() => getMessageColors(theme, direction, senderType, agentVariant), [theme, direction, senderType, agentVariant]);
43
- let messageMetaJustify = 'between';
44
- if (timestamp && !status) {
45
- messageMetaJustify = 'start';
46
- }
47
- else if (!timestamp && status) {
48
- messageMetaJustify = 'end';
49
- }
50
- const renderAvatar = useMemo(() => {
51
- if (direction !== 'in' || (senderType !== 'bot' && !avatarInfo)) {
52
- return null;
53
- }
54
- if (senderType === 'agent') {
55
- return (_jsxs(_Fragment, { children: [_jsxs(StyledHeadset, { children: [_jsx(Avatar, { name: avatarInfo.name, size: 'm', shape: 'circle', imageSrc: avatarInfo.imageSrc, ref: setAvatarRef, backgroundColor: messageBubbleBackgroundColor }), _jsx(StyledHeadsetIconBackground, { children: _jsx(Icon, { name: 'headset' }) })] }), _jsx(Tooltip, { target: avatarRef, showDelay: 'none', hideDelay: 'none', children: avatarInfo.name })] }));
56
- }
57
- return (_jsxs(_Fragment, { children: [_jsx(Avatar, { name: avatarInfo ? avatarInfo.name : t('bot'), size: 'm', shape: 'circle', icon: !avatarInfo?.imageSrc && senderType === 'bot' ? 'robot-solid' : undefined, imageSrc: avatarInfo?.imageSrc, ref: setAvatarRef, backgroundColor: messageBubbleBackgroundColor }), _jsx(Tooltip, { target: avatarRef, showDelay: 'none', hideDelay: 'none', children: avatarInfo ? avatarInfo.name : t('bot') })] }));
58
- }, [avatarInfo, senderType, direction, avatarRef]);
59
- let ariaLabel;
60
- const sender = avatarInfo ? avatarInfo.name : senderType;
61
- ariaLabel = t('sender_replied_message', [sender, message || '']);
62
- if (attachments.length > 0)
63
- ariaLabel = t('chat_attachments', [ariaLabel, attachments.length]);
64
- if (mediaPageLinks.length > 0)
65
- ariaLabel = t('chat_links', [ariaLabel, mediaPageLinks.length]);
66
- if (timestamp)
67
- ariaLabel = t('chat_message_at_timestamp', [ariaLabel, timestamp]);
68
- if (status && direction === 'out')
69
- ariaLabel += ` ${t('chat_message_status', [status])}`;
70
- return (_jsxs(Flex, { as: StyledMessageContainer, ref: ref, container: {
71
- gap: 1.5,
72
- direction: direction === 'in' ? 'row' : 'row-reverse'
73
- }, item: {
74
- shrink: 0
75
- }, hasMessage: !!message, direction: direction, senderType: senderType, typing: typing, messageHeader: messageHeader, status: status, agentVariant: agentVariant, "aria-label": ariaLabel, ...restProps, children: [renderAvatar, _jsxs(Flex, { container: {
76
- direction: 'column',
77
- alignItems: direction === 'in' ? 'start' : 'end',
78
- justify: 'center'
79
- }, as: StyledMessageMain, children: [_jsxs(Flex, { container: {
80
- direction: direction === 'in' ? 'row' : 'row-reverse',
81
- alignItems: 'center',
82
- gap: 0.5
83
- }, children: [_jsxs(StyledMessageBubble, { children: [messageHeader && (_jsxs(Flex, { container: { gap: 0.5, justify: 'between' }, as: StyledMessageHeader, children: [_jsxs(Flex, { container: { gap: 0.5 }, children: [_jsx(StyledFlagIcon, { name: 'flag-wave-solid' }), _jsx(StyledMessageHeaderContent, { children: messageHeader.content })] }), _jsx(StyledMessageHeaderMeta, { children: messageHeader.meta })] })), message && (_jsx(StyledMessageBubbleContent, { children: _jsx(EmojiDisplay, { content: message, size: 20 }) })), (attachments.length > 0 || mediaPageLinks.length > 0) && (_jsxs(StyledMediaList, { children: [attachments.map(attachment => {
84
- return _createElement(Attachment, { ...attachment, key: attachment.id });
85
- }), mediaPageLinks.map(pagePushLink => {
86
- const { id, href, title, thumbnail } = pagePushLink;
87
- return (_jsxs(Flex, { as: StyledMediaListItem, container: {
88
- direction: 'column'
89
- }, children: [thumbnail && (_jsx(Image, { as: StyledMediaThumbNail, src: thumbnail, alt: title || href })), _jsx(SummaryItem, { as: StyledSummaryItem, primary: _jsx(StyledMediaLink, { "aria-label": title, href: href, target: '_blank', rel: 'noreferrer', children: href }), visual: _jsx(Icon, { name: 'chain-up' }) })] }, id));
90
- })] }))] }), status === 'undeliverable' && message && direction === 'out' && (_jsx(StyledUndeliveredIcon, { name: 'warn-solid' }))] }), !typing && (_jsxs(Flex, { as: StyledMetaInfoContainer, container: {
91
- justify: messageMetaJustify,
92
- gap: 1.5
93
- }, children: [timestamp && _jsx(StyledMetaInfo, { children: timestamp }), status && direction === 'out' && _jsx(StyledStatusInfo, { children: t(status) })] })), typing && (_jsxs(Flex, { container: {
94
- gap: 0.25
95
- }, children: [_jsx(StyledBlinkingDot, { delay: 0 }), _jsx(StyledBlinkingDot, { delay: 0.25 }), _jsx(StyledBlinkingDot, { delay: 0.5 })] }))] })] }));
96
- });
97
- export default Message;
98
- //# sourceMappingURL=Message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAGV,SAAS,EACT,OAAO,EACP,MAAM,EACP,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EAEL,YAAY,EACZ,OAAO,EAEP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,eAA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EAAC,UAAU,GAAG,GAChC,KArBG,EAAE,CAsBF,CACR,CAAC;4CACJ,CAAC,CAAC,IACc,CACnB,IACmB,EAErB,MAAM,KAAK,eAAe,IAAI,OAAO,IAAI,SAAS,KAAK,KAAK,IAAI,CAC/D,KAAC,qBAAqB,IAAC,IAAI,EAAC,YAAY,GAAG,CAC5C,IACI,EAEN,CAAC,MAAM,IAAI,CACV,MAAC,IAAI,IACH,EAAE,EAAE,uBAAuB,EAC3B,SAAS,EAAE;4BACT,OAAO,EAAE,kBAAkB;4BAC3B,GAAG,EAAE,GAAG;yBACT,aAEA,SAAS,IAAI,KAAC,cAAc,cAAE,SAAS,GAAkB,EACzD,MAAM,IAAI,SAAS,KAAK,KAAK,IAAI,KAAC,gBAAgB,cAAE,CAAC,CAAC,MAAM,CAAC,GAAoB,IAC7E,CACR,EAEA,MAAM,IAAI,CACT,MAAC,IAAI,IACH,SAAS,EAAE;4BACT,GAAG,EAAE,IAAI;yBACV,aAED,KAAC,iBAAiB,IAAC,KAAK,EAAE,CAAC,GAAI,EAC/B,KAAC,iBAAiB,IAAC,KAAK,EAAE,IAAI,GAAI,EAClC,KAAC,iBAAiB,IAAC,KAAK,EAAE,GAAG,GAAI,IAC5B,CACR,IACI,IACF,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n PropsWithoutRef,\n MouseEvent,\n useEffect,\n useMemo,\n useRef\n} from 'react';\n\nimport {\n Avatar,\n Flex,\n Icon,\n registerIcon,\n SummaryItem,\n Image,\n FlexContainerProps,\n EmojiDisplay,\n useI18n,\n ForwardProps,\n Actions,\n Tooltip,\n useTheme,\n useElement\n} from '@pega/cosmos-react-core';\nimport * as documentDocIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/document-doc.icon';\nimport * as chainUpIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/chain-up.icon';\nimport * as flagWaveSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/flag-wave-solid.icon';\n\nimport { MessageProps } from './Chat.types';\nimport {\n StyledMessageContainer,\n StyledMessageMain,\n StyledMessageBubble,\n StyledMessageBubbleContent,\n StyledMediaList,\n StyledMediaListItem,\n StyledMediaThumbNail,\n StyledSummaryItem,\n StyledMediaLink,\n StyledMetaInfoContainer,\n StyledMetaInfo,\n StyledBlinkingDot,\n StyledMediaButton,\n StyledMessageHeader,\n StyledMessageHeaderContent,\n StyledMessageHeaderMeta,\n StyledUndeliveredIcon,\n StyledStatusInfo,\n StyledHeadset,\n getMessageColors,\n StyledFlagIcon,\n StyledHeadsetIconBackground\n} from './Message.styles';\nimport type { AttachmentItemProps } from './Chat.types';\n\nregisterIcon(documentDocIcon, chainUpIcon, flagWaveSolidIcon);\n\nconst Attachment = (props: AttachmentItemProps) => {\n const { id, icon, name, meta, actions = [], onPreview, thumbnail } = props;\n const actionRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n const listener = (e: KeyboardEvent) => {\n if (\n (e.target as HTMLButtonElement)?.getAttribute('aria-expanded') === 'true' &&\n ['ArrowLeft', 'ArrowRight', 'ArrowDown', 'ArrowUp'].includes(e.key)\n ) {\n e.stopPropagation();\n }\n };\n\n actionRef.current?.addEventListener('keydown', listener);\n\n return () => {\n actionRef.current?.removeEventListener('keydown', listener);\n };\n }, [actions]);\n\n return (\n <Flex\n key={id}\n as={StyledMediaListItem}\n container={{\n direction: 'column'\n }}\n >\n {thumbnail && (\n <Image\n as={StyledMediaThumbNail}\n src={thumbnail}\n onClick={(e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onPreview?.(id);\n }}\n alt={name}\n />\n )}\n\n <SummaryItem\n as={StyledSummaryItem}\n primary={\n <StyledMediaButton\n onClick={(e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onPreview?.(id);\n }}\n >\n {name}\n </StyledMediaButton>\n }\n secondary={meta}\n visual={<Icon name={icon || 'document-doc'} />}\n actions={<Actions ref={actionRef} items={actions} iconOnly />}\n />\n </Flex>\n );\n};\n\nconst Message: FunctionComponent<MessageProps & ForwardProps> = forwardRef(function Message(\n props: PropsWithoutRef<MessageProps>,\n ref: MessageProps['ref']\n) {\n const {\n message,\n direction,\n avatarInfo,\n timestamp,\n attachments = [],\n mediaPageLinks = [],\n status,\n typing,\n messageHeader,\n senderType,\n senderId,\n agentVariant,\n ...restProps\n } = props;\n\n const t = useI18n();\n const theme = useTheme();\n const [avatarRef, setAvatarRef] = useElement();\n const { content: messageBubbleBackgroundColor } = useMemo(\n () => getMessageColors(theme, direction, senderType, agentVariant),\n [theme, direction, senderType, agentVariant]\n );\n\n let messageMetaJustify: FlexContainerProps['justify'] = 'between';\n if (timestamp && !status) {\n messageMetaJustify = 'start';\n } else if (!timestamp && status) {\n messageMetaJustify = 'end';\n }\n\n const renderAvatar = useMemo(() => {\n if (direction !== 'in' || (senderType !== 'bot' && !avatarInfo)) {\n return null;\n }\n\n if (senderType === 'agent') {\n return (\n <>\n <StyledHeadset>\n <Avatar\n name={avatarInfo!.name}\n size='m'\n shape='circle'\n imageSrc={avatarInfo!.imageSrc}\n ref={setAvatarRef}\n backgroundColor={messageBubbleBackgroundColor}\n />\n <StyledHeadsetIconBackground>\n <Icon name='headset' />\n </StyledHeadsetIconBackground>\n </StyledHeadset>\n <Tooltip target={avatarRef} showDelay='none' hideDelay='none'>\n {avatarInfo!.name}\n </Tooltip>\n </>\n );\n }\n\n return (\n <>\n <Avatar\n name={avatarInfo ? avatarInfo.name : t('bot')}\n size='m'\n shape='circle'\n icon={!avatarInfo?.imageSrc && senderType === 'bot' ? 'robot-solid' : undefined}\n imageSrc={avatarInfo?.imageSrc}\n ref={setAvatarRef}\n backgroundColor={messageBubbleBackgroundColor}\n />\n <Tooltip target={avatarRef} showDelay='none' hideDelay='none'>\n {avatarInfo ? avatarInfo.name : t('bot')}\n </Tooltip>\n </>\n );\n }, [avatarInfo, senderType, direction, avatarRef]);\n\n let ariaLabel: string | undefined;\n const sender = avatarInfo ? avatarInfo.name : senderType;\n\n ariaLabel = t('sender_replied_message', [sender, message || '']);\n if (attachments.length > 0) ariaLabel = t('chat_attachments', [ariaLabel, attachments.length]);\n if (mediaPageLinks.length > 0) ariaLabel = t('chat_links', [ariaLabel, mediaPageLinks.length]);\n if (timestamp) ariaLabel = t('chat_message_at_timestamp', [ariaLabel, timestamp]);\n if (status && direction === 'out') ariaLabel += ` ${t('chat_message_status', [status])}`;\n\n return (\n <Flex\n as={StyledMessageContainer}\n ref={ref}\n container={{\n gap: 1.5,\n direction: direction === 'in' ? 'row' : 'row-reverse'\n }}\n item={{\n shrink: 0\n }}\n hasMessage={!!message}\n direction={direction}\n senderType={senderType}\n typing={typing}\n messageHeader={messageHeader}\n status={status}\n agentVariant={agentVariant}\n aria-label={ariaLabel}\n {...restProps}\n >\n {renderAvatar}\n <Flex\n container={{\n direction: 'column',\n alignItems: direction === 'in' ? 'start' : 'end',\n justify: 'center'\n }}\n as={StyledMessageMain}\n >\n <Flex\n container={{\n direction: direction === 'in' ? 'row' : 'row-reverse',\n alignItems: 'center',\n gap: 0.5\n }}\n >\n <StyledMessageBubble>\n {messageHeader && (\n <Flex container={{ gap: 0.5, justify: 'between' }} as={StyledMessageHeader}>\n <Flex container={{ gap: 0.5 }}>\n <StyledFlagIcon name='flag-wave-solid' />\n <StyledMessageHeaderContent>{messageHeader.content}</StyledMessageHeaderContent>\n </Flex>\n\n <StyledMessageHeaderMeta>{messageHeader.meta}</StyledMessageHeaderMeta>\n </Flex>\n )}\n\n {message && (\n <StyledMessageBubbleContent>\n <EmojiDisplay content={message} size={20} />\n </StyledMessageBubbleContent>\n )}\n\n {(attachments.length > 0 || mediaPageLinks.length > 0) && (\n <StyledMediaList>\n {attachments.map(attachment => {\n return <Attachment {...attachment} key={attachment.id} />;\n })}\n\n {mediaPageLinks.map(pagePushLink => {\n const { id, href, title, thumbnail } = pagePushLink;\n return (\n <Flex\n as={StyledMediaListItem}\n key={id}\n container={{\n direction: 'column'\n }}\n >\n {thumbnail && (\n <Image as={StyledMediaThumbNail} src={thumbnail} alt={title || href} />\n )}\n <SummaryItem\n as={StyledSummaryItem}\n primary={\n <StyledMediaLink\n aria-label={title}\n href={href}\n target='_blank'\n rel='noreferrer'\n >\n {href}\n </StyledMediaLink>\n }\n visual={<Icon name='chain-up' />}\n />\n </Flex>\n );\n })}\n </StyledMediaList>\n )}\n </StyledMessageBubble>\n\n {status === 'undeliverable' && message && direction === 'out' && (\n <StyledUndeliveredIcon name='warn-solid' />\n )}\n </Flex>\n\n {!typing && (\n <Flex\n as={StyledMetaInfoContainer}\n container={{\n justify: messageMetaJustify,\n gap: 1.5\n }}\n >\n {timestamp && <StyledMetaInfo>{timestamp}</StyledMetaInfo>}\n {status && direction === 'out' && <StyledStatusInfo>{t(status)}</StyledStatusInfo>}\n </Flex>\n )}\n\n {typing && (\n <Flex\n container={{\n gap: 0.25\n }}\n >\n <StyledBlinkingDot delay={0} />\n <StyledBlinkingDot delay={0.25} />\n <StyledBlinkingDot delay={0.5} />\n </Flex>\n )}\n </Flex>\n </Flex>\n );\n});\n\nexport default Message;\n"]}
@@ -1,43 +0,0 @@
1
- /// <reference types="react" />
2
- import { DefaultTheme } from 'styled-components';
3
- import { MessageProps } from './Chat.types';
4
- export declare const StyledMessageBubbleContent: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
5
- export declare const StyledMediaList: import("styled-components").StyledComponent<"ul", DefaultTheme, {}, never>;
6
- export declare const StyledMediaListItem: import("styled-components").StyledComponent<"li", DefaultTheme, {}, never>;
7
- export declare const StyledSummaryItem: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
8
- export declare const StyledMediaThumbNail: import("styled-components").StyledComponent<"img", DefaultTheme, {}, never>;
9
- export declare const StyledMediaLink: import("styled-components").StyledComponent<"a", DefaultTheme, {}, never>;
10
- export declare const StyledMediaButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core/lib/components/Button/BareButton").BareButtonProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
11
- export declare const StyledMessageMain: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
12
- export declare const StyledMessageBubble: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
13
- export declare const StyledMetaInfoContainer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
14
- export declare const StyledMetaInfo: import("styled-components").StyledComponent<"span", DefaultTheme, {}, never>;
15
- export declare const StyledStatusInfo: import("styled-components").StyledComponent<"span", DefaultTheme, {}, never>;
16
- export declare const StyledTypingIndicator: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
17
- export declare const StyledMessageHeader: import("styled-components").StyledComponent<"header", DefaultTheme, {}, never>;
18
- export declare const StyledMessageHeaderContent: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
19
- export declare const StyledMessageHeaderMeta: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
20
- export declare const StyledHeadsetIconBackground: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
21
- interface StyledMessageContainerProps {
22
- senderType: 'customer' | 'agent' | 'bot';
23
- direction: 'in' | 'out';
24
- typing: boolean;
25
- hasMessage: boolean;
26
- status: string;
27
- agentVariant: number;
28
- }
29
- export declare const StyledHeadset: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
30
- export interface MessageBubbleColor {
31
- header: string;
32
- content: string;
33
- }
34
- export declare const getMessageColors: (theme: DefaultTheme, direction: MessageProps['direction'], senderType: MessageProps['senderType'], agentVariant: MessageProps['agentVariant']) => MessageBubbleColor;
35
- export declare const StyledMessageContainer: import("styled-components").StyledComponent<"li", DefaultTheme, StyledMessageContainerProps, never>;
36
- interface StyledBlinkingDotProps {
37
- delay?: number;
38
- }
39
- export declare const StyledBlinkingDot: import("styled-components").StyledComponent<"div", DefaultTheme, StyledBlinkingDotProps, never>;
40
- export declare const StyledUndeliveredIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, DefaultTheme, {}, never>;
41
- export declare const StyledFlagIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, DefaultTheme, {}, never>;
42
- export {};
43
- //# sourceMappingURL=Message.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Message.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.styles.ts"],"names":[],"mappings":";AAAA,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAa9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,eAAO,MAAM,0BAA0B,6EAAe,CAAC;AAEvD,eAAO,MAAM,eAAe,4EAAc,CAAC;AAE3C,eAAO,MAAM,mBAAmB,4EAAc,CAAC;AAE/C,eAAO,MAAM,iBAAiB,6EAAe,CAAC;AAE9C,eAAO,MAAM,oBAAoB,6EAAe,CAAC;AAEjD,eAAO,MAAM,eAAe,2EAAa,CAAC;AAE1C,eAAO,MAAM,iBAAiB,8OAAuB,CAAC;AAEtD,eAAO,MAAM,iBAAiB,6EAAe,CAAC;AAE9C,eAAO,MAAM,mBAAmB,6EAAe,CAAC;AAEhD,eAAO,MAAM,uBAAuB,6EAAe,CAAC;AAEpD,eAAO,MAAM,cAAc,8EAAgB,CAAC;AAE5C,eAAO,MAAM,gBAAgB,8EAAgB,CAAC;AAE9C,eAAO,MAAM,qBAAqB,6EAAe,CAAC;AAElD,eAAO,MAAM,mBAAmB,gFAAkB,CAAC;AACnD,eAAO,MAAM,0BAA0B,6EAAe,CAAC;AACvD,eAAO,MAAM,uBAAuB,6EAAe,CAAC;AAEpD,eAAO,MAAM,2BAA2B,6EAAe,CAAC;AACxD,UAAU,2BAA2B;IACnC,UAAU,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;IACzC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IA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