@pega/cosmos-react-social 3.0.0-dev.1.0 → 3.0.0-dev.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Chat/Chat.js +1 -1
- package/lib/components/Chat/Chat.js.map +1 -1
- package/lib/components/Chat/ChatBody.js +1 -1
- package/lib/components/Chat/ChatBody.js.map +1 -1
- package/lib/components/Chat/ChatComposer.js +6 -6
- package/lib/components/Chat/ChatComposer.js.map +1 -1
- package/lib/components/Chat/ChatHeader.d.ts.map +1 -1
- package/lib/components/Chat/ChatHeader.js +2 -3
- package/lib/components/Chat/ChatHeader.js.map +1 -1
- package/lib/components/Chat/ChatTranscript.js +3 -3
- package/lib/components/Chat/ChatTranscript.js.map +1 -1
- package/lib/components/Chat/Message.js +9 -9
- package/lib/components/Chat/Message.js.map +1 -1
- package/lib/components/Chat/MessageList.js +3 -3
- package/lib/components/Chat/MessageList.js.map +1 -1
- package/lib/components/Chat/RepeatingView.js +1 -1
- package/lib/components/Chat/RepeatingView.js.map +1 -1
- package/lib/components/Chat/SuggestedReplyPicker.js +6 -6
- package/lib/components/Chat/SuggestedReplyPicker.js.map +1 -1
- package/lib/components/Chat/SystemMessage.js +1 -1
- package/lib/components/Chat/SystemMessage.js.map +1 -1
- package/lib/components/Chat/TranscriptMessage.js +2 -2
- package/lib/components/Chat/TranscriptMessage.js.map +1 -1
- package/lib/components/Chat/TypeIndicator.js +1 -1
- package/lib/components/Chat/TypeIndicator.js.map +1 -1
- package/lib/components/Email/ContextMenuPopover.d.ts +5 -0
- package/lib/components/Email/ContextMenuPopover.d.ts.map +1 -0
- package/lib/components/Email/ContextMenuPopover.js +48 -0
- package/lib/components/Email/ContextMenuPopover.js.map +1 -0
- package/lib/components/Email/Email.d.ts.map +1 -1
- package/lib/components/Email/Email.js +64 -30
- package/lib/components/Email/Email.js.map +1 -1
- package/lib/components/Email/Email.styles.d.ts +6 -2
- package/lib/components/Email/Email.styles.d.ts.map +1 -1
- package/lib/components/Email/Email.styles.js +42 -2
- package/lib/components/Email/Email.styles.js.map +1 -1
- package/lib/components/Email/Email.types.d.ts +41 -8
- package/lib/components/Email/Email.types.d.ts.map +1 -1
- package/lib/components/Email/Email.types.js.map +1 -1
- package/lib/components/Email/EmailComposer.d.ts +1 -1
- package/lib/components/Email/EmailComposer.d.ts.map +1 -1
- package/lib/components/Email/EmailComposer.js +83 -60
- package/lib/components/Email/EmailComposer.js.map +1 -1
- package/lib/components/Email/EmailConversation.js +4 -4
- package/lib/components/Email/EmailConversation.js.map +1 -1
- package/lib/components/Email/EmailEntity.d.ts.map +1 -1
- package/lib/components/Email/EmailEntity.js +7 -3
- package/lib/components/Email/EmailEntity.js.map +1 -1
- package/lib/components/Email/EmailSelector.d.ts +2 -2
- package/lib/components/Email/EmailSelector.d.ts.map +1 -1
- package/lib/components/Email/EmailSelector.js +36 -28
- package/lib/components/Email/EmailSelector.js.map +1 -1
- package/lib/components/Email/EmailShell.d.ts.map +1 -1
- package/lib/components/Email/EmailShell.js +7 -5
- package/lib/components/Email/EmailShell.js.map +1 -1
- package/lib/components/Email/EmailSummaryItem.d.ts.map +1 -1
- package/lib/components/Email/EmailSummaryItem.js +16 -8
- package/lib/components/Email/EmailSummaryItem.js.map +1 -1
- package/lib/components/Email/EmailSummaryList.d.ts.map +1 -1
- package/lib/components/Email/EmailSummaryList.js +74 -33
- package/lib/components/Email/EmailSummaryList.js.map +1 -1
- package/lib/components/Email/EntityList.d.ts +6 -0
- package/lib/components/Email/EntityList.d.ts.map +1 -0
- package/lib/components/Email/{ViewAnalysis.js → EntityList.js} +6 -6
- package/lib/components/Email/EntityList.js.map +1 -0
- package/lib/components/Email/index.d.ts +2 -2
- package/lib/components/Email/index.d.ts.map +1 -1
- package/lib/components/Email/index.js +1 -1
- package/lib/components/Email/index.js.map +1 -1
- package/lib/components/Feed/Feed.d.ts +2 -0
- package/lib/components/Feed/Feed.d.ts.map +1 -1
- package/lib/components/Feed/Feed.js +22 -45
- package/lib/components/Feed/Feed.js.map +1 -1
- package/lib/components/Feed/FeedAnnouncer.js +1 -1
- package/lib/components/Feed/FeedAnnouncer.js.map +1 -1
- package/lib/components/Feed/FeedAttachments.js +3 -3
- package/lib/components/Feed/FeedAttachments.js.map +1 -1
- package/lib/components/Feed/FeedContent.js +1 -1
- package/lib/components/Feed/FeedContent.js.map +1 -1
- package/lib/components/Feed/FeedLikeButton.d.ts +1 -1
- package/lib/components/Feed/FeedLikeButton.d.ts.map +1 -1
- package/lib/components/Feed/FeedLikeButton.js +10 -8
- package/lib/components/Feed/FeedLikeButton.js.map +1 -1
- package/lib/components/Feed/FeedModalList.d.ts +2 -0
- package/lib/components/Feed/FeedModalList.d.ts.map +1 -1
- package/lib/components/Feed/FeedModalList.js +25 -38
- package/lib/components/Feed/FeedModalList.js.map +1 -1
- package/lib/components/Feed/FeedNewPost.js +4 -4
- package/lib/components/Feed/FeedNewPost.js.map +1 -1
- package/lib/components/Feed/FeedNewPostTypeMenu.js +8 -8
- package/lib/components/Feed/FeedNewPostTypeMenu.js.map +1 -1
- package/lib/components/Feed/FeedPost.d.ts.map +1 -1
- package/lib/components/Feed/FeedPost.js +16 -14
- package/lib/components/Feed/FeedPost.js.map +1 -1
- package/lib/components/Feed/FeedPost.types.d.ts +4 -0
- package/lib/components/Feed/FeedPost.types.d.ts.map +1 -1
- package/lib/components/Feed/FeedPost.types.js.map +1 -1
- package/lib/components/Feed/FeedReply.d.ts.map +1 -1
- package/lib/components/Feed/FeedReply.js +7 -7
- package/lib/components/Feed/FeedReply.js.map +1 -1
- package/lib/components/Feed/FeedReply.types.d.ts +2 -0
- package/lib/components/Feed/FeedReply.types.d.ts.map +1 -1
- package/lib/components/Feed/FeedReply.types.js.map +1 -1
- package/lib/components/Feed/FeedReplyInput.js +4 -4
- package/lib/components/Feed/FeedReplyInput.js.map +1 -1
- package/lib/components/Feed/FeedRichText.js +1 -1
- package/lib/components/Feed/FeedRichText.js.map +1 -1
- package/lib/components/HashtagButton/HashtagButton.js +2 -2
- package/lib/components/HashtagButton/HashtagButton.js.map +1 -1
- package/lib/components/MentionButton/MentionButton.js +2 -2
- package/lib/components/MentionButton/MentionButton.js.map +1 -1
- package/package.json +16 -13
- package/lib/components/Email/ViewAnalysis.d.ts +0 -6
- package/lib/components/Email/ViewAnalysis.d.ts.map +0 -1
- package/lib/components/Email/ViewAnalysis.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EmailEntityProps } from './Email.types';
|
|
2
|
+
import { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';
|
|
3
3
|
export declare const StyledEmailMoreInfoButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const StyledEmailHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
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>;
|
|
@@ -14,5 +14,9 @@ export declare const StyledSecondarySeparator: import("styled-components").Style
|
|
|
14
14
|
export declare const emailEntityBackgroundColors: string[];
|
|
15
15
|
export declare const StyledEmail: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
16
|
export declare const StyledEmailEntity: import("styled-components").StyledComponent<"mark", import("styled-components").DefaultTheme, EmailEntityProps, never>;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const StyledEntityList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
+
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>;
|
|
19
|
+
export declare const StyledLoadMore: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const StyledContextMenuFieldSelector: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledContextMenuFieldSelectorProps, never>;
|
|
21
|
+
export declare const StyledContextMenu: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
22
|
//# sourceMappingURL=Email.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,MAAM,eAAe,CAAC;AAEtF,eAAO,MAAM,yBAAyB,4GAIrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yGAY5B,CAAC;AAIH,eAAO,MAAM,4BAA4B,qOAUvC,CAAC;AAIH,eAAO,MAAM,gCAAgC,yOAU3C,CAAC;AAIH,eAAO,MAAM,eAAe,yGAAe,CAAC;AAE5C,eAAO,MAAM,sBAAsB,2OAMjC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0GAE9B,CAAC;AAEF,eAAO,MAAM,gCAAgC,6OAE5C,CAAC;AAEF,eAAO,MAAM,kCAAkC,6OAY7C,CAAC;AAIH,eAAO,MAAM,0BAA0B,yGAEtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,yGAInC,CAAC;AACH,eAAO,MAAM,2BAA2B,UAqBvC,CAAC;AAEF,eAAO,MAAM,WAAW,yGAAe,CAAC;AAExC,eAAO,MAAM,iBAAiB,wHAgB5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,6OAU3B,CAAC;AAEH,eAAO,MAAM,4BAA4B,qOAExC,CAAC;AAIF,eAAO,MAAM,cAAc,yGAMzB,CAAC;AAIH,eAAO,MAAM,8BAA8B,0IAmB1C,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC"}
|
|
@@ -113,10 +113,11 @@ export const StyledEmailEntity = styled.mark(({ entity, theme }) => {
|
|
|
113
113
|
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
114
114
|
background-color: ${backgroundColor};
|
|
115
115
|
color: ${textColor};
|
|
116
|
+
display: inline-block;
|
|
116
117
|
`;
|
|
117
118
|
});
|
|
118
119
|
StyledEmailEntity.defaultProps = defaultThemeProp;
|
|
119
|
-
export const
|
|
120
|
+
export const StyledEntityList = styled(FieldValueList)(({ theme }) => {
|
|
120
121
|
const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));
|
|
121
122
|
return css `
|
|
122
123
|
${StyledFieldName} {
|
|
@@ -127,5 +128,44 @@ export const StyledViewAnalysisFieldValueList = styled(FieldValueList)(({ theme
|
|
|
127
128
|
}
|
|
128
129
|
`;
|
|
129
130
|
});
|
|
130
|
-
|
|
131
|
+
export const StyledForwardedContentToggle = styled(Button) `
|
|
132
|
+
align-self: flex-start;
|
|
133
|
+
`;
|
|
134
|
+
StyledEntityList.defaultProps = defaultThemeProp;
|
|
135
|
+
export const StyledLoadMore = styled.div(({ theme }) => {
|
|
136
|
+
return css `
|
|
137
|
+
margin: ${theme.base.spacing} 0;
|
|
138
|
+
min-height: 2rem;
|
|
139
|
+
min-width: 2rem;
|
|
140
|
+
`;
|
|
141
|
+
});
|
|
142
|
+
StyledLoadMore.defaultProps = defaultThemeProp;
|
|
143
|
+
export const StyledContextMenuFieldSelector = styled.div(({ theme, selected }) => {
|
|
144
|
+
const background = selected
|
|
145
|
+
? theme.base.colors.green.medium
|
|
146
|
+
: theme.base.palette['primary-background'];
|
|
147
|
+
const borderColor = selected
|
|
148
|
+
? theme.base.colors.green['extra-light']
|
|
149
|
+
: theme.base.palette['primary-background'];
|
|
150
|
+
return css `
|
|
151
|
+
background-color: ${background};
|
|
152
|
+
border: 0.0625rem solid ${borderColor};
|
|
153
|
+
border-radius: 100%;
|
|
154
|
+
display: inline-block;
|
|
155
|
+
height: 0.625rem;
|
|
156
|
+
width: 0.625rem;
|
|
157
|
+
background-clip: content-box;
|
|
158
|
+
padding: 0.0625rem;
|
|
159
|
+
`;
|
|
160
|
+
});
|
|
161
|
+
StyledContextMenuFieldSelector.defaultProps = defaultThemeProp;
|
|
162
|
+
export const StyledContextMenu = styled.div(({ theme }) => {
|
|
163
|
+
const secondaryBackground = theme.base.palette['secondary-background'];
|
|
164
|
+
return css `
|
|
165
|
+
header {
|
|
166
|
+
background-color: ${secondaryBackground};
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
});
|
|
170
|
+
StyledContextMenu.defaultProps = defaultThemeProp;
|
|
131
171
|
//# sourceMappingURL=Email.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;uBACW,K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gB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\nexport const emailEntityBackgroundColors = [\n '#00428B',\n '#008C80',\n '#53336F',\n '#005FA7',\n '#7C421B',\n '#BC1513',\n '#DE4342',\n '#661D34',\n '#8B479E',\n '#4B3380',\n '#10A5AC',\n '#5F67B9',\n '#1D447A',\n '#988CC4',\n '#AC1361',\n '#1B6B2E',\n '#4064B3',\n '#4D4D4D',\n '#0F5F5D',\n '#7F375B'\n];\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n emailEntityBackgroundColors[\n (Number.isFinite(variant) && variant > 0 ? variant : 0) % emailEntityBackgroundColors.length\n ],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledViewAnalysisFieldValueList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledViewAnalysisFieldValueList.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;uBACW,KAAK,CAAC,IAAI,CAAC,OAAO;qCACJ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;4BAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,cAAc,KAAK,CAAC,IAAI,CAAC,OAAO;MACxE,YAAY,IAAI,wBAAwB;;;MAGxC,eAAe;+BACU,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvE,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AE,EAAE,EAAE;IACtB,MAAM,UAAU,GAAG,QAAQ;QACzB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;QAChC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;QACxC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7C,OAAO,GAAG,CAAA;0BACY,UAAU;gCACJ,WAAW;;;;;;;KAOtC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,8BAA8B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEvE,OAAO,GAAG,CAAA;;0BAEc,mBAAmB;;GAE1C,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\nexport const emailEntityBackgroundColors = [\n '#00428B',\n '#008C80',\n '#53336F',\n '#005FA7',\n '#7C421B',\n '#BC1513',\n '#DE4342',\n '#661D34',\n '#8B479E',\n '#4B3380',\n '#10A5AC',\n '#5F67B9',\n '#1D447A',\n '#988CC4',\n '#AC1361',\n '#1B6B2E',\n '#4064B3',\n '#4D4D4D',\n '#0F5F5D',\n '#7F375B'\n];\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n emailEntityBackgroundColors[\n (Number.isFinite(variant) && variant > 0 ? variant : 0) % emailEntityBackgroundColors.length\n ],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n display: inline-block;\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledEntityList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nexport const StyledForwardedContentToggle = styled(Button)`\n align-self: flex-start;\n`;\n\nStyledEntityList.defaultProps = defaultThemeProp;\n\nexport const StyledLoadMore = styled.div(({ theme }) => {\n return css`\n margin: ${theme.base.spacing} 0;\n min-height: 2rem;\n min-width: 2rem;\n `;\n});\n\nStyledLoadMore.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenuFieldSelector = styled.div<StyledContextMenuFieldSelectorProps>(\n ({ theme, selected }) => {\n const background = selected\n ? theme.base.colors.green.medium\n : theme.base.palette['primary-background'];\n const borderColor = selected\n ? theme.base.colors.green['extra-light']\n : theme.base.palette['primary-background'];\n return css`\n background-color: ${background};\n border: 0.0625rem solid ${borderColor};\n border-radius: 100%;\n display: inline-block;\n height: 0.625rem;\n width: 0.625rem;\n background-clip: content-box;\n padding: 0.0625rem;\n `;\n }\n);\n\nStyledContextMenuFieldSelector.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenu = styled.div(({ theme }) => {\n const secondaryBackground = theme.base.palette['secondary-background'];\n\n return css`\n header {\n background-color: ${secondaryBackground};\n }\n `;\n});\nStyledContextMenu.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, FileUploadItemProps, OmitStrict, MenuProps, MenuItemProps, TooltipProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
2
|
+
import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, FileUploadItemProps, OmitStrict, MenuProps, MenuItemProps, TooltipProps, NoChildrenProp, EmptyStateProps, ProgressProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import { RichTextEditorProps } from '@pega/cosmos-react-rte';
|
|
4
4
|
export interface EmailTemplate {
|
|
5
5
|
/** Template title */
|
|
6
6
|
title: string;
|
|
7
|
-
/** Template value */
|
|
8
|
-
content: string;
|
|
9
7
|
/** Template id */
|
|
10
8
|
id: string;
|
|
11
9
|
}
|
|
@@ -27,6 +25,14 @@ export interface EntityHighlightMapping {
|
|
|
27
25
|
description?: TooltipProps['children'];
|
|
28
26
|
icon?: string;
|
|
29
27
|
}
|
|
28
|
+
export interface ContextMenuProps extends OmitStrict<MenuProps, 'onItemClick' | 'header' | 'items'> {
|
|
29
|
+
onItemClick: (selectedValue: {
|
|
30
|
+
fieldName: string;
|
|
31
|
+
fieldValue: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
heading: string;
|
|
34
|
+
items: MenuItemProps[];
|
|
35
|
+
}
|
|
30
36
|
export interface EmailProps extends BaseProps, NoChildrenProp {
|
|
31
37
|
/** Ref to the element */
|
|
32
38
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -48,6 +54,8 @@ export interface EmailProps extends BaseProps, NoChildrenProp {
|
|
|
48
54
|
subject?: string;
|
|
49
55
|
/** Body */
|
|
50
56
|
body?: string;
|
|
57
|
+
/** Forwarded content */
|
|
58
|
+
forwardedContent?: string;
|
|
51
59
|
/**
|
|
52
60
|
* Entity highlight mapping
|
|
53
61
|
* This requires body to be passed as a string with html tags
|
|
@@ -71,6 +79,8 @@ export interface EmailProps extends BaseProps, NoChildrenProp {
|
|
|
71
79
|
unRead?: boolean;
|
|
72
80
|
/** Attachments list */
|
|
73
81
|
attachments?: FileDisplayProps[];
|
|
82
|
+
/** Items list in Popover */
|
|
83
|
+
contextMenu?: ContextMenuProps;
|
|
74
84
|
}
|
|
75
85
|
export interface EmailConversationProps extends BaseProps {
|
|
76
86
|
/** ref to the element */
|
|
@@ -110,6 +120,8 @@ export interface EmailDirectRecipients {
|
|
|
110
120
|
forward?: EmailUser['emailAddress'][];
|
|
111
121
|
}
|
|
112
122
|
export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>, BaseProps, NoChildrenProp {
|
|
123
|
+
/** Show loader until the background process completes */
|
|
124
|
+
progress?: boolean | Pick<ProgressProps, 'message'>;
|
|
113
125
|
/** Object containing full list of email participants. */
|
|
114
126
|
participants: EmailUser[];
|
|
115
127
|
/** Object to hold initial to address/addresses based on different action types. */
|
|
@@ -122,8 +134,8 @@ export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'su
|
|
|
122
134
|
subject: string;
|
|
123
135
|
/** Body content of the email */
|
|
124
136
|
bodyContent: string;
|
|
125
|
-
/**
|
|
126
|
-
|
|
137
|
+
/** Template id to select the initial template */
|
|
138
|
+
defaultTemplateId?: EmailTemplate['id'];
|
|
127
139
|
/** Callback when email needs to be sent */
|
|
128
140
|
onSend: (data: EmailComposerData) => void;
|
|
129
141
|
/** Callback when image is added */
|
|
@@ -133,7 +145,9 @@ export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'su
|
|
|
133
145
|
/** Region to show more actions in footer */
|
|
134
146
|
footerMoreActions?: ReactNode;
|
|
135
147
|
/** Templates for drafting email */
|
|
136
|
-
templates?: EmailTemplate[];
|
|
148
|
+
templates?: Pick<EmailTemplate, 'id' | 'title'>[];
|
|
149
|
+
/** Template change callback */
|
|
150
|
+
onTemplateChange?: (id: EmailTemplate['id']) => string | Promise<string>;
|
|
137
151
|
/** Callback when cancel composing */
|
|
138
152
|
onCancel: () => void;
|
|
139
153
|
/**
|
|
@@ -171,7 +185,7 @@ export interface EmailSummaryItemProps extends BaseProps {
|
|
|
171
185
|
/** Timestamp of the latest email */
|
|
172
186
|
timeStamp: Date | string | number;
|
|
173
187
|
/** Top topic of an email */
|
|
174
|
-
topic
|
|
188
|
+
topic?: string;
|
|
175
189
|
/** Sentiment */
|
|
176
190
|
sentiment?: SentimentProps;
|
|
177
191
|
/** Urgency of an email */
|
|
@@ -216,14 +230,30 @@ export interface EmailSummaryListProps extends BaseProps {
|
|
|
216
230
|
onFilterChange?: (filterId: Filter['id'], on: boolean) => void;
|
|
217
231
|
/** onClick of list item */
|
|
218
232
|
onItemClick: (id: EmailSummaryItemProps['id']) => void;
|
|
233
|
+
/** Indicates if the data is being currently loading */
|
|
234
|
+
loading?: boolean;
|
|
235
|
+
/** Callback to fetch more rows */
|
|
236
|
+
onLoadMore?: () => void;
|
|
219
237
|
/** ref to the element */
|
|
220
238
|
ref?: Ref<HTMLDivElement>;
|
|
239
|
+
/** Empty message when there are no email summary items */
|
|
240
|
+
emptyMessage?: EmptyStateProps['message'];
|
|
221
241
|
}
|
|
222
242
|
export interface EmailEntityProps extends BaseProps {
|
|
223
243
|
entity: EntityHighlightMapping;
|
|
224
244
|
ref?: Ref<HTMLElement>;
|
|
225
245
|
}
|
|
226
|
-
export interface
|
|
246
|
+
export interface TargetProps {
|
|
247
|
+
cursorPosition: {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
};
|
|
251
|
+
targetNode: Node | null;
|
|
252
|
+
}
|
|
253
|
+
export interface ContextMenuPopoverProps extends BaseProps, TargetProps {
|
|
254
|
+
contextMenu: ContextMenuProps;
|
|
255
|
+
}
|
|
256
|
+
export interface EntityListProps extends BaseProps {
|
|
227
257
|
content: {
|
|
228
258
|
name: string;
|
|
229
259
|
value?: {
|
|
@@ -237,4 +267,7 @@ export interface ViewAnalysisProps extends BaseProps {
|
|
|
237
267
|
};
|
|
238
268
|
ref?: Ref<HTMLDivElement>;
|
|
239
269
|
}
|
|
270
|
+
export interface StyledContextMenuFieldSelectorProps extends BaseProps {
|
|
271
|
+
selected?: boolean;
|
|
272
|
+
}
|
|
240
273
|
//# sourceMappingURL=Email.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EA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C,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,uBAAwB,SAAQ,SAAS,EAAE,WAAW;IACrE,WAAW,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE;YACN,EAAE,EAAE,MAAM,CAAC;YACX,MAAM,EAAE,sBAAsB,CAAC;SAChC,EAAE,CAAC;KACL,EAAE,CAAC;IAEJ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,mCAAoC,SAAQ,SAAS;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template
|
|
1
|
+
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp,\n EmptyStateProps,\n ProgressProps\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template id */\n id: string;\n}\n\nexport interface EmailUser {\n /** Short name of the User */\n shortName: string;\n /** Full name of the User */\n fullName: string;\n /** Email of the User */\n emailAddress: string;\n /** Avatar props of the User */\n avatarProps?: Partial<AvatarProps>;\n}\n\nexport interface EntityHighlightMapping {\n value: string;\n type: string;\n name: string;\n variant: number;\n description?: TooltipProps['children'];\n icon?: string;\n}\n\nexport interface ContextMenuProps\n extends OmitStrict<MenuProps, 'onItemClick' | 'header' | 'items'> {\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n heading: string;\n items: MenuItemProps[];\n}\nexport interface EmailProps extends BaseProps, NoChildrenProp {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | number | string;\n /** From email */\n from: EmailUser;\n /** To email */\n to: EmailUser[];\n /** Carbon copy of email users list */\n cc?: EmailUser[];\n /** Blind carbon copy of email users list */\n bcc?: EmailUser[];\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Subject of the email */\n subject?: string;\n /** Body */\n body?: string;\n /** Forwarded content */\n forwardedContent?: string;\n /**\n * Entity highlight mapping\n * This requires body to be passed as a string with html tags\n */\n entityHighlightMapping?: EntityHighlightMapping[];\n /** onReply callback */\n onReply: (id: EmailProps['id']) => void;\n /** onForward Callback */\n onForward: (id: EmailProps['id']) => void;\n /** onReply callback */\n onReplyAll?: (id: EmailProps['id']) => void;\n /** List of suggestions */\n suggestions?: EmailTemplate[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: EmailTemplate['id']) => void;\n /** Actions region */\n actions?: ReactNode;\n /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /** Items list in Popover */\n contextMenu?: ContextMenuProps;\n}\n\nexport interface EmailConversationProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\n /** Unique ID for this email conversation record */\n id: string;\n /** List of mails */\n emails: EmailProps[];\n /** Sender(s) of this email conversation */\n from: EmailUser;\n /** Recipient(s) of this email conversation */\n to: EmailUser[];\n /** Count of unread emails */\n unReadEmailCount?: number;\n /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | string | number;\n /** Flag that indicates if email conversation is expanded */\n isCollapsed?: boolean;\n /** Flag to set if conversation is spun off from forwarded email */\n isForwarded?: boolean;\n /** Callback when email conversation is collapsed */\n onCollapse?: () => void;\n /** Callback when email conversation is expanded */\n onExpand?: () => void;\n}\n\nexport interface EmailComposerData\n extends Pick<\n EmailComposerProps,\n 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments' | 'responseType'\n > {\n /** Array to hold the initial participants that should be default initialized in To address. */\n to: EmailUser['emailAddress'][];\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport interface EmailDirectRecipients {\n /** To address/addresses in case of reply response type on email. */\n reply: EmailUser['emailAddress'][];\n /** To address/addresses in case of replyAll response type on email. */\n replyAll: EmailUser['emailAddress'][];\n /** To address/addresses in case of forward response type on email. */\n forward?: EmailUser['emailAddress'][];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>,\n BaseProps,\n NoChildrenProp {\n /** Show loader until the background process completes */\n progress?: boolean | Pick<ProgressProps, 'message'>;\n /** Object containing full list of email participants. */\n participants: EmailUser[];\n /** Object to hold initial to address/addresses based on different action types. */\n to?: EmailDirectRecipients;\n /** Array to hold the initial participants that should be default initialized in Cc address. */\n cc?: EmailUser['emailAddress'][];\n /** Array to hold the initial participants that should be default initialized in Bcc address. */\n bcc?: EmailUser['emailAddress'][];\n /** Object containing the props to render the subject input */\n subject: string;\n /** Body content of the email */\n bodyContent: string;\n /** Template id to select the initial template */\n defaultTemplateId?: EmailTemplate['id'];\n /** Callback when email needs to be sent */\n onSend: (data: EmailComposerData) => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: Pick<EmailTemplate, 'id' | 'title'>[];\n /** Template change callback */\n onTemplateChange?: (id: EmailTemplate['id']) => string | Promise<string>;\n /** Callback when cancel composing */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation\n * If returned true considers the entry to be a valid entry\n */\n externalValidator?: (value: string) => boolean;\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Email action types */\n responseType?: EmailResponseType;\n}\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n\nexport interface EmailSummaryItemProps extends BaseProps {\n /** Id of each summary item */\n id: string;\n /** List of from participant names of the conversations */\n activeParticipants: EmailUser[];\n /** Email body of last email in the email */\n message: string;\n /** Timestamp of the latest email */\n timeStamp: Date | string | number;\n /** Top topic of an email */\n topic?: string;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Urgency of an email */\n urgency?: number;\n /** Total number of unread emails in the email */\n unreadEmailCount?: number;\n /** Is the email currently active */\n active?: boolean;\n /** On click of email item */\n onClick: MouseEventHandler;\n /** ref to the element */\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface Filter {\n /** Sets DOM id for the control and associates label element via 'for' attribute. */\n id: string;\n /** Pass a string or a fragment with an Icon and string for the filter label. */\n label: ReactNode;\n /**\n * Disables the filter.\n * @default false\n */\n disabled?: boolean;\n /**\n * Sets on prop via onFilterChange.\n * @default false\n */\n on?: boolean;\n}\n\nexport interface EmailSummaryListProps extends BaseProps {\n /** List of email categories */\n categories: MenuProps['items'];\n /** Handles category change */\n onCategoryClick?: MenuItemProps['onClick'];\n /** List of EmailItems items */\n items: OmitStrict<EmailSummaryItemProps, 'onClick' | 'active'>[];\n /** Total number of unread email count */\n unreadEmailCount?: number;\n /** A set of filters to apply to the email inbox. */\n filters?: Filter[];\n /** A callback that runs when a filter is clicked. */\n onFilterChange?: (filterId: Filter['id'], on: boolean) => void;\n /** onClick of list item */\n onItemClick: (id: EmailSummaryItemProps['id']) => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Empty message when there are no email summary items */\n emptyMessage?: EmptyStateProps['message'];\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: EntityHighlightMapping;\n ref?: Ref<HTMLElement>;\n}\n\nexport interface TargetProps {\n cursorPosition: { x: number; y: number };\n targetNode: Node | null;\n}\n\nexport interface ContextMenuPopoverProps extends BaseProps, TargetProps {\n contextMenu: ContextMenuProps;\n}\n\nexport interface EntityListProps extends BaseProps {\n content: {\n name: string;\n value?: {\n id: string;\n entity: EntityHighlightMapping;\n }[];\n }[];\n\n header: {\n icon: string;\n text: string;\n };\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface StyledContextMenuFieldSelectorProps extends BaseProps {\n selected?: boolean;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { Icon } from '@pega/cosmos-react-core';
|
|
3
3
|
import { EmailComposerProps } from './Email.types';
|
|
4
|
-
export declare const StyledEmailComposer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
4
|
+
export declare const StyledEmailComposer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, EmailComposerProps, never>;
|
|
5
5
|
export declare const StyledResponseTypeIcon: typeof Icon;
|
|
6
6
|
export declare const StyledToggleButton: import("styled-components").StyledComponent<FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
declare const EmailComposer: FunctionComponent<EmailComposerProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAGL,IAAI,EAYL,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,kBAAkB,EAA4B,MAAM,eAAe,CAAC;AAK7E,eAAO,MAAM,mBAAmB,yHAW9B,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,OAAO,IAI1C,CAAC;AAIH,eAAO,MAAM,kBAAkB,qNAK7B,CAAC;AAkBH,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CA6VxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -2,17 +2,27 @@ import { createElement as _createElement } from "react";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useState, useMemo, useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { stripUnit } from 'polished';
|
|
6
|
+
import { Button, Flex, Icon, registerIcon, useI18n, Option, defaultThemeProp, FileUploadItem, MenuButton, Select, Input, useUID, Progress } from '@pega/cosmos-react-core';
|
|
7
|
+
import { Editor } from '@pega/cosmos-react-rte';
|
|
7
8
|
import * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';
|
|
8
9
|
import * as replyAllIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply-all.icon';
|
|
9
10
|
import * as replyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply.icon';
|
|
10
11
|
import * as forwardIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/forward.icon';
|
|
11
12
|
import EmailSelector from './EmailSelector';
|
|
12
13
|
registerIcon(paperClipIcon, replyAllIcon, replyIcon, forwardIcon);
|
|
13
|
-
export const StyledEmailComposer = styled.div
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
export const StyledEmailComposer = styled.div(({ progress }) => {
|
|
15
|
+
return css `
|
|
16
|
+
max-height: 70vh;
|
|
17
|
+
${progress
|
|
18
|
+
? css `
|
|
19
|
+
visibility: hidden;
|
|
20
|
+
`
|
|
21
|
+
: css `
|
|
22
|
+
visibility: visible;
|
|
23
|
+
`}
|
|
24
|
+
`;
|
|
25
|
+
});
|
|
16
26
|
export const StyledResponseTypeIcon = styled(Icon)(({ theme }) => {
|
|
17
27
|
return css `
|
|
18
28
|
color: ${theme.base.palette.interactive};
|
|
@@ -31,24 +41,21 @@ const responseTypeIcons = {
|
|
|
31
41
|
replyAll: 'reply-all',
|
|
32
42
|
forward: 'forward'
|
|
33
43
|
};
|
|
34
|
-
const
|
|
44
|
+
const editorToolbar = [
|
|
35
45
|
'inline-styling',
|
|
36
|
-
'headers',
|
|
37
46
|
'lists',
|
|
47
|
+
'indentation',
|
|
38
48
|
'images',
|
|
39
|
-
'
|
|
40
|
-
'indentation'
|
|
49
|
+
'links'
|
|
41
50
|
];
|
|
42
|
-
const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend, onImageAdded, externalValidator, to, footerMoreActions, templates,
|
|
51
|
+
const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend, onImageAdded, externalValidator, onTemplateChange, to, footerMoreActions, progress = false, templates, defaultTemplateId, cc, bcc, responseType: responseTypeProp, subject: subjectProp, attachments: attachmentsProp, ...restProps }, ref) => {
|
|
43
52
|
const t = useI18n();
|
|
44
|
-
const [
|
|
45
|
-
const [
|
|
46
|
-
const [
|
|
47
|
-
const [
|
|
48
|
-
const [
|
|
49
|
-
const [
|
|
50
|
-
const [autoReplyTemplate, setAutoReplyTemplate] = useState(defaultTemplate || '');
|
|
51
|
-
const [attachments, setAttachments] = useState(restProps.attachments || []);
|
|
53
|
+
const [responseType, setResponseType] = useState(responseTypeProp);
|
|
54
|
+
const [showCC, setShowCC] = useState(responseTypeProp !== 'reply' && !!cc && cc.length > 0);
|
|
55
|
+
const [showBCC, setShowBCC] = useState(responseTypeProp !== 'reply' && !!bcc && bcc.length > 0);
|
|
56
|
+
const [subject, setSubject] = useState(subjectProp);
|
|
57
|
+
const [autoReplyTemplate, setAutoReplyTemplate] = useState(defaultTemplateId || '');
|
|
58
|
+
const [attachments, setAttachments] = useState(attachmentsProp || []);
|
|
52
59
|
const [toAddresses, setToAddresses] = useState(() => {
|
|
53
60
|
if (responseType && to?.[responseType])
|
|
54
61
|
return to?.[responseType];
|
|
@@ -64,44 +71,54 @@ const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend,
|
|
|
64
71
|
return bcc;
|
|
65
72
|
return [];
|
|
66
73
|
});
|
|
67
|
-
const
|
|
68
|
-
const initialBCC = bcc;
|
|
69
|
-
const rteEditorRef = useRef(null);
|
|
74
|
+
const editorRef = useRef(null);
|
|
70
75
|
const fileUploadInputRef = useRef(null);
|
|
71
76
|
const uid = useUID();
|
|
77
|
+
const replaceBodyWithTemplate = async (templateId) => {
|
|
78
|
+
if (templateId && onTemplateChange) {
|
|
79
|
+
const templateContent = await onTemplateChange(templateId);
|
|
80
|
+
editorRef?.current?.insertHtml(templateContent, true);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
72
83
|
// inserts selected template in RTE
|
|
73
84
|
useEffect(() => {
|
|
74
|
-
const selectedTemplate = templates?.find(template => template.
|
|
85
|
+
const selectedTemplate = templates?.find(template => template.id === autoReplyTemplate);
|
|
75
86
|
if (selectedTemplate) {
|
|
76
|
-
|
|
87
|
+
replaceBodyWithTemplate(selectedTemplate.id);
|
|
77
88
|
}
|
|
78
89
|
}, [autoReplyTemplate]);
|
|
79
90
|
// resets To | CC | BCC combobox selection and toggles fields on responseType change reply | replyAll | forward
|
|
80
91
|
useEffect(() => {
|
|
92
|
+
if (responseType && to?.[responseType]) {
|
|
93
|
+
setToAddresses(to?.[responseType]);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setToAddresses([]);
|
|
97
|
+
}
|
|
81
98
|
setShowCC(responseType === 'replyAll' ? !!cc && cc.length > 0 : false);
|
|
82
|
-
setShowBCC(responseType === 'replyAll'
|
|
99
|
+
setShowBCC(responseType === 'replyAll' ? !!bcc && bcc.length > 0 : false);
|
|
83
100
|
if (responseType === 'replyAll') {
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
setCcAddresses(cc || []);
|
|
102
|
+
setBccAddresses(bcc || []);
|
|
86
103
|
}
|
|
87
|
-
if (responseType === 'reply') {
|
|
104
|
+
else if (responseType === 'reply') {
|
|
88
105
|
setCcAddresses([]);
|
|
89
106
|
setBccAddresses([]);
|
|
90
107
|
}
|
|
91
108
|
}, [responseType]);
|
|
92
109
|
const templateOptions = useMemo(() => templates &&
|
|
93
110
|
templates.map(template => {
|
|
94
|
-
if (template.
|
|
95
|
-
_jsx(Option, { selected: 'selected', children: template.title }, template.id);
|
|
111
|
+
if (template.id === defaultTemplateId) {
|
|
112
|
+
_jsx(Option, { selected: 'selected', value: template.id, children: template.title }, template.id);
|
|
96
113
|
}
|
|
97
|
-
return _jsx(Option, { children: template.title }, template.id);
|
|
114
|
+
return (_jsx(Option, { value: template.id, children: template.title }, template.id));
|
|
98
115
|
}), [templates]);
|
|
99
116
|
const responseTypeMenuData = useMemo(() => {
|
|
100
117
|
const menuItems = [
|
|
101
118
|
{
|
|
102
119
|
id: 'reply',
|
|
103
120
|
primary: t('reply'),
|
|
104
|
-
visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.reply }
|
|
121
|
+
visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.reply }),
|
|
105
122
|
selected: responseType === 'reply',
|
|
106
123
|
onClick: () => {
|
|
107
124
|
setResponseType('reply');
|
|
@@ -110,7 +127,7 @@ const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend,
|
|
|
110
127
|
{
|
|
111
128
|
id: 'replyAll',
|
|
112
129
|
primary: t('reply_all'),
|
|
113
|
-
visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.replyAll }
|
|
130
|
+
visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.replyAll }),
|
|
114
131
|
selected: responseType === 'replyAll',
|
|
115
132
|
onClick: () => {
|
|
116
133
|
setResponseType('replyAll');
|
|
@@ -126,7 +143,7 @@ const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend,
|
|
|
126
143
|
const onSubjectChange = useCallback((e) => {
|
|
127
144
|
setSubject(e.target.value);
|
|
128
145
|
}, []);
|
|
129
|
-
const
|
|
146
|
+
const onTemplateSelectionChange = useCallback((e) => {
|
|
130
147
|
setAutoReplyTemplate(e.target.value);
|
|
131
148
|
}, []);
|
|
132
149
|
const onAttachmentDelete = useCallback((name) => {
|
|
@@ -143,15 +160,15 @@ const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend,
|
|
|
143
160
|
]);
|
|
144
161
|
}
|
|
145
162
|
}, []);
|
|
146
|
-
const
|
|
163
|
+
const updateSelectedItems = (selectedItems, label) => {
|
|
147
164
|
if (label === 'To') {
|
|
148
|
-
setToAddresses(
|
|
165
|
+
setToAddresses(selectedItems);
|
|
149
166
|
}
|
|
150
167
|
if (label === 'Cc') {
|
|
151
|
-
setCcAddresses(
|
|
168
|
+
setCcAddresses(selectedItems);
|
|
152
169
|
}
|
|
153
170
|
if (label === 'Bcc') {
|
|
154
|
-
setBccAddresses(
|
|
171
|
+
setBccAddresses(selectedItems);
|
|
155
172
|
}
|
|
156
173
|
};
|
|
157
174
|
const handleSend = () => {
|
|
@@ -160,33 +177,39 @@ const EmailComposer = forwardRef(({ participants, bodyContent, onCancel, onSend,
|
|
|
160
177
|
cc: showCC ? ccAddresses : undefined,
|
|
161
178
|
bcc: showBCC ? bccAddresses : undefined,
|
|
162
179
|
subject,
|
|
163
|
-
bodyContent:
|
|
180
|
+
bodyContent: editorRef.current?.getHtml() || '',
|
|
164
181
|
attachments,
|
|
165
182
|
responseType
|
|
166
183
|
});
|
|
167
184
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}, children: [_jsx(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
const handleImageAdded = (image, id) => {
|
|
186
|
+
const src = URL.createObjectURL(image);
|
|
187
|
+
editorRef.current?.appendImage({ src, alt: image.name }, id);
|
|
188
|
+
if (onImageAdded)
|
|
189
|
+
onImageAdded(image, id);
|
|
190
|
+
};
|
|
191
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: StyledEmailComposer, ref: ref, ...restProps, container: {
|
|
192
|
+
gap: 2,
|
|
193
|
+
direction: 'column'
|
|
194
|
+
}, progress: !!progress, children: [_jsx("div", { children: responseType !== 'forward' && (_jsx(MenuButton, { text: responseTypeMenuData.selectedResponseType, variant: 'link', icon: responseTypeMenuData.selectedResponseTypeIcon, menu: {
|
|
195
|
+
mode: 'single-select',
|
|
196
|
+
items: responseTypeMenuData.menuItems
|
|
197
|
+
} })) }), _jsxs(Flex, { container: {
|
|
198
|
+
alignItems: 'start',
|
|
199
|
+
gap: 0.5
|
|
200
|
+
}, children: [_jsx(Flex, { container: {
|
|
201
|
+
gap: 1,
|
|
202
|
+
direction: 'column'
|
|
203
|
+
}, item: {
|
|
204
|
+
grow: 1
|
|
205
|
+
}, children: _jsx(EmailSelector, { participants: participants, selectedItems: toAddresses, label: t('to'), mode: 'multi-select', required: true, onSelectedItemChange: updateSelectedItems, externalValidator: externalValidator }) }), !showCC && (_jsx(StyledToggleButton, { variant: 'simple', onClick: () => setShowCC(true), icon: true, children: t('cc') })), !showBCC && (_jsx(StyledToggleButton, { variant: 'simple', onClick: () => setShowBCC(true), icon: true, children: t('bcc') }))] }), showCC && (_jsx(EmailSelector, { participants: participants, selectedItems: ccAddresses, label: t('cc'), mode: 'multi-select', onSelectedItemChange: updateSelectedItems, externalValidator: externalValidator })), showBCC && (_jsx(EmailSelector, { participants: participants, selectedItems: bccAddresses, label: t('bcc'), mode: 'multi-select', onSelectedItemChange: updateSelectedItems, externalValidator: externalValidator })), _jsx(Input, { value: subject, onChange: onSubjectChange, label: t('subject') }), _jsxs(Select, { onChange: onTemplateSelectionChange, label: t('auto_reply'), value: autoReplyTemplate, children: [_jsx(Option, { value: uid, children: t('insert') }, uid), _jsx(_Fragment, { children: templateOptions })] }), _jsx(Editor, { autoFocus: true, ref: editorRef, toolbar: editorToolbar, onImageAdded: handleImageAdded, labelHidden: true, label: t('email_message'), defaultValue: bodyContent,
|
|
206
|
+
// Below rem values are derived from min 150px, max 300px minus the approx height of toolbar
|
|
207
|
+
height: {
|
|
208
|
+
min: stripUnit('7rem') * 16,
|
|
209
|
+
max: stripUnit('16.5rem') * 16
|
|
210
|
+
} }), attachments.length > 0 && (_jsx(Flex, { container: { gap: 1, wrap: 'wrap' }, children: attachments.map(attachment => (_createElement(FileUploadItem, { ...attachment, key: attachment.name, onDelete: onAttachmentDelete }))) })), _jsxs(Flex, { container: {
|
|
211
|
+
gap: 1
|
|
212
|
+
}, children: [_jsxs(Flex, { container: true, item: { grow: 1 }, children: [_jsx(Button, { variant: 'secondary', onClick: onCancel, children: t('cancel') }), footerMoreActions] }), _jsxs(Flex, { container: true, children: [_jsx(Button, { onClick: () => fileUploadInputRef.current?.click(), variant: 'link', label: t('file_upload_text_multiple'), children: _jsx(Icon, { name: 'paper-clip' }) }), _jsx(Button, { variant: 'primary', onClick: handleSend, children: t('send_label') })] })] }), _jsx("input", { type: 'file', style: { display: 'none' }, ref: fileUploadInputRef, onChange: onFileChange, multiple: true })] }), _jsx(Progress, { visible: !!progress, placement: 'local', message: typeof progress === 'object' ? progress.message : t('loading') })] }));
|
|
190
213
|
});
|
|
191
214
|
export default EmailComposer;
|
|
192
215
|
//# sourceMappingURL=EmailComposer.js.map
|