@pega/cosmos-react-social 3.0.0-dev.3.0 → 3.0.0-dev.4.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/ContextMenuPopover.d.ts +5 -0
- package/lib/components/Email/ContextMenuPopover.d.ts.map +1 -0
- package/lib/components/Email/ContextMenuPopover.js +48 -0
- package/lib/components/Email/ContextMenuPopover.js.map +1 -0
- package/lib/components/Email/Email.d.ts.map +1 -1
- package/lib/components/Email/Email.js +39 -10
- package/lib/components/Email/Email.js.map +1 -1
- package/lib/components/Email/Email.styles.d.ts +3 -1
- package/lib/components/Email/Email.styles.d.ts.map +1 -1
- package/lib/components/Email/Email.styles.js +28 -0
- package/lib/components/Email/Email.styles.js.map +1 -1
- package/lib/components/Email/Email.types.d.ts +23 -0
- 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/EmailEntity.d.ts.map +1 -1
- package/lib/components/Email/EmailEntity.js +6 -2
- package/lib/components/Email/EmailEntity.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuPopover.d.ts","sourceRoot":"","sources":["../../../src/components/Email/ContextMenuPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAS1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CAqElE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Popover, Menu, Text } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledEmailMoreInfoPopover, StyledContextMenuFieldSelector, StyledContextMenu } from './Email.styles';
|
|
4
|
+
const ContextMenuPopover = ({ cursorPosition, contextMenu, targetNode }) => {
|
|
5
|
+
const { heading } = contextMenu;
|
|
6
|
+
const selection = document.getSelection();
|
|
7
|
+
if (selection && !selection.toString() && targetNode) {
|
|
8
|
+
const range = document.createRange();
|
|
9
|
+
range.selectNodeContents(targetNode);
|
|
10
|
+
selection?.removeAllRanges();
|
|
11
|
+
selection.addRange(range);
|
|
12
|
+
}
|
|
13
|
+
const { onItemClick, items } = contextMenu;
|
|
14
|
+
const onItemSelect = (contextMenuItemId) => {
|
|
15
|
+
const selectedcontextMenuItem = items.find(({ id }) => id === contextMenuItemId);
|
|
16
|
+
if (selectedcontextMenuItem && selection) {
|
|
17
|
+
onItemClick({
|
|
18
|
+
fieldName: selectedcontextMenuItem.primary,
|
|
19
|
+
fieldValue: selection.toString()
|
|
20
|
+
});
|
|
21
|
+
selection.removeAllRanges();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const itemsToRender = items.map(item => {
|
|
25
|
+
return {
|
|
26
|
+
...item,
|
|
27
|
+
visual: item.selected ? (_jsx(StyledContextMenuFieldSelector, { selected: true }, void 0)) : (_jsx(StyledContextMenuFieldSelector, {}, void 0))
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
return (_jsx(Popover, { as: StyledEmailMoreInfoPopover, target: {
|
|
31
|
+
getBoundingClientRect: () => {
|
|
32
|
+
const { x, y } = cursorPosition;
|
|
33
|
+
return {
|
|
34
|
+
width: 0,
|
|
35
|
+
height: 0,
|
|
36
|
+
top: y,
|
|
37
|
+
right: x,
|
|
38
|
+
bottom: y,
|
|
39
|
+
left: x,
|
|
40
|
+
x,
|
|
41
|
+
y,
|
|
42
|
+
toJSON: () => { }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}, placement: 'bottom', children: _jsx(StyledContextMenu, { children: _jsx(Menu, { ...contextMenu, header: _jsx(Text, { variant: 'h5', children: heading }, void 0), items: itemsToRender, onItemClick: onItemSelect }, void 0) }, void 0) }, void 0));
|
|
46
|
+
};
|
|
47
|
+
export default ContextMenuPopover;
|
|
48
|
+
//# sourceMappingURL=ContextMenuPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuPopover.js","sourceRoot":"","sources":["../../../src/components/Email/ContextMenuPopover.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,kBAAkB,GAA+C,CAAC,EACtE,cAAc,EACd,WAAW,EACX,UAAU,EACX,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;IAChC,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IAE1C,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,UAAU,EAAE;QACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;QACrC,KAAK,CAAC,kBAAkB,CAAC,UAAkB,CAAC,CAAC;QAC7C,SAAS,EAAE,eAAe,EAAE,CAAC;QAC7B,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC3B;IACD,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC;IAC3C,MAAM,YAAY,GAAG,CAAC,iBAAyB,EAAE,EAAE;QACjD,MAAM,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,iBAAiB,CAAC,CAAC;QAEjF,IAAI,uBAAuB,IAAI,SAAS,EAAE;YACxC,WAAW,CAAC;gBACV,SAAS,EAAE,uBAAuB,CAAC,OAAO;gBAC1C,UAAU,EAAE,SAAS,CAAC,QAAQ,EAAY;aAC3C,CAAC,CAAC;YACH,SAAS,CAAC,eAAe,EAAE,CAAC;SAC7B;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrC,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACtB,KAAC,8BAA8B,IAAC,QAAQ,iBAAG,CAC5C,CAAC,CAAC,CAAC,CACF,KAAC,8BAA8B,aAAG,CACnC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,OAAO,IACN,EAAE,EAAE,0BAA0B,EAC9B,MAAM,EAAE;YACN,qBAAqB,EAAE,GAAG,EAAE;gBAC1B,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC;gBAChC,OAAO;oBACL,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,GAAG,EAAE,CAAC;oBACN,KAAK,EAAE,CAAC;oBACR,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,CAAC;oBACP,CAAC;oBACD,CAAC;oBACD,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;iBACjB,CAAC;YACJ,CAAC;SACF,EACD,SAAS,EAAC,QAAQ,YAElB,KAAC,iBAAiB,cAChB,KAAC,IAAI,OACC,WAAW,EACf,MAAM,EAAE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,OAAO,WAAQ,EAC3C,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,YAAY,WACzB,WACgB,WACZ,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { Popover, Menu, Text } from '@pega/cosmos-react-core';\n\nimport {\n StyledEmailMoreInfoPopover,\n StyledContextMenuFieldSelector,\n StyledContextMenu\n} from './Email.styles';\nimport { ContextMenuPopoverProps } from './Email.types';\n\nconst ContextMenuPopover: FunctionComponent<ContextMenuPopoverProps> = ({\n cursorPosition,\n contextMenu,\n targetNode\n}) => {\n const { heading } = contextMenu;\n const selection = document.getSelection();\n\n if (selection && !selection.toString() && targetNode) {\n const range = document.createRange();\n range.selectNodeContents(targetNode as Node);\n selection?.removeAllRanges();\n selection.addRange(range);\n }\n const { onItemClick, items } = contextMenu;\n const onItemSelect = (contextMenuItemId: string) => {\n const selectedcontextMenuItem = items.find(({ id }) => id === contextMenuItemId);\n\n if (selectedcontextMenuItem && selection) {\n onItemClick({\n fieldName: selectedcontextMenuItem.primary,\n fieldValue: selection.toString() as string\n });\n selection.removeAllRanges();\n }\n };\n\n const itemsToRender = items.map(item => {\n return {\n ...item,\n visual: item.selected ? (\n <StyledContextMenuFieldSelector selected />\n ) : (\n <StyledContextMenuFieldSelector />\n )\n };\n });\n\n return (\n <Popover\n as={StyledEmailMoreInfoPopover}\n target={{\n getBoundingClientRect: () => {\n const { x, y } = cursorPosition;\n return {\n width: 0,\n height: 0,\n top: y,\n right: x,\n bottom: y,\n left: x,\n x,\n y,\n toJSON: () => {}\n };\n }\n }}\n placement='bottom'\n >\n <StyledContextMenu>\n <Menu\n {...contextMenu}\n header={<Text variant='h5'>{heading}</Text>}\n items={itemsToRender}\n onItemClick={onItemSelect}\n />\n </StyledContextMenu>\n </Popover>\n );\n};\n\nexport default ContextMenuPopover;\n"]}
|
|
@@ -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,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAsBb,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAa,UAAU,EAAe,MAAM,eAAe,CAAC;AA8CnE,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CAoYvD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
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 } from 'react';
|
|
4
|
-
import { Text, SummaryItem, Avatar, Flex, EmailDisplay, Button, Icon, Sentiment, useOuterEvent, Popover, useElement, CardContent, useI18n, FileDisplay, useBreakpoint, DateTimeDisplay, useConfiguration, MetaList } from '@pega/cosmos-react-core';
|
|
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';
|
|
5
5
|
import { RichTextViewer } from '@pega/cosmos-react-rte';
|
|
6
6
|
import EmailEntity from './EmailEntity';
|
|
7
|
+
import ContextMenuPopover from './ContextMenuPopover';
|
|
7
8
|
import { StyledEmail, StyledEmailDisplay, StyledEmailHeader, StyledFromEmailDisplay, StyledEmailMoreInfoButton, StyledEmailMoreInfoPopover, StyledEmailPrimaryFieldValueList, StyledEmailBody, StyledEmailSecondaryFieldValueList, StyledSuggestedRepliesButton, StyledSuggestedRepliesMenuButton } from './Email.styles';
|
|
8
9
|
const EmailDisplayList = ({ emailUsers, showEmailAddress, showShortName }) => {
|
|
9
10
|
return (_jsx(_Fragment, { children: emailUsers.map(({ emailAddress, fullName, shortName }, i) => (_jsxs(Fragment, { children: [i === 0 ? '' : '; ', _jsx(EmailDisplay, { value: emailAddress, displayText: `${showShortName ? shortName : fullName}${showEmailAddress ? ` <${emailAddress}>` : ''}`, variant: 'text', as: StyledEmailDisplay }, void 0)] }, emailAddress))) }, void 0));
|
|
@@ -11,7 +12,7 @@ const EmailDisplayList = ({ emailUsers, showEmailAddress, showShortName }) => {
|
|
|
11
12
|
const OVERFLOW_TO_EMAIL_COUNT = 2;
|
|
12
13
|
const OVERFLOW_EMAIL_SUGGESTION_COUNT = 2;
|
|
13
14
|
const Email = forwardRef((props, ref) => {
|
|
14
|
-
const { id, from, to = [], cc = [], bcc = [], actions = [], timeStamp, sentiment, subject, body, attachments = [], suggestions = [], entityHighlightMapping = [], onReply, onForward, onReplyAll, onSuggestionClick, ...restProps } = props;
|
|
15
|
+
const { id, from, to = [], cc = [], bcc = [], actions = [], timeStamp, sentiment, subject, body, attachments = [], suggestions = [], entityHighlightMapping = [], onReply, onForward, onReplyAll, onSuggestionClick, contextMenu, ...restProps } = props;
|
|
15
16
|
const t = useI18n();
|
|
16
17
|
const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement(null);
|
|
17
18
|
const [showEmailMoreInfo, setShowEmailMoreInfo] = useState(false);
|
|
@@ -20,6 +21,14 @@ const Email = forwardRef((props, ref) => {
|
|
|
20
21
|
const headerRef = useRef(null);
|
|
21
22
|
const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: headerRef });
|
|
22
23
|
const { locale } = useConfiguration();
|
|
24
|
+
const [currentTarget, setcurrentTarget] = useState({
|
|
25
|
+
targetNode: null,
|
|
26
|
+
cursorPosition: {
|
|
27
|
+
x: 0,
|
|
28
|
+
y: 0
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const [open, showPopover] = useState(false);
|
|
23
32
|
if (from) {
|
|
24
33
|
emailMoreInfoFields.push({
|
|
25
34
|
id: 'from',
|
|
@@ -90,17 +99,22 @@ const Email = forwardRef((props, ref) => {
|
|
|
90
99
|
});
|
|
91
100
|
}
|
|
92
101
|
let renderedBody = body;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const regExp = RegExp(entity.value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi');
|
|
102
|
+
const entityConfigs = useMemo(() => {
|
|
103
|
+
return entityHighlightMapping.map(entity => {
|
|
104
|
+
const regExp = createStringMatcher(entity.value, 'contains', 'gi');
|
|
97
105
|
return {
|
|
98
106
|
type: 'entity',
|
|
99
107
|
regexPattern: regExp,
|
|
100
108
|
component: () => _jsx(EmailEntity, { entity: entity }, void 0)
|
|
101
109
|
};
|
|
102
110
|
});
|
|
103
|
-
|
|
111
|
+
}, [entityHighlightMapping]);
|
|
112
|
+
// Apply entity highlighting only on string body
|
|
113
|
+
if (typeof body === 'string') {
|
|
114
|
+
const { cursorPosition, targetNode } = currentTarget;
|
|
115
|
+
renderedBody = (_jsxs(_Fragment, { children: [_jsx(RichTextViewer, { content: body, type: 'html', interactionRenderers: entityConfigs, "aria-label": t('unique_entities', [entityConfigs.length], {
|
|
116
|
+
count: entityConfigs.length
|
|
117
|
+
}), role: 'group' }, void 0), contextMenu && open && (_jsx(ContextMenuPopover, { cursorPosition: cursorPosition, contextMenu: contextMenu, targetNode: targetNode }, void 0))] }, void 0));
|
|
104
118
|
}
|
|
105
119
|
const emailMetaListItems = [
|
|
106
120
|
_jsxs(Text, { variant: 'secondary', children: [`${t('to')}: `, _jsx(EmailDisplayList, { emailUsers: to.slice(0, OVERFLOW_TO_EMAIL_COUNT), showShortName: true }, void 0), to.length > OVERFLOW_TO_EMAIL_COUNT &&
|
|
@@ -110,7 +124,13 @@ const Email = forwardRef((props, ref) => {
|
|
|
110
124
|
return (_jsxs(Flex, { as: StyledEmail, container: {
|
|
111
125
|
direction: 'column',
|
|
112
126
|
gap: 1
|
|
113
|
-
}, ref: ref, ...restProps,
|
|
127
|
+
}, ref: ref, ...restProps, onClick: () => {
|
|
128
|
+
showPopover(false);
|
|
129
|
+
setcurrentTarget({
|
|
130
|
+
targetNode: null,
|
|
131
|
+
cursorPosition: { x: 0, y: 0 }
|
|
132
|
+
});
|
|
133
|
+
}, children: [_jsx(SummaryItem, { as: StyledEmailHeader, visual: _jsx(Avatar, { ...from.avatarProps, name: from.fullName }, void 0), ref: headerRef, primary: _jsxs(Flex, { container: {
|
|
114
134
|
gap: 1,
|
|
115
135
|
alignItems: 'center'
|
|
116
136
|
}, children: [_jsx(StyledFromEmailDisplay, { value: from.emailAddress, displayText: from.fullName, variant: 'text' }, void 0), sentiment && _jsx(Sentiment, { ...sentiment, labelHidden: true }, void 0)] }, void 0), secondary: _jsxs(Flex, { container: {
|
|
@@ -128,7 +148,16 @@ const Email = forwardRef((props, ref) => {
|
|
|
128
148
|
direction: 'column',
|
|
129
149
|
gap: 2,
|
|
130
150
|
pad: [0, 2]
|
|
131
|
-
}, children: [subject && (_jsxs(Text, { variant: 'primary', children: [t('subject'), ": ", subject] }, void 0)), _jsx(StyledEmailBody, {
|
|
151
|
+
}, children: [subject && (_jsxs(Text, { variant: 'primary', children: [t('subject'), ": ", subject] }, void 0)), _jsx(StyledEmailBody, { onContextMenu: e => {
|
|
152
|
+
if (e.target instanceof HTMLElement && contextMenu && e.target.innerText.trim()) {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
showPopover(true);
|
|
155
|
+
setcurrentTarget({
|
|
156
|
+
targetNode: e.target,
|
|
157
|
+
cursorPosition: { x: e.pageX, y: e.pageY }
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}, children: renderedBody }, void 0)] }, void 0), _jsxs(Flex, { container: {
|
|
132
161
|
direction: 'column',
|
|
133
162
|
gap: 1,
|
|
134
163
|
pad: [0, 2]
|
|
@@ -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,EACT,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,EAC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AAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,EACrB,yBAAO,CAAC,CAAC,OAAO,CAAC,WAAQ,YACpB,WACA,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,WAAG,EACzB,yBAAO,CAAC,CAAC,WAAW,CAAC,WAAQ,YACxB,WACA,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,WAAG,EACvB,yBAAO,CAAC,CAAC,SAAS,CAAC,WAAQ,YACtB,WACA,CACV,YACG,YACD,YACF,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} 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} from '@pega/cosmos-react-core';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport EmailEntity from './EmailEntity';\nimport { EmailUser, EmailProps } 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} 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 attachments = [],\n suggestions = [],\n entityHighlightMapping = [],\n onReply,\n onForward,\n onReplyAll,\n onSuggestionClick,\n ...restProps\n } = props;\n const t = useI18n();\n\n const [emailMoreInfoBtnRef, setEmailMoreInfoBtnRef] = useElement<HTMLButtonElement>(null);\n const [showEmailMoreInfo, setShowEmailMoreInfo] = 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\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 // Apply entity highlighting only on string body\n if (typeof body === 'string') {\n const entityConfigs = entityHighlightMapping.map(entity => {\n const regExp = RegExp(entity.value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n\n return {\n type: 'entity',\n regexPattern: regExp,\n component: () => <EmailEntity entity={entity} />\n };\n });\n\n renderedBody = (\n <RichTextViewer content={body} type='html' interactionRenderers={entityConfigs} />\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 >\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>{renderedBody}</StyledEmailBody>\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,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,EACjC,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,KAAC,YAAY,IACX,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,GAClD,gBAAgB,CAAC,CAAC,CAAC,KAAK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,YACF,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} 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 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 [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 </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,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EmailEntityProps } from './Email.types';
|
|
2
|
+
import { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';
|
|
3
3
|
export declare const StyledEmailMoreInfoButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const StyledEmailHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
5
|
export declare const StyledSuggestedRepliesButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -15,4 +15,6 @@ export declare const emailEntityBackgroundColors: string[];
|
|
|
15
15
|
export declare const StyledEmail: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
16
|
export declare const StyledEmailEntity: import("styled-components").StyledComponent<"mark", import("styled-components").DefaultTheme, EmailEntityProps, never>;
|
|
17
17
|
export declare const StyledEntityList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
+
export declare const StyledContextMenuFieldSelector: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledContextMenuFieldSelectorProps, never>;
|
|
19
|
+
export declare const StyledContextMenu: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
20
|
//# sourceMappingURL=Email.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Email.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,MAAM,eAAe,CAAC;AAEtF,eAAO,MAAM,yBAAyB,4GAIrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yGAY5B,CAAC;AAIH,eAAO,MAAM,4BAA4B,qOAUvC,CAAC;AAIH,eAAO,MAAM,gCAAgC,yOAU3C,CAAC;AAIH,eAAO,MAAM,eAAe,yGAAe,CAAC;AAE5C,eAAO,MAAM,sBAAsB,2OAMjC,CAAC;AAIH,eAAO,MAAM,kBAAkB,0GAE9B,CAAC;AAEF,eAAO,MAAM,gCAAgC,6OAE5C,CAAC;AAEF,eAAO,MAAM,kCAAkC,6OAY7C,CAAC;AAIH,eAAO,MAAM,0BAA0B,yGAEtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,yGAInC,CAAC;AACH,eAAO,MAAM,2BAA2B,UAqBvC,CAAC;AAEF,eAAO,MAAM,WAAW,yGAAe,CAAC;AAExC,eAAO,MAAM,iBAAiB,wHAgB5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,6OAU3B,CAAC;AAIH,eAAO,MAAM,8BAA8B,0IAmB1C,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC"}
|
|
@@ -129,4 +129,32 @@ export const StyledEntityList = styled(FieldValueList)(({ theme }) => {
|
|
|
129
129
|
`;
|
|
130
130
|
});
|
|
131
131
|
StyledEntityList.defaultProps = defaultThemeProp;
|
|
132
|
+
export const StyledContextMenuFieldSelector = styled.div(({ theme, selected }) => {
|
|
133
|
+
const background = selected
|
|
134
|
+
? theme.base.colors.green.medium
|
|
135
|
+
: theme.base.palette['primary-background'];
|
|
136
|
+
const borderColor = selected
|
|
137
|
+
? theme.base.colors.green['extra-light']
|
|
138
|
+
: theme.base.palette['primary-background'];
|
|
139
|
+
return css `
|
|
140
|
+
background-color: ${background};
|
|
141
|
+
border: 0.0625rem solid ${borderColor};
|
|
142
|
+
border-radius: 100%;
|
|
143
|
+
display: inline-block;
|
|
144
|
+
height: 0.625rem;
|
|
145
|
+
width: 0.625rem;
|
|
146
|
+
background-clip: content-box;
|
|
147
|
+
padding: 0.0625rem;
|
|
148
|
+
`;
|
|
149
|
+
});
|
|
150
|
+
StyledContextMenuFieldSelector.defaultProps = defaultThemeProp;
|
|
151
|
+
export const StyledContextMenu = styled.div(({ theme }) => {
|
|
152
|
+
const secondaryBackground = theme.base.palette['secondary-background'];
|
|
153
|
+
return css `
|
|
154
|
+
header {
|
|
155
|
+
background-color: ${secondaryBackground};
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
});
|
|
159
|
+
StyledContextMenu.defaultProps = defaultThemeProp;
|
|
132
160
|
//# sourceMappingURL=Email.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIrD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;uBACW,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,C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CACjC,2BAA2B,CACzB,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,MAAM,CAC7F,EACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CACzC,CAAC;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IACjE,OAAO,GAAG,CAAA;0BACc,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;4BACzB,KAAK,CAAC,IAAI,CAAC,OAAO;wBACtB,eAAe;aAC1B,SAAS;;GAEnB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnE,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC1F,OAAO,GAAG,CAAA;MACN,eAAe;eACN,SAAS;;MAElB,iBAAiB;4BACK,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\nexport const emailEntityBackgroundColors = [\n '#00428B',\n '#008C80',\n '#53336F',\n '#005FA7',\n '#7C421B',\n '#BC1513',\n '#DE4342',\n '#661D34',\n '#8B479E',\n '#4B3380',\n '#10A5AC',\n '#5F67B9',\n '#1D447A',\n '#988CC4',\n '#AC1361',\n '#1B6B2E',\n '#4064B3',\n '#4D4D4D',\n '#0F5F5D',\n '#7F375B'\n];\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n emailEntityBackgroundColors[\n (Number.isFinite(variant) && variant > 0 ? variant : 0) % emailEntityBackgroundColors.length\n ],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n display: inline-block;\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledEntityList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEntityList.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Email.styles.js","sourceRoot":"","sources":["../../../src/components/Email/Email.styles.ts"],"names":[],"mappings":"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EAAE,EAAE,EAAE;IACxD,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEvE,OAAO,GAAG,CAAA;;0BAEc,mBAAmB;;GAE1C,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Button,\n calculateFontSize,\n defaultThemeProp,\n EmailDisplay,\n FieldValueList,\n MenuButton,\n StyledFieldName,\n StyledFieldValue,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual,\n tryCatch,\n readableHue\n} from '@pega/cosmos-react-core';\n\nimport { EmailEntityProps, StyledContextMenuFieldSelectorProps } from './Email.types';\n\nexport const StyledEmailMoreInfoButton = styled.button`\n min-height: 0.5rem;\n min-width: 0.5rem;\n flex-shrink: 0;\n`;\n\nexport const StyledEmailHeader = styled.div(({ theme }) => {\n return css`\n grid-column-gap: ${theme.base.spacing};\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding: 0 0 calc(2 * ${theme.base.spacing}) calc(2 * ${theme.base.spacing});\n ${StyledVisual},${StyledSummaryItemActions} {\n align-self: flex-start;\n }\n ${StyledSecondary} {\n margin-top: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailHeader.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesButton = styled(Button)(({ theme }) => {\n return css`\n & + & {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesButton.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedRepliesMenuButton = styled(MenuButton)(({ theme }) => {\n return css`\n &&& {\n margin-inline-start: 0;\n }\n margin-block-start: ${theme.base.spacing};\n :not(:last-child) {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledSuggestedRepliesMenuButton.defaultProps = defaultThemeProp;\n\nexport const StyledEmailBody = styled.div``;\n\nexport const StyledFromEmailDisplay = styled(EmailDisplay)(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${fontSize.m};\n `;\n});\n\nStyledFromEmailDisplay.defaultProps = defaultThemeProp;\n\nexport const StyledEmailDisplay = styled.span`\n font-size: inherit;\n`;\n\nexport const StyledEmailPrimaryFieldValueList = styled(FieldValueList)`\n grid-template-columns: auto 1fr;\n`;\n\nexport const StyledEmailSecondaryFieldValueList = styled(FieldValueList)(({ theme }) => {\n return css`\n grid-template-columns: 1fr;\n gap: 0;\n padding: ${theme.base.spacing} 0;\n ${StyledFieldValue}:not(:last-child) {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledFieldName} {\n margin-bottom: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEmailSecondaryFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledEmailMoreInfoPopover = styled.div`\n max-width: 30rem;\n`;\n\nexport const StyledSecondarySeparator = styled.div(({ theme }) => {\n return css`\n margin: 0 calc(${theme.base.spacing} / 2);\n `;\n});\nexport const emailEntityBackgroundColors = [\n '#00428B',\n '#008C80',\n '#53336F',\n '#005FA7',\n '#7C421B',\n '#BC1513',\n '#DE4342',\n '#661D34',\n '#8B479E',\n '#4B3380',\n '#10A5AC',\n '#5F67B9',\n '#1D447A',\n '#988CC4',\n '#AC1361',\n '#1B6B2E',\n '#4064B3',\n '#4D4D4D',\n '#0F5F5D',\n '#7F375B'\n];\n\nexport const StyledEmail = styled.div``;\n\nexport const StyledEmailEntity = styled.mark<EmailEntityProps>(({ entity, theme }) => {\n const variant = entity.variant;\n const backgroundColor = readableHue(\n emailEntityBackgroundColors[\n (Number.isFinite(variant) && variant > 0 ? variant : 0) % emailEntityBackgroundColors.length\n ],\n theme.base.palette['primary-background']\n );\n const textColor = tryCatch(() => readableColor(backgroundColor));\n return css`\n border-radius: calc(${theme.base['border-radius']} / 3);\n padding: 0 calc(0.5 * ${theme.base.spacing});\n background-color: ${backgroundColor};\n color: ${textColor};\n display: inline-block;\n `;\n});\n\nStyledEmailEntity.defaultProps = defaultThemeProp;\n\nexport const StyledEntityList = styled(FieldValueList)(({ theme }) => {\n const textColor = tryCatch(() => readableColor(theme.base.palette['primary-background']));\n return css`\n ${StyledFieldName} {\n color: ${textColor};\n }\n ${StyledEmailEntity} {\n padding: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledEntityList.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"]}
|
|
@@ -25,6 +25,14 @@ export interface EntityHighlightMapping {
|
|
|
25
25
|
description?: TooltipProps['children'];
|
|
26
26
|
icon?: string;
|
|
27
27
|
}
|
|
28
|
+
export interface ContextMenuProps extends OmitStrict<MenuProps, 'onItemClick' | 'header' | 'items'> {
|
|
29
|
+
onItemClick: (selectedValue: {
|
|
30
|
+
fieldName: string;
|
|
31
|
+
fieldValue: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
heading: string;
|
|
34
|
+
items: MenuItemProps[];
|
|
35
|
+
}
|
|
28
36
|
export interface EmailProps extends BaseProps, NoChildrenProp {
|
|
29
37
|
/** Ref to the element */
|
|
30
38
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -69,6 +77,8 @@ export interface EmailProps extends BaseProps, NoChildrenProp {
|
|
|
69
77
|
unRead?: boolean;
|
|
70
78
|
/** Attachments list */
|
|
71
79
|
attachments?: FileDisplayProps[];
|
|
80
|
+
/** Items list in Popover */
|
|
81
|
+
contextMenu?: ContextMenuProps;
|
|
72
82
|
}
|
|
73
83
|
export interface EmailConversationProps extends BaseProps {
|
|
74
84
|
/** ref to the element */
|
|
@@ -223,6 +233,16 @@ export interface EmailEntityProps extends BaseProps {
|
|
|
223
233
|
entity: EntityHighlightMapping;
|
|
224
234
|
ref?: Ref<HTMLElement>;
|
|
225
235
|
}
|
|
236
|
+
export interface TargetProps {
|
|
237
|
+
cursorPosition: {
|
|
238
|
+
x: number;
|
|
239
|
+
y: number;
|
|
240
|
+
};
|
|
241
|
+
targetNode: Node | null;
|
|
242
|
+
}
|
|
243
|
+
export interface ContextMenuPopoverProps extends BaseProps, TargetProps {
|
|
244
|
+
contextMenu: ContextMenuProps;
|
|
245
|
+
}
|
|
226
246
|
export interface EntityListProps extends BaseProps {
|
|
227
247
|
content: {
|
|
228
248
|
name: string;
|
|
@@ -237,4 +257,7 @@ export interface EntityListProps extends BaseProps {
|
|
|
237
257
|
};
|
|
238
258
|
ref?: Ref<HTMLDivElement>;
|
|
239
259
|
}
|
|
260
|
+
export interface StyledContextMenuFieldSelectorProps extends BaseProps {
|
|
261
|
+
selected?: boolean;
|
|
262
|
+
}
|
|
240
263
|
//# sourceMappingURL=Email.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE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
|
|
|
1
|
-
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template 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 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 /**\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}\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 /** 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;\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 /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EmailEntityProps extends BaseProps {\n entity: EntityHighlightMapping;\n ref?: Ref<HTMLElement>;\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"]}
|
|
1
|
+
{"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n FileUploadItemProps,\n OmitStrict,\n MenuProps,\n MenuItemProps,\n TooltipProps,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface EmailTemplate {\n /** Template title */\n title: string;\n /** Template 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 /**\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 /** 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;\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 /** ref to the element */\n ref?: Ref<HTMLDivElement>;\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailEntity.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,
|
|
1
|
+
{"version":3,"file":"EmailEntity.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailEntity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA2B,MAAM,OAAO,CAAC;AAE/E,OAAO,EACL,YAAY,EAQb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAoCnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useRef } from 'react';
|
|
3
3
|
import { Tooltip, useConsolidatedRef, useElement, useI18n, useConfiguration, formatListToLocaleString, Icon } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledEmailEntity } from './Email.styles';
|
|
5
5
|
const EmailEntity = forwardRef(({ entity, ...restProps }, ref) => {
|
|
@@ -7,9 +7,13 @@ const EmailEntity = forwardRef(({ entity, ...restProps }, ref) => {
|
|
|
7
7
|
const elementRef = useConsolidatedRef(setEl, ref);
|
|
8
8
|
const t = useI18n();
|
|
9
9
|
const { locale } = useConfiguration();
|
|
10
|
+
const tooltipRef = useRef(null);
|
|
10
11
|
return (_jsxs(StyledEmailEntity, { ...restProps, entity: entity, ref: elementRef, "aria-label": Array.isArray(entity.description)
|
|
11
12
|
? formatListToLocaleString(entity.description, t, locale)
|
|
12
|
-
: entity.description,
|
|
13
|
+
: entity.description, onContextMenu: () => {
|
|
14
|
+
if (tooltipRef.current)
|
|
15
|
+
tooltipRef.current.hidden = true;
|
|
16
|
+
}, contentEditable: false, children: [entity.value, entity.icon && _jsx(Icon, { name: entity.icon }, void 0), entity.description && (_jsx(Tooltip, { target: el, ref: tooltipRef, children: Array.isArray(entity.description)
|
|
13
17
|
? formatListToLocaleString(entity.description, t, locale, {
|
|
14
18
|
separator: '\n'
|
|
15
19
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailEntity.js","sourceRoot":"","sources":["../../../src/components/Email/EmailEntity.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EmailEntity.js","sourceRoot":"","sources":["../../../src/components/Email/EmailEntity.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,EAEL,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,wBAAwB,EACxB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,MAAM,WAAW,GAAuD,UAAU,CAChF,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,EAAqC,EAAE,GAA4B,EAAE,EAAE;IAC5F,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,U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ConsolidatedRef,\n useElement,\n useI18n,\n useConfiguration,\n formatListToLocaleString,\n Icon\n} from '@pega/cosmos-react-core';\n\nimport { StyledEmailEntity } from './Email.styles';\nimport { EmailEntityProps } from './Email.types';\n\nconst EmailEntity: FunctionComponent<EmailEntityProps & ForwardProps> = forwardRef(\n ({ entity, ...restProps }: PropsWithoutRef<EmailEntityProps>, ref: EmailEntityProps['ref']) => {\n const [el, setEl] = useElement<HTMLElement>();\n const elementRef = useConsolidatedRef<HTMLElement>(setEl, ref);\n const t = useI18n();\n const { locale } = useConfiguration();\n const tooltipRef = useRef<HTMLDivElement>(null);\n return (\n <StyledEmailEntity\n {...restProps}\n entity={entity}\n ref={elementRef}\n aria-label={\n Array.isArray(entity.description)\n ? formatListToLocaleString(entity.description, t, locale)\n : entity.description\n }\n onContextMenu={() => {\n if (tooltipRef.current) tooltipRef.current.hidden = true;\n }}\n contentEditable={false}\n >\n {entity.value}\n {entity.icon && <Icon name={entity.icon} />}\n {entity.description && (\n <Tooltip target={el} ref={tooltipRef}>\n {Array.isArray(entity.description)\n ? formatListToLocaleString(entity.description, t, locale, {\n separator: '\\n'\n })\n : entity.description}\n </Tooltip>\n )}\n </StyledEmailEntity>\n );\n }\n);\n\nexport default EmailEntity;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-social",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.4.0",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,23 +20,23 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "3.0.0-dev.
|
|
24
|
-
"@pega/cosmos-react-rte": "3.0.0-dev.
|
|
25
|
-
"@pega/cosmos-react-work": "3.0.0-dev.
|
|
23
|
+
"@pega/cosmos-react-core": "3.0.0-dev.4.0",
|
|
24
|
+
"@pega/cosmos-react-rte": "3.0.0-dev.4.0",
|
|
25
|
+
"@pega/cosmos-react-work": "3.0.0-dev.4.0",
|
|
26
26
|
"polished": "^4.1.0",
|
|
27
27
|
"react": "^16.14.0 || ^17.0.0",
|
|
28
28
|
"react-dom": "^16.14.0 || ^17.0.0",
|
|
29
29
|
"styled-components": "^5.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@storybook/addon-a11y": "^6.4.
|
|
33
|
-
"@storybook/addon-actions": "^6.4.
|
|
32
|
+
"@storybook/addon-a11y": "^6.4.19",
|
|
33
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
34
34
|
"@storybook/addon-knobs": "^6.4.0",
|
|
35
|
-
"@storybook/addon-storysource": "^6.4.
|
|
36
|
-
"@storybook/addon-toolbars": "^6.4.
|
|
37
|
-
"@storybook/addons": "^6.4.
|
|
38
|
-
"@storybook/react": "^6.4.
|
|
39
|
-
"@storybook/theming": "^6.4.
|
|
35
|
+
"@storybook/addon-storysource": "^6.4.19",
|
|
36
|
+
"@storybook/addon-toolbars": "^6.4.19",
|
|
37
|
+
"@storybook/addons": "^6.4.19",
|
|
38
|
+
"@storybook/react": "^6.4.19",
|
|
39
|
+
"@storybook/theming": "^6.4.19",
|
|
40
40
|
"enzyme": "^3.11.0",
|
|
41
41
|
"typescript": "~4.5.2"
|
|
42
42
|
}
|