@pega/cosmos-react-social 3.0.0-rc.3 → 3.0.0-rc.4
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/Message.styles.d.ts.map +1 -1
- package/lib/components/Chat/Message.styles.js +8 -5
- package/lib/components/Chat/Message.styles.js.map +1 -1
- package/lib/components/Email/Email.types.d.ts +1 -1
- 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/EntityList.d.ts.map +1 -1
- package/lib/components/Email/EntityList.js +3 -3
- package/lib/components/Email/EntityList.js.map +1 -1
- package/lib/components/Feed/Feed.context.d.ts +1 -0
- package/lib/components/Feed/Feed.context.d.ts.map +1 -1
- package/lib/components/Feed/Feed.context.js.map +1 -1
- package/lib/components/Feed/FeedPost.d.ts.map +1 -1
- package/lib/components/Feed/FeedPost.js +4 -2
- package/lib/components/Feed/FeedPost.js.map +1 -1
- package/lib/components/MentionButton/MentionButton.d.ts.map +1 -1
- package/lib/components/MentionButton/MentionButton.js +1 -1
- package/lib/components/MentionButton/MentionButton.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,0BAA0B,yGAAe,CAAC;AAEvD,eAAO,MAAM,eAAe,wGAAc,CAAC;AAE3C,eAAO,MAAM,mBAAmB,wGAAc,CAAC;AAE/C,eAAO,MAAM,iBAAiB,yGAAe,CAAC;AAE9C,eAAO,MAAM,oBAAoB,yGAAe,CAAC;AAEjD,eAAO,MAAM,eAAe,uGAAa,CAAC;AAE1C,eAAO,MAAM,iBAAiB,0QAAuB,CAAC;AAEtD,eAAO,MAAM,iBAAiB,yGAAe,CAAC;AAE9C,eAAO,MAAM,mBAAmB,yGAAe,CAAC;AAEhD,eAAO,MAAM,uBAA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,uBAAuB,yGAAe,CAAC;AAEpD,UAAU,2BAA2B;IACnC,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IACzC,gBAAgB,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,sBAAsB,kIA4KlC,CAAC;AAEF,UAAU,sBAAsB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,6HAiB5B,CAAC;AAGH,eAAO,MAAM,qBAAqB,mOAajC,CAAC"}
|
|
@@ -25,10 +25,13 @@ export const StyledMessageContainer = styled.div(({ messageDirection, variant, h
|
|
|
25
25
|
const statusForegroundColor = status === 'undelivered' ? urgent : metaForegroundColor;
|
|
26
26
|
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
27
27
|
return css `
|
|
28
|
-
${messageDirection === 'out'
|
|
29
|
-
css `
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
${messageDirection === 'out'
|
|
29
|
+
? css `
|
|
30
|
+
padding-inline-start: calc(4 * ${spacing});
|
|
31
|
+
`
|
|
32
|
+
: css `
|
|
33
|
+
padding-inline-end: calc(4 * ${spacing});
|
|
34
|
+
`}
|
|
32
35
|
margin-block-end: ${typing ? spacing : '0'};
|
|
33
36
|
${StyledMessageMain} {
|
|
34
37
|
max-width: 90%;
|
|
@@ -50,7 +53,6 @@ export const StyledMessageContainer = styled.div(({ messageDirection, variant, h
|
|
|
50
53
|
${messageDirection === 'in' &&
|
|
51
54
|
css `
|
|
52
55
|
border-radius: ${borderRadius} calc(3 * ${borderRadius}) calc(3 * ${borderRadius});
|
|
53
|
-
padding-inline-end: calc(4 * ${spacing});
|
|
54
56
|
`}
|
|
55
57
|
|
|
56
58
|
> ${StyledMessageBubbleContent} {
|
|
@@ -188,6 +190,7 @@ export const StyledBlinkingDot = styled.div(({ delay = 0, theme }) => {
|
|
|
188
190
|
StyledBlinkingDot.defaultProps = defaultThemeProp;
|
|
189
191
|
export const StyledUndeliveredIcon = styled(Icon)(({ theme: { base: { palette: { urgent } } } }) => {
|
|
190
192
|
return css `
|
|
193
|
+
flex-shrink: 0;
|
|
191
194
|
color: ${urgent};
|
|
192
195
|
`;
|
|
193
196
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.styles.js","sourceRoot":"","sources":["../../../src/components/Chat/Message.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAA,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9C,MAAM,CAA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,EACpB,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;eACC,MAAM;KAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport {\n defaultThemeProp,\n tryCatch,\n Icon,\n StyledText,\n calculateFontSize\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nexport const StyledMessageBubbleContent = styled.div``;\n\nexport const StyledMediaList = styled.ul``;\n\nexport const StyledMediaListItem = styled.li``;\n\nexport const StyledSummaryItem = styled.div``;\n\nexport const StyledMediaThumbNail = styled.img``;\n\nexport const StyledMediaLink = styled.a``;\n\nexport const StyledMediaButton = styled(BareButton)``;\n\nexport const StyledMessageMain = styled.div``;\n\nexport const StyledMessageBubble = styled.div``;\n\nexport const StyledMetaInfoContainer = styled.div``;\n\nexport const StyledMetaInfo = styled.span``;\n\nexport const StyledStatusInfo = styled.span``;\n\nexport const StyledTypingIndicator = styled.div``;\n\nexport const StyledMessageHeader = styled.header``;\nexport const StyledMessageHeaderContent = styled.div``;\nexport const StyledMessageHeaderMeta = styled.div``;\n\ninterface StyledMessageContainerProps {\n variant: 'sender' | 'receiver' | 'other';\n messageDirection: 'in' | 'out' | string;\n typing: boolean;\n hasMessage: boolean;\n status: string;\n}\n\nexport const StyledMessageContainer = styled.div<StyledMessageContainerProps>(\n ({\n messageDirection,\n variant,\n hasMessage,\n typing,\n status,\n theme,\n theme: {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'border-radius': borderRadius,\n spacing,\n palette: {\n 'foreground-color': foregroundColor,\n 'secondary-background': secondaryBackground,\n urgent\n },\n transparency: { 'transparent-2': foregroundAlpha }\n }\n }\n }) => {\n const messageHeaderTheme = theme.components.chat.messageBubble[variant].header;\n const messageContentTheme = theme.components.chat.messageBubble[variant].content;\n const metaForegroundColor = tryCatch(() => rgba(foregroundColor, foregroundAlpha));\n const statusForegroundColor = status === 'undelivered' ? urgent : metaForegroundColor;\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n ${messageDirection === 'out' &&\n css`\n padding-inline-start: calc(4 * ${spacing});\n `}\n margin-block-end: ${typing ? spacing : '0'};\n ${StyledMessageMain} {\n max-width: 90%;\n }\n ${StyledMessageBubble} {\n background: ${messageContentTheme['background-color']};\n border-radius: calc(3 * ${borderRadius}) ${borderRadius} calc(3 * ${borderRadius})\n calc(3 * ${borderRadius});\n overflow: hidden;\n color: ${messageContentTheme['foreground-color']};\n display: inline-block;\n width: auto;\n margin-block-end: calc(0.5 * ${spacing});\n\n label {\n color: inherit;\n }\n\n ${messageDirection === 'in' &&\n css`\n border-radius: ${borderRadius} calc(3 * ${borderRadius}) calc(3 * ${borderRadius});\n padding-inline-end: calc(4 * ${spacing});\n `}\n\n > ${StyledMessageBubbleContent} {\n padding: ${spacing} calc(2 * ${spacing});\n word-break: break-word;\n white-space: pre-wrap;\n position: relative;\n }\n\n > ${StyledMediaList} {\n color: ${messageContentTheme['foreground-color']};\n max-width: 100%;\n\n > ${StyledMediaListItem} {\n position: relative;\n ${StyledMediaThumbNail} {\n max-height: 12rem;\n width: 100%;\n object-fit: contain;\n background-color: ${secondaryBackground};\n }\n ${StyledSummaryItem} {\n padding: ${spacing} calc(3 * ${spacing});\n font-size: ${fontSizes.xxs};\n margin-block-start: calc(0.5 * ${spacing});\n }\n ${StyledSummaryItem}::before {\n content: '';\n padding: ${spacing} 0;\n border-top: 0.0625rem solid ${messageContentTheme['foreground-color']};\n position: absolute;\n width: calc(100% - 2rem);\n left: 1rem;\n top: 0;\n }\n ${StyledMediaThumbNail} + ${StyledSummaryItem}::before {\n content: none;\n }\n svg {\n font-size: 1.6rem;\n }\n ${StyledText} {\n color: ${foregroundColor};\n }\n }\n\n ${!hasMessage &&\n css`\n > ${StyledMediaListItem}:first-child {\n > ${StyledSummaryItem}::before {\n border-top: none;\n }\n }\n `}\n }\n\n ${StyledMessageHeader} {\n padding: ${spacing} calc(2 * ${spacing});\n color: ${messageHeaderTheme['foreground-color']};\n background-color: ${messageHeaderTheme['background-color']};\n }\n\n ${StyledMessageHeaderContent} {\n color: ${messageHeaderTheme['foreground-color']};\n margin-inline-end: ${spacing};\n }\n ${StyledMessageHeaderMeta} {\n > a {\n color: ${messageHeaderTheme['foreground-color']};\n }\n }\n\n ${StyledMediaLink}, ${StyledMediaButton} {\n color: ${messageContentTheme['foreground-color']};\n font-size: inherit;\n text-decoration: none;\n font-weight: 700;\n overflow-x: hidden;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n max-width: 100%;\n &:hover {\n color: ${messageContentTheme['foreground-color']};\n text-decoration: underline;\n }\n &:visited {\n color: ${messageContentTheme['foreground-color']};\n }\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n\n ${StyledMetaInfoContainer} {\n width: 100%;\n padding: 0 ${spacing};\n ${StyledMetaInfo}, ${StyledStatusInfo} {\n margin-block-end: ${spacing};\n font-size: 0.7rem;\n color: ${metaForegroundColor};\n }\n ${StyledStatusInfo} {\n color: ${statusForegroundColor};\n }\n }\n ${StyledTypingIndicator} {\n width: 4.5rem;\n position: relative;\n height: 2rem;\n }\n `;\n }\n);\nStyledMessageContainer.defaultProps = defaultThemeProp;\ninterface StyledBlinkingDotProps {\n delay?: number;\n}\n\nexport const StyledBlinkingDot = styled.div<StyledBlinkingDotProps>(({ delay = 0, theme }) => {\n return css`\n @keyframes Blinking {\n 0% {\n background: ${theme.base.colors.gray.medium};\n }\n 100% {\n background: ${theme.base.colors.gray['extra-light']};\n }\n }\n animation: Blinking calc(4 * ${theme.base.animation.speed}) infinite;\n background: ${theme.base.colors.gray['extra-light']};\n border-radius: 50%;\n animation-delay: ${delay}s;\n height: 0.4rem;\n width: 0.4rem;\n `;\n});\nStyledBlinkingDot.defaultProps = defaultThemeProp;\n\nexport const StyledUndeliveredIcon = styled(Icon)(\n ({\n theme: {\n base: {\n palette: { urgent }\n }\n }\n }) => {\n return css`\n color: ${urgent};\n `;\n }\n);\n\nStyledUndeliveredIcon.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Message.styles.js","sourceRoot":"","sources":["../../../src/components/Chat/Message.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAElF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAA,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAA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AC,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport {\n defaultThemeProp,\n tryCatch,\n Icon,\n StyledText,\n calculateFontSize\n} from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nexport const StyledMessageBubbleContent = styled.div``;\n\nexport const StyledMediaList = styled.ul``;\n\nexport const StyledMediaListItem = styled.li``;\n\nexport const StyledSummaryItem = styled.div``;\n\nexport const StyledMediaThumbNail = styled.img``;\n\nexport const StyledMediaLink = styled.a``;\n\nexport const StyledMediaButton = styled(BareButton)``;\n\nexport const StyledMessageMain = styled.div``;\n\nexport const StyledMessageBubble = styled.div``;\n\nexport const StyledMetaInfoContainer = styled.div``;\n\nexport const StyledMetaInfo = styled.span``;\n\nexport const StyledStatusInfo = styled.span``;\n\nexport const StyledTypingIndicator = styled.div``;\n\nexport const StyledMessageHeader = styled.header``;\nexport const StyledMessageHeaderContent = styled.div``;\nexport const StyledMessageHeaderMeta = styled.div``;\n\ninterface StyledMessageContainerProps {\n variant: 'sender' | 'receiver' | 'other';\n messageDirection: 'in' | 'out' | string;\n typing: boolean;\n hasMessage: boolean;\n status: string;\n}\n\nexport const StyledMessageContainer = styled.div<StyledMessageContainerProps>(\n ({\n messageDirection,\n variant,\n hasMessage,\n typing,\n status,\n theme,\n theme: {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'border-radius': borderRadius,\n spacing,\n palette: {\n 'foreground-color': foregroundColor,\n 'secondary-background': secondaryBackground,\n urgent\n },\n transparency: { 'transparent-2': foregroundAlpha }\n }\n }\n }) => {\n const messageHeaderTheme = theme.components.chat.messageBubble[variant].header;\n const messageContentTheme = theme.components.chat.messageBubble[variant].content;\n const metaForegroundColor = tryCatch(() => rgba(foregroundColor, foregroundAlpha));\n const statusForegroundColor = status === 'undelivered' ? urgent : metaForegroundColor;\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n ${messageDirection === 'out'\n ? css`\n padding-inline-start: calc(4 * ${spacing});\n `\n : css`\n padding-inline-end: calc(4 * ${spacing});\n `}\n margin-block-end: ${typing ? spacing : '0'};\n ${StyledMessageMain} {\n max-width: 90%;\n }\n ${StyledMessageBubble} {\n background: ${messageContentTheme['background-color']};\n border-radius: calc(3 * ${borderRadius}) ${borderRadius} calc(3 * ${borderRadius})\n calc(3 * ${borderRadius});\n overflow: hidden;\n color: ${messageContentTheme['foreground-color']};\n display: inline-block;\n width: auto;\n margin-block-end: calc(0.5 * ${spacing});\n\n label {\n color: inherit;\n }\n\n ${messageDirection === 'in' &&\n css`\n border-radius: ${borderRadius} calc(3 * ${borderRadius}) calc(3 * ${borderRadius});\n `}\n\n > ${StyledMessageBubbleContent} {\n padding: ${spacing} calc(2 * ${spacing});\n word-break: break-word;\n white-space: pre-wrap;\n position: relative;\n }\n\n > ${StyledMediaList} {\n color: ${messageContentTheme['foreground-color']};\n max-width: 100%;\n\n > ${StyledMediaListItem} {\n position: relative;\n ${StyledMediaThumbNail} {\n max-height: 12rem;\n width: 100%;\n object-fit: contain;\n background-color: ${secondaryBackground};\n }\n ${StyledSummaryItem} {\n padding: ${spacing} calc(3 * ${spacing});\n font-size: ${fontSizes.xxs};\n margin-block-start: calc(0.5 * ${spacing});\n }\n ${StyledSummaryItem}::before {\n content: '';\n padding: ${spacing} 0;\n border-top: 0.0625rem solid ${messageContentTheme['foreground-color']};\n position: absolute;\n width: calc(100% - 2rem);\n left: 1rem;\n top: 0;\n }\n ${StyledMediaThumbNail} + ${StyledSummaryItem}::before {\n content: none;\n }\n svg {\n font-size: 1.6rem;\n }\n ${StyledText} {\n color: ${foregroundColor};\n }\n }\n\n ${!hasMessage &&\n css`\n > ${StyledMediaListItem}:first-child {\n > ${StyledSummaryItem}::before {\n border-top: none;\n }\n }\n `}\n }\n\n ${StyledMessageHeader} {\n padding: ${spacing} calc(2 * ${spacing});\n color: ${messageHeaderTheme['foreground-color']};\n background-color: ${messageHeaderTheme['background-color']};\n }\n\n ${StyledMessageHeaderContent} {\n color: ${messageHeaderTheme['foreground-color']};\n margin-inline-end: ${spacing};\n }\n ${StyledMessageHeaderMeta} {\n > a {\n color: ${messageHeaderTheme['foreground-color']};\n }\n }\n\n ${StyledMediaLink}, ${StyledMediaButton} {\n color: ${messageContentTheme['foreground-color']};\n font-size: inherit;\n text-decoration: none;\n font-weight: 700;\n overflow-x: hidden;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n max-width: 100%;\n &:hover {\n color: ${messageContentTheme['foreground-color']};\n text-decoration: underline;\n }\n &:visited {\n color: ${messageContentTheme['foreground-color']};\n }\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n\n ${StyledMetaInfoContainer} {\n width: 100%;\n padding: 0 ${spacing};\n ${StyledMetaInfo}, ${StyledStatusInfo} {\n margin-block-end: ${spacing};\n font-size: 0.7rem;\n color: ${metaForegroundColor};\n }\n ${StyledStatusInfo} {\n color: ${statusForegroundColor};\n }\n }\n ${StyledTypingIndicator} {\n width: 4.5rem;\n position: relative;\n height: 2rem;\n }\n `;\n }\n);\nStyledMessageContainer.defaultProps = defaultThemeProp;\ninterface StyledBlinkingDotProps {\n delay?: number;\n}\n\nexport const StyledBlinkingDot = styled.div<StyledBlinkingDotProps>(({ delay = 0, theme }) => {\n return css`\n @keyframes Blinking {\n 0% {\n background: ${theme.base.colors.gray.medium};\n }\n 100% {\n background: ${theme.base.colors.gray['extra-light']};\n }\n }\n animation: Blinking calc(4 * ${theme.base.animation.speed}) infinite;\n background: ${theme.base.colors.gray['extra-light']};\n border-radius: 50%;\n animation-delay: ${delay}s;\n height: 0.4rem;\n width: 0.4rem;\n `;\n});\nStyledBlinkingDot.defaultProps = defaultThemeProp;\n\nexport const StyledUndeliveredIcon = styled(Icon)(\n ({\n theme: {\n base: {\n palette: { urgent }\n }\n }\n }) => {\n return css`\n flex-shrink: 0;\n color: ${urgent};\n `;\n }\n);\n\nStyledUndeliveredIcon.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -324,7 +324,6 @@ export interface EntityListProps extends BaseProps {
|
|
|
324
324
|
icon: string;
|
|
325
325
|
text: string;
|
|
326
326
|
};
|
|
327
|
-
ref?: Ref<HTMLDivElement>;
|
|
328
327
|
/**
|
|
329
328
|
* Context menu props. Context menu is disabled if it is not provided.
|
|
330
329
|
* To set the context menu items, use the setContextMenuItems method provided on handle
|
|
@@ -332,6 +331,7 @@ export interface EntityListProps extends BaseProps {
|
|
|
332
331
|
contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {
|
|
333
332
|
onContextMenu: (e: MouseEvent) => void;
|
|
334
333
|
};
|
|
334
|
+
ref?: Ref<HTMLDivElement>;
|
|
335
335
|
}
|
|
336
336
|
export interface EmailManagerProps extends BaseProps {
|
|
337
337
|
/** Header of the component */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAC;AACzG,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAA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../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref, MouseEvent } from 'react';\n\nimport { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';\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 PageTemplateProps,\n PopoverProps,\n BannerProps\n} from '@pega/cosmos-react-core';\nimport { EditorState, 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 extends Pick<MenuProps, 'loading'> {\n /** Callback triggered when a menu item is clicked */\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n /** Menu items */\n items: MenuItemProps[];\n /** Imperative handle */\n handle: Ref<ContextMenuHandleValue>;\n}\n\nexport interface ContextMenuHandleValue {\n setItems: (contextMenuItems: ContextMenuProps['items']) => void;\n setOpen: (open: boolean) => void;\n setLoading: (loading: boolean) => void;\n}\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 /** Edit draft callback */\n onEditDraft?: (id: EmailProps['id']) => void;\n /** Delete draft Callback */\n onDeleteDraft?: (id: EmailProps['id']) => void;\n /** Show either undelivered or draft status on email */\n status?: 'undelivered' | 'draft';\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 /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n /** Callback on right click of content */\n onContextMenu: (id: EmailProps['id'], e: MouseEvent) => void;\n };\n /** Show banner for undelivered email */\n banner?: Pick<BannerProps, 'id' | 'heading' | 'messages'>;\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 /** Flag that indicates if email conversation contains drafted emails */\n drafts?: boolean;\n /** Flag that indicates if email conversation contains undelivered emails */\n undelivered?: boolean;\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport type EmailComposerFieldType =\n | 'to'\n | 'cc'\n | 'bcc'\n | 'subject'\n | 'bodyContent'\n | 'attachments'\n | 'responseType'\n | 'selectedTemplateId';\n\nexport type EmailComposerValueType<T> = T extends 'to' | 'cc' | 'bcc'\n ? EmailUser['emailAddress'][]\n : T extends 'subject' | 'bodyContent'\n ? string\n : T extends 'selectedTemplateId'\n ? EmailTemplate['id']\n : T extends 'attachments'\n ? FileUploadItemProps[]\n : T extends 'responseType'\n ? EmailResponseType\n : never;\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 EmailComposerHandleValue {\n replaceBodyContent: (content: string) => void;\n updateImage: EditorState['appendImage'];\n activate: () => void;\n setCursorLocationToStart: EditorState['setCursorLocationToStart'];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, '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 /** Data for all fields of the composer */\n data: {\n /** Object to hold to address/addresses and field error */\n to?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Cc address/addresses and field error */\n cc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Bcc address/addresses and field error */\n bcc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold the subject value and error */\n subject: {\n value: string;\n error?: string;\n };\n /** Object containing the default body content and error */\n bodyContent: {\n defaultValue: string;\n error?: string;\n };\n /** Selected template id */\n selectedTemplateId?: EmailTemplate['id'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Email response types */\n responseType?: EmailResponseType;\n };\n /** Callback when user clicks on the send button */\n onSend: () => void;\n /** Callback when user clicks on the save button */\n onSave?: () => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: Pick<EmailTemplate, 'id' | 'title'>[];\n /** Callback when user clicks on cancel */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation for to, cc and bcc fields while adding a new email to the list\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 /** Imperative handle for composer */\n handle?: Ref<EmailComposerHandleValue>;\n /** Change handler to all fields */\n onChange: <T extends EmailComposerFieldType>(field: T, value: EmailComposerValueType<T>) => void;\n}\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 onSelect: (id: EmailSummaryItemProps['id']) => void;\n /** Flag that indicates if email summary item contains drafted emails */\n drafts?: EmailConversationProps['drafts'];\n /** Flag that indicates if email summary item contains undelivered emails */\n undelivered?: EmailConversationProps['undelivered'];\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, 'onSelect' | '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 /** Id of the EmailSummaryItem */\n currentItemId?: string;\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 show: PopoverProps['show'];\n ref?: PopoverProps['ref'];\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 * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n onContextMenu: (e: MouseEvent) => void;\n };\n}\n\nexport interface EmailManagerProps extends BaseProps {\n /** Header of the component */\n header?: {\n title: PageTemplateProps['title'];\n icon?: PageTemplateProps['icon'];\n };\n /** A region to hold an EmailSummaryList component */\n list?: ReactNode;\n /** Email case details */\n emailCaseDetails?: ReactNode;\n}\n\nexport interface EmailCaseViewProps extends BaseProps {\n /** Header of the the component */\n header?: EmailManagerProps['header'];\n /** A region to hold an Emails component */\n content: ReactNode;\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n /** A region that is used to hold Utility components. */\n utilities?: ReactNode;\n /** The utilities summary array will be used to render the minimized utilities card. */\n utilitiesSummaryItems?: UtilitiesSummaryProps['items'];\n /** Expand/Collapse utilities */\n defaultUtilitiesExpanded?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref, MouseEvent } from 'react';\n\nimport { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';\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 PageTemplateProps,\n PopoverProps,\n BannerProps\n} from '@pega/cosmos-react-core';\nimport { EditorState, 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 extends Pick<MenuProps, 'loading'> {\n /** Callback triggered when a menu item is clicked */\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n /** Menu items */\n items: MenuItemProps[];\n /** Imperative handle */\n handle: Ref<ContextMenuHandleValue>;\n}\n\nexport interface ContextMenuHandleValue {\n setItems: (contextMenuItems: ContextMenuProps['items']) => void;\n setOpen: (open: boolean) => void;\n setLoading: (loading: boolean) => void;\n}\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 /** Edit draft callback */\n onEditDraft?: (id: EmailProps['id']) => void;\n /** Delete draft Callback */\n onDeleteDraft?: (id: EmailProps['id']) => void;\n /** Show either undelivered or draft status on email */\n status?: 'undelivered' | 'draft';\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 /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n /** Callback on right click of content */\n onContextMenu: (id: EmailProps['id'], e: MouseEvent) => void;\n };\n /** Show banner for undelivered email */\n banner?: Pick<BannerProps, 'id' | 'heading' | 'messages'>;\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 /** Flag that indicates if email conversation contains drafted emails */\n drafts?: boolean;\n /** Flag that indicates if email conversation contains undelivered emails */\n undelivered?: boolean;\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport type EmailComposerFieldType =\n | 'to'\n | 'cc'\n | 'bcc'\n | 'subject'\n | 'bodyContent'\n | 'attachments'\n | 'responseType'\n | 'selectedTemplateId';\n\nexport type EmailComposerValueType<T> = T extends 'to' | 'cc' | 'bcc'\n ? EmailUser['emailAddress'][]\n : T extends 'subject' | 'bodyContent'\n ? string\n : T extends 'selectedTemplateId'\n ? EmailTemplate['id']\n : T extends 'attachments'\n ? FileUploadItemProps[]\n : T extends 'responseType'\n ? EmailResponseType\n : never;\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 EmailComposerHandleValue {\n replaceBodyContent: (content: string) => void;\n updateImage: EditorState['appendImage'];\n activate: () => void;\n setCursorLocationToStart: EditorState['setCursorLocationToStart'];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, '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 /** Data for all fields of the composer */\n data: {\n /** Object to hold to address/addresses and field error */\n to?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Cc address/addresses and field error */\n cc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold Bcc address/addresses and field error */\n bcc?: {\n value: EmailUser['emailAddress'][];\n error?: string;\n };\n /** Object to hold the subject value and error */\n subject: {\n value: string;\n error?: string;\n };\n /** Object containing the default body content and error */\n bodyContent: {\n defaultValue: string;\n error?: string;\n };\n /** Selected template id */\n selectedTemplateId?: EmailTemplate['id'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Email response types */\n responseType?: EmailResponseType;\n };\n /** Callback when user clicks on the send button */\n onSend: () => void;\n /** Callback when user clicks on the save button */\n onSave?: () => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: Pick<EmailTemplate, 'id' | 'title'>[];\n /** Callback when user clicks on cancel */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation for to, cc and bcc fields while adding a new email to the list\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 /** Imperative handle for composer */\n handle?: Ref<EmailComposerHandleValue>;\n /** Change handler to all fields */\n onChange: <T extends EmailComposerFieldType>(field: T, value: EmailComposerValueType<T>) => void;\n}\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 onSelect: (id: EmailSummaryItemProps['id']) => void;\n /** Flag that indicates if email summary item contains drafted emails */\n drafts?: EmailConversationProps['drafts'];\n /** Flag that indicates if email summary item contains undelivered emails */\n undelivered?: EmailConversationProps['undelivered'];\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, 'onSelect' | '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 /** Id of the EmailSummaryItem */\n currentItemId?: string;\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 show: PopoverProps['show'];\n ref?: PopoverProps['ref'];\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 /**\n * Context menu props. Context menu is disabled if it is not provided.\n * To set the context menu items, use the setContextMenuItems method provided on handle\n */\n contextMenu?: OmitStrict<ContextMenuProps, 'items' | 'loading'> & {\n onContextMenu: (e: MouseEvent) => void;\n };\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EmailManagerProps extends BaseProps {\n /** Header of the component */\n header?: {\n title: PageTemplateProps['title'];\n icon?: PageTemplateProps['icon'];\n };\n /** A region to hold an EmailSummaryList component */\n list?: ReactNode;\n /** Email case details */\n emailCaseDetails?: ReactNode;\n}\n\nexport interface EmailCaseViewProps extends BaseProps {\n /** Header of the the component */\n header?: EmailManagerProps['header'];\n /** A region to hold an Emails component */\n content: ReactNode;\n /** A region above the center column to display banners. */\n banners?: ReactNode;\n /** A region that is used to hold Utility components. */\n utilities?: ReactNode;\n /** The utilities summary array will be used to render the minimized utilities card. */\n utilitiesSummaryItems?: UtilitiesSummaryProps['items'];\n /** Expand/Collapse utilities */\n defaultUtilitiesExpanded?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"EntityList.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAWb,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAoB,eAAe,EAAe,MAAM,eAAe,CAAC;AAE/E,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAwGjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
3
|
-
import { Text, Flex, Icon, Card, CardHeader, CardContent, useScrollToggle, useElement, useOuterEvent } from '@pega/cosmos-react-core';
|
|
3
|
+
import { Text, Flex, Icon, Card, CardHeader, CardContent, useScrollToggle, useElement, useOuterEvent, EmptyState } from '@pega/cosmos-react-core';
|
|
4
4
|
import ContextMenuPopover from './ContextMenuPopover';
|
|
5
5
|
import { StyledEntityList } from './Email.styles';
|
|
6
6
|
import EmailEntity from './EmailEntity';
|
|
@@ -62,12 +62,12 @@ const EntityList = forwardRef(({ content, header, contextMenu }, ref) => {
|
|
|
62
62
|
else
|
|
63
63
|
enableScroll();
|
|
64
64
|
}, [popoverOpen]);
|
|
65
|
-
return (_jsxs(Card, { ref: ref, children: [header && (_jsxs(CardHeader, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: header.icon }), _jsx(Text, { variant: 'h3', children: header.text })] })), _jsxs(CardContent, { children: [_jsx(StyledEntityList, { fields: fields, variant: 'stacked' }), contextMenu && currentTarget && (_jsx(ContextMenuPopover, { ref: setPopoverEl, cursorPosition: currentTarget?.cursorPosition, contextMenu: {
|
|
65
|
+
return (_jsxs(Card, { ref: ref, children: [header && (_jsxs(CardHeader, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: header.icon }), _jsx(Text, { variant: 'h3', children: header.text })] })), content.length > 0 ? (_jsxs(CardContent, { children: [_jsx(StyledEntityList, { fields: fields, variant: 'stacked' }), contextMenu && currentTarget && (_jsx(ContextMenuPopover, { ref: setPopoverEl, cursorPosition: currentTarget?.cursorPosition, contextMenu: {
|
|
66
66
|
...contextMenu,
|
|
67
67
|
items: contextMenuItems,
|
|
68
68
|
loading: contextMenuLoading,
|
|
69
69
|
onItemClick
|
|
70
|
-
}, targetNode: currentTarget.targetNode, show: popoverOpen }))] })] }));
|
|
70
|
+
}, targetNode: currentTarget.targetNode, show: popoverOpen }))] })) : (_jsx(EmptyState, {}))] }));
|
|
71
71
|
});
|
|
72
72
|
export default EntityList;
|
|
73
73
|
//# sourceMappingURL=EntityList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityList.js","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,QAAQ,EAER,SAAS,EACT,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,
|
|
1
|
+
{"version":3,"file":"EntityList.js","sourceRoot":"","sources":["../../../src/components/Email/EntityList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,QAAQ,EAER,SAAS,EACT,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU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,CAAC;;YAC5B,YAAY,EAAE,CAAC;IACtB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,MAAC,IAAI,IAAC,GAAG,EAAE,GAAG,aACX,MAAM,IAAI,CACT,MAAC,UAAU,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACrD,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EAC3B,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,MAAM,CAAC,IAAI,GAAQ,IAC5B,CACd,EACA,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACpB,MAAC,WAAW,eACV,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,SAAS,GAAG,EACrD,WAAW,IAAI,aAAa,IAAI,CAC/B,KAAC,kBAAkB,IACjB,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,aAAa,EAAE,cAAc,EAC7C,WAAW,EAAE;4BACX,GAAG,WAAW;4BACd,KAAK,EAAE,gBAAgB;4BACvB,OAAO,EAAE,kBAAkB;4BAC3B,WAAW;yBACZ,EACD,UAAU,EAAE,aAAa,CAAC,UAAU,EACpC,IAAI,EAAE,WAAW,GACjB,CACH,IACW,CACf,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,KAAG,CACf,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useState,\n MouseEvent,\n useEffect,\n useImperativeHandle\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n Flex,\n Icon,\n Card,\n CardHeader,\n CardContent,\n useScrollToggle,\n useElement,\n useOuterEvent,\n EmptyState\n} from '@pega/cosmos-react-core';\n\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { StyledEntityList } from './Email.styles';\nimport EmailEntity from './EmailEntity';\nimport { ContextMenuProps, EntityListProps, TargetProps } from './Email.types';\n\nconst EntityList: FunctionComponent<EntityListProps & ForwardProps> = forwardRef(\n (\n { content, header, contextMenu }: PropsWithoutRef<EntityListProps>,\n ref: EntityListProps['ref']\n ) => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [currentTarget, setCurrentTarget] = useState<TargetProps | undefined>();\n const { disableScroll, enableScroll } = useScrollToggle();\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 const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n\n useOuterEvent('mousedown', [popoverEl], () => {\n if (popoverOpen) setPopoverOpen(false);\n });\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 setPopoverOpen(visible);\n }\n }));\n\n // Handler for right click\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 contextMenu?.onContextMenu(e);\n }\n };\n\n const onItemClick: ContextMenuProps['onItemClick'] = (selectedValue: {\n fieldName: string;\n fieldValue: string;\n }) => {\n setPopoverOpen(false);\n contextMenu?.onItemClick(selectedValue);\n };\n\n const fields = content.map(data => {\n return data.value\n ? {\n ...data,\n value: (\n /* Attach the handler only when context menu is enabled */\n <Flex container={{ gap: 0.5, wrap: 'wrap' }} onContextMenu={onContextMenu}>\n {data.value.map(entityObject => {\n return <EmailEntity key={entityObject.id} entity={entityObject.entity} />;\n })}\n </Flex>\n )\n }\n : data;\n });\n\n useEffect(() => {\n if (popoverOpen) disableScroll();\n else enableScroll();\n }, [popoverOpen]);\n\n return (\n <Card ref={ref}>\n {header && (\n <CardHeader container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={header.icon} />\n <Text variant='h3'>{header.text}</Text>\n </CardHeader>\n )}\n {content.length > 0 ? (\n <CardContent>\n <StyledEntityList fields={fields} variant='stacked' />\n {contextMenu && currentTarget && (\n <ContextMenuPopover\n ref={setPopoverEl}\n cursorPosition={currentTarget?.cursorPosition}\n contextMenu={{\n ...contextMenu,\n items: contextMenuItems,\n loading: contextMenuLoading,\n onItemClick\n }}\n targetNode={currentTarget.targetNode}\n show={popoverOpen}\n />\n )}\n </CardContent>\n ) : (\n <EmptyState />\n )}\n </Card>\n );\n }\n);\n\nexport default EntityList;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feed.context.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACzF,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,M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D,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;IAC5F,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3E,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC9C,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;CACnE;AAED,eAAO,MAAM,WAAW,2CAMtB,CAAC;AAEH,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,gBAAgB,gDAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feed.context.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Feed.context.js","sourceRoot":"","sources":["../../../src/components/Feed/Feed.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AA0BhE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB;IACzD,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxC,QAAQ,EAAE,GAAG,EAAE;QACb,OAAO,CAAC,CAAwD,CAAC;IACnE,CAAC;CACF,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC","sourcesContent":["import { createContext, Dispatch, SetStateAction } from 'react';\n\nimport { InteractionRenderers, MDMap } from '@pega/cosmos-react-rte';\nimport { MenuItemProps } from '@pega/cosmos-react-core';\n\nexport interface FeedContextValue {\n searchTypes?: string[];\n onSearch?: (e: { type: 'mention' | 'tag'; search: string; mentionType: string }) => void;\n searchResults?: MenuItemProps[];\n showSearchResults?: boolean;\n setShowSearchResults?: Dispatch<SetStateAction<boolean>>;\n onMentionClick?: (e: { id: string; text: string; type: string }) => JSX.Element | undefined;\n onMentionPreview?: (e: { id: string; text: string; type: string }) => void;\n onTagClick?: (tag: string) => void;\n interactionRenderers?: InteractionRenderers[];\n markdownMap?: MDMap;\n userInfo: {\n username: string;\n fullname: string;\n avatarSrc?: string;\n meta?: string[];\n timeZone?: string;\n };\n announce: (announcement: string) => ReturnType<typeof setTimeout>;\n}\n\nexport const FeedContext = createContext<FeedContextValue>({\n searchTypes: [],\n userInfo: { username: '', fullname: '' },\n announce: () => {\n return -1 as unknown as ReturnType<FeedContextValue['announce']>;\n }\n});\n\nexport interface FeedReplyContextValue {\n onShowReplyInput?: () => void;\n}\n\nexport const FeedReplyContext = createContext<FeedReplyContextValue>({});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedPost.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAQH,MAAM,OAAO,CAAC;AAGf,OAAO,EAcL,YAAY,EAcb,MAAM,yBAAyB,CAAC;AAkBjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAcjD,eAAO,MAAM,cAAc,yGAM1B,CAAC;AAIF,eAAO,MAAM,cAAc,yGAM1B,CAAC;AAIF,eAAO,MAAM,aAAa,yGAKzB,CAAC;AAIF,eAAO,MAAM,gBAAgB,yGAI5B,CAAC;AAYF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,YAAY,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"FeedPost.d.ts","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAQH,MAAM,OAAO,CAAC;AAGf,OAAO,EAcL,YAAY,EAcb,MAAM,yBAAyB,CAAC;AAkBjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAcjD,eAAO,MAAM,cAAc,yGAM1B,CAAC;AAIF,eAAO,MAAM,cAAc,yGAM1B,CAAC;AAIF,eAAO,MAAM,aAAa,yGAKzB,CAAC;AAIF,eAAO,MAAM,gBAAgB,yGAI5B,CAAC;AAYF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,YAAY,GAAG,aAAa,CAwZ9C,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
|
@@ -140,7 +140,8 @@ const FeedPost = (props) => {
|
|
|
140
140
|
t,
|
|
141
141
|
locale,
|
|
142
142
|
format: 'short',
|
|
143
|
-
variant: 'datetime'
|
|
143
|
+
variant: 'datetime',
|
|
144
|
+
timeZone: loggedInUser.timeZone
|
|
144
145
|
}) }))] })
|
|
145
146
|
];
|
|
146
147
|
if (edited) {
|
|
@@ -148,7 +149,8 @@ const FeedPost = (props) => {
|
|
|
148
149
|
t,
|
|
149
150
|
locale,
|
|
150
151
|
format: 'short',
|
|
151
|
-
variant: 'datetime'
|
|
152
|
+
variant: 'datetime',
|
|
153
|
+
timeZone: loggedInUser.timeZone
|
|
152
154
|
}) }))] }));
|
|
153
155
|
}
|
|
154
156
|
return (_jsx(FeedReplyContext.Provider, { value: { onShowReplyInput: () => setReplyInputOpen(true) }, children: _jsxs(Card, { ...restProps, as: StyledFeedPost, onMouseEnter: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedPost.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EACR,SAAS,EAGT,MAAM,EACN,UAAU,EACV,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,IAAI,EACJ,gBAAgB,EAEhB,OAAO,EACP,QAAQ,EACR,aAAa,EACb,QAAQ,EAGR,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,OAAO,EACP,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAuB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAC9G,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,6DAA6D,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AAEvF,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,WAAW,MAAM,eAAe,CA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AE,UAAU,CAAC,WAAW,EACnC,WAAW,EAAE,UAAU,CAAC,WAAW,EACnC,YAAY,EAAE,UAAU,CAAC,YAAY,EACrC,QAAQ,EAAE,CAAC,CAAC,EAAE;4BACZ,iBAAiB,CAAC,KAAK,CAAC,CAAC;4BACzB,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACzB,CAAC,GACD,GACU,CACf,CAAC,CAAC,CAAC,IAAI,EACP,iBAAiB,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,CACxC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aAC5D,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;gCACZ,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;gCAClC,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAC;4BAC1C,CAAC,YAEA,CAAC,CAAC,WAAW,CAAC,GACR,EACR,cAAc,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC7C,CACR,IACI,GACmB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FC,\n useState,\n useEffect,\n MutableRefObject,\n MouseEvent,\n useRef,\n useContext,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n Count,\n Card,\n CardContent,\n CardHeader,\n Flex,\n Icon,\n registerIcon,\n MenuButton,\n SummaryItem,\n Text,\n defaultThemeProp,\n ForwardProps,\n useI18n,\n Progress,\n useOuterEvent,\n MetaList,\n SummaryListItem,\n ModalMethods,\n StyledVisual,\n useModalManager,\n useConfiguration,\n usePrevious,\n useElement,\n Tooltip,\n DateTimeDisplay\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as arrowMicroDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-down.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils/utils';\nimport { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\nimport { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';\n\nimport FeedButton from './FeedButton';\nimport FeedAttachments from './FeedAttachments';\nimport { StyledFeedReplyContainer } from './FeedReply';\nimport FeedContent from './FeedContent';\nimport FeedReplyInput from './FeedReplyInput';\nimport { FeedContext, FeedReplyContext } from './Feed.context';\nimport FeedRichText from './FeedRichText';\nimport FeedModalList, { FeedModalListProps } from './FeedModalList';\nimport { FeedLikeButton } from './FeedLikeButton';\nimport { FeedPostProps } from './FeedPost.types';\n\nregisterIcon(arrowMicroDownIcon, caretLeftIcon);\n\nconst defaultProps: Partial<FeedPostProps> = {\n info: {\n avatarSrc: '',\n fullname: '',\n username: '',\n postTimestamp: '',\n content: ''\n }\n};\n\nexport const StyledFeedPost = styled.div(\n ({ theme }) => css`\n ${StyledFeedReplyContainer}:not(:last-child) {\n margin-block-end: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledFeedPost.defaultProps = defaultThemeProp;\n\nexport const StyledPostEdit = styled.div(\n ({ theme }) => css`\n ${StyledRichTextEditor} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledPostEdit.defaultProps = defaultThemeProp;\n\nexport const StyledReplies = styled.div(\n ({ theme }) => css`\n border-top: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: calc(1.25 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledReplies.defaultProps = defaultThemeProp;\n\nexport const StyledPostFooter = styled.div(\n ({ theme }) => css`\n margin-block-start: ${theme.base.spacing};\n `\n);\n\nStyledPostFooter.defaultProps = defaultThemeProp;\n\nconst FullWidthSummaryItem = styled.div`\n width: 100%;\n\n ${StyledVisual} {\n align-self: start;\n }\n`;\n\nconst FeedPost: FC<ForwardProps & FeedPostProps> = (props: ForwardProps & FeedPostProps) => {\n const {\n id,\n info,\n interactionInfo,\n maxContentHeight = Infinity,\n onMouseEnter,\n onMouseLeave,\n onCommentClick,\n onLikeClick,\n onLikeCountInteraction,\n likesLoading,\n onLoadMoreLikes,\n onRecipientInteraction,\n recipientsLoading,\n onLoadMoreRecipients,\n onUserClick,\n onShowMoreClick,\n newReplyField,\n menuItems,\n onEditSubmit,\n edited = false,\n editTimestamp,\n replies = [],\n replyInput,\n replyInputShown,\n replyCount,\n repliesLoading,\n onShowLessReplies,\n onShowMoreReplies,\n ...restProps\n } = props;\n const {\n avatarSrc,\n fullname,\n username,\n postTimestamp,\n content,\n postType = 'public',\n recipients = [],\n recipientsCount = 0,\n attachments,\n liked,\n icon,\n postContext,\n userStatus\n } = info;\n const { commentLabel, interactionsEnabled = true } = interactionInfo;\n const { announce, userInfo: loggedInUser } = useContext(FeedContext);\n\n const t = useI18n();\n const { locale } = useConfiguration();\n const rteRef = useRef<RichTextEditorState>();\n const [editMode, setEditMode] = useState(false);\n const editTextAreaRef = useRef<HTMLDivElement>(null);\n const [emptyEditText, setEmptyEditText] = useState(false);\n const [postModified, setPostModified] = useState(false);\n const [replyInputOpen, setReplyInputOpen] = useState(false);\n const [replyInputRef, setReplyInputRef] = useState<MutableRefObject<\n RichTextEditorState | undefined\n > | null>(null);\n const { create } = useModalManager();\n const recipientsModalRef = useRef<ModalMethods<FeedModalListProps>>();\n const prevReplies = usePrevious(replies);\n const suppressNextAnnouncement = useRef(false);\n const [postTimestampEl, setPostTimestampEl] = useElement<HTMLSpanElement>();\n const [editTimestampEl, setEditTimestampEl] = useElement<HTMLSpanElement>();\n\n useEffect(() => {\n if (recipients.length) {\n recipientsModalRef.current?.update({\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);\n\n useOuterEvent('mousedown', [editTextAreaRef], () => {\n if (emptyEditText) setEditMode(false);\n });\n\n useEffect(() => {\n if ((replyInputOpen || replyInputShown) && replyInputRef) {\n replyInputRef.current?.focus();\n }\n }, [replyInputOpen, replyInputShown, replyInputRef]);\n\n const userVisual = icon ? (\n <Icon name={icon} />\n ) : (\n <Avatar name={fullname} size='l' imageSrc={avatarSrc} status={userStatus} />\n );\n\n const numReplies = replyCount || replies?.length;\n\n const postTypeAttributes = useMemo(() => {\n if (postType === 'private') {\n const recipientsList = recipients.map(x => x.primary);\n return {\n icon: 'users-solid',\n ariaLabel: `${t('feed_private_post')} ${t('feed_recipients')} ${formatListToLocaleString(\n recipientsList,\n t,\n locale,\n { count: recipientsCount }\n )}`,\n label: formatListToLocaleString(recipientsList, t, locale, {\n count: recipientsCount,\n separator: '\\n'\n })\n };\n }\n\n return {\n icon: 'globe',\n ariaLabel: t('feed_public_post'),\n label: t('feed_public_post')\n };\n }, [postType, recipients, recipientsCount]);\n\n const handleEdit = () => {\n if (!emptyEditText && postModified) {\n onEditSubmit?.({\n postId: id,\n value: rteRef.current?.getPlainText() || ''\n });\n setEditMode(false);\n }\n };\n\n useEffect(() => {\n if (prevReplies) {\n const difference = prevReplies.length - replies.length;\n if (difference > 0 && !suppressNextAnnouncement.current) {\n const timeoutId = announce(t('feed_reply_removed'));\n return () => clearTimeout(timeoutId);\n }\n suppressNextAnnouncement.current = false;\n }\n }, [replies]);\n\n const timestamps = [\n <>\n <DateTimeDisplay ref={setPostTimestampEl} value={postTimestamp} variant='relative' />\n {postTimestamp && (\n <Tooltip target={postTimestampEl}>\n {formatDateTime(parseToDate(postTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime'\n })}\n </Tooltip>\n )}\n </>\n ];\n\n if (edited) {\n timestamps.push(\n <>\n <Text ref={setEditTimestampEl} variant='secondary'>\n {t('edited', [<DateTimeDisplay value={editTimestamp} variant='relative' />])}\n </Text>\n {editTimestamp && (\n <Tooltip target={editTimestampEl}>\n {formatDateTime(parseToDate(editTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime'\n })}\n </Tooltip>\n )}\n </>\n );\n }\n\n return (\n <FeedReplyContext.Provider value={{ onShowReplyInput: () => setReplyInputOpen(true) }}>\n <Card\n {...restProps}\n as={StyledFeedPost}\n onMouseEnter={() => {\n onMouseEnter?.({ postId: id });\n }}\n onMouseLeave={() => {\n onMouseLeave?.({ postId: id });\n }}\n >\n <CardHeader>\n <SummaryItem\n as={FullWidthSummaryItem}\n visual={\n onUserClick ? (\n <BareButton\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: id, username }, event);\n }}\n >\n {userVisual}\n </BareButton>\n ) : (\n userVisual\n )\n }\n primary={\n <div>\n {onUserClick ? (\n <Button\n variant='text'\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: id, username }, event);\n }}\n >\n <Text variant='h3'>{fullname}</Text>\n </Button>\n ) : (\n <Text variant='h3'>{fullname}</Text>\n )}\n {postContext && <Text variant='primary'> {t('feed_context', [postContext])}</Text>}\n </div>\n }\n secondary={\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Button\n variant='text'\n icon\n onClick={\n recipients.length\n ? () => {\n if (recipientsCount > 10) {\n recipientsModalRef.current = create(FeedModalList, {\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }\n : onRecipientInteraction\n }\n onFocus={onRecipientInteraction}\n onMouseOver={onRecipientInteraction}\n aria-label={postTypeAttributes.ariaLabel}\n label={postTypeAttributes.label || t('feed_private_post')}\n >\n <Icon name={postTypeAttributes.icon} />\n </Button>\n <MetaList items={timestamps} />\n </Flex>\n }\n actions={\n menuItems ? (\n <MenuButton\n text='More'\n menu={{\n items:\n onEditSubmit &&\n typeof content === 'string' &&\n username === loggedInUser.username\n ? [\n {\n primary: t('edit'),\n id: 'edit',\n onClick: () => setEditMode(true)\n },\n ...menuItems\n ]\n : menuItems\n }}\n icon='more'\n iconOnly\n variant='simple'\n />\n ) : undefined\n }\n />\n </CardHeader>\n <CardContent>\n {editMode ? (\n <>\n <StyledPostEdit ref={editTextAreaRef}>\n <FeedRichText\n label={t('feed_edit_post')}\n onChange={() => {\n setEmptyEditText(rteRef.current?.getPlainText().trim() === '');\n setPostModified(rteRef.current?.getPlainText() !== content);\n }}\n autoFocus\n onSubmit={handleEdit}\n defaultValue={content}\n ref={rteRef}\n />\n </StyledPostEdit>\n <Flex container={{ justify: 'between', pad: [2, 0, 0] }}>\n <Button\n onClick={() => setEditMode(false)}\n aria-label={`${t('cancel')} ${t('edit')} ${id}`}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n disabled={emptyEditText || !postModified}\n onClick={handleEdit}\n aria-label={`${t('update')} ${t('edit')} ${id}`}\n >\n {t('update')}\n </Button>\n </Flex>\n </>\n ) : (\n <FeedContent maxContentHeight={maxContentHeight}>{content}</FeedContent>\n )}\n <FeedAttachments attachments={attachments} readOnly />\n <Flex as={StyledPostFooter} container={{ justify: 'between', wrap: 'wrap', gap: 1 }}>\n {interactionsEnabled ? (\n <Flex container={{ gap: 2 }}>\n <Button\n variant='text'\n as={FeedButton}\n onClick={() => {\n onCommentClick?.({ postId: id });\n if (!replyInputOpen) {\n setReplyInputOpen(true);\n }\n }}\n aria-label={commentLabel}\n >\n <Icon name='chat' />\n <Text>{commentLabel}</Text>\n {numReplies > 0 && <Count>{numReplies}</Count>}\n </Button>\n <FeedLikeButton\n id={id}\n variant='post'\n onLikeClick={onLikeClick}\n onLikeCountInteraction={onLikeCountInteraction}\n onLoadMoreLikes={onLoadMoreLikes}\n likesLoading={likesLoading}\n liked={liked}\n showText\n {...interactionInfo}\n />\n </Flex>\n ) : (\n <div />\n )}\n {(onShowLessReplies || onShowMoreReplies) && (\n <Flex container={{ gap: 0.5 }}>\n {replies.length !== numReplies && (\n <>\n <Text>{t('showing_num_of_num', [replies.length, numReplies])}</Text>\n <span>•</span>\n </>\n )}\n {onShowMoreReplies && replies.length < numReplies && (\n <Button variant='link' onClick={() => onShowMoreReplies({ postId: id })}>\n {t('show_more')}\n </Button>\n )}\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Flex>\n </CardContent>\n {!!replies?.length && <StyledReplies>{replies}</StyledReplies>}\n {replyInputShown || replyInputOpen ? (\n <CardContent>\n <FeedReplyInput\n onSetInputRef={({ ref }) => {\n setReplyInputRef(ref);\n }}\n id={id}\n commentLabel={replyInput.commentLabel}\n attachments={replyInput.attachments}\n placeholder={replyInput.placeholder}\n onFilesAdded={replyInput.onFilesAdded}\n onSubmit={e => {\n setReplyInputOpen(false);\n replyInput.onSubmit(e);\n }}\n />\n </CardContent>\n ) : null}\n {onShowLessReplies && !!replies.length && (\n <Flex container={{ justify: 'center', pad: [0, 0, 1], gap: 1 }}>\n <Button\n variant='link'\n onClick={() => {\n onShowLessReplies({ postId: id });\n suppressNextAnnouncement.current = true;\n }}\n >\n {t('show_less')}\n </Button>\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Card>\n </FeedReplyContext.Provider>\n );\n};\n\nFeedPost.defaultProps = defaultProps;\n\nexport default FeedPost;\n"]}
|
|
1
|
+
{"version":3,"file":"FeedPost.js","sourceRoot":"","sources":["../../../src/components/Feed/FeedPost.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EACR,SAAS,EAGT,MAAM,EACN,UAAU,EACV,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;A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AAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aAC5D,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE;gCACZ,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;gCAClC,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAC;4BAC1C,CAAC,YAEA,CAAC,CAAC,WAAW,CAAC,GACR,EACR,cAAc,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,IAC7C,CACR,IACI,GACmB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FC,\n useState,\n useEffect,\n MutableRefObject,\n MouseEvent,\n useRef,\n useContext,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Avatar,\n Button,\n Count,\n Card,\n CardContent,\n CardHeader,\n Flex,\n Icon,\n registerIcon,\n MenuButton,\n SummaryItem,\n Text,\n defaultThemeProp,\n ForwardProps,\n useI18n,\n Progress,\n useOuterEvent,\n MetaList,\n SummaryListItem,\n ModalMethods,\n StyledVisual,\n useModalManager,\n useConfiguration,\n usePrevious,\n useElement,\n Tooltip,\n DateTimeDisplay\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorState, StyledRichTextEditor } from '@pega/cosmos-react-rte';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as arrowMicroDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-down.icon';\nimport * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';\nimport { formatListToLocaleString } from '@pega/cosmos-react-core/lib/utils/utils';\nimport { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\nimport { formatDateTime } from '@pega/cosmos-react-core/lib/components/DateTime/utils';\n\nimport FeedButton from './FeedButton';\nimport FeedAttachments from './FeedAttachments';\nimport { StyledFeedReplyContainer } from './FeedReply';\nimport FeedContent from './FeedContent';\nimport FeedReplyInput from './FeedReplyInput';\nimport { FeedContext, FeedReplyContext } from './Feed.context';\nimport FeedRichText from './FeedRichText';\nimport FeedModalList, { FeedModalListProps } from './FeedModalList';\nimport { FeedLikeButton } from './FeedLikeButton';\nimport { FeedPostProps } from './FeedPost.types';\n\nregisterIcon(arrowMicroDownIcon, caretLeftIcon);\n\nconst defaultProps: Partial<FeedPostProps> = {\n info: {\n avatarSrc: '',\n fullname: '',\n username: '',\n postTimestamp: '',\n content: ''\n }\n};\n\nexport const StyledFeedPost = styled.div(\n ({ theme }) => css`\n ${StyledFeedReplyContainer}:not(:last-child) {\n margin-block-end: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledFeedPost.defaultProps = defaultThemeProp;\n\nexport const StyledPostEdit = styled.div(\n ({ theme }) => css`\n ${StyledRichTextEditor} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledPostEdit.defaultProps = defaultThemeProp;\n\nexport const StyledReplies = styled.div(\n ({ theme }) => css`\n border-top: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: calc(1.25 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledReplies.defaultProps = defaultThemeProp;\n\nexport const StyledPostFooter = styled.div(\n ({ theme }) => css`\n margin-block-start: ${theme.base.spacing};\n `\n);\n\nStyledPostFooter.defaultProps = defaultThemeProp;\n\nconst FullWidthSummaryItem = styled.div`\n width: 100%;\n\n ${StyledVisual} {\n align-self: start;\n }\n`;\n\nconst FeedPost: FC<ForwardProps & FeedPostProps> = (props: ForwardProps & FeedPostProps) => {\n const {\n id,\n info,\n interactionInfo,\n maxContentHeight = Infinity,\n onMouseEnter,\n onMouseLeave,\n onCommentClick,\n onLikeClick,\n onLikeCountInteraction,\n likesLoading,\n onLoadMoreLikes,\n onRecipientInteraction,\n recipientsLoading,\n onLoadMoreRecipients,\n onUserClick,\n onShowMoreClick,\n newReplyField,\n menuItems,\n onEditSubmit,\n edited = false,\n editTimestamp,\n replies = [],\n replyInput,\n replyInputShown,\n replyCount,\n repliesLoading,\n onShowLessReplies,\n onShowMoreReplies,\n ...restProps\n } = props;\n const {\n avatarSrc,\n fullname,\n username,\n postTimestamp,\n content,\n postType = 'public',\n recipients = [],\n recipientsCount = 0,\n attachments,\n liked,\n icon,\n postContext,\n userStatus\n } = info;\n const { commentLabel, interactionsEnabled = true } = interactionInfo;\n const { announce, userInfo: loggedInUser } = useContext(FeedContext);\n\n const t = useI18n();\n const { locale } = useConfiguration();\n const rteRef = useRef<RichTextEditorState>();\n const [editMode, setEditMode] = useState(false);\n const editTextAreaRef = useRef<HTMLDivElement>(null);\n const [emptyEditText, setEmptyEditText] = useState(false);\n const [postModified, setPostModified] = useState(false);\n const [replyInputOpen, setReplyInputOpen] = useState(false);\n const [replyInputRef, setReplyInputRef] = useState<MutableRefObject<\n RichTextEditorState | undefined\n > | null>(null);\n const { create } = useModalManager();\n const recipientsModalRef = useRef<ModalMethods<FeedModalListProps>>();\n const prevReplies = usePrevious(replies);\n const suppressNextAnnouncement = useRef(false);\n const [postTimestampEl, setPostTimestampEl] = useElement<HTMLSpanElement>();\n const [editTimestampEl, setEditTimestampEl] = useElement<HTMLSpanElement>();\n\n useEffect(() => {\n if (recipients.length) {\n recipientsModalRef.current?.update({\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }, [recipientsCount, recipients, onLoadMoreRecipients, recipientsLoading]);\n\n useOuterEvent('mousedown', [editTextAreaRef], () => {\n if (emptyEditText) setEditMode(false);\n });\n\n useEffect(() => {\n if ((replyInputOpen || replyInputShown) && replyInputRef) {\n replyInputRef.current?.focus();\n }\n }, [replyInputOpen, replyInputShown, replyInputRef]);\n\n const userVisual = icon ? (\n <Icon name={icon} />\n ) : (\n <Avatar name={fullname} size='l' imageSrc={avatarSrc} status={userStatus} />\n );\n\n const numReplies = replyCount || replies?.length;\n\n const postTypeAttributes = useMemo(() => {\n if (postType === 'private') {\n const recipientsList = recipients.map(x => x.primary);\n return {\n icon: 'users-solid',\n ariaLabel: `${t('feed_private_post')} ${t('feed_recipients')} ${formatListToLocaleString(\n recipientsList,\n t,\n locale,\n { count: recipientsCount }\n )}`,\n label: formatListToLocaleString(recipientsList, t, locale, {\n count: recipientsCount,\n separator: '\\n'\n })\n };\n }\n\n return {\n icon: 'globe',\n ariaLabel: t('feed_public_post'),\n label: t('feed_public_post')\n };\n }, [postType, recipients, recipientsCount]);\n\n const handleEdit = () => {\n if (!emptyEditText && postModified) {\n onEditSubmit?.({\n postId: id,\n value: rteRef.current?.getPlainText() || ''\n });\n setEditMode(false);\n }\n };\n\n useEffect(() => {\n if (prevReplies) {\n const difference = prevReplies.length - replies.length;\n if (difference > 0 && !suppressNextAnnouncement.current) {\n const timeoutId = announce(t('feed_reply_removed'));\n return () => clearTimeout(timeoutId);\n }\n suppressNextAnnouncement.current = false;\n }\n }, [replies]);\n\n const timestamps = [\n <>\n <DateTimeDisplay ref={setPostTimestampEl} value={postTimestamp} variant='relative' />\n {postTimestamp && (\n <Tooltip target={postTimestampEl}>\n {formatDateTime(parseToDate(postTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime',\n timeZone: loggedInUser.timeZone\n })}\n </Tooltip>\n )}\n </>\n ];\n\n if (edited) {\n timestamps.push(\n <>\n <Text ref={setEditTimestampEl} variant='secondary'>\n {t('edited', [<DateTimeDisplay value={editTimestamp} variant='relative' />])}\n </Text>\n {editTimestamp && (\n <Tooltip target={editTimestampEl}>\n {formatDateTime(parseToDate(editTimestamp), {\n t,\n locale,\n format: 'short',\n variant: 'datetime',\n timeZone: loggedInUser.timeZone\n })}\n </Tooltip>\n )}\n </>\n );\n }\n\n return (\n <FeedReplyContext.Provider value={{ onShowReplyInput: () => setReplyInputOpen(true) }}>\n <Card\n {...restProps}\n as={StyledFeedPost}\n onMouseEnter={() => {\n onMouseEnter?.({ postId: id });\n }}\n onMouseLeave={() => {\n onMouseLeave?.({ postId: id });\n }}\n >\n <CardHeader>\n <SummaryItem\n as={FullWidthSummaryItem}\n visual={\n onUserClick ? (\n <BareButton\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: id, username }, event);\n }}\n >\n {userVisual}\n </BareButton>\n ) : (\n userVisual\n )\n }\n primary={\n <div>\n {onUserClick ? (\n <Button\n variant='text'\n onClick={(event: MouseEvent) => {\n onUserClick?.({ postId: id, username }, event);\n }}\n >\n <Text variant='h3'>{fullname}</Text>\n </Button>\n ) : (\n <Text variant='h3'>{fullname}</Text>\n )}\n {postContext && <Text variant='primary'> {t('feed_context', [postContext])}</Text>}\n </div>\n }\n secondary={\n <Flex container={{ gap: 1, alignItems: 'center' }}>\n <Button\n variant='text'\n icon\n onClick={\n recipients.length\n ? () => {\n if (recipientsCount > 10) {\n recipientsModalRef.current = create(FeedModalList, {\n count: recipientsCount,\n heading: t('feed_recipients'),\n listItems: recipients as SummaryListItem[],\n onLoadMore: onLoadMoreRecipients,\n loading: recipientsLoading\n });\n }\n }\n : onRecipientInteraction\n }\n onFocus={onRecipientInteraction}\n onMouseOver={onRecipientInteraction}\n aria-label={postTypeAttributes.ariaLabel}\n label={postTypeAttributes.label || t('feed_private_post')}\n >\n <Icon name={postTypeAttributes.icon} />\n </Button>\n <MetaList items={timestamps} />\n </Flex>\n }\n actions={\n menuItems ? (\n <MenuButton\n text='More'\n menu={{\n items:\n onEditSubmit &&\n typeof content === 'string' &&\n username === loggedInUser.username\n ? [\n {\n primary: t('edit'),\n id: 'edit',\n onClick: () => setEditMode(true)\n },\n ...menuItems\n ]\n : menuItems\n }}\n icon='more'\n iconOnly\n variant='simple'\n />\n ) : undefined\n }\n />\n </CardHeader>\n <CardContent>\n {editMode ? (\n <>\n <StyledPostEdit ref={editTextAreaRef}>\n <FeedRichText\n label={t('feed_edit_post')}\n onChange={() => {\n setEmptyEditText(rteRef.current?.getPlainText().trim() === '');\n setPostModified(rteRef.current?.getPlainText() !== content);\n }}\n autoFocus\n onSubmit={handleEdit}\n defaultValue={content}\n ref={rteRef}\n />\n </StyledPostEdit>\n <Flex container={{ justify: 'between', pad: [2, 0, 0] }}>\n <Button\n onClick={() => setEditMode(false)}\n aria-label={`${t('cancel')} ${t('edit')} ${id}`}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n disabled={emptyEditText || !postModified}\n onClick={handleEdit}\n aria-label={`${t('update')} ${t('edit')} ${id}`}\n >\n {t('update')}\n </Button>\n </Flex>\n </>\n ) : (\n <FeedContent maxContentHeight={maxContentHeight}>{content}</FeedContent>\n )}\n <FeedAttachments attachments={attachments} readOnly />\n <Flex as={StyledPostFooter} container={{ justify: 'between', wrap: 'wrap', gap: 1 }}>\n {interactionsEnabled ? (\n <Flex container={{ gap: 2 }}>\n <Button\n variant='text'\n as={FeedButton}\n onClick={() => {\n onCommentClick?.({ postId: id });\n if (!replyInputOpen) {\n setReplyInputOpen(true);\n }\n }}\n aria-label={commentLabel}\n >\n <Icon name='chat' />\n <Text>{commentLabel}</Text>\n {numReplies > 0 && <Count>{numReplies}</Count>}\n </Button>\n <FeedLikeButton\n id={id}\n variant='post'\n onLikeClick={onLikeClick}\n onLikeCountInteraction={onLikeCountInteraction}\n onLoadMoreLikes={onLoadMoreLikes}\n likesLoading={likesLoading}\n liked={liked}\n showText\n {...interactionInfo}\n />\n </Flex>\n ) : (\n <div />\n )}\n {(onShowLessReplies || onShowMoreReplies) && (\n <Flex container={{ gap: 0.5 }}>\n {replies.length !== numReplies && (\n <>\n <Text>{t('showing_num_of_num', [replies.length, numReplies])}</Text>\n <span>•</span>\n </>\n )}\n {onShowMoreReplies && replies.length < numReplies && (\n <Button variant='link' onClick={() => onShowMoreReplies({ postId: id })}>\n {t('show_more')}\n </Button>\n )}\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Flex>\n </CardContent>\n {!!replies?.length && <StyledReplies>{replies}</StyledReplies>}\n {replyInputShown || replyInputOpen ? (\n <CardContent>\n <FeedReplyInput\n onSetInputRef={({ ref }) => {\n setReplyInputRef(ref);\n }}\n id={id}\n commentLabel={replyInput.commentLabel}\n attachments={replyInput.attachments}\n placeholder={replyInput.placeholder}\n onFilesAdded={replyInput.onFilesAdded}\n onSubmit={e => {\n setReplyInputOpen(false);\n replyInput.onSubmit(e);\n }}\n />\n </CardContent>\n ) : null}\n {onShowLessReplies && !!replies.length && (\n <Flex container={{ justify: 'center', pad: [0, 0, 1], gap: 1 }}>\n <Button\n variant='link'\n onClick={() => {\n onShowLessReplies({ postId: id });\n suppressNextAnnouncement.current = true;\n }}\n >\n {t('show_less')}\n </Button>\n {repliesLoading && <Progress placement='inline' />}\n </Flex>\n )}\n </Card>\n </FeedReplyContext.Provider>\n );\n};\n\nFeedPost.defaultProps = defaultProps;\n\nexport default FeedPost;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionButton.d.ts","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAKb,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAKjC,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"MentionButton.d.ts","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,YAAY,EAKb,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAKjC,UAAU,kBAAkB;IAC1B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC;IAChD,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgGvE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;YAKW,MAAM;cAAQ,MAAM;cAAQ,MAAM;;;uBAWxD,MAAM;;;;;;CAW1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -62,7 +62,7 @@ const MentionButton = forwardRef(({ children, id: idProp = '', text: textProp =
|
|
|
62
62
|
text,
|
|
63
63
|
type
|
|
64
64
|
})
|
|
65
|
-
: undefined, spellCheck: false, children: isValidElement(children) ? children : text })) : (_jsx(StyledButton, { ...restProps, ref: mentionRef, variant: 'link', onClick: handleClick, spellCheck: false, children: isValidElement(children) ? children : text })), _jsx(Popover, { ref: popoverRef, show: showPopover, target: mentionRef.current, placement: 'bottom-start', arrow: true, children: mentionContent })] }));
|
|
65
|
+
: undefined, spellCheck: false, children: isValidElement(children) ? children : text })) : (_jsx(StyledButton, { ...restProps, ref: mentionRef, variant: 'link', onClick: handleClick, spellCheck: false, children: isValidElement(children) ? children : text })), _jsx(Popover, { ref: popoverRef, show: showPopover, target: mentionRef.current, placement: 'bottom-start', portal: true, arrow: true, children: mentionContent })] }));
|
|
66
66
|
});
|
|
67
67
|
export const MentionButtonConfig = {
|
|
68
68
|
type: 'mention',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACV,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAenD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;CAMlC,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;CAM9B,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;AAEvC,MAAM,aAAa,GAAyD,UAAU,CACpF,CACE,EACE,QAAQ,EACR,EAAE,EAAE,MAAM,GAAG,EAAE,EACf,IAAI,EAAE,QAAQ,GAAG,EAAE,EACnB,IAAI,EAAE,QAAQ,GAAG,EAAE,EACnB,IAAI,EAAE,QAAQ,GAAG,EAAE,EACnB,GAAG,SAAS,EACwB,EACtC,GAA2B,EAC3B,EAAE;IACF,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACrE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,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,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAC/D,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/B,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACnC,IAAI,IAAI;YAAE,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE7C,OAAO,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5F,OAAO;YACL,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n Popover,\n useConsolidatedRef,\n useOuterEvent\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [showPopover, setShowPopover] = useState(false);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const mentionRef = useConsolidatedRef(ref);\n const popoverRef = useRef(null);\n\n useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {\n setShowPopover(false);\n });\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = () => {\n const comp = onMentionClick?.({\n id,\n text,\n type\n });\n if (comp) setShowPopover(true);\n setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n <Popover\n ref={popoverRef}\n show={showPopover}\n target={mentionRef.current}\n placement='bottom-start'\n arrow\n >\n {mentionContent}\n </Popover>\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
|
|
1
|
+
{"version":3,"file":"MentionButton.js","sourceRoot":"","sources":["../../../src/components/MentionButton/MentionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,cAAc,EAId,UAAU,EACV,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAenD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;CAMlC,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;CAM9B,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;AAEvC,MAAM,aAAa,GAAyD,UAAU,CAC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Component,\n isValidElement,\n PropsWithoutRef,\n ReactElement,\n Ref,\n useContext,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n ForwardProps,\n Link,\n Popover,\n useConsolidatedRef,\n useOuterEvent\n} from '@pega/cosmos-react-core';\nimport { getXMLAttributes } from '@pega/cosmos-react-rte';\n\nimport { FeedContext } from '../Feed/Feed.context';\n\ninterface MentionButtonProps {\n /** Text for the button, or an object containing all necessary props. */\n children: Record<string, string> | ReactElement;\n /** The id of the mention. */\n id?: string;\n /** The text of the mention button. */\n text?: string;\n /** Designates the type of the mention for proper handling on click. */\n type?: string;\n /** If an href is provided, render a link. Otherwise, render a button. */\n href?: string;\n}\n\nconst StyledButton = styled(Button)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst StyledLink = styled(Link)`\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: none;\n text-decoration: underline;\n }\n`;\n\nconst serializer = new XMLSerializer();\n\nconst MentionButton: FunctionComponent<MentionButtonProps & ForwardProps> = forwardRef(\n (\n {\n children,\n id: idProp = '',\n text: textProp = '',\n type: typeProp = '',\n href: hrefProp = '',\n ...restProps\n }: PropsWithoutRef<MentionButtonProps>,\n ref: Ref<HTMLButtonElement>\n ) => {\n const { onMentionClick, onMentionPreview } = useContext(FeedContext);\n const [showPopover, setShowPopover] = useState(false);\n const [mentionContent, setMentionContent] = useState<JSX.Element | undefined>();\n const mentionRef = useConsolidatedRef(ref);\n const popoverRef = useRef(null);\n\n useOuterEvent(['click', 'focusin'], [mentionRef, popoverRef], () => {\n setShowPopover(false);\n });\n\n let id = '';\n let text = '';\n let type = '';\n let href = '';\n\n if (!isValidElement(children)) {\n if (!children.id || !children.text || !children.type) return <span>{children.rawText}</span>;\n id = children.id;\n text = children.text;\n type = children.type;\n href = children.href || '';\n } else {\n id = idProp;\n text = textProp;\n type = typeProp;\n href = hrefProp;\n }\n\n const handleClick = () => {\n const comp = onMentionClick?.({\n id,\n text,\n type\n });\n if (comp) setShowPopover(true);\n setMentionContent(comp);\n };\n\n return (\n <>\n {href ? (\n <StyledLink\n {...restProps}\n ref={mentionRef}\n href={href}\n previewable={!!onMentionPreview}\n onPreview={\n onMentionPreview\n ? () =>\n onMentionPreview({\n id,\n text,\n type\n })\n : undefined\n }\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledLink>\n ) : (\n <StyledButton\n {...restProps}\n ref={mentionRef}\n variant='link'\n onClick={handleClick}\n spellCheck={false}\n >\n {isValidElement(children) ? children : text}\n </StyledButton>\n )}\n <Popover\n ref={popoverRef}\n show={showPopover}\n target={mentionRef.current}\n placement='bottom-start'\n portal\n arrow\n >\n {mentionContent}\n </Popover>\n </>\n );\n }\n);\n\nexport const MentionButtonConfig = {\n type: 'mention',\n xmlElement: 'pega-mention',\n regexPattern: /(?:^|)<pega-mention (?:[^\\n/]|\\/(?!>))+\\/>/g,\n component: MentionButton,\n inject: ({ id, type, text, href }: { id: string; type: string; text: string; href?: string }) => {\n if (!id || !type || !text) return;\n\n const element = document.createElementNS(null, 'pega-mention');\n element.setAttribute('id', id);\n element.setAttribute('text', text);\n element.setAttribute('type', type);\n if (href) element.setAttribute('href', href);\n\n return serializer.serializeToString(element);\n },\n extract: (element: string) => {\n const attributes = getXMLAttributes(element);\n\n if (!attributes || !attributes.id || !attributes.text || !attributes.type) return undefined;\n return {\n id: attributes.id,\n text: attributes.text,\n type: attributes.type,\n href: attributes.href\n };\n }\n};\n\nexport default MentionButton;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-social",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.4",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "3.0.0-rc.
|
|
24
|
-
"@pega/cosmos-react-rte": "3.0.0-rc.
|
|
25
|
-
"@pega/cosmos-react-work": "3.0.0-rc.
|
|
23
|
+
"@pega/cosmos-react-core": "3.0.0-rc.4",
|
|
24
|
+
"@pega/cosmos-react-rte": "3.0.0-rc.4",
|
|
25
|
+
"@pega/cosmos-react-work": "3.0.0-rc.4",
|
|
26
26
|
"@types/react": "^16.14.24 || ^17.0.38",
|
|
27
27
|
"@types/react-dom": "^16.9.14 || ^17.0.11",
|
|
28
28
|
"@types/styled-components": "^5.1.7",
|