@pega/cosmos-react-social 5.0.0-dev.4.6 → 5.0.0-dev.4.8
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.
- package/package.json +4 -4
- package/lib/components/Autopilot/Autopilot.d.ts +0 -15
- package/lib/components/Autopilot/Autopilot.d.ts.map +0 -1
- package/lib/components/Autopilot/Autopilot.js +0 -50
- package/lib/components/Autopilot/Autopilot.js.map +0 -1
- package/lib/components/Autopilot/AutopilotAvatar.d.ts +0 -8
- package/lib/components/Autopilot/AutopilotAvatar.d.ts.map +0 -1
- package/lib/components/Autopilot/AutopilotAvatar.js +0 -11
- package/lib/components/Autopilot/AutopilotAvatar.js.map +0 -1
- package/lib/components/Autopilot/AutopilotGlimpse.d.ts +0 -9
- package/lib/components/Autopilot/AutopilotGlimpse.d.ts.map +0 -1
- package/lib/components/Autopilot/AutopilotGlimpse.js +0 -24
- package/lib/components/Autopilot/AutopilotGlimpse.js.map +0 -1
- package/lib/components/Autopilot/index.d.ts +0 -4
- package/lib/components/Autopilot/index.d.ts.map +0 -1
- package/lib/components/Autopilot/index.js +0 -3
- package/lib/components/Autopilot/index.js.map +0 -1
- package/lib/components/Chat/Chat.d.ts +0 -29
- package/lib/components/Chat/Chat.d.ts.map +0 -1
- package/lib/components/Chat/Chat.js +0 -64
- package/lib/components/Chat/Chat.js.map +0 -1
- package/lib/components/Chat/Chat.types.d.ts +0 -136
- package/lib/components/Chat/Chat.types.d.ts.map +0 -1
- package/lib/components/Chat/Chat.types.js +0 -10
- package/lib/components/Chat/Chat.types.js.map +0 -1
- package/lib/components/Chat/ChatBody.d.ts +0 -7
- package/lib/components/Chat/ChatBody.d.ts.map +0 -1
- package/lib/components/Chat/ChatBody.js +0 -292
- package/lib/components/Chat/ChatBody.js.map +0 -1
- package/lib/components/Chat/ChatComposer.d.ts +0 -50
- package/lib/components/Chat/ChatComposer.d.ts.map +0 -1
- package/lib/components/Chat/ChatComposer.js +0 -221
- package/lib/components/Chat/ChatComposer.js.map +0 -1
- package/lib/components/Chat/ChatHeader.d.ts +0 -29
- package/lib/components/Chat/ChatHeader.d.ts.map +0 -1
- package/lib/components/Chat/ChatHeader.js +0 -44
- package/lib/components/Chat/ChatHeader.js.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.d.ts +0 -7
- package/lib/components/Chat/ChatSettingsPanel.d.ts.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.js +0 -15
- package/lib/components/Chat/ChatSettingsPanel.js.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.styles.d.ts +0 -16
- package/lib/components/Chat/ChatSettingsPanel.styles.d.ts.map +0 -1
- package/lib/components/Chat/ChatSettingsPanel.styles.js +0 -47
- package/lib/components/Chat/ChatSettingsPanel.styles.js.map +0 -1
- package/lib/components/Chat/Message.d.ts +0 -6
- package/lib/components/Chat/Message.d.ts.map +0 -1
- package/lib/components/Chat/Message.js +0 -98
- package/lib/components/Chat/Message.js.map +0 -1
- package/lib/components/Chat/Message.styles.d.ts +0 -43
- package/lib/components/Chat/Message.styles.d.ts.map +0 -1
- package/lib/components/Chat/Message.styles.js +0 -270
- package/lib/components/Chat/Message.styles.js.map +0 -1
- package/lib/components/Chat/SuggestedReplyPicker.d.ts +0 -42
- package/lib/components/Chat/SuggestedReplyPicker.d.ts.map +0 -1
- package/lib/components/Chat/SuggestedReplyPicker.js +0 -143
- package/lib/components/Chat/SuggestedReplyPicker.js.map +0 -1
- package/lib/components/Chat/SystemMessage.d.ts +0 -8
- package/lib/components/Chat/SystemMessage.d.ts.map +0 -1
- package/lib/components/Chat/SystemMessage.js +0 -50
- package/lib/components/Chat/SystemMessage.js.map +0 -1
- package/lib/components/Chat/TypeIndicator.d.ts +0 -6
- package/lib/components/Chat/TypeIndicator.d.ts.map +0 -1
- package/lib/components/Chat/TypeIndicator.js +0 -12
- package/lib/components/Chat/TypeIndicator.js.map +0 -1
- package/lib/components/Chat/index.d.ts +0 -15
- package/lib/components/Chat/index.d.ts.map +0 -1
- package/lib/components/Chat/index.js +0 -10
- package/lib/components/Chat/index.js.map +0 -1
- package/lib/components/Email/ContextMenuPopover.d.ts +0 -5
- package/lib/components/Email/ContextMenuPopover.d.ts.map +0 -1
- package/lib/components/Email/ContextMenuPopover.js +0 -53
- package/lib/components/Email/ContextMenuPopover.js.map +0 -1
- package/lib/components/Email/Email.d.ts +0 -7
- package/lib/components/Email/Email.d.ts.map +0 -1
- package/lib/components/Email/Email.js +0 -244
- package/lib/components/Email/Email.js.map +0 -1
- package/lib/components/Email/Email.styles.d.ts +0 -67
- package/lib/components/Email/Email.styles.d.ts.map +0 -1
- package/lib/components/Email/Email.styles.js +0 -392
- package/lib/components/Email/Email.styles.js.map +0 -1
- package/lib/components/Email/Email.types.d.ts +0 -394
- package/lib/components/Email/Email.types.d.ts.map +0 -1
- package/lib/components/Email/Email.types.js +0 -2
- package/lib/components/Email/Email.types.js.map +0 -1
- package/lib/components/Email/EmailCaseView.d.ts +0 -6
- package/lib/components/Email/EmailCaseView.d.ts.map +0 -1
- package/lib/components/Email/EmailCaseView.js +0 -36
- package/lib/components/Email/EmailCaseView.js.map +0 -1
- package/lib/components/Email/EmailComposer.d.ts +0 -10
- package/lib/components/Email/EmailComposer.d.ts.map +0 -1
- package/lib/components/Email/EmailComposer.js +0 -255
- package/lib/components/Email/EmailComposer.js.map +0 -1
- package/lib/components/Email/EmailConversation.d.ts +0 -17
- package/lib/components/Email/EmailConversation.d.ts.map +0 -1
- package/lib/components/Email/EmailConversation.js +0 -174
- package/lib/components/Email/EmailConversation.js.map +0 -1
- package/lib/components/Email/EmailEntity.d.ts +0 -11
- package/lib/components/Email/EmailEntity.d.ts.map +0 -1
- package/lib/components/Email/EmailEntity.js +0 -51
- package/lib/components/Email/EmailEntity.js.map +0 -1
- package/lib/components/Email/EmailManager.d.ts +0 -6
- package/lib/components/Email/EmailManager.d.ts.map +0 -1
- package/lib/components/Email/EmailManager.js +0 -21
- package/lib/components/Email/EmailManager.js.map +0 -1
- package/lib/components/Email/EmailNotificationPanel.d.ts +0 -7
- package/lib/components/Email/EmailNotificationPanel.d.ts.map +0 -1
- package/lib/components/Email/EmailNotificationPanel.js +0 -15
- package/lib/components/Email/EmailNotificationPanel.js.map +0 -1
- package/lib/components/Email/EmailSelector.d.ts +0 -22
- package/lib/components/Email/EmailSelector.d.ts.map +0 -1
- package/lib/components/Email/EmailSelector.js +0 -121
- package/lib/components/Email/EmailSelector.js.map +0 -1
- package/lib/components/Email/EmailShell.d.ts +0 -6
- package/lib/components/Email/EmailShell.d.ts.map +0 -1
- package/lib/components/Email/EmailShell.js +0 -46
- package/lib/components/Email/EmailShell.js.map +0 -1
- package/lib/components/Email/EmailSummaryItem.d.ts +0 -11
- package/lib/components/Email/EmailSummaryItem.d.ts.map +0 -1
- package/lib/components/Email/EmailSummaryItem.js +0 -118
- package/lib/components/Email/EmailSummaryItem.js.map +0 -1
- package/lib/components/Email/EmailSummaryList.d.ts +0 -6
- package/lib/components/Email/EmailSummaryList.d.ts.map +0 -1
- package/lib/components/Email/EmailSummaryList.js +0 -95
- package/lib/components/Email/EmailSummaryList.js.map +0 -1
- package/lib/components/Email/EntityList.d.ts +0 -6
- package/lib/components/Email/EntityList.d.ts.map +0 -1
- package/lib/components/Email/EntityList.js +0 -74
- package/lib/components/Email/EntityList.js.map +0 -1
- package/lib/components/Email/index.d.ts +0 -13
- package/lib/components/Email/index.d.ts.map +0 -1
- package/lib/components/Email/index.js +0 -12
- package/lib/components/Email/index.js.map +0 -1
- package/lib/components/Email/utils/EntityHighlighter.d.ts +0 -10
- package/lib/components/Email/utils/EntityHighlighter.d.ts.map +0 -1
- package/lib/components/Email/utils/EntityHighlighter.js +0 -260
- package/lib/components/Email/utils/EntityHighlighter.js.map +0 -1
- package/lib/components/Feed/Feed.context.d.ts +0 -51
- package/lib/components/Feed/Feed.context.d.ts.map +0 -1
- package/lib/components/Feed/Feed.context.js +0 -10
- package/lib/components/Feed/Feed.context.js.map +0 -1
- package/lib/components/Feed/Feed.d.ts +0 -6
- package/lib/components/Feed/Feed.d.ts.map +0 -1
- package/lib/components/Feed/Feed.js +0 -149
- package/lib/components/Feed/Feed.js.map +0 -1
- package/lib/components/Feed/Feed.types.d.ts +0 -334
- package/lib/components/Feed/Feed.types.d.ts.map +0 -1
- package/lib/components/Feed/Feed.types.js +0 -2
- package/lib/components/Feed/Feed.types.js.map +0 -1
- package/lib/components/Feed/FeedAnnouncer.d.ts +0 -6
- package/lib/components/Feed/FeedAnnouncer.d.ts.map +0 -1
- package/lib/components/Feed/FeedAnnouncer.js +0 -11
- package/lib/components/Feed/FeedAnnouncer.js.map +0 -1
- package/lib/components/Feed/FeedAttachments.d.ts +0 -8
- package/lib/components/Feed/FeedAttachments.d.ts.map +0 -1
- package/lib/components/Feed/FeedAttachments.js +0 -97
- package/lib/components/Feed/FeedAttachments.js.map +0 -1
- package/lib/components/Feed/FeedButton.d.ts +0 -5
- package/lib/components/Feed/FeedButton.d.ts.map +0 -1
- package/lib/components/Feed/FeedButton.js +0 -15
- package/lib/components/Feed/FeedButton.js.map +0 -1
- package/lib/components/Feed/FeedContent.d.ts +0 -6
- package/lib/components/Feed/FeedContent.d.ts.map +0 -1
- package/lib/components/Feed/FeedContent.js +0 -46
- package/lib/components/Feed/FeedContent.js.map +0 -1
- package/lib/components/Feed/FeedContentFooter.d.ts +0 -5
- package/lib/components/Feed/FeedContentFooter.d.ts.map +0 -1
- package/lib/components/Feed/FeedContentFooter.js +0 -34
- package/lib/components/Feed/FeedContentFooter.js.map +0 -1
- package/lib/components/Feed/FeedContentHeader.d.ts +0 -5
- package/lib/components/Feed/FeedContentHeader.d.ts.map +0 -1
- package/lib/components/Feed/FeedContentHeader.js +0 -107
- package/lib/components/Feed/FeedContentHeader.js.map +0 -1
- package/lib/components/Feed/FeedEditRegion.d.ts +0 -6
- package/lib/components/Feed/FeedEditRegion.d.ts.map +0 -1
- package/lib/components/Feed/FeedEditRegion.js +0 -57
- package/lib/components/Feed/FeedEditRegion.js.map +0 -1
- package/lib/components/Feed/FeedInputRegion.d.ts +0 -8
- package/lib/components/Feed/FeedInputRegion.d.ts.map +0 -1
- package/lib/components/Feed/FeedInputRegion.js +0 -86
- package/lib/components/Feed/FeedInputRegion.js.map +0 -1
- package/lib/components/Feed/FeedLikeButton.d.ts +0 -7
- package/lib/components/Feed/FeedLikeButton.d.ts.map +0 -1
- package/lib/components/Feed/FeedLikeButton.js +0 -102
- package/lib/components/Feed/FeedLikeButton.js.map +0 -1
- package/lib/components/Feed/FeedModalList.d.ts +0 -5
- package/lib/components/Feed/FeedModalList.d.ts.map +0 -1
- package/lib/components/Feed/FeedModalList.js +0 -39
- package/lib/components/Feed/FeedModalList.js.map +0 -1
- package/lib/components/Feed/FeedNewPost.d.ts +0 -7
- package/lib/components/Feed/FeedNewPost.d.ts.map +0 -1
- package/lib/components/Feed/FeedNewPost.js +0 -30
- package/lib/components/Feed/FeedNewPost.js.map +0 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts +0 -6
- package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +0 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.js +0 -375
- package/lib/components/Feed/FeedNewPostTypeMenu.js.map +0 -1
- package/lib/components/Feed/FeedPost.d.ts +0 -8
- package/lib/components/Feed/FeedPost.d.ts.map +0 -1
- package/lib/components/Feed/FeedPost.js +0 -85
- package/lib/components/Feed/FeedPost.js.map +0 -1
- package/lib/components/Feed/FeedReply.d.ts +0 -7
- package/lib/components/Feed/FeedReply.d.ts.map +0 -1
- package/lib/components/Feed/FeedReply.js +0 -36
- package/lib/components/Feed/FeedReply.js.map +0 -1
- package/lib/components/Feed/FeedReplyInput.d.ts +0 -7
- package/lib/components/Feed/FeedReplyInput.d.ts.map +0 -1
- package/lib/components/Feed/FeedReplyInput.js +0 -21
- package/lib/components/Feed/FeedReplyInput.js.map +0 -1
- package/lib/components/Feed/FeedRichText.d.ts +0 -6
- package/lib/components/Feed/FeedRichText.d.ts.map +0 -1
- package/lib/components/Feed/FeedRichText.js +0 -163
- package/lib/components/Feed/FeedRichText.js.map +0 -1
- package/lib/components/Feed/index.d.ts +0 -7
- package/lib/components/Feed/index.d.ts.map +0 -1
- package/lib/components/Feed/index.js +0 -6
- package/lib/components/Feed/index.js.map +0 -1
- package/lib/components/HashtagButton/HashtagButton.d.ts +0 -23
- package/lib/components/HashtagButton/HashtagButton.d.ts.map +0 -1
- package/lib/components/HashtagButton/HashtagButton.js +0 -44
- package/lib/components/HashtagButton/HashtagButton.js.map +0 -1
- package/lib/components/HashtagButton/index.d.ts +0 -3
- package/lib/components/HashtagButton/index.d.ts.map +0 -1
- package/lib/components/HashtagButton/index.js +0 -3
- package/lib/components/HashtagButton/index.js.map +0 -1
- package/lib/components/MentionButton/MentionButton.d.ts +0 -35
- package/lib/components/MentionButton/MentionButton.d.ts.map +0 -1
- package/lib/components/MentionButton/MentionButton.js +0 -94
- package/lib/components/MentionButton/MentionButton.js.map +0 -1
- package/lib/components/MentionButton/index.d.ts +0 -3
- package/lib/components/MentionButton/index.d.ts.map +0 -1
- package/lib/components/MentionButton/index.js +0 -3
- package/lib/components/MentionButton/index.js.map +0 -1
- package/lib/index.d.ts +0 -12
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypeIndicator.js","sourceRoot":"","sources":["../../../src/components/Chat/TypeIndicator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAmB,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAgB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,OAAO,MAAM,WAAW,CAAC;AAGhC,MAAM,aAAa,GAAyD,UAAU,CACpF,SAAS,aAAa,CACpB,KAA0C,EAC1C,GAA8B;IAE9B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,SAAS,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;IACnE,OAAO,CACL,KAAC,OAAO,OACF,SAAS,EACb,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,IAAI,EACd,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,MAAM,QACN,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,gBACJ,SAAS,GACrB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef } from 'react';\n\nimport { ForwardProps, useI18n } from '@pega/cosmos-react-core';\n\nimport Message from './Message';\nimport { TypeIndicatorProps } from './Chat.types';\n\nconst TypeIndicator: FunctionComponent<TypeIndicatorProps & ForwardProps> = forwardRef(\n function TypeIndicator(\n props: PropsWithoutRef<TypeIndicatorProps>,\n ref: TypeIndicatorProps['ref']\n ) {\n const { avatarInfo, message, senderId, senderType, agentVariant, ...restProps } = props;\n const t = useI18n();\n\n const ariaLabel = t('is_typing', [avatarInfo.name, message || '']);\n return (\n <Message\n {...restProps}\n senderType={senderType}\n senderId={senderId}\n direction='in'\n avatarInfo={avatarInfo}\n agentVariant={agentVariant}\n typing\n ref={ref}\n message={message}\n aria-label={ariaLabel}\n />\n );\n }\n);\n\nexport default TypeIndicator;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { default } from './Chat';
|
|
2
|
-
export type { ChatProps } from './Chat';
|
|
3
|
-
export { default as ChatHeader } from './ChatHeader';
|
|
4
|
-
export type { ChatHeaderProps } from './ChatHeader';
|
|
5
|
-
export { default as ChatBody, NewMessageSeparatorId } from './ChatBody';
|
|
6
|
-
export { default as ChatComposer } from './ChatComposer';
|
|
7
|
-
export type { ChatComposerProps, ChatComposerImperativeHandleProps } from './ChatComposer';
|
|
8
|
-
export { default as SuggestedReplyPicker } from './SuggestedReplyPicker';
|
|
9
|
-
export type { SuggestedReplyPickerProps, SuggestedReply } from './SuggestedReplyPicker';
|
|
10
|
-
export type { AttachmentItemProps, ChatSettingsPanelProps, MediaPageLinks, MessageProps, MessageHeaderProps, ChatBodyProps, ChatBodyListItemProps, ChatBodyHandleValue, TypeIndicatorProps, SystemMessageProps } from './Chat.types';
|
|
11
|
-
export { default as Message } from './Message';
|
|
12
|
-
export { default as SystemMessage } from './SystemMessage';
|
|
13
|
-
export { default as TypeIndicator } from './TypeIndicator';
|
|
14
|
-
export { default as ChatSettingsPanel } from './ChatSettingsPanel';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxF,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default } from './Chat';
|
|
2
|
-
export { default as ChatHeader } from './ChatHeader';
|
|
3
|
-
export { default as ChatBody, NewMessageSeparatorId } from './ChatBody';
|
|
4
|
-
export { default as ChatComposer } from './ChatComposer';
|
|
5
|
-
export { default as SuggestedReplyPicker } from './SuggestedReplyPicker';
|
|
6
|
-
export { default as Message } from './Message';
|
|
7
|
-
export { default as SystemMessage } from './SystemMessage';
|
|
8
|
-
export { default as TypeIndicator } from './TypeIndicator';
|
|
9
|
-
export { default as ChatSettingsPanel } from './ChatSettingsPanel';
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAczE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { default } from './Chat';\nexport type { ChatProps } from './Chat';\nexport { default as ChatHeader } from './ChatHeader';\nexport type { ChatHeaderProps } from './ChatHeader';\nexport { default as ChatBody, NewMessageSeparatorId } from './ChatBody';\nexport { default as ChatComposer } from './ChatComposer';\nexport type { ChatComposerProps, ChatComposerImperativeHandleProps } from './ChatComposer';\nexport { default as SuggestedReplyPicker } from './SuggestedReplyPicker';\nexport type { SuggestedReplyPickerProps, SuggestedReply } from './SuggestedReplyPicker';\nexport type {\n AttachmentItemProps,\n ChatSettingsPanelProps,\n MediaPageLinks,\n MessageProps,\n MessageHeaderProps,\n ChatBodyProps,\n ChatBodyListItemProps,\n ChatBodyHandleValue,\n TypeIndicatorProps,\n SystemMessageProps\n} from './Chat.types';\nexport { default as Message } from './Message';\nexport { default as SystemMessage } from './SystemMessage';\nexport { default as TypeIndicator } from './TypeIndicator';\nexport { default as ChatSettingsPanel } from './ChatSettingsPanel';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuPopover.d.ts","sourceRoot":"","sources":["../../../src/components/Email/ContextMenuPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AASnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CA6ElE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Popover, Menu, Text, useI18n } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledEmailMoreInfoPopover, StyledContextMenuFieldSelector, StyledContextMenu } from './Email.styles';
|
|
5
|
-
const ContextMenuPopover = forwardRef(function ContextMenuPopover({ cursorPosition, contextMenu, targetNode, show }, ref) {
|
|
6
|
-
const t = useI18n();
|
|
7
|
-
const selection = document.getSelection();
|
|
8
|
-
const targetElement = targetNode instanceof Element ? targetNode : targetNode?.parentElement;
|
|
9
|
-
if (targetElement && targetElement.tagName.toLowerCase() === 'mark') {
|
|
10
|
-
selection?.removeAllRanges();
|
|
11
|
-
}
|
|
12
|
-
if (selection && !selection.toString() && targetNode) {
|
|
13
|
-
const range = document.createRange();
|
|
14
|
-
range.selectNodeContents(targetNode);
|
|
15
|
-
selection?.removeAllRanges();
|
|
16
|
-
selection.addRange(range);
|
|
17
|
-
}
|
|
18
|
-
const { onItemClick, items } = contextMenu;
|
|
19
|
-
const onItemSelect = (contextMenuItemId, e) => {
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
const selectedcontextMenuItem = items.find(({ id }) => id === contextMenuItemId);
|
|
22
|
-
if (selectedcontextMenuItem && selection) {
|
|
23
|
-
onItemClick({
|
|
24
|
-
fieldName: selectedcontextMenuItem.primary,
|
|
25
|
-
fieldValue: selection.toString()
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const itemsToRender = items.map(item => {
|
|
30
|
-
return {
|
|
31
|
-
...item,
|
|
32
|
-
visual: item.selected ? (_jsx(StyledContextMenuFieldSelector, { selected: true })) : (_jsx(StyledContextMenuFieldSelector, {}))
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
return (_jsx(Popover, { as: StyledEmailMoreInfoPopover, target: {
|
|
36
|
-
getBoundingClientRect: () => {
|
|
37
|
-
const { x, y } = cursorPosition;
|
|
38
|
-
return {
|
|
39
|
-
width: 0,
|
|
40
|
-
height: 0,
|
|
41
|
-
top: y,
|
|
42
|
-
right: x,
|
|
43
|
-
bottom: y,
|
|
44
|
-
left: x,
|
|
45
|
-
x,
|
|
46
|
-
y,
|
|
47
|
-
toJSON: () => { }
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}, show: show, placement: 'bottom', ref: ref, children: _jsx(StyledContextMenu, { children: _jsx(Menu, { ...contextMenu, header: _jsx(Text, { variant: 'h5', children: t('copy_to') }), items: itemsToRender, onItemClick: onItemSelect }) }) }));
|
|
51
|
-
});
|
|
52
|
-
export default ContextMenuPopover;
|
|
53
|
-
//# sourceMappingURL=ContextMenuPopover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuPopover.js","sourceRoot":"","sources":["../../../src/components/Email/ContextMenuPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiC,UAAU,EAAmB,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,kBAAkB,GAA+C,UAAU,CAC/E,SAAS,kBAAkB,CACzB,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAA4C,EAC3F,GAAmC;IAEnC,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,UAAU,YAAY,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC;IAC7F,IAAI,aAAa,IAAI,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE;QACnE,SAAS,EAAE,eAAe,EAAE,CAAC;KAC9B;IAED,IAAI,SAAS,IAAI,CAAC,SAAS,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,CAAC;oBACN,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,CAAC;oBACP,CAAC;oBACD,CAAC;oBACD,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;iBACjB,CAAC;YACJ,CAAC;SACF,EACD,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,QAAQ,EAClB,GAAG,EAAE,GAAG,YAER,KAAC,iBAAiB,cAChB,KAAC,IAAI,OACC,WAAW,EACf,MAAM,EAAE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,SAAS,CAAC,GAAQ,EAChD,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,YAAY,GACzB,GACgB,GACZ,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent, MouseEvent, forwardRef, PropsWithoutRef } from 'react';\n\nimport { Popover, Menu, Text, useI18n } from '@pega/cosmos-react-core';\n\nimport {\n StyledEmailMoreInfoPopover,\n StyledContextMenuFieldSelector,\n StyledContextMenu\n} from './Email.styles';\nimport { ContextMenuPopoverProps } from './Email.types';\n\nconst ContextMenuPopover: FunctionComponent<ContextMenuPopoverProps> = forwardRef(\n function ContextMenuPopover(\n { cursorPosition, contextMenu, targetNode, show }: PropsWithoutRef<ContextMenuPopoverProps>,\n ref: ContextMenuPopoverProps['ref']\n ) {\n const t = useI18n();\n const selection = document.getSelection();\n\n const targetElement = targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement && targetElement.tagName.toLowerCase() === 'mark') {\n selection?.removeAllRanges();\n }\n\n if (selection && !selection.toString() && targetNode) {\n const range = document.createRange();\n range.selectNodeContents(targetNode as Node);\n selection?.removeAllRanges();\n selection.addRange(range);\n }\n const { onItemClick, items } = contextMenu;\n const onItemSelect = (contextMenuItemId: string, e: MouseEvent) => {\n e.stopPropagation();\n const selectedcontextMenuItem = items.find(({ id }) => id === contextMenuItemId);\n\n if (selectedcontextMenuItem && selection) {\n onItemClick({\n fieldName: selectedcontextMenuItem.primary,\n fieldValue: selection.toString()\n });\n }\n };\n\n const itemsToRender = items.map(item => {\n return {\n ...item,\n visual: item.selected ? (\n <StyledContextMenuFieldSelector selected />\n ) : (\n <StyledContextMenuFieldSelector />\n )\n };\n });\n\n return (\n <Popover\n as={StyledEmailMoreInfoPopover}\n target={{\n getBoundingClientRect: () => {\n const { x, y } = cursorPosition;\n return {\n width: 0,\n height: 0,\n top: y,\n right: x,\n bottom: y,\n left: x,\n x,\n y,\n toJSON: () => {}\n };\n }\n }}\n show={show}\n placement='bottom'\n ref={ref}\n >\n <StyledContextMenu>\n <Menu\n {...contextMenu}\n header={<Text variant='h5'>{t('copy_to')}</Text>}\n items={itemsToRender}\n onItemClick={onItemSelect}\n />\n </StyledContextMenu>\n </Popover>\n );\n }\n);\n\nexport default ContextMenuPopover;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import { EmailProps } from './Email.types';
|
|
4
|
-
import './EmailEntity';
|
|
5
|
-
declare const Email: FunctionComponent<EmailProps & ForwardProps>;
|
|
6
|
-
export default Email;
|
|
7
|
-
//# sourceMappingURL=Email.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EA2Bb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAa,UAAU,EAAiC,MAAM,eAAe,CAAC;AAiBrF,OAAO,eAAe,CAAC;AAiCvB,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CAmftD,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1,244 +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, Fragment, useRef, useState, useMemo, useEffect, useImperativeHandle } from 'react';
|
|
4
|
-
import { Text, SummaryItem, Avatar, Flex, EmailDisplay, Button, Icon, Sentiment, useOuterEvent, Popover, useElement, CardContent, useI18n, FileDisplay, useBreakpoint, DateTimeDisplay, useConfiguration, MetaList, useScrollToggle, Status, Banner, useTheme, useEscape, HTML } from '@pega/cosmos-react-core';
|
|
5
|
-
import { RichTextViewer } from '@pega/cosmos-react-rte';
|
|
6
|
-
import ContextMenuPopover from './ContextMenuPopover';
|
|
7
|
-
import { StyledEmail, StyledEmailDisplay, StyledEmailHeader, StyledFromEmailDisplay, StyledEmailMoreInfoButton, StyledEmailMoreInfoPopover, StyledEmailPrimaryFieldValueList, StyledEmailBody, StyledEmailSecondaryFieldValueList, StyledSuggestedRepliesButton, StyledSuggestedRepliesMenuButton, StyledForwardedContentToggle, StyledEmailActions } from './Email.styles';
|
|
8
|
-
import highlightEntities from './utils/EntityHighlighter';
|
|
9
|
-
import './EmailEntity';
|
|
10
|
-
const EmailDisplayList = ({ emailUsers, showEmailAddress, showShortName }) => {
|
|
11
|
-
return (_jsx(_Fragment, { children: emailUsers.map(({ emailAddress, fullName, shortName }, i) => (_jsxs(Fragment, { children: [i === 0 ? '' : '; ', _jsx(EmailDisplay, { value: emailAddress, displayText: `${showShortName ? shortName : fullName}${showEmailAddress ? ` <${emailAddress}>` : ''}`, variant: 'text', as: StyledEmailDisplay })] }, emailAddress))) }));
|
|
12
|
-
};
|
|
13
|
-
const OVERFLOW_TO_EMAIL_COUNT = 2;
|
|
14
|
-
const OVERFLOW_EMAIL_SUGGESTION_COUNT = 2;
|
|
15
|
-
const Email = forwardRef(function Email(props, ref) {
|
|
16
|
-
const { id, from, to = [], cc = [], bcc = [], timeStamp, sentiment, subject, forwardedContent, attachments = [], suggestions = [], entityHighlightMapping = [], onReply, onForward, onReplyAll, onEditDraft, onDeleteDraft, onSuggestionClick, contextMenu, status, banner, body, ...restProps } = props;
|
|
17
|
-
const t = useI18n();
|
|
18
|
-
const theme = useTheme();
|
|
19
|
-
const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement(null);
|
|
20
|
-
const [showEmailMoreInfo, setShowEmailMoreInfo] = useState(false);
|
|
21
|
-
const [showForwardedContent, setShowForwardedContent] = useState(false);
|
|
22
|
-
const [emailMoreInfoPopover, setEmailMoreInfoPopover] = useElement(null);
|
|
23
|
-
const emailMoreInfoFields = [];
|
|
24
|
-
// Only way to set this is through imperative handle
|
|
25
|
-
const [contextMenuItems, setContextMenuItems] = useState([]);
|
|
26
|
-
const [contextMenuLoading, setContextMenuLoading] = useState(false);
|
|
27
|
-
const [contextMenuPopoverOpen, setContextMenuPopoverOpen] = useState(false);
|
|
28
|
-
const { disableScroll, enableScroll } = useScrollToggle();
|
|
29
|
-
const [contextMenuPopoverEl, setContextMenuPopoverEl] = useElement();
|
|
30
|
-
useImperativeHandle(contextMenu?.handle, () => ({
|
|
31
|
-
setItems: (ctxMenuItems) => {
|
|
32
|
-
setContextMenuItems(ctxMenuItems || []);
|
|
33
|
-
},
|
|
34
|
-
setLoading(loading) {
|
|
35
|
-
setContextMenuLoading(loading);
|
|
36
|
-
},
|
|
37
|
-
setOpen(visible) {
|
|
38
|
-
setContextMenuPopoverOpen(visible);
|
|
39
|
-
}
|
|
40
|
-
}));
|
|
41
|
-
const headerRef = useRef(null);
|
|
42
|
-
const isSmallOrAbove = useBreakpoint('sm', {
|
|
43
|
-
breakpointRef: headerRef,
|
|
44
|
-
themeProp: 'content-width'
|
|
45
|
-
});
|
|
46
|
-
const { locale } = useConfiguration();
|
|
47
|
-
const [currentTarget, setCurrentTarget] = useState();
|
|
48
|
-
useOuterEvent('mousedown', [contextMenuPopoverEl], () => {
|
|
49
|
-
if (contextMenuPopoverOpen)
|
|
50
|
-
setContextMenuPopoverOpen(false);
|
|
51
|
-
});
|
|
52
|
-
// Handler for right click on email body
|
|
53
|
-
const onContextMenu = (e) => {
|
|
54
|
-
if (e.target instanceof HTMLElement && e.target.textContent?.trim()) {
|
|
55
|
-
setCurrentTarget({
|
|
56
|
-
targetNode: e.target,
|
|
57
|
-
cursorPosition: {
|
|
58
|
-
x: e.pageX - window.scrollX,
|
|
59
|
-
y: e.pageY - window.scrollY
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
contextMenu?.onContextMenu(id, e);
|
|
64
|
-
};
|
|
65
|
-
const onItemClick = (selectedValue) => {
|
|
66
|
-
setContextMenuPopoverOpen(false);
|
|
67
|
-
contextMenu?.onItemClick(selectedValue);
|
|
68
|
-
};
|
|
69
|
-
if (from) {
|
|
70
|
-
emailMoreInfoFields.push({
|
|
71
|
-
id: 'from',
|
|
72
|
-
name: t('from'),
|
|
73
|
-
value: from.emailAddress
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (to.length > 0) {
|
|
77
|
-
emailMoreInfoFields.push({
|
|
78
|
-
id: 'to',
|
|
79
|
-
name: t('to'),
|
|
80
|
-
value: _jsx(EmailDisplayList, { emailUsers: to, showEmailAddress: true })
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (cc.length > 0) {
|
|
84
|
-
emailMoreInfoFields.push({
|
|
85
|
-
id: 'cc',
|
|
86
|
-
name: 'CC',
|
|
87
|
-
value: _jsx(EmailDisplayList, { emailUsers: cc, showEmailAddress: true })
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (bcc.length > 0) {
|
|
91
|
-
emailMoreInfoFields.push({
|
|
92
|
-
id: 'BCC',
|
|
93
|
-
name: 'BCC',
|
|
94
|
-
value: _jsx(EmailDisplayList, { emailUsers: bcc, showEmailAddress: true })
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (timeStamp) {
|
|
98
|
-
emailMoreInfoFields.push({
|
|
99
|
-
id: 'date',
|
|
100
|
-
name: t('date'),
|
|
101
|
-
value: (_jsxs(Text, { children: [`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `, _jsx(DateTimeDisplay, { variant: 'datetime', format: 'short', value: timeStamp })] }))
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
useOuterEvent('mousedown', [emailMoreInfoPopover], () => {
|
|
105
|
-
setShowEmailMoreInfo(false);
|
|
106
|
-
});
|
|
107
|
-
useEscape(() => {
|
|
108
|
-
setShowEmailMoreInfo(false);
|
|
109
|
-
});
|
|
110
|
-
const secondaryFields = [];
|
|
111
|
-
if (attachments.length > 0) {
|
|
112
|
-
secondaryFields.push({
|
|
113
|
-
id: 'attachments',
|
|
114
|
-
name: '',
|
|
115
|
-
value: (_jsx(Flex, { container: { gap: 1, wrap: 'wrap' }, children: attachments.map(attachmentProps => (_createElement(FileDisplay, { ...attachmentProps, key: attachmentProps.value }))) }))
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
if (suggestions.length > 0) {
|
|
119
|
-
secondaryFields.push({
|
|
120
|
-
id: 'suggested_replies',
|
|
121
|
-
name: '',
|
|
122
|
-
value: (_jsxs(Flex, { container: { wrap: 'wrap' }, children: [suggestions
|
|
123
|
-
.slice(0, OVERFLOW_EMAIL_SUGGESTION_COUNT)
|
|
124
|
-
.map(({ id: suggestionId, title }) => (_jsx(StyledSuggestedRepliesButton, { variant: 'secondary', onClick: () => {
|
|
125
|
-
onSuggestionClick?.(id, suggestionId);
|
|
126
|
-
}, children: title }, suggestionId))), suggestions.length > OVERFLOW_EMAIL_SUGGESTION_COUNT && (_jsx(StyledSuggestedRepliesMenuButton, { text: t('other_responses'), variant: 'secondary', menu: {
|
|
127
|
-
items: suggestions
|
|
128
|
-
.slice(OVERFLOW_EMAIL_SUGGESTION_COUNT)
|
|
129
|
-
.map(({ id: suggestionId, title }) => {
|
|
130
|
-
return {
|
|
131
|
-
primary: title,
|
|
132
|
-
id: suggestionId,
|
|
133
|
-
onClick: () => {
|
|
134
|
-
onSuggestionClick?.(id, suggestionId);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
})
|
|
138
|
-
} }, 'other_responses'))] }))
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
let renderedBody = body;
|
|
142
|
-
renderedBody = useMemo(() => {
|
|
143
|
-
// Apply entity highlighting only on string body
|
|
144
|
-
if (typeof body === 'string') {
|
|
145
|
-
let bodyString = body;
|
|
146
|
-
if (subject) {
|
|
147
|
-
bodyString = `<div style="font-weight: ${theme.base['font-weight']['semi-bold']}">${t('subject_label', [subject])}</div><br>${body}`;
|
|
148
|
-
}
|
|
149
|
-
if (entityHighlightMapping) {
|
|
150
|
-
bodyString = highlightEntities(bodyString, entityHighlightMapping);
|
|
151
|
-
}
|
|
152
|
-
return (_jsxs(_Fragment, { children: [_jsx(HTML, { content: bodyString, customTags: ['pega-email-entity'], "aria-label": t('unique_entities', [entityHighlightMapping?.length ?? 0], {
|
|
153
|
-
count: entityHighlightMapping?.length ?? 0
|
|
154
|
-
}), role: 'group' }), contextMenu && currentTarget && (_jsx(ContextMenuPopover, { cursorPosition: currentTarget.cursorPosition, contextMenu: {
|
|
155
|
-
...contextMenu,
|
|
156
|
-
items: contextMenuItems,
|
|
157
|
-
loading: contextMenuLoading,
|
|
158
|
-
onItemClick
|
|
159
|
-
}, targetNode: currentTarget.targetNode, show: contextMenuPopoverOpen, ref: setContextMenuPopoverEl }))] }));
|
|
160
|
-
}
|
|
161
|
-
}, [
|
|
162
|
-
currentTarget,
|
|
163
|
-
contextMenu,
|
|
164
|
-
contextMenuPopoverOpen,
|
|
165
|
-
contextMenuItems,
|
|
166
|
-
contextMenuLoading,
|
|
167
|
-
entityHighlightMapping
|
|
168
|
-
]);
|
|
169
|
-
const emailMetaListItems = [
|
|
170
|
-
_jsxs(Text, { variant: 'secondary', children: [`${t('to')}: `, _jsx(EmailDisplayList, { emailUsers: to.slice(0, OVERFLOW_TO_EMAIL_COUNT), showShortName: true }), to.length > OVERFLOW_TO_EMAIL_COUNT &&
|
|
171
|
-
`; +${t('more_count', [to.length - OVERFLOW_TO_EMAIL_COUNT])}`] }),
|
|
172
|
-
_jsxs(Text, { variant: 'secondary', children: [`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `, _jsx(DateTimeDisplay, { variant: 'datetime', format: 'short', value: timeStamp })] })
|
|
173
|
-
];
|
|
174
|
-
useEffect(() => {
|
|
175
|
-
if (contextMenuPopoverOpen)
|
|
176
|
-
disableScroll();
|
|
177
|
-
else
|
|
178
|
-
enableScroll();
|
|
179
|
-
}, [contextMenuPopoverOpen]);
|
|
180
|
-
const actions = useMemo(() => {
|
|
181
|
-
const applicableActions = [];
|
|
182
|
-
if (status !== 'draft') {
|
|
183
|
-
if (onReply) {
|
|
184
|
-
applicableActions.push(_jsx(Button, { variant: 'simple', icon: true, label: t('reply'), onClick: () => {
|
|
185
|
-
onReply?.(id);
|
|
186
|
-
}, children: _jsx(Icon, { name: 'reply' }) }));
|
|
187
|
-
}
|
|
188
|
-
if (onReplyAll) {
|
|
189
|
-
applicableActions.push(_jsx(Button, { icon: true, variant: 'simple', label: t('reply_all'), onClick: () => {
|
|
190
|
-
onReplyAll?.(id);
|
|
191
|
-
}, children: _jsx(Icon, { name: 'reply-all' }) }));
|
|
192
|
-
}
|
|
193
|
-
if (onForward) {
|
|
194
|
-
applicableActions.push(_jsx(Button, { variant: 'simple', icon: true, label: t('forward'), onClick: () => {
|
|
195
|
-
onForward?.(id);
|
|
196
|
-
}, children: _jsx(Icon, { name: 'forward' }) }));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (status === 'draft') {
|
|
200
|
-
if (onEditDraft) {
|
|
201
|
-
applicableActions.push(_jsx(Button, { variant: 'simple', icon: true, label: t('edit'), onClick: () => {
|
|
202
|
-
onEditDraft?.(id);
|
|
203
|
-
}, children: _jsx(Icon, { name: 'pencil' }) }));
|
|
204
|
-
}
|
|
205
|
-
if (onDeleteDraft) {
|
|
206
|
-
applicableActions.push(_jsx(Button, { variant: 'simple', icon: true, label: t('delete'), onClick: () => {
|
|
207
|
-
onDeleteDraft?.(id);
|
|
208
|
-
}, children: _jsx(Icon, { name: 'trash' }) }));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return applicableActions;
|
|
212
|
-
}, [status, onEditDraft, onDeleteDraft, onReply, onReplyAll, onForward]);
|
|
213
|
-
return (_jsxs(Flex, { as: StyledEmail, container: {
|
|
214
|
-
direction: 'column',
|
|
215
|
-
gap: 1
|
|
216
|
-
}, ref: ref, ...restProps, children: [_jsx(SummaryItem, { as: StyledEmailHeader, visual: _jsx(Avatar, { ...from.avatarProps, name: from.fullName }), ref: headerRef, primary: _jsxs(Flex, { container: {
|
|
217
|
-
gap: 1,
|
|
218
|
-
alignItems: 'center'
|
|
219
|
-
}, children: [_jsx(StyledFromEmailDisplay, { value: from.emailAddress, displayText: from.fullName, variant: 'text' }), sentiment && _jsx(Sentiment, { ...sentiment, labelHidden: true }), status && isSmallOrAbove && (_jsx(Status, { variant: status === 'draft' ? 'pending' : 'urgent', children: status === 'draft' ? t('draft', [], { count: 1 }) : t(status) }))] }), secondary: _jsxs(Flex, { container: {
|
|
220
|
-
gap: 0,
|
|
221
|
-
alignItems: 'start',
|
|
222
|
-
direction: 'column'
|
|
223
|
-
}, children: [_jsxs(Flex, { container: {
|
|
224
|
-
gap: 0,
|
|
225
|
-
alignItems: 'start'
|
|
226
|
-
}, children: [_jsx(MetaList, { items: isSmallOrAbove ? emailMetaListItems : [emailMetaListItems[0]] }), _jsx(Button, { icon: true, variant: 'simple', as: StyledEmailMoreInfoButton, ref: setEmailMoreInfoBtnRef, onClick: () => {
|
|
227
|
-
setShowEmailMoreInfo(true);
|
|
228
|
-
}, label: t('show_more'), children: _jsx(Icon, { name: 'arrow-micro-down' }) }), _jsx(Popover, { as: StyledEmailMoreInfoPopover, show: showEmailMoreInfo, ref: setEmailMoreInfoPopover, target: emailMoreInfoBtnRef, placement: 'bottom', children: _jsx(CardContent, { children: _jsx(StyledEmailPrimaryFieldValueList, { fields: emailMoreInfoFields }) }) })] }), !isSmallOrAbove && timeStamp && emailMetaListItems[1], status && !isSmallOrAbove && (_jsx(Flex, { container: { pad: [0.5, 0, 0] }, children: _jsx(Status, { variant: status === 'draft' ? 'pending' : 'urgent', children: status === 'draft' ? t('draft', [], { count: 1 }) : t(status) }) }))] }), actions: _jsxs(Flex, { as: StyledEmailActions, container: {
|
|
229
|
-
pad: 1,
|
|
230
|
-
alignItems: 'center'
|
|
231
|
-
}, children: [...actions] }) }), banner && _jsx(Banner, { variant: 'urgent', ...banner }), _jsxs(Flex, { container: {
|
|
232
|
-
direction: 'column',
|
|
233
|
-
gap: 2,
|
|
234
|
-
pad: [0, 2]
|
|
235
|
-
}, onContextMenu: contextMenu ? onContextMenu : undefined, children: [_jsx(StyledEmailBody, { children: renderedBody }), forwardedContent && forwardedContent.length > 0 && (_jsxs(_Fragment, { children: [_jsx(StyledForwardedContentToggle, { variant: 'simple', icon: true, onClick: () => {
|
|
236
|
-
setShowForwardedContent(prev => !prev);
|
|
237
|
-
}, label: showForwardedContent
|
|
238
|
-
? t('collapse_forwarded_message')
|
|
239
|
-
: t('expand_forwarded_message'), compact: true, children: _jsx(Icon, { name: 'more-alt' }) }), showForwardedContent && _jsx(RichTextViewer, { content: forwardedContent, type: 'html' })] }))] }), secondaryFields.length > 0 && (_jsx(Flex, { container: {
|
|
240
|
-
pad: [0, 2]
|
|
241
|
-
}, children: _jsx(StyledEmailSecondaryFieldValueList, { fields: secondaryFields }) }))] }));
|
|
242
|
-
});
|
|
243
|
-
export default Email;
|
|
244
|
-
//# sourceMappingURL=Email.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,E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AAC,MAAM,IAAC,OAAO,EAAC,QAAQ,KAAK,MAAM,GAAI,EAClD,MAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,GAAG,EAAE,CAAC;oBACN,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;iBACZ,EACD,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,aAGtD,KAAC,eAAe,cAAE,YAAY,GAAmB,EAChD,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,CAClD,8BACE,KAAC,4BAA4B,IAC3B,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE;oCACZ,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;gCACzC,CAAC,EACD,KAAK,EACH,oBAAoB;oCAClB,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC;oCACjC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,EAEnC,OAAO,kBAEP,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,GAAG,GACK,EAC9B,oBAAoB,IAAI,KAAC,cAAc,IAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,GAAG,IACjF,CACJ,IACI,EACN,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAC7B,KAAC,IAAI,IACH,SAAS,EAAE;oBACT,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;iBACZ,YAED,KAAC,kCAAkC,IAAC,MAAM,EAAE,eAAe,GAAI,GAC1D,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import {\n forwardRef,\n Fragment,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n useRef,\n useState,\n useMemo,\n useEffect,\n MouseEvent,\n useImperativeHandle\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n SummaryItem,\n Avatar,\n Flex,\n EmailDisplay,\n Button,\n Icon,\n FieldValueListProps,\n Sentiment,\n useOuterEvent,\n Popover,\n useElement,\n CardContent,\n useI18n,\n FileDisplay,\n useBreakpoint,\n DateTimeDisplay,\n useConfiguration,\n MetaList,\n MetaListProps,\n useScrollToggle,\n Status,\n Banner,\n useTheme,\n useEscape,\n HTML\n} from '@pega/cosmos-react-core';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { EmailUser, EmailProps, TargetProps, ContextMenuProps } from './Email.types';\nimport {\n StyledEmail,\n StyledEmailDisplay,\n StyledEmailHeader,\n StyledFromEmailDisplay,\n StyledEmailMoreInfoButton,\n StyledEmailMoreInfoPopover,\n StyledEmailPrimaryFieldValueList,\n StyledEmailBody,\n StyledEmailSecondaryFieldValueList,\n StyledSuggestedRepliesButton,\n StyledSuggestedRepliesMenuButton,\n StyledForwardedContentToggle,\n StyledEmailActions\n} from './Email.styles';\nimport highlightEntities from './utils/EntityHighlighter';\nimport './EmailEntity';\n\nconst EmailDisplayList = ({\n emailUsers,\n showEmailAddress,\n showShortName\n}: {\n emailUsers: EmailUser[];\n showEmailAddress?: boolean;\n showShortName?: boolean;\n}) => {\n return (\n <>\n {emailUsers.map(({ emailAddress, fullName, shortName }, i) => (\n <Fragment key={emailAddress}>\n {i === 0 ? '' : '; '}\n <EmailDisplay\n value={emailAddress}\n displayText={`${showShortName ? shortName : fullName}${\n showEmailAddress ? ` <${emailAddress}>` : ''\n }`}\n variant='text'\n as={StyledEmailDisplay}\n />\n </Fragment>\n ))}\n </>\n );\n};\n\nconst OVERFLOW_TO_EMAIL_COUNT = 2;\nconst OVERFLOW_EMAIL_SUGGESTION_COUNT = 2;\n\nconst Email: FunctionComponent<EmailProps & ForwardProps> = forwardRef(function Email(\n props: PropsWithoutRef<EmailProps>,\n ref: EmailProps['ref']\n) {\n const {\n id,\n from,\n to = [],\n cc = [],\n bcc = [],\n timeStamp,\n sentiment,\n subject,\n forwardedContent,\n attachments = [],\n suggestions = [],\n entityHighlightMapping = [],\n onReply,\n onForward,\n onReplyAll,\n onEditDraft,\n onDeleteDraft,\n onSuggestionClick,\n contextMenu,\n status,\n banner,\n body,\n ...restProps\n } = props;\n const t = useI18n();\n const theme = useTheme();\n\n const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement<HTMLButtonElement>(null);\n const [showEmailMoreInfo, setShowEmailMoreInfo] = useState(false);\n const [showForwardedContent, setShowForwardedContent] = useState(false);\n const [emailMoreInfoPopover, setEmailMoreInfoPopover] = useElement<HTMLDivElement>(null);\n const emailMoreInfoFields: FieldValueListProps['fields'] = [];\n // Only way to set this is through imperative handle\n const [contextMenuItems, setContextMenuItems] = useState<ContextMenuProps['items']>([]);\n const [contextMenuLoading, setContextMenuLoading] = useState<boolean>(false);\n\n const [contextMenuPopoverOpen, setContextMenuPopoverOpen] = useState(false);\n const { disableScroll, enableScroll } = useScrollToggle();\n const [contextMenuPopoverEl, setContextMenuPopoverEl] = useElement<HTMLElement>();\n\n useImperativeHandle(contextMenu?.handle, () => ({\n setItems: (ctxMenuItems: ContextMenuProps['items']) => {\n setContextMenuItems(ctxMenuItems || []);\n },\n setLoading(loading) {\n setContextMenuLoading(loading);\n },\n setOpen(visible) {\n setContextMenuPopoverOpen(visible);\n }\n }));\n\n const headerRef = useRef<HTMLDivElement>(null);\n const isSmallOrAbove = useBreakpoint('sm', {\n breakpointRef: headerRef,\n themeProp: 'content-width'\n });\n const { locale } = useConfiguration();\n const [currentTarget, setCurrentTarget] = useState<TargetProps | undefined>();\n\n useOuterEvent('mousedown', [contextMenuPopoverEl], () => {\n if (contextMenuPopoverOpen) setContextMenuPopoverOpen(false);\n });\n\n // Handler for right click on email body\n const onContextMenu = (e: MouseEvent<HTMLDivElement>) => {\n if (e.target instanceof HTMLElement && e.target.textContent?.trim()) {\n setCurrentTarget({\n targetNode: e.target,\n cursorPosition: {\n x: e.pageX - window.scrollX,\n y: e.pageY - window.scrollY\n }\n });\n }\n contextMenu?.onContextMenu(id, e);\n };\n\n const onItemClick: ContextMenuProps['onItemClick'] = (selectedValue: {\n fieldName: string;\n fieldValue: string;\n }) => {\n setContextMenuPopoverOpen(false);\n contextMenu?.onItemClick(selectedValue);\n };\n\n if (from) {\n emailMoreInfoFields.push({\n id: 'from',\n name: t('from'),\n value: from.emailAddress\n });\n }\n\n if (to.length > 0) {\n emailMoreInfoFields.push({\n id: 'to',\n name: t('to'),\n value: <EmailDisplayList emailUsers={to} showEmailAddress />\n });\n }\n\n if (cc.length > 0) {\n emailMoreInfoFields.push({\n id: 'cc',\n name: 'CC',\n value: <EmailDisplayList emailUsers={cc} showEmailAddress />\n });\n }\n\n if (bcc.length > 0) {\n emailMoreInfoFields.push({\n id: 'BCC',\n name: 'BCC',\n value: <EmailDisplayList emailUsers={bcc} showEmailAddress />\n });\n }\n\n if (timeStamp) {\n emailMoreInfoFields.push({\n id: 'date',\n name: t('date'),\n value: (\n <Text>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )\n });\n }\n\n useOuterEvent('mousedown', [emailMoreInfoPopover], () => {\n setShowEmailMoreInfo(false);\n });\n\n useEscape(() => {\n setShowEmailMoreInfo(false);\n });\n\n const secondaryFields: FieldValueListProps['fields'] = [];\n\n if (attachments.length > 0) {\n secondaryFields.push({\n id: 'attachments',\n name: '',\n value: (\n <Flex container={{ gap: 1, wrap: 'wrap' }}>\n {attachments.map(attachmentProps => (\n <FileDisplay {...attachmentProps} key={attachmentProps.value} />\n ))}\n </Flex>\n )\n });\n }\n\n if (suggestions.length > 0) {\n secondaryFields.push({\n id: 'suggested_replies',\n name: '',\n value: (\n <Flex container={{ wrap: 'wrap' }}>\n {suggestions\n .slice(0, OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => (\n <StyledSuggestedRepliesButton\n variant='secondary'\n key={suggestionId}\n onClick={() => {\n onSuggestionClick?.(id, suggestionId);\n }}\n >\n {title}\n </StyledSuggestedRepliesButton>\n ))}\n {suggestions.length > OVERFLOW_EMAIL_SUGGESTION_COUNT && (\n <StyledSuggestedRepliesMenuButton\n text={t('other_responses')}\n key='other_responses'\n variant='secondary'\n menu={{\n items: suggestions\n .slice(OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => {\n return {\n primary: title,\n id: suggestionId,\n onClick: () => {\n onSuggestionClick?.(id, suggestionId);\n }\n };\n })\n }}\n />\n )}\n </Flex>\n )\n });\n }\n\n let renderedBody: ReactNode = body;\n\n renderedBody = useMemo(() => {\n // Apply entity highlighting only on string body\n if (typeof body === 'string') {\n let bodyString = body;\n\n if (subject) {\n bodyString = `<div style=\"font-weight: ${theme.base['font-weight']['semi-bold']}\">${t(\n 'subject_label',\n [subject]\n )}</div><br>${body}`;\n }\n\n if (entityHighlightMapping) {\n bodyString = highlightEntities(bodyString, entityHighlightMapping);\n }\n\n return (\n <>\n <HTML\n content={bodyString}\n customTags={['pega-email-entity']}\n aria-label={t('unique_entities', [entityHighlightMapping?.length ?? 0], {\n count: entityHighlightMapping?.length ?? 0\n })}\n role='group'\n />\n\n {contextMenu && currentTarget && (\n <ContextMenuPopover\n cursorPosition={currentTarget.cursorPosition}\n contextMenu={{\n ...contextMenu,\n items: contextMenuItems,\n loading: contextMenuLoading,\n onItemClick\n }}\n targetNode={currentTarget.targetNode}\n show={contextMenuPopoverOpen}\n ref={setContextMenuPopoverEl}\n />\n )}\n </>\n );\n }\n }, [\n currentTarget,\n contextMenu,\n contextMenuPopoverOpen,\n contextMenuItems,\n contextMenuLoading,\n entityHighlightMapping\n ]);\n\n const emailMetaListItems: MetaListProps['items'] = [\n <Text variant='secondary'>\n {`${t('to')}: `}\n <EmailDisplayList emailUsers={to.slice(0, OVERFLOW_TO_EMAIL_COUNT)} showShortName />\n {to.length > OVERFLOW_TO_EMAIL_COUNT &&\n `; +${t('more_count', [to.length - OVERFLOW_TO_EMAIL_COUNT])}`}\n </Text>,\n <Text variant='secondary'>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n ];\n\n useEffect(() => {\n if (contextMenuPopoverOpen) disableScroll();\n else enableScroll();\n }, [contextMenuPopoverOpen]);\n\n const actions = useMemo(() => {\n const applicableActions: ReactNode[] = [];\n if (status !== 'draft') {\n if (onReply) {\n applicableActions.push(\n <Button\n variant='simple'\n icon\n label={t('reply')}\n onClick={() => {\n onReply?.(id);\n }}\n >\n <Icon name='reply' />\n </Button>\n );\n }\n if (onReplyAll) {\n applicableActions.push(\n <Button\n icon\n variant='simple'\n label={t('reply_all')}\n onClick={() => {\n onReplyAll?.(id);\n }}\n >\n <Icon name='reply-all' />\n </Button>\n );\n }\n if (onForward) {\n applicableActions.push(\n <Button\n variant='simple'\n icon\n label={t('forward')}\n onClick={() => {\n onForward?.(id);\n }}\n >\n <Icon name='forward' />\n </Button>\n );\n }\n }\n if (status === 'draft') {\n if (onEditDraft) {\n applicableActions.push(\n <Button\n variant='simple'\n icon\n label={t('edit')}\n onClick={() => {\n onEditDraft?.(id);\n }}\n >\n <Icon name='pencil' />\n </Button>\n );\n }\n if (onDeleteDraft) {\n applicableActions.push(\n <Button\n variant='simple'\n icon\n label={t('delete')}\n onClick={() => {\n onDeleteDraft?.(id);\n }}\n >\n <Icon name='trash' />\n </Button>\n );\n }\n }\n return applicableActions;\n }, [status, onEditDraft, onDeleteDraft, onReply, onReplyAll, onForward]);\n\n return (\n <Flex\n as={StyledEmail}\n container={{\n direction: 'column',\n gap: 1\n }}\n ref={ref}\n {...restProps}\n >\n <SummaryItem\n as={StyledEmailHeader}\n visual={<Avatar {...from.avatarProps} name={from.fullName} />}\n ref={headerRef}\n primary={\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <StyledFromEmailDisplay\n value={from.emailAddress}\n displayText={from.fullName}\n variant='text'\n />\n {sentiment && <Sentiment {...sentiment} labelHidden />}\n {status && isSmallOrAbove && (\n <Status variant={status === 'draft' ? 'pending' : 'urgent'}>\n {/* Passing mock count so that translation engine select correct form of draft,\n with [](second argument) as empty so that count is not shown */}\n {status === 'draft' ? t('draft', [], { count: 1 }) : t(status)}\n </Status>\n )}\n </Flex>\n }\n secondary={\n <Flex\n container={{\n gap: 0,\n alignItems: 'start',\n direction: 'column'\n }}\n >\n <Flex\n container={{\n gap: 0,\n alignItems: 'start'\n }}\n >\n <MetaList items={isSmallOrAbove ? emailMetaListItems : [emailMetaListItems[0]]} />\n\n <Button\n icon\n variant='simple'\n as={StyledEmailMoreInfoButton}\n ref={setEmailMoreInfoBtnRef}\n onClick={() => {\n setShowEmailMoreInfo(true);\n }}\n label={t('show_more')}\n >\n <Icon name='arrow-micro-down' />\n </Button>\n <Popover\n as={StyledEmailMoreInfoPopover}\n show={showEmailMoreInfo}\n ref={setEmailMoreInfoPopover}\n target={emailMoreInfoBtnRef}\n placement='bottom'\n >\n <CardContent>\n <StyledEmailPrimaryFieldValueList fields={emailMoreInfoFields} />\n </CardContent>\n </Popover>\n </Flex>\n {!isSmallOrAbove && timeStamp && emailMetaListItems[1]}\n {status && !isSmallOrAbove && (\n <Flex container={{ pad: [0.5, 0, 0] }}>\n <Status variant={status === 'draft' ? 'pending' : 'urgent'}>\n {/* Passing mock count so that translation engine select correct form of draft,\n with [](second argument) as empty so that count is not shown */}\n {status === 'draft' ? t('draft', [], { count: 1 }) : t(status)}\n </Status>\n </Flex>\n )}\n </Flex>\n }\n actions={\n <Flex\n as={StyledEmailActions}\n container={{\n pad: 1,\n alignItems: 'center'\n }}\n >\n {...actions}\n </Flex>\n }\n />\n {banner && <Banner variant='urgent' {...banner} />}\n <Flex\n container={{\n direction: 'column',\n gap: 2,\n pad: [0, 2]\n }}\n onContextMenu={contextMenu ? onContextMenu : undefined}\n >\n {/* Attach the handler only when context menu enabled by providing the prop */}\n <StyledEmailBody>{renderedBody}</StyledEmailBody>\n {forwardedContent && forwardedContent.length > 0 && (\n <>\n <StyledForwardedContentToggle\n variant='simple'\n icon\n onClick={() => {\n setShowForwardedContent(prev => !prev);\n }}\n label={\n showForwardedContent\n ? t('collapse_forwarded_message')\n : t('expand_forwarded_message')\n }\n compact\n >\n <Icon name='more-alt' />\n </StyledForwardedContentToggle>\n {showForwardedContent && <RichTextViewer content={forwardedContent} type='html' />}\n </>\n )}\n </Flex>\n {secondaryFields.length > 0 && (\n <Flex\n container={{\n pad: [0, 2]\n }}\n >\n <StyledEmailSecondaryFieldValueList fields={secondaryFields} />\n </Flex>\n )}\n </Flex>\n );\n});\n\nexport default Email;\n"]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { EmailEntityProps, EmailShellProps } from './Email.types';
|
|
3
|
-
export declare const StyledEmailMoreInfoButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const StyledEmailHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare const StyledSuggestedRepliesButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const StyledSuggestedRepliesMenuButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ForwardProps & import("@pega/cosmos-react-core").MenuButtonProps> & {
|
|
7
|
-
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
8
|
-
}, import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
-
export declare const StyledEmailBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const StyledFromEmailDisplay: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").EmailDisplayProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
-
export declare const StyledEmailDisplay: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare const StyledEmailPrimaryFieldValueList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
13
|
-
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
14
|
-
}, import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
-
export declare const StyledEmailSecondaryFieldValueList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
16
|
-
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
17
|
-
}, import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
-
export declare const StyledEmailMoreInfoPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
export declare const StyledSecondarySeparator: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const StyledEmail: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
-
export declare const StyledEmailEntity: import("styled-components").StyledComponent<"mark", import("styled-components").DefaultTheme, EmailEntityProps, never>;
|
|
22
|
-
export declare const StyledEntityList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
23
|
-
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
24
|
-
}, import("styled-components").DefaultTheme, {}, never>;
|
|
25
|
-
export declare const StyledForwardedContentToggle: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
26
|
-
export declare const StyledLoadMore: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
27
|
-
export declare const StyledContextMenuFieldSelector: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
28
|
-
selected?: boolean | undefined;
|
|
29
|
-
}, never>;
|
|
30
|
-
export declare const StyledEmailShellHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
31
|
-
export declare const StyledEmailConversationList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
32
|
-
export declare const StyledEmailShell: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, EmailShellProps & {
|
|
33
|
-
singleConversation?: boolean | undefined;
|
|
34
|
-
}, never>;
|
|
35
|
-
export declare const StyledContextMenu: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
36
|
-
export declare const StyledList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
37
|
-
export declare const StyledHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
38
|
-
export declare const StyledEmailCaseViewHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
39
|
-
export declare const StyledUtilitiesContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
40
|
-
showExpandedUtilities: boolean;
|
|
41
|
-
}, never>;
|
|
42
|
-
export declare const StyledGridContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
43
|
-
showExpandedUtilities?: boolean | undefined;
|
|
44
|
-
hasHeader: boolean;
|
|
45
|
-
}, never>;
|
|
46
|
-
export declare const StyledCollapsedUtilitiesToggle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
47
|
-
export declare const StyledExpandedUtilitiesToggle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
48
|
-
export declare const StyledDrawerUtilitiesToggle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
49
|
-
export declare const StyledExpandedUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
50
|
-
showExpandedUtilities: boolean;
|
|
51
|
-
}, never>;
|
|
52
|
-
export declare const StyledEmailActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
53
|
-
export declare const StyledUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
54
|
-
showExpandedUtilities: boolean;
|
|
55
|
-
}, never>;
|
|
56
|
-
export declare const StyledEmailCaseViewColumns: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
57
|
-
hasHeader?: boolean | undefined;
|
|
58
|
-
}, never>;
|
|
59
|
-
export declare const StyledEmailCaseViewDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
60
|
-
export declare const StyledEmailCaseViewContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
61
|
-
export declare const StyledEmailManagerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
62
|
-
export declare const StyledEmailCountIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("@pega/cosmos-react-core").CountProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>> & {
|
|
63
|
-
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
64
|
-
}, import("styled-components").DefaultTheme, {}, never>;
|
|
65
|
-
export declare const StyledEmailSummaryList: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
|
|
66
|
-
export declare const StyledEmailNotificationList: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
|
|
67
|
-
//# sourceMappingURL=Email.styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGlE,eAAO,MAAM,yBAAyB,4GAIrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yGAW5B,CAAC;AAIH,eAAO,MAAM,4BAA4B,qOAUvC,CAAC;AAIH,eAAO,MAAM,gCAAgC;;uDAU3C,CAAC;AAIH,eAAO,MAAM,eAAe,yGAAe,CAAC;AAE5C,eAAO,MAAM,sBAAsB,2OAMjC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0GAE9B,CAAC;AAEF,eAAO,MAAM,gCAAgC;;uDAE5C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;uDAY7C,CAAC;AAIH,eAAO,MAAM,0BAA0B,yGAEtC,CAAC;AAIF,eAAO,MAAM,wBAAwB,yGAInC,CAAC;AAIH,eAAO,MAAM,WAAW,yGAStB,CAAC;AAIH,eAAO,MAAM,iBAAiB,wHAc5B,CAAC;AAIH,eAAO,MAAM,gBAAgB;;uDAU3B,CAAC;AAIH,eAAO,MAAM,4BAA4B,qOAExC,CAAC;AAEF,eAAO,MAAM,cAAc,yGAMzB,CAAC;AAIH,eAAO,MAAM,8BAA8B;;SAmBzC,CAAC;AAIH,eAAO,MAAM,sBAAsB,4GAAkB,CAAC;AACtD,eAAO,MAAM,2BAA2B,wGAAc,CAAC;AACvD,eAAO,MAAM,gBAAgB;;SA6B5B,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAM5B,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAIH,eAAO,MAAM,YAAY,4GAOvB,CAA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