@pega/cosmos-react-social 3.0.0-dev.12.0 → 3.0.0-dev.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Email/Email.d.ts.map +1 -1
- package/lib/components/Email/Email.js +32 -18
- package/lib/components/Email/Email.js.map +1 -1
- package/lib/components/Email/Email.styles.d.ts +12 -0
- package/lib/components/Email/Email.styles.d.ts.map +1 -1
- package/lib/components/Email/Email.styles.js +55 -0
- package/lib/components/Email/Email.styles.js.map +1 -1
- package/lib/components/Email/Email.types.d.ts +71 -28
- package/lib/components/Email/Email.types.d.ts.map +1 -1
- package/lib/components/Email/Email.types.js.map +1 -1
- package/lib/components/Email/EmailComposer.d.ts.map +1 -1
- package/lib/components/Email/EmailComposer.js +60 -103
- package/lib/components/Email/EmailComposer.js.map +1 -1
- package/lib/components/Email/EmailManager.d.ts +6 -0
- package/lib/components/Email/EmailManager.d.ts.map +1 -0
- package/lib/components/Email/EmailManager.js +36 -0
- package/lib/components/Email/EmailManager.js.map +1 -0
- package/lib/components/Email/EmailSelector.d.ts +3 -1
- package/lib/components/Email/EmailSelector.d.ts.map +1 -1
- package/lib/components/Email/EmailSelector.js +5 -10
- package/lib/components/Email/EmailSelector.js.map +1 -1
- package/lib/components/Email/EmailShell.d.ts.map +1 -1
- package/lib/components/Email/EmailShell.js +4 -1
- package/lib/components/Email/EmailShell.js.map +1 -1
- package/lib/components/Email/EmailSummaryList.d.ts.map +1 -1
- package/lib/components/Email/EmailSummaryList.js +8 -8
- package/lib/components/Email/EmailSummaryList.js.map +1 -1
- package/lib/components/Email/EntityList.d.ts.map +1 -1
- package/lib/components/Email/EntityList.js +44 -5
- package/lib/components/Email/EntityList.js.map +1 -1
- package/lib/components/Email/index.d.ts +2 -1
- package/lib/components/Email/index.d.ts.map +1 -1
- package/lib/components/Email/index.js +1 -0
- package/lib/components/Email/index.js.map +1 -1
- package/lib/components/Feed/Feed.context.d.ts +9 -1
- 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/Feed.d.ts +3 -1
- package/lib/components/Feed/Feed.d.ts.map +1 -1
- package/lib/components/Feed/Feed.js +2 -1
- package/lib/components/Feed/Feed.js.map +1 -1
- package/lib/components/Feed/FeedRichText.d.ts.map +1 -1
- package/lib/components/Feed/FeedRichText.js +18 -10
- package/lib/components/Feed/FeedRichText.js.map +1 -1
- package/lib/components/MentionButton/MentionButton.d.ts +2 -0
- package/lib/components/MentionButton/MentionButton.d.ts.map +1 -1
- package/lib/components/MentionButton/MentionButton.js +21 -5
- package/lib/components/MentionButton/MentionButton.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAuBb,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAa,UAAU,EAAe,MAAM,eAAe,CAAC;AA+CnE,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CA4avD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, Fragment, useRef, useState, useMemo } from 'react';
|
|
4
|
-
import { Text, SummaryItem, Avatar, Flex, EmailDisplay, Button, Icon, Sentiment, useOuterEvent, Popover, useElement, CardContent, useI18n, FileDisplay, useBreakpoint, DateTimeDisplay, useConfiguration, MetaList, createStringMatcher } from '@pega/cosmos-react-core';
|
|
3
|
+
import { forwardRef, Fragment, useRef, useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import { Text, SummaryItem, Avatar, Flex, EmailDisplay, Button, Icon, Sentiment, useOuterEvent, Popover, useElement, CardContent, useI18n, FileDisplay, useBreakpoint, DateTimeDisplay, useConfiguration, MetaList, createStringMatcher, useScrollToggle } from '@pega/cosmos-react-core';
|
|
5
5
|
import { RichTextViewer } from '@pega/cosmos-react-rte';
|
|
6
6
|
import EmailEntity from './EmailEntity';
|
|
7
7
|
import ContextMenuPopover from './ContextMenuPopover';
|
|
@@ -30,6 +30,7 @@ const Email = forwardRef((props, ref) => {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
const [open, showPopover] = useState(false);
|
|
33
|
+
const { disableScroll, enableScroll } = useScrollToggle();
|
|
33
34
|
if (from) {
|
|
34
35
|
emailMoreInfoFields.push({
|
|
35
36
|
id: 'from',
|
|
@@ -122,16 +123,24 @@ const Email = forwardRef((props, ref) => {
|
|
|
122
123
|
`; +${t('more_count', [to.length - OVERFLOW_TO_EMAIL_COUNT])}`] }),
|
|
123
124
|
_jsxs(Text, { variant: 'secondary', children: [`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `, _jsx(DateTimeDisplay, { variant: 'datetime', format: 'short', value: timeStamp })] })
|
|
124
125
|
];
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (open)
|
|
128
|
+
disableScroll();
|
|
129
|
+
else
|
|
130
|
+
enableScroll();
|
|
131
|
+
}, [open]);
|
|
125
132
|
return (_jsxs(Flex, { as: StyledEmail, container: {
|
|
126
133
|
direction: 'column',
|
|
127
134
|
gap: 1
|
|
128
|
-
}, ref: ref, ...restProps, onClick:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
}, ref: ref, ...restProps, onClick: open
|
|
136
|
+
? () => {
|
|
137
|
+
showPopover(false);
|
|
138
|
+
setcurrentTarget({
|
|
139
|
+
targetNode: null,
|
|
140
|
+
cursorPosition: { x: 0, y: 0 }
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
: undefined, children: [_jsx(SummaryItem, { as: StyledEmailHeader, visual: _jsx(Avatar, { ...from.avatarProps, name: from.fullName }), ref: headerRef, primary: _jsxs(Flex, { container: {
|
|
135
144
|
gap: 1,
|
|
136
145
|
alignItems: 'center'
|
|
137
146
|
}, children: [_jsx(StyledFromEmailDisplay, { value: from.emailAddress, displayText: from.fullName, variant: 'text' }), sentiment && _jsx(Sentiment, { ...sentiment, labelHidden: true })] }), secondary: _jsxs(Flex, { container: {
|
|
@@ -149,16 +158,21 @@ const Email = forwardRef((props, ref) => {
|
|
|
149
158
|
direction: 'column',
|
|
150
159
|
gap: 2,
|
|
151
160
|
pad: [0, 2]
|
|
152
|
-
}, children: [subject && (_jsxs(Text, { variant: 'primary', children: [t('subject'), ": ", subject] })), _jsx(StyledEmailBody, { onContextMenu:
|
|
153
|
-
|
|
154
|
-
e.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
}, children: [subject && (_jsxs(Text, { variant: 'primary', children: [t('subject'), ": ", subject] })), _jsx(StyledEmailBody, { onContextMenu: contextMenu
|
|
162
|
+
? (e) => {
|
|
163
|
+
if (e.target instanceof HTMLElement && e.target.innerText.trim()) {
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
showPopover(true);
|
|
166
|
+
setcurrentTarget({
|
|
167
|
+
targetNode: e.target,
|
|
168
|
+
cursorPosition: {
|
|
169
|
+
x: e.pageX - window.scrollX,
|
|
170
|
+
y: e.pageY - window.scrollY
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
160
174
|
}
|
|
161
|
-
|
|
175
|
+
: undefined, children: renderedBody }), forwardedContent && forwardedContent.length > 0 && (_jsxs(_Fragment, { children: [_jsx(StyledForwardedContentToggle, { variant: 'simple', icon: true, onClick: () => {
|
|
162
176
|
setShowForwardedContent(prev => !prev);
|
|
163
177
|
}, label: showForwardedContent
|
|
164
178
|
? t('collapse_forwarded_message')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EAIR,MAAM,EACN,QAAQ,EACR,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,IAAI,EAEJ,SAAS,EACT,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,QAAQ,EAER,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,gCAAgC,EAChC,eAAe,EACf,kCAAkC,EAClC,4BAA4B,EAC5B,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AAExB,MAAM,gBAAgB,GAAG,CAAC,EACxB,UAAU,EACV,gBAAgB,EAChB,aAAa,EAKd,EAAE,EAAE;IACH,OAAO,CACL,4BACG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5D,MAAC,QAAQ,eACN,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACpB,K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AAC,IAAI,EAAC,OAAO,GAAG,EACrB,yBAAO,CAAC,CAAC,OAAO,CAAC,GAAQ,IACpB,GACA,EACR,UAAU,IAAI,CACb,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,CAAC,EAAE,CAAC,CAAC;gCACjB,CAAC,YAED,MAAC,IAAI,IACH,SAAS,EAAE;wCACT,GAAG,EAAE,CAAC;wCACN,UAAU,EAAE,QAAQ;qCACrB,aAED,KAAC,IAAI,IAAC,IAAI,EAAC,WAAW,GAAG,EACzB,yBAAO,CAAC,CAAC,WAAW,CAAC,GAAQ,IACxB,GACA,CACV,EACA,SAAS,IAAI,CACZ,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE;oCACZ,SAAS,CAAC,EAAE,CAAC,CAAC;gCAChB,CAAC,YAED,MAAC,IAAI,IACH,SAAS,EAAE;wCACT,GAAG,EAAE,CAAC;wCACN,UAAU,EAAE,QAAQ;qCACrB,aAED,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,GAAG,EACvB,yBAAO,CAAC,CAAC,SAAS,CAAC,GAAQ,IACtB,GACA,CACV,IACG,IACD,IACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n forwardRef,\n Fragment,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n useRef,\n useState,\n useMemo\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n SummaryItem,\n Avatar,\n Flex,\n EmailDisplay,\n Button,\n Icon,\n FieldValueListProps,\n Sentiment,\n useOuterEvent,\n Popover,\n useElement,\n CardContent,\n useI18n,\n FileDisplay,\n useBreakpoint,\n DateTimeDisplay,\n useConfiguration,\n MetaList,\n MetaListProps,\n createStringMatcher\n} from '@pega/cosmos-react-core';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport EmailEntity from './EmailEntity';\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { EmailUser, EmailProps, TargetProps } from './Email.types';\nimport {\n StyledEmail,\n StyledEmailDisplay,\n StyledEmailHeader,\n StyledFromEmailDisplay,\n StyledEmailMoreInfoButton,\n StyledEmailMoreInfoPopover,\n StyledEmailPrimaryFieldValueList,\n StyledEmailBody,\n StyledEmailSecondaryFieldValueList,\n StyledSuggestedRepliesButton,\n StyledSuggestedRepliesMenuButton,\n StyledForwardedContentToggle\n} from './Email.styles';\n\nconst EmailDisplayList = ({\n emailUsers,\n showEmailAddress,\n showShortName\n}: {\n emailUsers: EmailUser[];\n showEmailAddress?: boolean;\n showShortName?: boolean;\n}) => {\n return (\n <>\n {emailUsers.map(({ emailAddress, fullName, shortName }, i) => (\n <Fragment key={emailAddress}>\n {i === 0 ? '' : '; '}\n <EmailDisplay\n value={emailAddress}\n displayText={`${showShortName ? shortName : fullName}${\n showEmailAddress ? ` <${emailAddress}>` : ''\n }`}\n variant='text'\n as={StyledEmailDisplay}\n />\n </Fragment>\n ))}\n </>\n );\n};\n\nconst OVERFLOW_TO_EMAIL_COUNT = 2;\nconst OVERFLOW_EMAIL_SUGGESTION_COUNT = 2;\n\nconst Email: FunctionComponent<EmailProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<EmailProps>, ref: EmailProps['ref']) => {\n const {\n id,\n from,\n to = [],\n cc = [],\n bcc = [],\n actions = [],\n timeStamp,\n sentiment,\n subject,\n body,\n forwardedContent,\n attachments = [],\n suggestions = [],\n entityHighlightMapping = [],\n onReply,\n onForward,\n onReplyAll,\n onSuggestionClick,\n contextMenu,\n ...restProps\n } = props;\n const t = useI18n();\n\n const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement<HTMLButtonElement>(null);\n const [showEmailMoreInfo, setShowEmailMoreInfo] = useState(false);\n const [showForwardedContent, setShowForwardedContent] = useState(false);\n const [emailMoreInfoPopover, setEmailMoreInfoPopover] = useElement<HTMLDivElement>(null);\n const emailMoreInfoFields: FieldValueListProps['fields'] = [];\n\n const headerRef = useRef<HTMLDivElement>(null);\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: headerRef });\n const { locale } = useConfiguration();\n const [currentTarget, setcurrentTarget] = useState<TargetProps>({\n targetNode: null,\n cursorPosition: {\n x: 0,\n y: 0\n }\n });\n const [open, showPopover] = useState(false);\n if (from) {\n emailMoreInfoFields.push({\n id: 'from',\n name: t('from'),\n value: from.emailAddress\n });\n }\n\n if (to.length > 0) {\n emailMoreInfoFields.push({\n id: 'to',\n name: t('to'),\n value: <EmailDisplayList emailUsers={to} showEmailAddress />\n });\n }\n\n if (cc.length > 0) {\n emailMoreInfoFields.push({\n id: 'cc',\n name: 'CC',\n value: <EmailDisplayList emailUsers={cc} showEmailAddress />\n });\n }\n\n if (bcc.length > 0) {\n emailMoreInfoFields.push({\n id: 'BCC',\n name: 'BCC',\n value: <EmailDisplayList emailUsers={bcc} showEmailAddress />\n });\n }\n\n if (timeStamp) {\n emailMoreInfoFields.push({\n id: 'date',\n name: t('date'),\n value: (\n <Text>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )\n });\n }\n\n useOuterEvent('mousedown', [emailMoreInfoPopover], () => {\n setShowEmailMoreInfo(false);\n });\n\n const secondaryFields: FieldValueListProps['fields'] = [];\n\n if (attachments.length > 0) {\n secondaryFields.push({\n id: 'attachments',\n name: '',\n value: (\n <Flex container={{ gap: 1, wrap: 'wrap' }}>\n {attachments.map(attachmentProps => (\n <FileDisplay {...attachmentProps} key={attachmentProps.value} />\n ))}\n </Flex>\n )\n });\n }\n\n if (suggestions.length > 0) {\n secondaryFields.push({\n id: 'suggested_replies',\n name: '',\n value: (\n <Flex container={{ wrap: 'wrap' }}>\n {suggestions\n .slice(0, OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => (\n <StyledSuggestedRepliesButton\n variant='secondary'\n key={suggestionId}\n onClick={() => {\n onSuggestionClick?.(id, suggestionId);\n }}\n >\n {title}\n </StyledSuggestedRepliesButton>\n ))}\n {suggestions.length > OVERFLOW_EMAIL_SUGGESTION_COUNT && (\n <StyledSuggestedRepliesMenuButton\n text='Other responses'\n key='other_responses'\n variant='secondary'\n menu={{\n items: suggestions\n .slice(OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => {\n return {\n primary: title,\n id: suggestionId,\n onClick: () => {\n onSuggestionClick?.(id, suggestionId);\n }\n };\n })\n }}\n />\n )}\n </Flex>\n )\n });\n }\n\n let renderedBody: ReactNode = body;\n\n const entityConfigs = useMemo(() => {\n return entityHighlightMapping.map(entity => {\n const regExp = createStringMatcher(entity.value, 'contains', 'gi');\n\n return {\n type: 'entity',\n regexPattern: regExp,\n component: () => <EmailEntity entity={entity} />\n };\n });\n }, [entityHighlightMapping]);\n\n // Apply entity highlighting only on string body\n if (typeof body === 'string') {\n const { cursorPosition, targetNode } = currentTarget;\n\n renderedBody = (\n <>\n <RichTextViewer\n content={body}\n type='html'\n interactionRenderers={entityConfigs}\n aria-label={t('unique_entities', [entityConfigs.length], {\n count: entityConfigs.length\n })}\n role='group'\n />\n\n {contextMenu && open && (\n <ContextMenuPopover\n cursorPosition={cursorPosition}\n contextMenu={contextMenu}\n targetNode={targetNode as Node}\n />\n )}\n </>\n );\n }\n\n const emailMetaListItems: MetaListProps['items'] = [\n <Text variant='secondary'>\n {`${t('to')}: `}\n <EmailDisplayList emailUsers={to.slice(0, OVERFLOW_TO_EMAIL_COUNT)} showShortName />\n {to.length > OVERFLOW_TO_EMAIL_COUNT &&\n `; +${t('more_count', [to.length - OVERFLOW_TO_EMAIL_COUNT])}`}\n </Text>,\n <Text variant='secondary'>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n ];\n\n return (\n <Flex\n as={StyledEmail}\n container={{\n direction: 'column',\n gap: 1\n }}\n ref={ref}\n {...restProps}\n onClick={() => {\n showPopover(false);\n setcurrentTarget({\n targetNode: null,\n cursorPosition: { x: 0, y: 0 }\n });\n }}\n >\n <SummaryItem\n as={StyledEmailHeader}\n visual={<Avatar {...from.avatarProps} name={from.fullName} />}\n ref={headerRef}\n primary={\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <StyledFromEmailDisplay\n value={from.emailAddress}\n displayText={from.fullName}\n variant='text'\n />\n {sentiment && <Sentiment {...sentiment} labelHidden />}\n </Flex>\n }\n secondary={\n <Flex\n container={{\n gap: 0,\n alignItems: 'start',\n direction: 'column'\n }}\n >\n <Flex\n container={{\n gap: 0,\n alignItems: 'start'\n }}\n >\n <MetaList items={isSmallOrAbove ? emailMetaListItems : [emailMetaListItems[0]]} />\n\n <Button\n icon\n variant='simple'\n as={StyledEmailMoreInfoButton}\n ref={setEmailMoreInfoBtnRef}\n onClick={() => {\n setShowEmailMoreInfo(true);\n }}\n label={t('show_more')}\n >\n <Icon name='arrow-micro-down' />\n </Button>\n <Popover\n as={StyledEmailMoreInfoPopover}\n show={showEmailMoreInfo}\n ref={setEmailMoreInfoPopover}\n target={emailMoreInfoBtnRef}\n placement='bottom'\n >\n <CardContent>\n <StyledEmailPrimaryFieldValueList fields={emailMoreInfoFields} />\n </CardContent>\n </Popover>\n </Flex>\n {!isSmallOrAbove && timeStamp && emailMetaListItems[1]}\n </Flex>\n }\n actions={\n <Flex\n container={{\n gap: 1\n }}\n >\n {actions}\n </Flex>\n }\n />\n <Flex\n container={{\n direction: 'column',\n gap: 2,\n pad: [0, 2]\n }}\n >\n {subject && (\n <Text variant='primary'>\n {t('subject')}: {subject}\n </Text>\n )}\n <StyledEmailBody\n onContextMenu={e => {\n if (e.target instanceof HTMLElement && contextMenu && e.target.innerText.trim()) {\n e.preventDefault();\n showPopover(true);\n setcurrentTarget({\n targetNode: e.target,\n cursorPosition: { x: e.pageX, y: e.pageY }\n });\n }\n }}\n >\n {renderedBody}\n </StyledEmailBody>\n {forwardedContent && forwardedContent.length > 0 && (\n <>\n <StyledForwardedContentToggle\n variant='simple'\n icon\n onClick={() => {\n setShowForwardedContent(prev => !prev);\n }}\n label={\n showForwardedContent\n ? t('collapse_forwarded_message')\n : t('expand_forwarded_message')\n }\n compact\n >\n <Icon name='more-alt' />\n </StyledForwardedContentToggle>\n {showForwardedContent && <RichTextViewer content={forwardedContent} type='html' />}\n </>\n )}\n </Flex>\n <Flex\n container={{\n direction: 'column',\n gap: 1,\n pad: [0, 2]\n }}\n >\n <StyledEmailSecondaryFieldValueList fields={secondaryFields} />\n <div>\n <Button\n variant='simple'\n onClick={() => {\n onReply?.(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='reply' />\n <span>{t('reply')}</span>\n </Flex>\n </Button>\n {onReplyAll && (\n <Button\n variant='simple'\n onClick={() => {\n onReplyAll(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='reply-all' />\n <span>{t('reply_all')}</span>\n </Flex>\n </Button>\n )}\n {onForward && (\n <Button\n variant='simple'\n onClick={() => {\n onForward(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='forward' />\n <span>{t('forward')}</span>\n </Flex>\n </Button>\n )}\n </div>\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default Email;\n"]}
|
|
1
|
+
{"version":3,"file":"Email.js","sourceRoot":"","sources":["../../../src/components/Email/Email.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EAIR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EAEV,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,IAAI,EAEJ,SAAS,EACT,a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ACpB,GACA,EACR,UAAU,IAAI,CACb,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,CAAC,EAAE,CAAC,CAAC;gCACjB,CAAC,YAED,MAAC,IAAI,IACH,SAAS,EAAE;wCACT,GAAG,EAAE,CAAC;wCACN,UAAU,EAAE,QAAQ;qCACrB,aAED,KAAC,IAAI,IAAC,IAAI,EAAC,WAAW,GAAG,EACzB,yBAAO,CAAC,CAAC,WAAW,CAAC,GAAQ,IACxB,GACA,CACV,EACA,SAAS,IAAI,CACZ,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE;oCACZ,SAAS,CAAC,EAAE,CAAC,CAAC;gCAChB,CAAC,YAED,MAAC,IAAI,IACH,SAAS,EAAE;wCACT,GAAG,EAAE,CAAC;wCACN,UAAU,EAAE,QAAQ;qCACrB,aAED,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,GAAG,EACvB,yBAAO,CAAC,CAAC,SAAS,CAAC,GAAQ,IACtB,GACA,CACV,IACG,IACD,IACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n forwardRef,\n Fragment,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n useRef,\n useState,\n useMemo,\n useEffect,\n MouseEvent\n} from 'react';\n\nimport {\n ForwardProps,\n Text,\n SummaryItem,\n Avatar,\n Flex,\n EmailDisplay,\n Button,\n Icon,\n FieldValueListProps,\n Sentiment,\n useOuterEvent,\n Popover,\n useElement,\n CardContent,\n useI18n,\n FileDisplay,\n useBreakpoint,\n DateTimeDisplay,\n useConfiguration,\n MetaList,\n MetaListProps,\n createStringMatcher,\n useScrollToggle\n} from '@pega/cosmos-react-core';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport EmailEntity from './EmailEntity';\nimport ContextMenuPopover from './ContextMenuPopover';\nimport { EmailUser, EmailProps, TargetProps } from './Email.types';\nimport {\n StyledEmail,\n StyledEmailDisplay,\n StyledEmailHeader,\n StyledFromEmailDisplay,\n StyledEmailMoreInfoButton,\n StyledEmailMoreInfoPopover,\n StyledEmailPrimaryFieldValueList,\n StyledEmailBody,\n StyledEmailSecondaryFieldValueList,\n StyledSuggestedRepliesButton,\n StyledSuggestedRepliesMenuButton,\n StyledForwardedContentToggle\n} from './Email.styles';\n\nconst EmailDisplayList = ({\n emailUsers,\n showEmailAddress,\n showShortName\n}: {\n emailUsers: EmailUser[];\n showEmailAddress?: boolean;\n showShortName?: boolean;\n}) => {\n return (\n <>\n {emailUsers.map(({ emailAddress, fullName, shortName }, i) => (\n <Fragment key={emailAddress}>\n {i === 0 ? '' : '; '}\n <EmailDisplay\n value={emailAddress}\n displayText={`${showShortName ? shortName : fullName}${\n showEmailAddress ? ` <${emailAddress}>` : ''\n }`}\n variant='text'\n as={StyledEmailDisplay}\n />\n </Fragment>\n ))}\n </>\n );\n};\n\nconst OVERFLOW_TO_EMAIL_COUNT = 2;\nconst OVERFLOW_EMAIL_SUGGESTION_COUNT = 2;\n\nconst Email: FunctionComponent<EmailProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<EmailProps>, ref: EmailProps['ref']) => {\n const {\n id,\n from,\n to = [],\n cc = [],\n bcc = [],\n actions = [],\n timeStamp,\n sentiment,\n subject,\n body,\n forwardedContent,\n attachments = [],\n suggestions = [],\n entityHighlightMapping = [],\n onReply,\n onForward,\n onReplyAll,\n onSuggestionClick,\n contextMenu,\n ...restProps\n } = props;\n const t = useI18n();\n\n const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement<HTMLButtonElement>(null);\n const [showEmailMoreInfo, setShowEmailMoreInfo] = useState(false);\n const [showForwardedContent, setShowForwardedContent] = useState(false);\n const [emailMoreInfoPopover, setEmailMoreInfoPopover] = useElement<HTMLDivElement>(null);\n const emailMoreInfoFields: FieldValueListProps['fields'] = [];\n\n const headerRef = useRef<HTMLDivElement>(null);\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: headerRef });\n const { locale } = useConfiguration();\n const [currentTarget, setcurrentTarget] = useState<TargetProps>({\n targetNode: null,\n cursorPosition: {\n x: 0,\n y: 0\n }\n });\n const [open, showPopover] = useState(false);\n const { disableScroll, enableScroll } = useScrollToggle();\n\n if (from) {\n emailMoreInfoFields.push({\n id: 'from',\n name: t('from'),\n value: from.emailAddress\n });\n }\n\n if (to.length > 0) {\n emailMoreInfoFields.push({\n id: 'to',\n name: t('to'),\n value: <EmailDisplayList emailUsers={to} showEmailAddress />\n });\n }\n\n if (cc.length > 0) {\n emailMoreInfoFields.push({\n id: 'cc',\n name: 'CC',\n value: <EmailDisplayList emailUsers={cc} showEmailAddress />\n });\n }\n\n if (bcc.length > 0) {\n emailMoreInfoFields.push({\n id: 'BCC',\n name: 'BCC',\n value: <EmailDisplayList emailUsers={bcc} showEmailAddress />\n });\n }\n\n if (timeStamp) {\n emailMoreInfoFields.push({\n id: 'date',\n name: t('date'),\n value: (\n <Text>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(\n new Date(timeStamp)\n )}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n )\n });\n }\n\n useOuterEvent('mousedown', [emailMoreInfoPopover], () => {\n setShowEmailMoreInfo(false);\n });\n\n const secondaryFields: FieldValueListProps['fields'] = [];\n\n if (attachments.length > 0) {\n secondaryFields.push({\n id: 'attachments',\n name: '',\n value: (\n <Flex container={{ gap: 1, wrap: 'wrap' }}>\n {attachments.map(attachmentProps => (\n <FileDisplay {...attachmentProps} key={attachmentProps.value} />\n ))}\n </Flex>\n )\n });\n }\n\n if (suggestions.length > 0) {\n secondaryFields.push({\n id: 'suggested_replies',\n name: '',\n value: (\n <Flex container={{ wrap: 'wrap' }}>\n {suggestions\n .slice(0, OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => (\n <StyledSuggestedRepliesButton\n variant='secondary'\n key={suggestionId}\n onClick={() => {\n onSuggestionClick?.(id, suggestionId);\n }}\n >\n {title}\n </StyledSuggestedRepliesButton>\n ))}\n {suggestions.length > OVERFLOW_EMAIL_SUGGESTION_COUNT && (\n <StyledSuggestedRepliesMenuButton\n text='Other responses'\n key='other_responses'\n variant='secondary'\n menu={{\n items: suggestions\n .slice(OVERFLOW_EMAIL_SUGGESTION_COUNT)\n .map(({ id: suggestionId, title }) => {\n return {\n primary: title,\n id: suggestionId,\n onClick: () => {\n onSuggestionClick?.(id, suggestionId);\n }\n };\n })\n }}\n />\n )}\n </Flex>\n )\n });\n }\n\n let renderedBody: ReactNode = body;\n\n const entityConfigs = useMemo(() => {\n return entityHighlightMapping.map(entity => {\n const regExp = createStringMatcher(entity.value, 'contains', 'gi');\n\n return {\n type: 'entity',\n regexPattern: regExp,\n component: () => <EmailEntity entity={entity} />\n };\n });\n }, [entityHighlightMapping]);\n\n // Apply entity highlighting only on string body\n if (typeof body === 'string') {\n const { cursorPosition, targetNode } = currentTarget;\n\n renderedBody = (\n <>\n <RichTextViewer\n content={body}\n type='html'\n interactionRenderers={entityConfigs}\n aria-label={t('unique_entities', [entityConfigs.length], {\n count: entityConfigs.length\n })}\n role='group'\n />\n\n {contextMenu && open && (\n <ContextMenuPopover\n cursorPosition={cursorPosition}\n contextMenu={contextMenu}\n targetNode={targetNode as Node}\n />\n )}\n </>\n );\n }\n\n const emailMetaListItems: MetaListProps['items'] = [\n <Text variant='secondary'>\n {`${t('to')}: `}\n <EmailDisplayList emailUsers={to.slice(0, OVERFLOW_TO_EMAIL_COUNT)} showShortName />\n {to.length > OVERFLOW_TO_EMAIL_COUNT &&\n `; +${t('more_count', [to.length - OVERFLOW_TO_EMAIL_COUNT])}`}\n </Text>,\n <Text variant='secondary'>\n {`${new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(new Date(timeStamp))}, `}\n <DateTimeDisplay variant='datetime' format='short' value={timeStamp} />\n </Text>\n ];\n\n useEffect(() => {\n if (open) disableScroll();\n else enableScroll();\n }, [open]);\n\n return (\n <Flex\n as={StyledEmail}\n container={{\n direction: 'column',\n gap: 1\n }}\n ref={ref}\n {...restProps}\n onClick={\n open\n ? () => {\n showPopover(false);\n setcurrentTarget({\n targetNode: null,\n cursorPosition: { x: 0, y: 0 }\n });\n }\n : undefined\n }\n >\n <SummaryItem\n as={StyledEmailHeader}\n visual={<Avatar {...from.avatarProps} name={from.fullName} />}\n ref={headerRef}\n primary={\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <StyledFromEmailDisplay\n value={from.emailAddress}\n displayText={from.fullName}\n variant='text'\n />\n {sentiment && <Sentiment {...sentiment} labelHidden />}\n </Flex>\n }\n secondary={\n <Flex\n container={{\n gap: 0,\n alignItems: 'start',\n direction: 'column'\n }}\n >\n <Flex\n container={{\n gap: 0,\n alignItems: 'start'\n }}\n >\n <MetaList items={isSmallOrAbove ? emailMetaListItems : [emailMetaListItems[0]]} />\n\n <Button\n icon\n variant='simple'\n as={StyledEmailMoreInfoButton}\n ref={setEmailMoreInfoBtnRef}\n onClick={() => {\n setShowEmailMoreInfo(true);\n }}\n label={t('show_more')}\n >\n <Icon name='arrow-micro-down' />\n </Button>\n <Popover\n as={StyledEmailMoreInfoPopover}\n show={showEmailMoreInfo}\n ref={setEmailMoreInfoPopover}\n target={emailMoreInfoBtnRef}\n placement='bottom'\n >\n <CardContent>\n <StyledEmailPrimaryFieldValueList fields={emailMoreInfoFields} />\n </CardContent>\n </Popover>\n </Flex>\n {!isSmallOrAbove && timeStamp && emailMetaListItems[1]}\n </Flex>\n }\n actions={\n <Flex\n container={{\n gap: 1\n }}\n >\n {actions}\n </Flex>\n }\n />\n <Flex\n container={{\n direction: 'column',\n gap: 2,\n pad: [0, 2]\n }}\n >\n {subject && (\n <Text variant='primary'>\n {t('subject')}: {subject}\n </Text>\n )}\n <StyledEmailBody\n onContextMenu={\n contextMenu\n ? (e: MouseEvent<HTMLDivElement>) => {\n if (e.target instanceof HTMLElement && e.target.innerText.trim()) {\n e.preventDefault();\n showPopover(true);\n setcurrentTarget({\n targetNode: e.target,\n cursorPosition: {\n x: e.pageX - window.scrollX,\n y: e.pageY - window.scrollY\n }\n });\n }\n }\n : undefined\n }\n >\n {renderedBody}\n </StyledEmailBody>\n {forwardedContent && forwardedContent.length > 0 && (\n <>\n <StyledForwardedContentToggle\n variant='simple'\n icon\n onClick={() => {\n setShowForwardedContent(prev => !prev);\n }}\n label={\n showForwardedContent\n ? t('collapse_forwarded_message')\n : t('expand_forwarded_message')\n }\n compact\n >\n <Icon name='more-alt' />\n </StyledForwardedContentToggle>\n {showForwardedContent && <RichTextViewer content={forwardedContent} type='html' />}\n </>\n )}\n </Flex>\n <Flex\n container={{\n direction: 'column',\n gap: 1,\n pad: [0, 2]\n }}\n >\n <StyledEmailSecondaryFieldValueList fields={secondaryFields} />\n <div>\n <Button\n variant='simple'\n onClick={() => {\n onReply?.(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='reply' />\n <span>{t('reply')}</span>\n </Flex>\n </Button>\n {onReplyAll && (\n <Button\n variant='simple'\n onClick={() => {\n onReplyAll(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='reply-all' />\n <span>{t('reply_all')}</span>\n </Flex>\n </Button>\n )}\n {onForward && (\n <Button\n variant='simple'\n onClick={() => {\n onForward(id);\n }}\n >\n <Flex\n container={{\n gap: 1,\n alignItems: 'center'\n }}\n >\n <Icon name='forward' />\n <span>{t('forward')}</span>\n </Flex>\n </Button>\n )}\n </div>\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default Email;\n"]}
|
|
@@ -18,4 +18,16 @@ export declare const StyledForwardedContentToggle: import("styled-components").S
|
|
|
18
18
|
export declare const StyledLoadMore: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
19
|
export declare const StyledContextMenuFieldSelector: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledContextMenuFieldSelectorProps, never>;
|
|
20
20
|
export declare const StyledContextMenu: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
+
export declare const StyledList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
+
export declare const StyledHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
+
export declare const StyledGridContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
24
|
+
showExpandedUtilities?: boolean | undefined;
|
|
25
|
+
}, never>;
|
|
26
|
+
export declare const StyledUtilitiesToggle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
27
|
+
export declare const StyledExpandedUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
28
|
+
showExpandedUtilities: boolean;
|
|
29
|
+
}, never>;
|
|
30
|
+
export declare const StyledUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
31
|
+
showExpandedUtilities: boolean;
|
|
32
|
+
}, never>;
|
|
21
33
|
//# sourceMappingURL=Email.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAoBA,OAAO,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,MAAM,eAAe,CAAC;AAEtF,eAAO,MAAM,yBAAyB,4GAIrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yGAY5B,CAAC;AAIH,eAAO,MAAM,4BAA4B,qOAUvC,CAAC;AAIH,eAAO,MAAM,gCAAgC,yOAU3C,CAAC;AAIH,eAAO,MAAM,eAAe,yGAAe,CAAC;AAE5C,eAAO,MAAM,sBAAsB,2OAMjC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0GAE9B,CAAC;AAEF,eAAO,MAAM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AIH,eAAO,MAAM,8BAA8B,0IAmB1C,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC;AAGH,eAAO,MAAM,UAAU,yGAKrB,CAAC;AAIH,eAAO,MAAM,YAAY,4GAMvB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;SAgB9B,CAAC;AAIH,eAAO,MAAM,qBAAqB,4GAKhC,CAAC;AAIH,eAAO,MAAM,uBAAuB;2BAAuC,OAAO;SASjF,CAAC;AAEF,eAAO,MAAM,eAAe;2BAAuC,OAAO;SAUzE,CAAC"}
|
|
@@ -146,4 +146,59 @@ export const StyledContextMenu = styled.div(({ theme }) => {
|
|
|
146
146
|
`;
|
|
147
147
|
});
|
|
148
148
|
StyledContextMenu.defaultProps = defaultThemeProp;
|
|
149
|
+
export const StyledList = styled.div(() => {
|
|
150
|
+
return css `
|
|
151
|
+
position: sticky;
|
|
152
|
+
top: inherit;
|
|
153
|
+
`;
|
|
154
|
+
});
|
|
155
|
+
StyledList.defaultProps = defaultThemeProp;
|
|
156
|
+
export const StyledHeader = styled.header(() => {
|
|
157
|
+
return css `
|
|
158
|
+
position: sticky;
|
|
159
|
+
top: var(--appshell-offset);
|
|
160
|
+
height: 4rem;
|
|
161
|
+
`;
|
|
162
|
+
});
|
|
163
|
+
export const StyledGridContainer = styled.div(({ theme, showExpandedUtilities }) => {
|
|
164
|
+
return css `
|
|
165
|
+
min-height: calc(100vh - var(--appshell-offset, 0rem));
|
|
166
|
+
background-color: ${theme.base.palette['app-background']};
|
|
167
|
+
top: calc(var(--appshell-offset) + var(--headerOffsetHeight));
|
|
168
|
+
${!showExpandedUtilities &&
|
|
169
|
+
css `
|
|
170
|
+
width: auto;
|
|
171
|
+
`}
|
|
172
|
+
|
|
173
|
+
${StyledList} {
|
|
174
|
+
height: calc(100vh - var(--appshell-offset) - var(--headerOffsetHeight));
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
});
|
|
178
|
+
StyledGridContainer.defaultProps = defaultThemeProp;
|
|
179
|
+
export const StyledUtilitiesToggle = styled.button(({ theme }) => {
|
|
180
|
+
return css `
|
|
181
|
+
color: ${theme.base.palette['foreground-color']};
|
|
182
|
+
align-self: flex-end;
|
|
183
|
+
`;
|
|
184
|
+
});
|
|
185
|
+
StyledUtilitiesToggle.defaultProps = defaultThemeProp;
|
|
186
|
+
export const StyledExpandedUtilities = styled.div(({ showExpandedUtilities }) => {
|
|
187
|
+
return css `
|
|
188
|
+
${!showExpandedUtilities &&
|
|
189
|
+
css `
|
|
190
|
+
display: none;
|
|
191
|
+
`}
|
|
192
|
+
`;
|
|
193
|
+
});
|
|
194
|
+
export const StyledUtilities = styled.div(({ showExpandedUtilities, theme }) => {
|
|
195
|
+
return css `
|
|
196
|
+
${showExpandedUtilities &&
|
|
197
|
+
css `
|
|
198
|
+
width: 25rem;
|
|
199
|
+
`}
|
|
200
|
+
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
201
|
+
`;
|
|
202
|
+
});
|
|
203
|
+
StyledUtilities.defaultProps = defaultThemeProp;
|
|
149
204
|
//# sourceMappingURL=Email.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACV,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAA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AEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,GAAG,CACtD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtB,MAAM,UAAU,GAAG,QAAQ;QACzB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;QAChC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC;QACxC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7C,OAAO,GAAG,CAAA;0BACY,UAAU;gCACJ,WAAW;;;;;;;KAOtC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,8BAA8B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEvE,OAAO,GAAG,CAAA;;0BAEc,mBAAmB;;GAE1C,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue,\n nlpColors\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n nlpColors[variant % nlpColors.length],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n display: inline-block;\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledEntityList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nexport const StyledForwardedContentToggle = styled(Button)`\n align-self: flex-start;\n`;\n\nStyledEntityList.defaultProps = defaultThemeProp;\n\nexport const StyledLoadMore = styled.div(({ theme }) => {\n return css`\n margin: ${theme.base.spacing} 0;\n min-height: 2rem;\n min-width: 2rem;\n `;\n});\n\nStyledLoadMore.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenuFieldSelector = styled.div<StyledContextMenuFieldSelectorProps>(\n ({ theme, selected }) => {\n const background = selected\n ? theme.base.colors.green.medium\n : theme.base.palette['primary-background'];\n const borderColor = selected\n ? theme.base.colors.green['extra-light']\n : theme.base.palette['primary-background'];\n return css`\n background-color: ${background};\n border: 0.0625rem solid ${borderColor};\n border-radius: 100%;\n display: inline-block;\n height: 0.625rem;\n width: 0.625rem;\n background-clip: content-box;\n padding: 0.0625rem;\n `;\n }\n);\n\nStyledContextMenuFieldSelector.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenu = styled.div(({ theme }) => {\n const secondaryBackground = theme.base.palette['secondary-background'];\n\n return css`\n header {\n background-color: ${secondaryBackground};\n }\n `;\n});\nStyledContextMenu.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACV,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;uBACW,KAAK,CAAC,IAAI,CAAC,OAAO;qCACJ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;4BAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,cAAc,KAAK,CAAC,IAAI,CAAC,OAAO;MACxE,YAAY,IAAI,wBAAwB;;;MAGxC,eAAe;+BACU,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAA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,CAAC;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/D,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;GAEhD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAC/C,CAAC,EAAE,qBAAqB,EAAE,EAAE,EAAE;IAC5B,OAAO,GAAG,CAAA;QACN,CAAC,qBAAqB;QACxB,GAAG,CAAA;;OAEF;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CACvC,CAAC,EAAE,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE;IACnC,OAAO,GAAG,CAAA;QACN,qBAAqB;QACvB,GAAG,CAAA;;OAEF;oCAC6B,KAAK,CAAC,IAAI,CAAC,OAAO;KACjD,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue,\n nlpColors\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n nlpColors[variant % nlpColors.length],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n display: inline-block;\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledEntityList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nexport const StyledForwardedContentToggle = styled(Button)`\n align-self: flex-start;\n`;\n\nStyledEntityList.defaultProps = defaultThemeProp;\n\nexport const StyledLoadMore = styled.div(({ theme }) => {\n return css`\n margin: ${theme.base.spacing} 0;\n min-height: 2rem;\n min-width: 2rem;\n `;\n});\n\nStyledLoadMore.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenuFieldSelector = styled.div<StyledContextMenuFieldSelectorProps>(\n ({ theme, selected }) => {\n const background = selected\n ? theme.base.colors.green.medium\n : theme.base.palette['primary-background'];\n const borderColor = selected\n ? theme.base.colors.green['extra-light']\n : theme.base.palette['primary-background'];\n return css`\n background-color: ${background};\n border: 0.0625rem solid ${borderColor};\n border-radius: 100%;\n display: inline-block;\n height: 0.625rem;\n width: 0.625rem;\n background-clip: content-box;\n padding: 0.0625rem;\n `;\n }\n);\n\nStyledContextMenuFieldSelector.defaultProps = defaultThemeProp;\n\nexport const StyledContextMenu = styled.div(({ theme }) => {\n const secondaryBackground = theme.base.palette['secondary-background'];\n\n return css`\n header {\n background-color: ${secondaryBackground};\n }\n `;\n});\nStyledContextMenu.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(() => {\n return css`\n position: sticky;\n top: inherit;\n `;\n});\n\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledHeader = styled.header(() => {\n return css`\n position: sticky;\n top: var(--appshell-offset);\n height: 4rem;\n `;\n});\n\nexport const StyledGridContainer = styled.div<{\n showExpandedUtilities?: boolean;\n}>(({ theme, showExpandedUtilities }) => {\n return css`\n min-height: calc(100vh - var(--appshell-offset, 0rem));\n background-color: ${theme.base.palette['app-background']};\n top: calc(var(--appshell-offset) + var(--headerOffsetHeight));\n ${!showExpandedUtilities &&\n css`\n width: auto;\n `}\n\n ${StyledList} {\n height: calc(100vh - var(--appshell-offset) - var(--headerOffsetHeight));\n }\n `;\n});\n\nStyledGridContainer.defaultProps = defaultThemeProp;\n\nexport const StyledUtilitiesToggle = styled.button(({ theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n align-self: flex-end;\n `;\n});\n\nStyledUtilitiesToggle.defaultProps = defaultThemeProp;\n\nexport const StyledExpandedUtilities = styled.div<{ showExpandedUtilities: boolean }>(\n ({ showExpandedUtilities }) => {\n return css`\n ${!showExpandedUtilities &&\n css`\n display: none;\n `}\n `;\n }\n);\n\nexport const StyledUtilities = styled.div<{ showExpandedUtilities: boolean }>(\n ({ showExpandedUtilities, theme }) => {\n return css`\n ${showExpandedUtilities &&\n css`\n width: 25rem;\n `}\n margin-inline-end: calc(2 * ${theme.base.spacing});\n `;\n }\n);\n\nStyledUtilities.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, FileUploadItemProps, OmitStrict, MenuProps, MenuItemProps, TooltipProps, NoChildrenProp, EmptyStateProps, ProgressProps } from '@pega/cosmos-react-core';
|
|
2
|
+
import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, FileUploadItemProps, OmitStrict, MenuProps, MenuItemProps, TooltipProps, NoChildrenProp, EmptyStateProps, ProgressProps, PageTemplateProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import { RichTextEditorProps } from '@pega/cosmos-react-rte';
|
|
4
|
+
import { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';
|
|
4
5
|
export interface EmailTemplate {
|
|
5
6
|
/** Template title */
|
|
6
7
|
title: string;
|
|
@@ -106,11 +107,9 @@ export interface EmailConversationProps extends BaseProps {
|
|
|
106
107
|
/** Callback when email conversation is expanded */
|
|
107
108
|
onExpand?: () => void;
|
|
108
109
|
}
|
|
109
|
-
export interface EmailComposerData extends Pick<EmailComposerProps, 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments' | 'responseType'> {
|
|
110
|
-
/** Array to hold the initial participants that should be default initialized in To address. */
|
|
111
|
-
to: EmailUser['emailAddress'][];
|
|
112
|
-
}
|
|
113
110
|
export declare type EmailResponseType = 'reply' | 'replyAll' | 'forward';
|
|
111
|
+
export declare type EmailComposerFieldType = 'to' | 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments' | 'responseType' | 'selectedTemplateId';
|
|
112
|
+
export declare type EmailComposerValueType<T> = T extends 'to' | 'cc' | 'bcc' ? EmailUser['emailAddress'][] : T extends 'subject' | 'bodyContent' ? string : T extends 'selectedTemplateId' ? EmailTemplate['id'] : T extends 'attachments' ? FileUploadItemProps[] : T extends 'responseType' ? EmailResponseType : never;
|
|
114
113
|
export interface EmailDirectRecipients {
|
|
115
114
|
/** To address/addresses in case of reply response type on email. */
|
|
116
115
|
reply: EmailUser['emailAddress'][];
|
|
@@ -119,46 +118,70 @@ export interface EmailDirectRecipients {
|
|
|
119
118
|
/** To address/addresses in case of forward response type on email. */
|
|
120
119
|
forward?: EmailUser['emailAddress'][];
|
|
121
120
|
}
|
|
122
|
-
export interface
|
|
121
|
+
export interface EmailComposerHandleValue {
|
|
122
|
+
replaceBodyContent: (content: string) => void;
|
|
123
|
+
activate: () => void;
|
|
124
|
+
}
|
|
125
|
+
export interface EmailComposerProps extends Pick<EmailProps, 'suggestions' | 'onSuggestionClick'>, BaseProps, NoChildrenProp {
|
|
123
126
|
/** Show loader until the background process completes */
|
|
124
127
|
progress?: boolean | Pick<ProgressProps, 'message'>;
|
|
125
128
|
/** Object containing full list of email participants. */
|
|
126
129
|
participants: EmailUser[];
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
/** Data for all fields of the composer */
|
|
131
|
+
data: {
|
|
132
|
+
/** Object to hold to address/addresses and field error */
|
|
133
|
+
to?: {
|
|
134
|
+
value: EmailUser['emailAddress'][];
|
|
135
|
+
error?: string;
|
|
136
|
+
};
|
|
137
|
+
/** Object to hold Cc address/addresses and field error */
|
|
138
|
+
cc?: {
|
|
139
|
+
value: EmailUser['emailAddress'][];
|
|
140
|
+
error?: string;
|
|
141
|
+
};
|
|
142
|
+
/** Object to hold Bcc address/addresses and field error */
|
|
143
|
+
bcc?: {
|
|
144
|
+
value: EmailUser['emailAddress'][];
|
|
145
|
+
error?: string;
|
|
146
|
+
};
|
|
147
|
+
/** Object to hold the subject value and error */
|
|
148
|
+
subject: {
|
|
149
|
+
value: string;
|
|
150
|
+
error?: string;
|
|
151
|
+
};
|
|
152
|
+
/** Object containing the default body content and error */
|
|
153
|
+
bodyContent: {
|
|
154
|
+
defaultValue: string;
|
|
155
|
+
error?: string;
|
|
156
|
+
};
|
|
157
|
+
/** Selected template id */
|
|
158
|
+
selectedTemplateId?: EmailTemplate['id'];
|
|
159
|
+
/** List of attachments */
|
|
160
|
+
attachments?: FileUploadItemProps[];
|
|
161
|
+
/** Email response types */
|
|
162
|
+
responseType?: EmailResponseType;
|
|
163
|
+
};
|
|
164
|
+
/** Callback when user clicks on the send button */
|
|
165
|
+
onSend: () => void;
|
|
141
166
|
/** Callback when image is added */
|
|
142
167
|
onImageAdded?: RichTextEditorProps['onImageAdded'];
|
|
143
|
-
/** List of attachments */
|
|
144
|
-
attachments?: FileUploadItemProps[];
|
|
145
168
|
/** Region to show more actions in footer */
|
|
146
169
|
footerMoreActions?: ReactNode;
|
|
147
170
|
/** Templates for drafting email */
|
|
148
171
|
templates?: Pick<EmailTemplate, 'id' | 'title'>[];
|
|
149
|
-
/**
|
|
150
|
-
onTemplateChange?: (id: EmailTemplate['id']) => string | Promise<string>;
|
|
151
|
-
/** Callback when cancel composing */
|
|
172
|
+
/** Callback when user clicks on cancel */
|
|
152
173
|
onCancel: () => void;
|
|
153
174
|
/**
|
|
154
|
-
* Callback to handle external entry validation
|
|
175
|
+
* Callback to handle external entry validation for to, cc and bcc fields while adding a new email to the list
|
|
155
176
|
* If returned true considers the entry to be a valid entry
|
|
156
177
|
*/
|
|
157
178
|
externalValidator?: (value: string) => boolean;
|
|
158
179
|
/** Ref to the element */
|
|
159
180
|
ref?: Ref<HTMLDivElement>;
|
|
160
|
-
/**
|
|
161
|
-
|
|
181
|
+
/** Imperative handle for composer */
|
|
182
|
+
handle?: Ref<EmailComposerHandleValue>;
|
|
183
|
+
/** Change handler to all fields */
|
|
184
|
+
onChange: <T extends EmailComposerFieldType>(field: T, value: EmailComposerValueType<T>) => void;
|
|
162
185
|
}
|
|
163
186
|
export interface EmailShellProps extends BaseProps {
|
|
164
187
|
/** ref to the element */
|
|
@@ -266,6 +289,26 @@ export interface EntityListProps extends BaseProps {
|
|
|
266
289
|
text: string;
|
|
267
290
|
};
|
|
268
291
|
ref?: Ref<HTMLDivElement>;
|
|
292
|
+
contextMenu?: ContextMenuProps;
|
|
293
|
+
}
|
|
294
|
+
export interface EmailManagerProps extends BaseProps {
|
|
295
|
+
/** Ref placed on the root */
|
|
296
|
+
ref?: Ref<HTMLDivElement>;
|
|
297
|
+
/** Header of the component */
|
|
298
|
+
header?: {
|
|
299
|
+
icon: PageTemplateProps['icon'];
|
|
300
|
+
title: PageTemplateProps['title'];
|
|
301
|
+
};
|
|
302
|
+
/** A region to hold an EmailSummaryList component */
|
|
303
|
+
list?: ReactNode;
|
|
304
|
+
/** A region to hold an Emails component */
|
|
305
|
+
content?: ReactNode;
|
|
306
|
+
/** A region that is used to hold Utility components. */
|
|
307
|
+
utilities?: ReactNode;
|
|
308
|
+
/** The utilities summary array will be used to render the minimized utilities card. */
|
|
309
|
+
utilitiesSummaryItems?: UtilitiesSummaryProps['items'];
|
|
310
|
+
/** Collapses the utilities by default on load */
|
|
311
|
+
defaultCollapsedUtilities?: boolean;
|
|
269
312
|
}
|
|
270
313
|
export interface StyledContextMenuFieldSelectorProps extends BaseProps {
|
|
271
314
|
selected?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACd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1B,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,6BAA6B;IAC7B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,8BAA8B;IAC9B,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IAChF,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,mCAAoC,SAAQ,SAAS;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp,\n EmptyStateProps,\n ProgressProps\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template id */\n id: string;\n}\n\nexport interface EmailUser {\n /** Short name of the User */\n shortName: string;\n /** Full name of the User */\n fullName: string;\n /** Email of the User */\n emailAddress: string;\n /** Avatar props of the User */\n avatarProps?: Partial<AvatarProps>;\n}\n\nexport interface EntityHighlightMapping {\n value: string;\n type: string;\n name: string;\n variant: number;\n description?: TooltipProps['children'];\n icon?: string;\n}\n\nexport interface ContextMenuProps\n extends OmitStrict<MenuProps, 'onItemClick' | 'header' | 'items'> {\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n heading: string;\n items: MenuItemProps[];\n}\nexport interface EmailProps extends BaseProps, NoChildrenProp {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | number | string;\n /** From email */\n from: EmailUser;\n /** To email */\n to: EmailUser[];\n /** Carbon copy of email users list */\n cc?: EmailUser[];\n /** Blind carbon copy of email users list */\n bcc?: EmailUser[];\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Subject of the email */\n subject?: string;\n /** Body */\n body?: string;\n /** Forwarded content */\n forwardedContent?: string;\n /**\n * Entity highlight mapping\n * This requires body to be passed as a string with html tags\n */\n entityHighlightMapping?: EntityHighlightMapping[];\n /** onReply callback */\n onReply: (id: EmailProps['id']) => void;\n /** onForward Callback */\n onForward: (id: EmailProps['id']) => void;\n /** onReply callback */\n onReplyAll?: (id: EmailProps['id']) => void;\n /** List of suggestions */\n suggestions?: EmailTemplate[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: EmailTemplate['id']) => void;\n /** Actions region */\n actions?: ReactNode;\n /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /** Items list in Popover */\n contextMenu?: ContextMenuProps;\n}\n\nexport interface EmailConversationProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\n /** Unique ID for this email conversation record */\n id: string;\n /** List of mails */\n emails: EmailProps[];\n /** Sender(s) of this email conversation */\n from: EmailUser;\n /** Recipient(s) of this email conversation */\n to: EmailUser[];\n /** Count of unread emails */\n unReadEmailCount?: number;\n /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | string | number;\n /** Flag that indicates if email conversation is expanded */\n isCollapsed?: boolean;\n /** Flag to set if conversation is spun off from forwarded email */\n isForwarded?: boolean;\n /** Callback when email conversation is collapsed */\n onCollapse?: () => void;\n /** Callback when email conversation is expanded */\n onExpand?: () => void;\n}\n\nexport interface EmailComposerData\n extends Pick<\n EmailComposerProps,\n 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments' | 'responseType'\n > {\n /** Array to hold the initial participants that should be default initialized in To address. */\n to: EmailUser['emailAddress'][];\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\n\nexport interface EmailDirectRecipients {\n /** To address/addresses in case of reply response type on email. */\n reply: EmailUser['emailAddress'][];\n /** To address/addresses in case of replyAll response type on email. */\n replyAll: EmailUser['emailAddress'][];\n /** To address/addresses in case of forward response type on email. */\n forward?: EmailUser['emailAddress'][];\n}\n\nexport interface EmailComposerProps\n extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>,\n BaseProps,\n NoChildrenProp {\n /** Show loader until the background process completes */\n progress?: boolean | Pick<ProgressProps, 'message'>;\n /** Object containing full list of email participants. */\n participants: EmailUser[];\n /** Object to hold initial to address/addresses based on different action types. */\n to?: EmailDirectRecipients;\n /** Array to hold the initial participants that should be default initialized in Cc address. */\n cc?: EmailUser['emailAddress'][];\n /** Array to hold the initial participants that should be default initialized in Bcc address. */\n bcc?: EmailUser['emailAddress'][];\n /** Object containing the props to render the subject input */\n subject: string;\n /** Body content of the email */\n bodyContent: string;\n /** Template id to select the initial template */\n defaultTemplateId?: EmailTemplate['id'];\n /** Callback when email needs to be sent */\n onSend: (data: EmailComposerData) => void;\n /** Callback when image is added */\n onImageAdded?: RichTextEditorProps['onImageAdded'];\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: Pick<EmailTemplate, 'id' | 'title'>[];\n /** Template change callback */\n onTemplateChange?: (id: EmailTemplate['id']) => string | Promise<string>;\n /** Callback when cancel composing */\n onCancel: () => void;\n /**\n * Callback to handle external entry validation\n * If returned true considers the entry to be a valid entry\n */\n externalValidator?: (value: string) => boolean;\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Email action types */\n responseType?: EmailResponseType;\n}\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n\nexport interface EmailSummaryItemProps extends BaseProps {\n /** Id of each summary item */\n id: string;\n /** List of from participant names of the conversations */\n activeParticipants: EmailUser[];\n /** Email body of last email in the email */\n message: string;\n /** Timestamp of the latest email */\n timeStamp: Date | string | number;\n /** Top topic of an email */\n topic?: string;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Urgency of an email */\n urgency?: number;\n /** Total number of unread emails in the email */\n unreadEmailCount?: number;\n /** Is the email currently active */\n active?: boolean;\n /** On click of email item */\n onClick: MouseEventHandler;\n /** ref to the element */\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface Filter {\n /** Sets DOM id for the control and associates label element via 'for' attribute. */\n id: string;\n /** Pass a string or a fragment with an Icon and string for the filter label. */\n label: ReactNode;\n /**\n * Disables the filter.\n * @default false\n */\n disabled?: boolean;\n /**\n * Sets on prop via onFilterChange.\n * @default false\n */\n on?: boolean;\n}\n\nexport interface EmailSummaryListProps extends BaseProps {\n /** List of email categories */\n categories: MenuProps['items'];\n /** Handles category change */\n onCategoryClick?: MenuItemProps['onClick'];\n /** List of EmailItems items */\n items: OmitStrict<EmailSummaryItemProps, 'onClick' | 'active'>[];\n /** Total number of unread email count */\n unreadEmailCount?: number;\n /** A set of filters to apply to the email inbox. */\n filters?: Filter[];\n /** A callback that runs when a filter is clicked. */\n onFilterChange?: (filterId: Filter['id'], on: boolean) => void;\n /** onClick of list item */\n onItemClick: (id: EmailSummaryItemProps['id']) => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Empty message when there are no email summary items */\n emptyMessage?: EmptyStateProps['message'];\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: EntityHighlightMapping;\n ref?: Ref<HTMLElement>;\n}\n\nexport interface TargetProps {\n cursorPosition: { x: number; y: number };\n targetNode: Node | null;\n}\n\nexport interface ContextMenuPopoverProps extends BaseProps, TargetProps {\n contextMenu: ContextMenuProps;\n}\n\nexport interface EntityListProps extends BaseProps {\n content: {\n name: string;\n value?: {\n id: string;\n entity: EntityHighlightMapping;\n }[];\n }[];\n\n header: {\n icon: string;\n text: string;\n };\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface StyledContextMenuFieldSelectorProps extends BaseProps {\n selected?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp,\n EmptyStateProps,\n ProgressProps,\n PageTemplateProps\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\nimport { UtilitiesSummaryProps } from '@pega/cosmos-react-work/lib/components/CaseView/UtilitiesSummary';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template id */\n id: string;\n}\n\nexport interface EmailUser {\n /** Short name of the User */\n shortName: string;\n /** Full name of the User */\n fullName: string;\n /** Email of the User */\n emailAddress: string;\n /** Avatar props of the User */\n avatarProps?: Partial<AvatarProps>;\n}\n\nexport interface EntityHighlightMapping {\n value: string;\n type: string;\n name: string;\n variant: number;\n description?: TooltipProps['children'];\n icon?: string;\n}\n\nexport interface ContextMenuProps\n extends OmitStrict<MenuProps, 'onItemClick' | 'header' | 'items'> {\n onItemClick: (selectedValue: { fieldName: string; fieldValue: string }) => void;\n heading: string;\n items: MenuItemProps[];\n}\nexport interface EmailProps extends BaseProps, NoChildrenProp {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | number | string;\n /** From email */\n from: EmailUser;\n /** To email */\n to: EmailUser[];\n /** Carbon copy of email users list */\n cc?: EmailUser[];\n /** Blind carbon copy of email users list */\n bcc?: EmailUser[];\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Subject of the email */\n subject?: string;\n /** Body */\n body?: string;\n /** Forwarded content */\n forwardedContent?: string;\n /**\n * Entity highlight mapping\n * This requires body to be passed as a string with html tags\n */\n entityHighlightMapping?: EntityHighlightMapping[];\n /** onReply callback */\n onReply: (id: EmailProps['id']) => void;\n /** onForward Callback */\n onForward: (id: EmailProps['id']) => void;\n /** onReply callback */\n onReplyAll?: (id: EmailProps['id']) => void;\n /** List of suggestions */\n suggestions?: EmailTemplate[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: EmailTemplate['id']) => void;\n /** Actions region */\n actions?: ReactNode;\n /** Flag that indicates if email is unread\n * @default false\n */\n unRead?: boolean;\n /** Attachments list */\n attachments?: FileDisplayProps[];\n /** Items list in Popover */\n contextMenu?: ContextMenuProps;\n}\n\nexport interface EmailConversationProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLLIElement>;\n /** Unique ID for this email conversation record */\n id: string;\n /** List of mails */\n emails: EmailProps[];\n /** Sender(s) of this email conversation */\n from: EmailUser;\n /** Recipient(s) of this email conversation */\n to: EmailUser[];\n /** Count of unread emails */\n unReadEmailCount?: number;\n /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */\n timeStamp: Date | string | number;\n /** Flag that indicates if email conversation is expanded */\n isCollapsed?: boolean;\n /** Flag to set if conversation is spun off from forwarded email */\n isForwarded?: boolean;\n /** Callback when email conversation is collapsed */\n onCollapse?: () => void;\n /** Callback when email conversation is expanded */\n onExpand?: () => void;\n}\n\nexport type EmailResponseType = 'reply' | 'replyAll' | 'forward';\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 activate: () => void;\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 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}\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n\nexport interface EmailSummaryItemProps extends BaseProps {\n /** Id of each summary item */\n id: string;\n /** List of from participant names of the conversations */\n activeParticipants: EmailUser[];\n /** Email body of last email in the email */\n message: string;\n /** Timestamp of the latest email */\n timeStamp: Date | string | number;\n /** Top topic of an email */\n topic?: string;\n /** Sentiment */\n sentiment?: SentimentProps;\n /** Urgency of an email */\n urgency?: number;\n /** Total number of unread emails in the email */\n unreadEmailCount?: number;\n /** Is the email currently active */\n active?: boolean;\n /** On click of email item */\n onClick: MouseEventHandler;\n /** ref to the element */\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface Filter {\n /** Sets DOM id for the control and associates label element via 'for' attribute. */\n id: string;\n /** Pass a string or a fragment with an Icon and string for the filter label. */\n label: ReactNode;\n /**\n * Disables the filter.\n * @default false\n */\n disabled?: boolean;\n /**\n * Sets on prop via onFilterChange.\n * @default false\n */\n on?: boolean;\n}\n\nexport interface EmailSummaryListProps extends BaseProps {\n /** List of email categories */\n categories: MenuProps['items'];\n /** Handles category change */\n onCategoryClick?: MenuItemProps['onClick'];\n /** List of EmailItems items */\n items: OmitStrict<EmailSummaryItemProps, 'onClick' | 'active'>[];\n /** Total number of unread email count */\n unreadEmailCount?: number;\n /** A set of filters to apply to the email inbox. */\n filters?: Filter[];\n /** A callback that runs when a filter is clicked. */\n onFilterChange?: (filterId: Filter['id'], on: boolean) => void;\n /** onClick of list item */\n onItemClick: (id: EmailSummaryItemProps['id']) => void;\n /** Indicates if the data is being currently loading */\n loading?: boolean;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Empty message when there are no email summary items */\n emptyMessage?: EmptyStateProps['message'];\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: EntityHighlightMapping;\n ref?: Ref<HTMLElement>;\n}\n\nexport interface TargetProps {\n cursorPosition: { x: number; y: number };\n targetNode: Node | null;\n}\n\nexport interface ContextMenuPopoverProps extends BaseProps, TargetProps {\n contextMenu: ContextMenuProps;\n}\n\nexport interface EntityListProps extends BaseProps {\n content: {\n name: string;\n value?: {\n id: string;\n entity: EntityHighlightMapping;\n }[];\n }[];\n\n header: {\n icon: string;\n text: string;\n };\n ref?: Ref<HTMLDivElement>;\n contextMenu?: ContextMenuProps;\n}\n\nexport interface EmailManagerProps extends BaseProps {\n /** Ref placed on the root */\n ref?: Ref<HTMLDivElement>;\n /** Header of the component */\n header?: { icon: PageTemplateProps['icon']; title: PageTemplateProps['title'] };\n /** A region to hold an EmailSummaryList component */\n list?: ReactNode;\n /** A region to hold an Emails component */\n content?: 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 /** Collapses the utilities by default on load */\n defaultCollapsedUtilities?: boolean;\n}\n\nexport interface StyledContextMenuFieldSelectorProps extends BaseProps {\n selected?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAUlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAGL,IAAI,EAeL,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAKnD,eAAO,MAAM,mBAAmB,yHAW9B,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,OAAO,IAI1C,CAAC;AAIH,eAAO,MAAM,kBAAkB,qNAK7B,CAAC;AAkBH,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CA2UxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|