@pega/cosmos-react-social 2.0.0-dev.2.0 → 2.0.0-dev.21.1

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.
Files changed (133) hide show
  1. package/lib/components/Chat/Chat.d.ts.map +1 -1
  2. package/lib/components/Chat/Chat.js +9 -16
  3. package/lib/components/Chat/Chat.js.map +1 -1
  4. package/lib/components/Chat/Chat.types.d.ts +3 -3
  5. package/lib/components/Chat/Chat.types.d.ts.map +1 -1
  6. package/lib/components/Chat/Chat.types.js.map +1 -1
  7. package/lib/components/Chat/ChatBody.d.ts.map +1 -1
  8. package/lib/components/Chat/ChatBody.js +4 -3
  9. package/lib/components/Chat/ChatBody.js.map +1 -1
  10. package/lib/components/Chat/ChatComposer.d.ts.map +1 -1
  11. package/lib/components/Chat/ChatComposer.js +36 -51
  12. package/lib/components/Chat/ChatComposer.js.map +1 -1
  13. package/lib/components/Chat/ChatHeader.d.ts.map +1 -1
  14. package/lib/components/Chat/ChatHeader.js +10 -13
  15. package/lib/components/Chat/ChatHeader.js.map +1 -1
  16. package/lib/components/Chat/ChatTranscript.d.ts.map +1 -1
  17. package/lib/components/Chat/ChatTranscript.js +15 -16
  18. package/lib/components/Chat/ChatTranscript.js.map +1 -1
  19. package/lib/components/Chat/Message.d.ts.map +1 -1
  20. package/lib/components/Chat/Message.js +41 -59
  21. package/lib/components/Chat/Message.js.map +1 -1
  22. package/lib/components/Chat/Message.styles.js +2 -2
  23. package/lib/components/Chat/Message.styles.js.map +1 -1
  24. package/lib/components/Chat/MessageList.d.ts.map +1 -1
  25. package/lib/components/Chat/MessageList.js +36 -41
  26. package/lib/components/Chat/MessageList.js.map +1 -1
  27. package/lib/components/Chat/RepeatingView.d.ts.map +1 -1
  28. package/lib/components/Chat/RepeatingView.js +10 -14
  29. package/lib/components/Chat/RepeatingView.js.map +1 -1
  30. package/lib/components/Chat/SuggestedReplyPicker.d.ts.map +1 -1
  31. package/lib/components/Chat/SuggestedReplyPicker.js +46 -54
  32. package/lib/components/Chat/SuggestedReplyPicker.js.map +1 -1
  33. package/lib/components/Chat/SystemMessage.d.ts.map +1 -1
  34. package/lib/components/Chat/SystemMessage.js +4 -6
  35. package/lib/components/Chat/SystemMessage.js.map +1 -1
  36. package/lib/components/Chat/TranscriptMessage.d.ts.map +1 -1
  37. package/lib/components/Chat/TranscriptMessage.js +7 -13
  38. package/lib/components/Chat/TranscriptMessage.js.map +1 -1
  39. package/lib/components/Chat/TypeIndicator.d.ts.map +1 -1
  40. package/lib/components/Chat/TypeIndicator.js +3 -2
  41. package/lib/components/Chat/TypeIndicator.js.map +1 -1
  42. package/lib/components/Email/Email.d.ts.map +1 -1
  43. package/lib/components/Email/Email.js +102 -129
  44. package/lib/components/Email/Email.js.map +1 -1
  45. package/lib/components/Email/Email.styles.d.ts +8 -1
  46. package/lib/components/Email/Email.styles.d.ts.map +1 -1
  47. package/lib/components/Email/Email.styles.js +85 -4
  48. package/lib/components/Email/Email.styles.js.map +1 -1
  49. package/lib/components/Email/Email.types.d.ts +139 -62
  50. package/lib/components/Email/Email.types.d.ts.map +1 -1
  51. package/lib/components/Email/Email.types.js.map +1 -1
  52. package/lib/components/Email/EmailComposer.d.ts +4 -6
  53. package/lib/components/Email/EmailComposer.d.ts.map +1 -1
  54. package/lib/components/Email/EmailComposer.js +155 -73
  55. package/lib/components/Email/EmailComposer.js.map +1 -1
  56. package/lib/components/Email/EmailConversation.d.ts +7 -4
  57. package/lib/components/Email/EmailConversation.d.ts.map +1 -1
  58. package/lib/components/Email/EmailConversation.js +132 -76
  59. package/lib/components/Email/EmailConversation.js.map +1 -1
  60. package/lib/components/Email/EmailEntity.d.ts +6 -0
  61. package/lib/components/Email/EmailEntity.d.ts.map +1 -0
  62. package/lib/components/Email/EmailEntity.js +19 -0
  63. package/lib/components/Email/EmailEntity.js.map +1 -0
  64. package/lib/components/Email/EmailSelector.d.ts +14 -0
  65. package/lib/components/Email/EmailSelector.d.ts.map +1 -0
  66. package/lib/components/Email/EmailSelector.js +62 -0
  67. package/lib/components/Email/EmailSelector.js.map +1 -0
  68. package/lib/components/Email/EmailShell.d.ts.map +1 -1
  69. package/lib/components/Email/EmailShell.js +23 -31
  70. package/lib/components/Email/EmailShell.js.map +1 -1
  71. package/lib/components/Email/EmailSummaryItem.d.ts +10 -0
  72. package/lib/components/Email/EmailSummaryItem.d.ts.map +1 -0
  73. package/lib/components/Email/EmailSummaryItem.js +93 -0
  74. package/lib/components/Email/EmailSummaryItem.js.map +1 -0
  75. package/lib/components/Email/EmailSummaryList.d.ts +6 -0
  76. package/lib/components/Email/EmailSummaryList.d.ts.map +1 -0
  77. package/lib/components/Email/EmailSummaryList.js +115 -0
  78. package/lib/components/Email/EmailSummaryList.js.map +1 -0
  79. package/lib/components/Email/ViewAnalysis.d.ts +6 -0
  80. package/lib/components/Email/ViewAnalysis.d.ts.map +1 -0
  81. package/lib/components/Email/ViewAnalysis.js +20 -0
  82. package/lib/components/Email/ViewAnalysis.js.map +1 -0
  83. package/lib/components/Feed/Feed.context.d.ts +16 -6
  84. package/lib/components/Feed/Feed.context.d.ts.map +1 -1
  85. package/lib/components/Feed/Feed.context.js +1 -0
  86. package/lib/components/Feed/Feed.context.js.map +1 -1
  87. package/lib/components/Feed/Feed.d.ts +13 -17
  88. package/lib/components/Feed/Feed.d.ts.map +1 -1
  89. package/lib/components/Feed/Feed.js +20 -31
  90. package/lib/components/Feed/Feed.js.map +1 -1
  91. package/lib/components/Feed/FeedAttachments.d.ts.map +1 -1
  92. package/lib/components/Feed/FeedAttachments.js +7 -6
  93. package/lib/components/Feed/FeedAttachments.js.map +1 -1
  94. package/lib/components/Feed/FeedButton.d.ts.map +1 -1
  95. package/lib/components/Feed/FeedButton.js.map +1 -1
  96. package/lib/components/Feed/FeedContent.d.ts.map +1 -1
  97. package/lib/components/Feed/FeedContent.js +12 -6
  98. package/lib/components/Feed/FeedContent.js.map +1 -1
  99. package/lib/components/Feed/FeedModalList.d.ts +15 -0
  100. package/lib/components/Feed/FeedModalList.d.ts.map +1 -0
  101. package/lib/components/Feed/FeedModalList.js +49 -0
  102. package/lib/components/Feed/FeedModalList.js.map +1 -0
  103. package/lib/components/Feed/FeedNewPost.d.ts +2 -1
  104. package/lib/components/Feed/FeedNewPost.d.ts.map +1 -1
  105. package/lib/components/Feed/FeedNewPost.js +44 -44
  106. package/lib/components/Feed/FeedNewPost.js.map +1 -1
  107. package/lib/components/Feed/FeedNewPostTypeMenu.d.ts.map +1 -1
  108. package/lib/components/Feed/FeedNewPostTypeMenu.js +47 -79
  109. package/lib/components/Feed/FeedNewPostTypeMenu.js.map +1 -1
  110. package/lib/components/Feed/FeedPost.d.ts +34 -12
  111. package/lib/components/Feed/FeedPost.d.ts.map +1 -1
  112. package/lib/components/Feed/FeedPost.js +165 -101
  113. package/lib/components/Feed/FeedPost.js.map +1 -1
  114. package/lib/components/Feed/FeedReply.d.ts +31 -13
  115. package/lib/components/Feed/FeedReply.d.ts.map +1 -1
  116. package/lib/components/Feed/FeedReply.js +123 -39
  117. package/lib/components/Feed/FeedReply.js.map +1 -1
  118. package/lib/components/Feed/FeedReplyInput.d.ts +6 -6
  119. package/lib/components/Feed/FeedReplyInput.d.ts.map +1 -1
  120. package/lib/components/Feed/FeedReplyInput.js +43 -46
  121. package/lib/components/Feed/FeedReplyInput.js.map +1 -1
  122. package/lib/components/Feed/FeedRichText.d.ts.map +1 -1
  123. package/lib/components/Feed/FeedRichText.js +81 -19
  124. package/lib/components/Feed/FeedRichText.js.map +1 -1
  125. package/lib/components/HashtagButton/HashtagButton.d.ts +6 -4
  126. package/lib/components/HashtagButton/HashtagButton.d.ts.map +1 -1
  127. package/lib/components/HashtagButton/HashtagButton.js +23 -17
  128. package/lib/components/HashtagButton/HashtagButton.js.map +1 -1
  129. package/lib/components/MentionButton/MentionButton.d.ts +10 -4
  130. package/lib/components/MentionButton/MentionButton.d.ts.map +1 -1
  131. package/lib/components/MentionButton/MentionButton.js +34 -18
  132. package/lib/components/MentionButton/MentionButton.js.map +1 -1
  133. package/package.json +15 -16
@@ -1,12 +1,11 @@
1
- import { ReactNode, Ref } from 'react';
2
- import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, ComboBoxProps, EmojiPickerProps, FileUploadItemProps, ForwardProps } from '@pega/cosmos-react-core';
3
- import { InputProps } from '@pega/cosmos-react-core/lib/components/Input/Input';
4
- import { SelectProps } from '@pega/cosmos-react-core/lib/components/Select/Select';
5
- import { RichTextEditorProps } from '@pega/cosmos-react-rte';
1
+ import { MouseEventHandler, ReactNode, Ref } from 'react';
2
+ import { BaseProps, AvatarProps, SentimentProps, FileDisplayProps, FileUploadItemProps, OmitStrict, MenuProps, MenuItemProps, TooltipProps, NoChildrenProp } from '@pega/cosmos-react-core';
6
3
  export interface Suggestion {
7
- /** suggestion title */
4
+ /** Suggestion title */
8
5
  title: string;
9
- /** suggestion id */
6
+ /** Suggestion value */
7
+ content: string;
8
+ /** Suggestion id */
10
9
  id: string;
11
10
  }
12
11
  export interface EmailUser {
@@ -14,50 +13,49 @@ export interface EmailUser {
14
13
  shortName: string;
15
14
  /** Full name of the User */
16
15
  fullName: string;
17
- /** email of the User */
16
+ /** Email of the User */
18
17
  emailAddress: string;
19
18
  /** Avatar props of the User */
20
19
  avatarProps?: Partial<AvatarProps>;
21
20
  }
21
+ export interface EntityHighlightMapping {
22
+ value: string;
23
+ type: string;
24
+ name: string;
25
+ variant: number;
26
+ description?: TooltipProps['children'];
27
+ icon?: string;
28
+ }
22
29
  export interface EmailProps extends BaseProps {
23
30
  /** Ref to the element */
24
31
  ref?: Ref<HTMLDivElement>;
25
32
  /** Unique ID for this email record */
26
33
  id: string;
27
- /** Timestamp of this email */
28
- timeStamp: string;
34
+ /** Timestamp of this email as ISO8601 string, timestamp or native Date object. */
35
+ timeStamp: Date | number | string;
29
36
  /** From email */
30
37
  from: EmailUser;
31
38
  /** To email */
32
39
  to: EmailUser[];
33
- /** carbon copy of email users list */
40
+ /** Carbon copy of email users list */
34
41
  cc?: EmailUser[];
35
- /** blind carbon copy of email users list */
42
+ /** Blind carbon copy of email users list */
36
43
  bcc?: EmailUser[];
37
- /** Tags list */
38
- tags?: {
39
- /** Label for tags */
40
- label: string;
41
- /** List of tags */
42
- items: string[];
43
- /** Indicates if tags are dismissable */
44
- dismissable?: boolean;
45
- /** Callback when dimiss tag is triggered */
46
- onRemove?: (tagName: string) => void;
47
- };
48
44
  /** Sentiment */
49
45
  sentiment?: SentimentProps;
50
- /** subject of the email */
46
+ /** Subject of the email */
51
47
  subject?: string;
52
- /** body */
48
+ /** Body */
53
49
  body?: ReactNode | string;
50
+ /** Entity highlight mapping */
51
+ entityHighlightMapping?: EntityHighlightMapping[];
54
52
  /** onReply callback */
55
53
  onReply: (id: EmailProps['id']) => void;
56
54
  /** onForward Callback */
57
55
  onForward: (id: EmailProps['id']) => void;
58
56
  /** onReply callback */
59
57
  onReplyAll?: (id: EmailProps['id']) => void;
60
- /** list of suggestions */
58
+ /** List of suggestions */
61
59
  suggestions?: Suggestion[];
62
60
  /** Callback that triggers on click of tag */
63
61
  onSuggestionClick?: (id: EmailProps['id'], suggestionId: Suggestion['id']) => void;
@@ -78,51 +76,50 @@ export interface EmailConversationProps extends BaseProps {
78
76
  /** List of mails */
79
77
  emails: EmailProps[];
80
78
  /** Sender(s) of this email conversation */
81
- from: EmailUser[];
79
+ from: EmailUser;
82
80
  /** Recipient(s) of this email conversation */
83
81
  to: EmailUser[];
84
82
  /** Count of unread emails */
85
83
  unReadEmailCount?: number;
86
- /** Timestamp of this conversation */
87
- timeStamp: string;
88
- /** Sentiment */
89
- sentiment?: SentimentProps;
84
+ /** Timestamp of this conversation as ISO8601 string, timestamp or native Date object. */
85
+ timeStamp: Date | string | number;
90
86
  /** Flag that indicates if email conversation is expanded */
91
87
  isCollapsed?: boolean;
92
88
  /** Flag to set if conversation is spun off from forwarded email */
93
89
  isForwarded?: boolean;
94
90
  /** Callback when email conversation is collapsed */
95
- onCollapse?(): void;
91
+ onCollapse?: () => void;
96
92
  /** Callback when email conversation is expanded */
97
- onExpand?(): void;
93
+ onExpand?: () => void;
98
94
  }
99
- export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>, BaseProps {
100
- /** Ref to the element */
101
- ref?: Ref<HTMLDivElement>;
102
- /** Object containing the props to render the from drop down */
103
- from: SelectProps;
104
- /** Object containing the props to render the TO input */
105
- to: ComboBoxProps;
106
- /** Object containing the props to render the CC input */
107
- cc?: ComboBoxProps;
108
- /** Object containing the props to render the BCC input */
109
- bcc?: ComboBoxProps;
95
+ export interface EmailComposerData extends Pick<EmailComposerProps, 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments'> {
96
+ /** Array to hold the initial participants that should be default initialized in To address. */
97
+ to: EmailUser['emailAddress'][];
98
+ }
99
+ export declare type EmailResponseType = 'reply' | 'replyAll' | 'forward';
100
+ export interface EmailDirectRecipients {
101
+ /** To address/addresses in case of reply response type on email. */
102
+ reply: EmailUser['emailAddress'][];
103
+ /** To address/addresses in case of replyAll response type on email. */
104
+ replyAll: EmailUser['emailAddress'][];
105
+ /** To address/addresses in case of forward response type on email. */
106
+ forward?: EmailUser['emailAddress'][];
107
+ }
108
+ export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>, BaseProps, NoChildrenProp {
109
+ /** Object containing full list of email participants. */
110
+ participants: EmailUser[];
111
+ /** Object to hold initial to address/addresses based on different action types. */
112
+ to?: EmailDirectRecipients;
113
+ /** Array to hold the initial participants that should be default initialized in Cc address. */
114
+ cc?: EmailUser['emailAddress'][];
115
+ /** Array to hold the initial participants that should be default initialized in Bcc address. */
116
+ bcc?: EmailUser['emailAddress'][];
110
117
  /** Object containing the props to render the subject input */
111
- subject: InputProps;
112
- /** Region to hold primary email composer fields */
113
- primaryMoreFields?: ReactNode;
114
- /** Region to hold secondary email composer fields */
115
- secondaryMoreFields?: ReactNode;
116
- /** Object containing the props to render the email body rte */
117
- body: RichTextEditorProps & ForwardProps;
118
- /** Callback when CC is clicked */
119
- onShowCC: () => void;
120
- /** Callback when BCC is clicked */
121
- onShowBCC: () => void;
118
+ subject: string;
119
+ /** Body content of the email */
120
+ bodyContent: string;
122
121
  /** Callback when email needs to be sent */
123
- onSend: () => void;
124
- /** Callback when attachment icon is clicked */
125
- onAddAttachment?: () => void;
122
+ onSend: (data: EmailComposerData) => void;
126
123
  /** List of attachments */
127
124
  attachments?: FileUploadItemProps[];
128
125
  /** Max number of attachments to be allowed in Email composer.
@@ -130,12 +127,16 @@ export interface EmailComposerProps extends Pick<EmailProps, 'attachments' | 'su
130
127
  * If attachments added are >= maxAttachments, add attachments icon will be disabled.
131
128
  */
132
129
  maxAttachments?: number;
133
- /** show/hide emoji */
134
- showEmoji?: boolean;
135
- /** Callback when emoji is picked */
136
- onEmojiSelect?: EmojiPickerProps['onSelect'];
137
130
  /** Region to show more actions in footer */
138
131
  footerMoreActions?: ReactNode;
132
+ /** Templates for drafting email */
133
+ templates?: Record<string, string>;
134
+ /** Callback when cancel composing */
135
+ onCancel: () => void;
136
+ /** Ref to the element */
137
+ ref?: Ref<HTMLDivElement>;
138
+ /** Email action types */
139
+ responseType?: EmailResponseType;
139
140
  }
140
141
  export interface EmailShellProps extends BaseProps {
141
142
  /** ref to the element */
@@ -152,4 +153,80 @@ export interface EmailShellProps extends BaseProps {
152
153
  /** Shows only one conversation at a time */
153
154
  autoCollapse?: boolean;
154
155
  }
156
+ export interface EmailSummaryItemProps extends BaseProps {
157
+ /** Id of each summary item */
158
+ id: string;
159
+ /** List of from participant names of the conversations */
160
+ activeParticipants: EmailUser[];
161
+ /** Email body of last email in the email */
162
+ message: string;
163
+ /** Timestamp of the latest email */
164
+ timeStamp: Date | string | number;
165
+ /** Top topic of an email */
166
+ topic: string;
167
+ /** Sentiment */
168
+ sentiment?: SentimentProps;
169
+ /** Urgency of an email */
170
+ urgency?: number;
171
+ /** Total number of unread emails in the email */
172
+ unreadEmailCount?: number;
173
+ /** Is the email currently active */
174
+ active?: boolean;
175
+ /** On click of email item */
176
+ onClick: MouseEventHandler;
177
+ /** ref to the element */
178
+ ref?: Ref<HTMLButtonElement>;
179
+ }
180
+ export interface Filter {
181
+ /** Sets DOM id for the control and associates label element via 'for' attribute. */
182
+ id: string;
183
+ /** Pass a string or a fragment with an Icon and string for the filter label. */
184
+ label: ReactNode;
185
+ /**
186
+ * Disables the filter.
187
+ * @default false
188
+ */
189
+ disabled?: boolean;
190
+ /**
191
+ * Sets on prop via onFilterChange.
192
+ * @default false
193
+ */
194
+ on?: boolean;
195
+ }
196
+ export interface EmailSummaryListProps extends BaseProps {
197
+ /** List of email categories */
198
+ categories: MenuProps['items'];
199
+ /** Handles category change */
200
+ onCategoryClick?: MenuItemProps['onClick'];
201
+ /** List of EmailItems items */
202
+ items: OmitStrict<EmailSummaryItemProps, 'onClick' | 'active'>[];
203
+ /** Total number of unread email count */
204
+ unreadEmailCount?: number;
205
+ /** A set of filters to apply to the email inbox. */
206
+ filters?: Filter[];
207
+ /** A callback that runs when a filter is clicked. */
208
+ onFilterChange?: (filterId: Filter['id'], on: boolean) => void;
209
+ /** onClick of list item */
210
+ onItemClick: (id: EmailSummaryItemProps['id']) => void;
211
+ /** ref to the element */
212
+ ref?: Ref<HTMLDivElement>;
213
+ }
214
+ export interface EmailEntityProps extends BaseProps {
215
+ entity: EntityHighlightMapping;
216
+ ref?: Ref<HTMLElement>;
217
+ }
218
+ export interface ViewAnalysisProps extends BaseProps {
219
+ content: {
220
+ name: string;
221
+ value?: {
222
+ id: string;
223
+ entity: EntityHighlightMapping;
224
+ }[];
225
+ }[];
226
+ header: {
227
+ icon: string;
228
+ text: string;
229
+ };
230
+ ref?: Ref<HTMLDivElement>;
231
+ }
155
232
  //# sourceMappingURL=Email.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA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,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,aAAa,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC7C,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,yBAAyB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,wBAAwB;IACxB,WAAW,CAAC,EAAE;QACZ,yBAAyB;QACzB,OAAO,CAAC,EAAE,SAAS,CAAC;QACpB,8CAA8C;QAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,0BAA0B;IAC1B,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACzC,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"Email.types.d.ts","sourceRoot":"","sources":["../../../src/components/Email/Email.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,YA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
- {"version":3,"file":"Email.types.js","sourceRoot":"","sources":["../../../src/components/Email/Email.types.tsx"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n AvatarProps,\n SentimentProps,\n FileDisplayProps,\n ComboBoxProps,\n EmojiPickerProps,\n FileUploadItemProps,\n ForwardProps\n} from '@pega/cosmos-react-core';\nimport { InputProps } from '@pega/cosmos-react-core/lib/components/Input/Input';\nimport { SelectProps } from '@pega/cosmos-react-core/lib/components/Select/Select';\nimport { RichTextEditorProps } from '@pega/cosmos-react-rte';\n\nexport interface Suggestion {\n /** suggestion title */\n title: string;\n /** suggestion 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 EmailProps extends BaseProps {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Unique ID for this email record */\n id: string;\n /** Timestamp of this email */\n timeStamp: 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 /** Tags list */\n tags?: {\n /** Label for tags */\n label: string;\n /** List of tags */\n items: string[];\n /** Indicates if tags are dismissable */\n dismissable?: boolean;\n /** Callback when dimiss tag is triggered */\n onRemove?: (tagName: string) => void;\n };\n /** Sentiment */\n sentiment?: SentimentProps;\n /** subject of the email */\n subject?: string;\n /** body */\n body?: ReactNode | string;\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?: Suggestion[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: Suggestion['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 */\n timeStamp: string;\n /** Sentiment */\n sentiment?: SentimentProps;\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 EmailComposerProps\n extends Pick<EmailProps, 'attachments' | 'suggestions' | 'onSuggestionClick'>,\n BaseProps {\n /** Ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Object containing the props to render the from drop down */\n from: SelectProps;\n /** Object containing the props to render the TO input */\n to: ComboBoxProps;\n /** Object containing the props to render the CC input */\n cc?: ComboBoxProps;\n /** Object containing the props to render the BCC input */\n bcc?: ComboBoxProps;\n /** Object containing the props to render the subject input */\n subject: InputProps;\n /** Region to hold primary email composer fields */\n primaryMoreFields?: ReactNode;\n /** Region to hold secondary email composer fields */\n secondaryMoreFields?: ReactNode;\n /** Object containing the props to render the email body rte */\n body: RichTextEditorProps & ForwardProps;\n /** Callback when CC is clicked */\n onShowCC: () => void;\n /** Callback when BCC is clicked */\n onShowBCC: () => void;\n /** Callback when email needs to be sent */\n onSend: () => void;\n /** Callback when attachment icon is clicked */\n onAddAttachment?: () => void;\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Max number of attachments to be allowed in Email composer.\n * If zero is passed, add attachments icon will be hidden. same rule applies if prop is not passed.\n * If attachments added are >= maxAttachments, add attachments icon will be disabled.\n */\n maxAttachments?: number;\n /** show/hide emoji */\n showEmoji?: boolean;\n /** Callback when emoji is picked */\n onEmojiSelect?: EmojiPickerProps['onSelect'];\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n}\n\nexport interface EmailShellProps extends BaseProps {\n /** ref to the element */\n ref?: Ref<HTMLDivElement>;\n /** Region for header */\n headerProps?: {\n /** Region for actions */\n actions?: ReactNode;\n /** Subject of the email conversations list */\n subject?: string;\n };\n /** Email conversations */\n conversations?: EmailConversationProps[];\n /** Shows only one conversation at a time */\n autoCollapse?: boolean;\n}\n"]}
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';\n\nexport interface Suggestion {\n /** Suggestion title */\n title: string;\n /** Suggestion value */\n content: string;\n /** Suggestion 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 {\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?: ReactNode | string;\n /** Entity highlight mapping */\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?: Suggestion[];\n /** Callback that triggers on click of tag */\n onSuggestionClick?: (id: EmailProps['id'], suggestionId: Suggestion['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<EmailComposerProps, 'cc' | 'bcc' | 'subject' | 'bodyContent' | 'attachments'> {\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 /** Callback when email needs to be sent */\n onSend: (data: EmailComposerData) => void;\n /** List of attachments */\n attachments?: FileUploadItemProps[];\n /** Max number of attachments to be allowed in Email composer.\n * If zero is passed, add attachments icon will be hidden. same rule applies if prop is not passed.\n * If attachments added are >= maxAttachments, add attachments icon will be disabled.\n */\n maxAttachments?: number;\n /** Region to show more actions in footer */\n footerMoreActions?: ReactNode;\n /** Templates for drafting email */\n templates?: Record<string, string>;\n /** Callback when cancel composing */\n onCancel: () => void;\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 ViewAnalysisProps 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,11 +1,9 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
2
+ import { Icon } from '@pega/cosmos-react-core';
3
3
  import { EmailComposerProps } from './Email.types';
4
- interface StyledAttachmentElementContainerProps {
5
- disabled?: boolean;
6
- }
7
- export declare const StyledAttachmentElementContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledAttachmentElementContainerProps, never>;
8
4
  export declare const StyledEmailComposer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
- declare const EmailComposer: FunctionComponent<EmailComposerProps & ForwardProps>;
5
+ export declare const StyledResponseTypeIcon: typeof Icon;
6
+ export declare const StyledToggleButton: import("styled-components").StyledComponent<FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
7
+ declare const EmailComposer: FunctionComponent<EmailComposerProps>;
10
8
  export default EmailComposer;
11
9
  //# sourceMappingURL=EmailComposer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAc,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAIhG,OAAO,EAUL,YAAY,EAIb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,UAAU,qCAAqC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,eAAO,MAAM,gCAAgC,4IAa5C,CAAC;AAGF,eAAO,MAAM,mBAAmB,yGAAe,CAAC;AAEhD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAoKvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"EmailComposer.d.ts","sourceRoot":"","sources":["../../../src/components/Email/EmailComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,IAAI,EAUL,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,kBAAkB,EAAa,MAAM,eAAe,CAAC;AAK9D,eAAO,MAAM,mBAAmB,yGAAe,CAAC;AAEhD,eAAO,MAAM,sBAAsB,EAAE,OAAO,IAI1C,CAAC;AAIH,eAAO,MAAM,kBAAkB,qNAK7B,CAAC;AAmBH,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CAmSxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,81 +1,163 @@
1
- import React, { forwardRef, useRef, useState } from 'react';
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { forwardRef, useState, useMemo, useRef, useCallback, useEffect } from 'react';
2
4
  import styled, { css } from 'styled-components';
3
- import Select from '@pega/cosmos-react-core/lib/components/Select/Select';
4
- import { Button, ComboBox, EmojiPicker, Flex, Icon, Popover, useElement, useI18n, useOuterEvent, defaultThemeProp, Tooltip, FileUploadItem } from '@pega/cosmos-react-core';
5
- import Input from '@pega/cosmos-react-core/lib/components/Input/Input';
5
+ import { Button, Flex, Icon, registerIcon, useI18n, Option, defaultThemeProp, FileUploadItem, MenuButton, Select, Input } from '@pega/cosmos-react-core';
6
6
  import { RichTextEditor } from '@pega/cosmos-react-rte';
7
- export const StyledAttachmentElementContainer = styled.div(({ disabled, theme }) => {
8
- return (disabled &&
9
- css `
10
- &:focus {
11
- box-shadow: ${theme.base.shadow.focus};
12
- border-radius: 50%;
13
- outline: none;
14
- }
15
- `);
16
- });
17
- StyledAttachmentElementContainer.defaultProps = defaultThemeProp;
7
+ import * as paperClipIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/paper-clip.icon';
8
+ import * as replyAllIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply-all.icon';
9
+ import * as replyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply.icon';
10
+ import * as forwardIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/forward.icon';
11
+ import EmailSelector from './EmailSelector';
12
+ registerIcon(paperClipIcon, replyAllIcon, replyIcon, forwardIcon);
18
13
  export const StyledEmailComposer = styled.div ``;
19
- const EmailComposer = forwardRef((props, ref) => {
20
- const { from, to, onShowBCC, onShowCC, cc, bcc, subject, body, primaryMoreFields, secondaryMoreFields, maxAttachments = 0, attachments = [], onAddAttachment, showEmoji, onEmojiSelect, onSend, footerMoreActions, ...restProps } = props;
21
- const [emojiBtnEl, setEmojiBtnEl] = useElement();
22
- const [attachmentsBtnEl, setAttachmentsBtnEl] = useElement();
23
- const [showEmojiPicker, setShowEmojiPicker] = useState(false);
24
- const toggleEmoji = () => {
25
- setShowEmojiPicker(!showEmojiPicker);
26
- };
27
- const EmojiPickerRef = useRef(null);
28
- useOuterEvent('mousedown', [emojiBtnEl, EmojiPickerRef], () => {
29
- setShowEmojiPicker(false);
30
- });
14
+ export const StyledResponseTypeIcon = styled(Icon)(({ theme }) => {
15
+ return css `
16
+ color: ${theme.base.palette.interactive};
17
+ `;
18
+ });
19
+ StyledResponseTypeIcon.defaultProps = defaultThemeProp;
20
+ export const StyledToggleButton = styled(Button)(({ theme }) => {
21
+ return css `
22
+ margin-block-start: calc(2 * ${theme.base.spacing});
23
+ color: ${theme.base.palette.interactive};
24
+ `;
25
+ });
26
+ StyledToggleButton.defaultProps = defaultThemeProp;
27
+ const responseTypeIcons = {
28
+ reply: 'reply',
29
+ replyAll: 'reply-all',
30
+ forward: 'forward'
31
+ };
32
+ const rteToolbar = [
33
+ 'inline-styling',
34
+ 'headers',
35
+ 'lists',
36
+ 'images',
37
+ 'cut-copy-paste',
38
+ 'indentation'
39
+ ];
40
+ const EmailComposer = forwardRef(({ participants, cc, bcc, bodyContent, maxAttachments = 0, onCancel, onSend, to, footerMoreActions, templates, ...restProps }, ref) => {
31
41
  const t = useI18n();
32
- return (React.createElement(Flex, { as: StyledEmailComposer, ref: ref, ...restProps, container: {
33
- itemGap: 1,
34
- direction: 'column'
35
- } },
36
- React.createElement(Select, { ...from, label: t('from') }),
37
- React.createElement(Flex, { container: {
38
- itemGap: 2,
39
- alignItems: 'end'
40
- } },
41
- React.createElement(Flex, { container: {
42
- itemGap: 1,
43
- direction: 'column'
44
- }, item: {
45
- grow: 1
46
- } }, to && React.createElement(ComboBox, { ...to, label: t('to'), mode: 'multi-select', required: true })),
47
- onShowCC && (React.createElement(Button, { variant: 'link', onClick: onShowCC }, "CC")),
48
- onShowBCC && (React.createElement(Button, { variant: 'link', onClick: onShowBCC }, "BCC"))),
49
- cc && React.createElement(ComboBox, { ...cc, label: 'CC', mode: 'multi-select' }),
50
- bcc && React.createElement(ComboBox, { ...bcc, label: 'BCC', mode: 'multi-select' }),
51
- React.createElement(Input, { ...subject, label: t('subject') }),
52
- primaryMoreFields,
53
- React.createElement(RichTextEditor, { autoFocus: true, ...body, labelHidden: true }),
54
- secondaryMoreFields,
55
- attachments.length > 0 && (React.createElement(Flex, { container: { itemGap: 1, wrap: 'wrap' } }, attachments.map(attachment => (React.createElement(FileUploadItem, { ...attachment, key: attachment.name }))))),
56
- React.createElement(Flex, { container: {
57
- itemGap: 1
58
- } },
59
- showEmoji && (React.createElement(Button, { ref: setEmojiBtnEl, onClick: toggleEmoji, variant: 'simple', icon: true, "aria-label": t('add_emoji'), title: t('add_emoji') },
60
- React.createElement(Icon, { name: 'face-happy' }))),
61
- maxAttachments > 0 && (React.createElement(StyledAttachmentElementContainer, { disabled: attachments.length >= maxAttachments, ref: setAttachmentsBtnEl, tabIndex: attachments.length >= maxAttachments ? 0 : undefined, role: 'button' },
62
- React.createElement(Button, { onClick: onAddAttachment, disabled: attachments.length >= maxAttachments, variant: 'simple', icon: true, "aria-label": attachments.length >= maxAttachments
63
- ? t('disable_attachment', maxAttachments)
64
- : t('add_attachment', maxAttachments), title: t('add_attachment', maxAttachments) },
65
- React.createElement(Icon, { name: 'paper-clip' })),
66
- attachments.length >= maxAttachments && (React.createElement(Tooltip, { target: attachmentsBtnEl, showDelay: 'none', hideDelay: 'none', ...restProps }, t('disable_attachment', maxAttachments))))),
67
- React.createElement(Flex, { container: true, item: { grow: 1 } }, footerMoreActions),
68
- React.createElement(Button, { variant: 'primary', onClick: onSend }, t('send'))),
69
- React.createElement(Popover, { show: showEmojiPicker, target: emojiBtnEl, placement: 'bottom-start', modifiers: [
70
- {
71
- name: 'flip',
72
- enabled: true
42
+ const [responseType, setResponseType] = useState(restProps.responseType);
43
+ const [showCC, setShowCC] = useState(restProps.responseType !== 'reply' && !!cc && cc.length > 0);
44
+ const [showBCC, setShowBCC] = useState(restProps.responseType !== 'reply' && !!bcc && bcc.length > 0);
45
+ const [subject, setSubject] = useState(restProps.subject);
46
+ const [autoReplyTemplate, setAutoReplyTemplate] = useState('');
47
+ const [attachments, setAttachments] = useState(restProps.attachments || []);
48
+ const rteEditorRef = useRef(null);
49
+ const fileUploadInputRef = useRef(null);
50
+ // inserts selected template in RTE
51
+ useEffect(() => {
52
+ if (templates?.[autoReplyTemplate]) {
53
+ rteEditorRef?.current?.clear();
54
+ setTimeout(() => {
55
+ rteEditorRef?.current?.insertHtml(templates?.[autoReplyTemplate], false);
56
+ }, 0);
57
+ }
58
+ }, [autoReplyTemplate]);
59
+ // resets To | CC | BCC combobox selection and toggles fields on responseType change reply | replyAll | forward
60
+ useEffect(() => {
61
+ setShowCC(responseType === 'replyAll' ? !!cc && cc.length > 0 : false);
62
+ setShowBCC(responseType === 'replyAll' && !!bcc && bcc?.length > 0 ? !!bcc : false);
63
+ }, [responseType]);
64
+ const templateOptions = useMemo(() => templates && Object.keys(templates).map(option => _jsx(Option, { children: option }, option)), [templates]);
65
+ const responseTypeMenuData = useMemo(() => {
66
+ const menuItems = [
67
+ {
68
+ id: 'reply',
69
+ primary: t('reply'),
70
+ visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.reply }, void 0),
71
+ selected: responseType === 'reply',
72
+ onClick: () => {
73
+ setResponseType('reply');
74
+ }
75
+ },
76
+ {
77
+ id: 'replyAll',
78
+ primary: t('reply_all'),
79
+ visual: _jsx(StyledResponseTypeIcon, { name: responseTypeIcons.replyAll }, void 0),
80
+ selected: responseType === 'replyAll',
81
+ onClick: () => {
82
+ setResponseType('replyAll');
73
83
  }
74
- ] },
75
- React.createElement(EmojiPicker, { ref: EmojiPickerRef, onSelect: emoji => {
76
- setShowEmojiPicker(false);
77
- onEmojiSelect === null || onEmojiSelect === void 0 ? void 0 : onEmojiSelect(emoji);
78
- } }))));
84
+ }
85
+ ];
86
+ return {
87
+ menuItems,
88
+ selectedResponseType: menuItems.find(item => item.selected)?.primary || menuItems[0].primary,
89
+ selectedResponseTypeIcon: (responseType && responseTypeIcons[responseType]) || responseTypeIcons.reply
90
+ };
91
+ }, [responseType]);
92
+ const onImageAdded = (image, id) => {
93
+ const src = URL.createObjectURL(image);
94
+ rteEditorRef.current?.appendImage({ src, alt: image.name }, id);
95
+ };
96
+ const onSubjectChange = useCallback((e) => {
97
+ setSubject(e.target.value);
98
+ }, []);
99
+ const onTemplateChange = useCallback((e) => {
100
+ setAutoReplyTemplate(e.target.value);
101
+ }, []);
102
+ const onAttachmentDelete = useCallback((name) => {
103
+ setAttachments(prevAttachments => prevAttachments.filter(item => item.name !== name));
104
+ }, []);
105
+ const onFileChange = useCallback((e) => {
106
+ if (e.target.files) {
107
+ setAttachments(prevAttachments => [
108
+ ...prevAttachments,
109
+ ...Array.from(e.target.files).map(file => ({
110
+ name: file.name,
111
+ file
112
+ }))
113
+ ]);
114
+ }
115
+ }, []);
116
+ const [toAddresses, setToAddresses] = useState(to?.[responseType] || []);
117
+ const [ccAddresses, setCcAddresses] = useState(cc);
118
+ const [bccAddresses, setBccAddresses] = useState(bcc);
119
+ const selectedItems = (selections, label) => {
120
+ if (label === 'To') {
121
+ setToAddresses(selections);
122
+ }
123
+ if (label === 'Cc') {
124
+ setCcAddresses(selections);
125
+ }
126
+ if (label === 'Bcc') {
127
+ setBccAddresses(selections);
128
+ }
129
+ };
130
+ const handleSend = useCallback(() => {
131
+ onSend({
132
+ to: toAddresses,
133
+ cc: showCC ? ccAddresses : undefined,
134
+ bcc: showBCC ? bccAddresses : undefined,
135
+ subject,
136
+ bodyContent: rteEditorRef.current?.getHtml() || '',
137
+ attachments
138
+ });
139
+ }, [toAddresses, ccAddresses, bccAddresses, subject, attachments, showCC, showBCC]);
140
+ return (_jsxs(Flex, { as: StyledEmailComposer, ref: ref, ...restProps, container: {
141
+ gap: 2,
142
+ direction: 'column'
143
+ }, children: [_jsx("div", { children: responseType !== 'forward' && (_jsx(MenuButton, { text: responseTypeMenuData.selectedResponseType, variant: 'link', icon: responseTypeMenuData.selectedResponseTypeIcon, menu: {
144
+ mode: 'single-select',
145
+ items: responseTypeMenuData.menuItems
146
+ } }, void 0)) }, void 0), _jsxs(Flex, { container: {
147
+ alignItems: 'start',
148
+ gap: 0.5
149
+ }, children: [_jsx(Flex, { container: {
150
+ gap: 1,
151
+ direction: 'column'
152
+ }, item: {
153
+ grow: 1
154
+ }, children: _jsx(EmailSelector, { participants: participants, defaultSelections: to?.[responseType], label: t('to'), mode: 'multi-select', required: true, selections: selectedItems }, void 0) }, void 0), !showCC && (_jsx(StyledToggleButton, { variant: 'simple', onClick: () => setShowCC(true), icon: true, children: t('cc') }, void 0)), !showBCC && (_jsx(StyledToggleButton, { variant: 'simple', onClick: () => setShowBCC(true), icon: true, children: t('bcc') }, void 0))] }, void 0), showCC && (_jsx(EmailSelector, { participants: participants, defaultSelections: cc, label: t('cc'), mode: 'multi-select', selections: selectedItems }, void 0)), showBCC && (_jsx(EmailSelector, { selections: selectedItems, participants: participants, defaultSelections: bcc, label: t('bcc'), mode: 'multi-select' }, void 0)), _jsx(Input, { value: subject, onChange: onSubjectChange, label: t('subject') }, void 0), _jsx(Select, { onChange: onTemplateChange, label: t('auto_reply'), value: autoReplyTemplate, children: _jsxs(_Fragment, { children: [_jsx(Option, { children: t('insert') }, void 0), templateOptions] }, void 0) }, void 0), _jsx(RichTextEditor, { autoFocus: true, ref: rteEditorRef, toolbar: rteToolbar, onImageAdded: onImageAdded, labelHidden: true, label: t('email_message'), defaultValue: bodyContent }, void 0), attachments.length > 0 && (_jsx(Flex, { container: { gap: 1, wrap: 'wrap' }, children: attachments.map(attachment => (_createElement(FileUploadItem, { ...attachment, key: attachment.name, onDelete: onAttachmentDelete }))) }, void 0)), _jsxs(Flex, { container: {
155
+ gap: 1
156
+ }, children: [_jsxs(Flex, { container: true, item: { grow: 1 }, children: [_jsx(Button, { variant: 'secondary', onClick: onCancel, children: t('cancel') }, void 0), footerMoreActions] }, void 0), _jsxs(Flex, { container: true, children: [maxAttachments > 0 && (_jsx(Button, { onClick: attachments.length < maxAttachments
157
+ ? () => fileUploadInputRef.current?.click()
158
+ : undefined, variant: 'link', label: attachments.length >= maxAttachments
159
+ ? t('email_disable_attachment', [maxAttachments])
160
+ : t('email_add_attachment', [maxAttachments]), children: _jsx(Icon, { name: 'paper-clip' }, void 0) }, void 0)), _jsx(Button, { variant: 'primary', onClick: handleSend, children: t('send') }, void 0)] }, void 0)] }, void 0), _jsx("input", { type: 'file', style: { display: 'none' }, ref: fileUploadInputRef, onChange: onFileChange }, void 0)] }, void 0));
79
161
  });
80
162
  export default EmailComposer;
81
163
  //# sourceMappingURL=EmailComposer.js.map