@microsoft/omnichannel-chat-widget 1.3.1-main.da9dc59 → 1.4.1-main.3c12a8b
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/cjs/assets/Icons.js +8 -2
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +2 -22
- package/lib/cjs/common/utils.js +19 -2
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -1
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +5 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +77 -17
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +6 -0
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +11 -9
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +31 -17
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +5 -2
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +13 -7
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +6 -3
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +40 -101
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +92 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.js +21 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +36 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +24 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +24 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.js +41 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/cjs/contexts/createReducer.js +8 -0
- package/lib/esm/assets/Icons.js +4 -1
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +2 -22
- package/lib/esm/common/utils.js +16 -0
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -2
- package/lib/esm/components/livechatwidget/common/createAdapter.js +5 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +76 -20
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +6 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +11 -9
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +34 -20
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +6 -3
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +13 -7
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +6 -3
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +36 -96
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +84 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.js +9 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +28 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +16 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +16 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.js +33 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/esm/contexts/createReducer.js +8 -0
- package/lib/types/assets/Icons.d.ts +3 -0
- package/lib/types/common/utils.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/endChat.d.ts +6 -2
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +2 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +16 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +5 -3
|
@@ -55,7 +55,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
const WebChatContainerStateful = props => {
|
|
58
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14
|
|
58
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _props$webChatContain3, _props$webChatContain4, _defaultWebChatContai, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai2, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14;
|
|
59
59
|
const {
|
|
60
60
|
BasicWebChat
|
|
61
61
|
} = _botframeworkWebchat.Components;
|
|
@@ -153,21 +153,27 @@ const WebChatContainerStateful = props => {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
div[class="ac-textBlock"] *,
|
|
156
|
-
div[class="ac-input-container"] * {
|
|
156
|
+
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
157
|
+
|
|
158
|
+
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
159
|
+
background-color: ${((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : (_props$webChatContain4 = _props$webChatContain3.webChatStyles) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.bubbleBackground) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.bubbleBackground)};
|
|
160
|
+
color:${((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 ? void 0 : (_props$webChatContain6 = _props$webChatContain5.webChatStyles) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.bubbleTextColor) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleTextColor)};
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
div[class="ac-textBlock"] a:link,
|
|
158
164
|
div[class="ac-textBlock"] a:visited,
|
|
159
165
|
div[class="ac-textBlock"] a:hover,
|
|
160
166
|
div[class="ac-textBlock"] a:active {
|
|
161
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
167
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
162
168
|
}
|
|
163
169
|
|
|
164
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
170
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
165
171
|
|
|
166
172
|
.ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
|
|
167
173
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
|
|
168
174
|
height: '.75em';
|
|
169
175
|
marginLeft: '.25em';
|
|
170
|
-
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
176
|
+
filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp9 === void 0 ? void 0 : (_webChatContainerProp10 = _webChatContainerProp9.receivedMessageAnchorStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
171
177
|
}
|
|
172
178
|
pre {
|
|
173
179
|
white-space: pre-wrap;
|
|
@@ -180,13 +186,13 @@ const WebChatContainerStateful = props => {
|
|
|
180
186
|
.ms_lcw_webchat_received_message a:visited,
|
|
181
187
|
.ms_lcw_webchat_received_message a:hover,
|
|
182
188
|
.ms_lcw_webchat_received_message a:active {
|
|
183
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
189
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp11 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp11 === void 0 ? void 0 : (_webChatContainerProp12 = _webChatContainerProp11.receivedMessageAnchorStyles) === null || _webChatContainerProp12 === void 0 ? void 0 : _webChatContainerProp12.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
184
190
|
}
|
|
185
191
|
.ms_lcw_webchat_sent_message a:link,
|
|
186
192
|
.ms_lcw_webchat_sent_message a:visited,
|
|
187
193
|
.ms_lcw_webchat_sent_message a:hover,
|
|
188
194
|
.ms_lcw_webchat_sent_message a:active {
|
|
189
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
195
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp13 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp13 === void 0 ? void 0 : (_webChatContainerProp14 = _webChatContainerProp13.sentMessageAnchorStyles) === null || _webChatContainerProp14 === void 0 ? void 0 : _webChatContainerProp14.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
190
196
|
}
|
|
191
197
|
`), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
192
198
|
styles: containerStyles
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultMiddlewareLocalizedTexts = void 0;
|
|
7
|
-
/*
|
|
7
|
+
/*
|
|
8
8
|
MIDDLEWARE_BANNER_FILE parameters:
|
|
9
9
|
{0} = File limit size
|
|
10
10
|
{1} = File extension
|
|
11
|
-
{2} = File name
|
|
11
|
+
{2} = File name
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
const defaultMiddlewareLocalizedTexts = {
|
|
@@ -31,6 +31,9 @@ const defaultMiddlewareLocalizedTexts = {
|
|
|
31
31
|
MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
|
|
32
32
|
MIDDLEWARE_MESSAGE_RETRY: "Retry",
|
|
33
33
|
MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
|
|
34
|
-
THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
|
|
34
|
+
THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation.",
|
|
35
|
+
MIDDLEWARE_BANNER_FILE_IS_MALICIOUS: "{0} has been blocked because the file may contain a malware.",
|
|
36
|
+
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS: "Email will be sent after chat ends!",
|
|
37
|
+
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR: "Email {0} could not be saved, try again later."
|
|
35
38
|
};
|
|
36
39
|
exports.defaultMiddlewareLocalizedTexts = defaultMiddlewareLocalizedTexts;
|
package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.NotificationScenarios = NotificationScenarios;
|
|
|
10
10
|
NotificationScenarios["Connection"] = "connection";
|
|
11
11
|
NotificationScenarios["DownloadTranscriptError"] = "download transcript";
|
|
12
12
|
NotificationScenarios["EmailTranscriptError"] = "email transcript";
|
|
13
|
+
NotificationScenarios["EmailAddressSaved"] = "email address saved";
|
|
13
14
|
NotificationScenarios["AttachmentError"] = "attachment";
|
|
14
15
|
NotificationScenarios["InternetConnection"] = "internet connection";
|
|
15
16
|
NotificationScenarios["MaxSizeError"] = "max size";
|
|
@@ -11,108 +11,23 @@ var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryCons
|
|
|
11
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
12
12
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
13
13
|
var _defaultAtttachmentAdaptiveCardStyles = require("./defaultStyles/defaultAtttachmentAdaptiveCardStyles");
|
|
14
|
-
var _defaultAttachmentContentStyles = require("./defaultStyles/defaultAttachmentContentStyles");
|
|
15
|
-
var _defaultAttachmentDividerStyles = require("./defaultStyles/defaultAttachmentDividerStyles");
|
|
16
|
-
var _defaultAttachmentDownloadIconStyles = require("./defaultStyles/defaultAttachmentDownloadIconStyles");
|
|
17
|
-
var _defaultAttachmentFileNameStyles = require("./defaultStyles/defaultAttachmentFileNameStyles");
|
|
18
|
-
var _defaultAtttachmentIconStyles = require("./defaultStyles/defaultAtttachmentIconStyles");
|
|
19
14
|
var _defaultAttachmentProps = require("../../../common/defaultProps/defaultAttachmentProps");
|
|
20
|
-
var _defaultAttachmentSizeStyles = require("./defaultStyles/defaultAttachmentSizeStyles");
|
|
21
|
-
var _defaultAtttachmentStyles = require("./defaultStyles/defaultAtttachmentStyles");
|
|
22
15
|
var _ = require("../../../../..");
|
|
16
|
+
var _NotificationHandler = require("../../notification/NotificationHandler");
|
|
17
|
+
var _NotificationScenarios = require("../../enums/NotificationScenarios");
|
|
18
|
+
var _defaultMiddlewareLocalizedTexts = require("../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
19
|
+
var _Attachment = _interopRequireDefault(require("./attachments/Attachment"));
|
|
20
|
+
var _ScanInProgressAttachment = _interopRequireDefault(require("./attachments/ScanInProgressAttachment"));
|
|
21
|
+
var _MaliciousAttachment = _interopRequireDefault(require("./attachments/MaliciousAttachment"));
|
|
22
|
+
var _FileScanStatus = _interopRequireDefault(require("./attachments/FileScanStatus"));
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
25
25
|
/******
|
|
26
26
|
* AttachmentMiddleware
|
|
27
|
-
*
|
|
27
|
+
*
|
|
28
28
|
* Handles attachment downloading.
|
|
29
29
|
******/
|
|
30
30
|
|
|
31
|
-
const AttachmentContent = props => {
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
-
id: props.id,
|
|
34
|
-
style: props.style
|
|
35
|
-
}, props.children);
|
|
36
|
-
};
|
|
37
|
-
const AttachmentIcon = props => {
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
-
id: props.id,
|
|
40
|
-
style: props.style
|
|
41
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
42
|
-
src: props.src ?? (0, _FileAttachmentIconManager.getFileAttachmentIconData)("txt")
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
const Attachment = props => {
|
|
46
|
-
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$r5, _state$domainStates$r6, _state$domainStates$r7, _state$domainStates$r8, _state$domainStates$r9;
|
|
47
|
-
const {
|
|
48
|
-
iconData,
|
|
49
|
-
imageCard,
|
|
50
|
-
textCard,
|
|
51
|
-
renderer
|
|
52
|
-
} = props;
|
|
53
|
-
const [state] = (0, _.useChatContextStore)();
|
|
54
|
-
const attachmentId = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : (_state$domainStates$r2 = _state$domainStates$r.attachmentProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.webChatAttachmentId) ?? _defaultAttachmentProps.defaultAttachmentProps.webChatAttachmentId;
|
|
55
|
-
const attachmentDividerStyles = {
|
|
56
|
-
..._defaultAttachmentDividerStyles.defaultAttachmentDividerStyles,
|
|
57
|
-
...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.attachmentDividerStyles)
|
|
58
|
-
};
|
|
59
|
-
const attachmentIconStyles = {
|
|
60
|
-
..._defaultAtttachmentIconStyles.defaultAttachmentIconStyles,
|
|
61
|
-
...((_state$domainStates$r4 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.attachmentIconStyles)
|
|
62
|
-
};
|
|
63
|
-
const attachmentStyles = {
|
|
64
|
-
..._defaultAtttachmentStyles.defaultAttachmentStyles,
|
|
65
|
-
...((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.attachmentStyles)
|
|
66
|
-
};
|
|
67
|
-
const attachmentSizeStylesString = Object.entries({
|
|
68
|
-
..._defaultAttachmentSizeStyles.defaultAttachmentSizeStyles,
|
|
69
|
-
...((_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.attachmentSizeStyles)
|
|
70
|
-
}).map(_ref => {
|
|
71
|
-
let [k, v] = _ref;
|
|
72
|
-
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
73
|
-
}).join(";");
|
|
74
|
-
const attachmentContentStylesString = Object.entries({
|
|
75
|
-
..._defaultAttachmentContentStyles.defaultAttachmentContentStyles,
|
|
76
|
-
...((_state$domainStates$r7 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r7 === void 0 ? void 0 : _state$domainStates$r7.attachmentContentStyles)
|
|
77
|
-
}).map(_ref2 => {
|
|
78
|
-
let [k, v] = _ref2;
|
|
79
|
-
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
80
|
-
}).join(";");
|
|
81
|
-
const attachmentFileNameStylesString = Object.entries({
|
|
82
|
-
..._defaultAttachmentFileNameStyles.defaultAttachmentFileNameStyles,
|
|
83
|
-
...((_state$domainStates$r8 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r8 === void 0 ? void 0 : _state$domainStates$r8.attachmentFileNameStyles)
|
|
84
|
-
}).map(_ref3 => {
|
|
85
|
-
let [k, v] = _ref3;
|
|
86
|
-
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
87
|
-
}).join(";");
|
|
88
|
-
const attachmentDownloadIconStylesString = Object.entries({
|
|
89
|
-
..._defaultAttachmentDownloadIconStyles.defaultAttachmentDownloadIconStyles,
|
|
90
|
-
...((_state$domainStates$r9 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r9 === void 0 ? void 0 : _state$domainStates$r9.attachmentDownloadIconStyles)
|
|
91
|
-
}).map(_ref4 => {
|
|
92
|
-
let [k, v] = _ref4;
|
|
93
|
-
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
94
|
-
}).join(";");
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("style", null, `
|
|
96
|
-
.webchat__fileContent__size { ${attachmentSizeStylesString} }
|
|
97
|
-
.webchat__fileContent { ${attachmentContentStylesString} }
|
|
98
|
-
.webchat__fileContent__fileName { ${attachmentFileNameStylesString} }
|
|
99
|
-
.webchat__fileContent__downloadIcon { ${attachmentDownloadIconStylesString} }
|
|
100
|
-
`), /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
dir: state.domainStates.globalDir
|
|
102
|
-
}, imageCard && renderer(imageCard), imageCard && /*#__PURE__*/_react.default.createElement("hr", {
|
|
103
|
-
id: attachmentId + "-divider",
|
|
104
|
-
style: attachmentDividerStyles
|
|
105
|
-
}), /*#__PURE__*/_react.default.createElement(AttachmentContent, {
|
|
106
|
-
attachment: textCard.attachment,
|
|
107
|
-
id: attachmentId,
|
|
108
|
-
style: attachmentStyles
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(AttachmentIcon, {
|
|
110
|
-
src: iconData,
|
|
111
|
-
id: attachmentId + "-icon",
|
|
112
|
-
style: attachmentIconStyles
|
|
113
|
-
}), textCard && renderer(textCard))));
|
|
114
|
-
};
|
|
115
|
-
|
|
116
31
|
/**
|
|
117
32
|
* Patch card with different attachment data.
|
|
118
33
|
* @param card
|
|
@@ -139,7 +54,7 @@ const genPreviewCardWithAttachment = (card, iconData, next) => {
|
|
|
139
54
|
contentType: _Constants.MimeTypes.UnknownFileType,
|
|
140
55
|
thumbnailUrl: undefined
|
|
141
56
|
});
|
|
142
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_Attachment.default, {
|
|
143
58
|
iconData: iconData,
|
|
144
59
|
imageCard: card,
|
|
145
60
|
textCard: patchedTextCard,
|
|
@@ -147,9 +62,9 @@ const genPreviewCardWithAttachment = (card, iconData, next) => {
|
|
|
147
62
|
});
|
|
148
63
|
};
|
|
149
64
|
const createAttachmentMiddleware = enableInlinePlaying => {
|
|
150
|
-
// eslint-disable-next-line react/display-name
|
|
65
|
+
// eslint-disable-next-line react/display-name
|
|
151
66
|
const attachmentMiddleware = () => next => function () {
|
|
152
|
-
var _state$domainStates$
|
|
67
|
+
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _card$activity$channe;
|
|
153
68
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
154
69
|
args[_key] = arguments[_key];
|
|
155
70
|
}
|
|
@@ -199,10 +114,10 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
199
114
|
}
|
|
200
115
|
}
|
|
201
116
|
const [state] = (0, _.useChatContextStore)();
|
|
202
|
-
const attachmentId = ((_state$domainStates$
|
|
117
|
+
const attachmentId = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : (_state$domainStates$r2 = _state$domainStates$r.attachmentProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.adaptiveCardAttachmentId) ?? _defaultAttachmentProps.defaultAttachmentProps.adaptiveCardAttachmentId;
|
|
203
118
|
const atttachmentAdaptiveCardStyles = {
|
|
204
119
|
..._defaultAtttachmentAdaptiveCardStyles.defaultAttachmentAdaptiveCardStyles,
|
|
205
|
-
...((_state$domainStates$
|
|
120
|
+
...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.attachmentAdaptiveCardStyles)
|
|
206
121
|
};
|
|
207
122
|
if (type === _Constants.WebChatMiddlewareConstants.adaptiveCard || _Constants.Constants.supportedAdaptiveCardContentTypes.indexOf(contentType) >= 0) {
|
|
208
123
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -220,6 +135,30 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
220
135
|
if (!attachment.name) {
|
|
221
136
|
return next(...args);
|
|
222
137
|
}
|
|
138
|
+
if (card.activity.channelData && card.activity.channelData.fileScan) {
|
|
139
|
+
const index = attachments.findIndex(attachment => attachment.name === card.attachment.name);
|
|
140
|
+
const {
|
|
141
|
+
activity: {
|
|
142
|
+
channelData: {
|
|
143
|
+
fileScan
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} = card;
|
|
147
|
+
const scanResult = fileScan[index];
|
|
148
|
+
if ((scanResult === null || scanResult === void 0 ? void 0 : scanResult.status) === _FileScanStatus.default.INPROGRESS) {
|
|
149
|
+
return /*#__PURE__*/_react.default.createElement(_ScanInProgressAttachment.default, {
|
|
150
|
+
textCard: card
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if ((scanResult === null || scanResult === void 0 ? void 0 : scanResult.status) === _FileScanStatus.default.MALWARE) {
|
|
154
|
+
var _state$domainStates$m;
|
|
155
|
+
const localizedText = ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_BANNER_FILE_IS_MALICIOUS) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_FILE_IS_MALICIOUS;
|
|
156
|
+
_NotificationHandler.NotificationHandler.notifyError(_NotificationScenarios.NotificationScenarios.AttachmentError, localizedText.replace("{0}", attachment.name));
|
|
157
|
+
return /*#__PURE__*/_react.default.createElement(_MaliciousAttachment.default, {
|
|
158
|
+
textCard: card
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
223
162
|
const fileExtension = attachment.name.substring(attachment.name.lastIndexOf(".") + 1, attachment.name.length) || attachment.name;
|
|
224
163
|
const imageExtension = _Constants.Constants.imageRegex.test(attachment.name);
|
|
225
164
|
const audioExtension = _Constants.Constants.audioMediaRegex.test(attachment.name);
|
|
@@ -232,7 +171,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
232
171
|
if (enableInlinePlaying && card.activity.actionType && card.activity.actionType === _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (0, _FileAttachmentIconManager.isInlineMediaSupported)(attachment.name)) {
|
|
233
172
|
return genPreviewCardWithAttachment(card, iconData, next);
|
|
234
173
|
}
|
|
235
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
174
|
+
return /*#__PURE__*/_react.default.createElement(_Attachment.default, {
|
|
236
175
|
iconData: iconData,
|
|
237
176
|
textCard: patchAttachment(card, {
|
|
238
177
|
contentType: _Constants.MimeTypes.UnknownFileType,
|
|
@@ -243,7 +182,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
243
182
|
}
|
|
244
183
|
const isUnknownImageObject = contentType.toLowerCase().includes("image") && !imageExtension;
|
|
245
184
|
if (fileExtension === "txt" || isUnknownImageObject) {
|
|
246
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_Attachment.default, {
|
|
247
186
|
iconData: iconData,
|
|
248
187
|
textCard: patchAttachment(card, {
|
|
249
188
|
contentType: _Constants.MimeTypes.UnknownFileType,
|
|
@@ -252,7 +191,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
252
191
|
renderer: next
|
|
253
192
|
});
|
|
254
193
|
}
|
|
255
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
194
|
+
return /*#__PURE__*/_react.default.createElement(_Attachment.default, {
|
|
256
195
|
iconData: iconData,
|
|
257
196
|
textCard: card,
|
|
258
197
|
renderer: next
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _useChatContextStore = _interopRequireDefault(require("../../../../../../hooks/useChatContextStore"));
|
|
9
|
+
var _defaultAttachmentProps = require("../../../../common/defaultProps/defaultAttachmentProps");
|
|
10
|
+
var _defaultAttachmentContentStyles = require("../defaultStyles/defaultAttachmentContentStyles");
|
|
11
|
+
var _defaultAttachmentDividerStyles = require("../defaultStyles/defaultAttachmentDividerStyles");
|
|
12
|
+
var _defaultAttachmentDownloadIconStyles = require("../defaultStyles/defaultAttachmentDownloadIconStyles");
|
|
13
|
+
var _defaultAttachmentFileNameStyles = require("../defaultStyles/defaultAttachmentFileNameStyles");
|
|
14
|
+
var _defaultAttachmentSizeStyles = require("../defaultStyles/defaultAttachmentSizeStyles");
|
|
15
|
+
var _defaultAtttachmentIconStyles = require("../defaultStyles/defaultAtttachmentIconStyles");
|
|
16
|
+
var _defaultAtttachmentStyles = require("../defaultStyles/defaultAtttachmentStyles");
|
|
17
|
+
var _AttachmentContent = _interopRequireDefault(require("./AttachmentContent"));
|
|
18
|
+
var _AttachmentIcon = _interopRequireDefault(require("./AttachmentIcon"));
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
const Attachment = props => {
|
|
21
|
+
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$r5, _state$domainStates$r6, _state$domainStates$r7, _state$domainStates$r8, _state$domainStates$r9;
|
|
22
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const {
|
|
24
|
+
iconData,
|
|
25
|
+
imageCard,
|
|
26
|
+
textCard,
|
|
27
|
+
renderer
|
|
28
|
+
} = props;
|
|
29
|
+
const [state] = (0, _useChatContextStore.default)();
|
|
30
|
+
const attachmentId = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : (_state$domainStates$r2 = _state$domainStates$r.attachmentProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.webChatAttachmentId) ?? _defaultAttachmentProps.defaultAttachmentProps.webChatAttachmentId;
|
|
31
|
+
const attachmentDividerStyles = {
|
|
32
|
+
..._defaultAttachmentDividerStyles.defaultAttachmentDividerStyles,
|
|
33
|
+
...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.attachmentDividerStyles)
|
|
34
|
+
};
|
|
35
|
+
const attachmentIconStyles = {
|
|
36
|
+
..._defaultAtttachmentIconStyles.defaultAttachmentIconStyles,
|
|
37
|
+
...((_state$domainStates$r4 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.attachmentIconStyles)
|
|
38
|
+
};
|
|
39
|
+
const attachmentStyles = {
|
|
40
|
+
..._defaultAtttachmentStyles.defaultAttachmentStyles,
|
|
41
|
+
...((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.attachmentStyles)
|
|
42
|
+
};
|
|
43
|
+
const attachmentSizeStylesString = Object.entries({
|
|
44
|
+
..._defaultAttachmentSizeStyles.defaultAttachmentSizeStyles,
|
|
45
|
+
...((_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.attachmentSizeStyles)
|
|
46
|
+
}).map(_ref => {
|
|
47
|
+
let [k, v] = _ref;
|
|
48
|
+
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
49
|
+
}).join(";");
|
|
50
|
+
const attachmentContentStylesString = Object.entries({
|
|
51
|
+
..._defaultAttachmentContentStyles.defaultAttachmentContentStyles,
|
|
52
|
+
...((_state$domainStates$r7 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r7 === void 0 ? void 0 : _state$domainStates$r7.attachmentContentStyles)
|
|
53
|
+
}).map(_ref2 => {
|
|
54
|
+
let [k, v] = _ref2;
|
|
55
|
+
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
56
|
+
}).join(";");
|
|
57
|
+
const attachmentFileNameStylesString = Object.entries({
|
|
58
|
+
..._defaultAttachmentFileNameStyles.defaultAttachmentFileNameStyles,
|
|
59
|
+
...((_state$domainStates$r8 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r8 === void 0 ? void 0 : _state$domainStates$r8.attachmentFileNameStyles)
|
|
60
|
+
}).map(_ref3 => {
|
|
61
|
+
let [k, v] = _ref3;
|
|
62
|
+
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
63
|
+
}).join(";");
|
|
64
|
+
const attachmentDownloadIconStylesString = Object.entries({
|
|
65
|
+
..._defaultAttachmentDownloadIconStyles.defaultAttachmentDownloadIconStyles,
|
|
66
|
+
...((_state$domainStates$r9 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r9 === void 0 ? void 0 : _state$domainStates$r9.attachmentDownloadIconStyles)
|
|
67
|
+
}).map(_ref4 => {
|
|
68
|
+
let [k, v] = _ref4;
|
|
69
|
+
return `${k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)}:${v}`;
|
|
70
|
+
}).join(";");
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("style", null, `
|
|
72
|
+
.webchat__fileContent__size { ${attachmentSizeStylesString} }
|
|
73
|
+
.webchat__fileContent { ${attachmentContentStylesString} }
|
|
74
|
+
.webchat__fileContent__fileName { ${attachmentFileNameStylesString} }
|
|
75
|
+
.webchat__fileContent__downloadIcon { ${attachmentDownloadIconStylesString} }
|
|
76
|
+
`), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
dir: state.domainStates.globalDir
|
|
78
|
+
}, imageCard && renderer(imageCard), imageCard && /*#__PURE__*/_react.default.createElement("hr", {
|
|
79
|
+
id: attachmentId + "-divider",
|
|
80
|
+
style: attachmentDividerStyles
|
|
81
|
+
}), /*#__PURE__*/_react.default.createElement(_AttachmentContent.default, {
|
|
82
|
+
attachment: textCard.attachment,
|
|
83
|
+
id: attachmentId,
|
|
84
|
+
style: attachmentStyles
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_AttachmentIcon.default, {
|
|
86
|
+
src: iconData,
|
|
87
|
+
id: attachmentId + "-icon",
|
|
88
|
+
style: attachmentIconStyles
|
|
89
|
+
}), textCard && renderer(textCard))));
|
|
90
|
+
};
|
|
91
|
+
var _default = Attachment;
|
|
92
|
+
exports.default = _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const AttachmentContent = props => {
|
|
10
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
11
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
12
|
+
id: props.id,
|
|
13
|
+
style: props.style
|
|
14
|
+
}, props.children);
|
|
15
|
+
};
|
|
16
|
+
var _default = AttachmentContent;
|
|
17
|
+
exports.default = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _FileAttachmentIconManager = require("../../../../common/utils/FileAttachmentIconManager");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const AttachmentIcon = props => {
|
|
11
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
13
|
+
id: props.id,
|
|
14
|
+
style: props.style
|
|
15
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
16
|
+
src: props.src ?? (0, _FileAttachmentIconManager.getFileAttachmentIconData)("txt"),
|
|
17
|
+
alt: "attachment icon"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
var _default = AttachmentIcon;
|
|
21
|
+
exports.default = _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Attachment = _interopRequireDefault(require("./Attachment"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
const DownloadBlockedAttachment = props => {
|
|
12
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
13
|
+
const renderer = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
14
|
+
style: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
padding: "10px 10px 10px 8px",
|
|
17
|
+
width: "100%"
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
style: {
|
|
21
|
+
fontSize: 12,
|
|
22
|
+
fontFamily: "Segoe UI, Arial, sans-serif"
|
|
23
|
+
}
|
|
24
|
+
}, " ", props.textCard.attachment.name, " "), /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
+
style: {
|
|
26
|
+
marginLeft: "auto",
|
|
27
|
+
paddingRight: "10px"
|
|
28
|
+
}
|
|
29
|
+
}, props.extraContent && props.extraContent));
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_Attachment.default, _extends({}, props, {
|
|
31
|
+
imageCard: undefined,
|
|
32
|
+
renderer: renderer
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
var _default = DownloadBlockedAttachment;
|
|
36
|
+
exports.default = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var FileScanStatus;
|
|
8
|
+
(function (FileScanStatus) {
|
|
9
|
+
FileScanStatus["PASSED"] = "passed";
|
|
10
|
+
FileScanStatus["MALWARE"] = "malware";
|
|
11
|
+
FileScanStatus["INPROGRESS"] = "in progress";
|
|
12
|
+
})(FileScanStatus || (FileScanStatus = {}));
|
|
13
|
+
var _default = FileScanStatus;
|
|
14
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _DownloadBlockedAttachment = _interopRequireDefault(require("./DownloadBlockedAttachment"));
|
|
9
|
+
var _Icons = require("../../../../../../assets/Icons");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
+
const MaliciousAttachment = props => {
|
|
13
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
14
|
+
const extraContent = /*#__PURE__*/_react.default.createElement("img", {
|
|
15
|
+
src: _Icons.CrossIcon,
|
|
16
|
+
alt: "download blocked icon"
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_DownloadBlockedAttachment.default, _extends({}, props, {
|
|
19
|
+
iconData: _Icons.MaliciousFileIcon,
|
|
20
|
+
extraContent: extraContent
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
var _default = MaliciousAttachment;
|
|
24
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
9
|
+
var _DownloadBlockedAttachment = _interopRequireDefault(require("./DownloadBlockedAttachment"));
|
|
10
|
+
var _Icons = require("../../../../../../assets/Icons");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
const ScanInProgressAttachment = props => {
|
|
14
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
15
|
+
const extraContent = /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
16
|
+
size: 16
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_DownloadBlockedAttachment.default, _extends({}, props, {
|
|
19
|
+
iconData: _Icons.FileScanInProgressIcon,
|
|
20
|
+
extraContent: extraContent
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
var _default = ScanInProgressAttachment;
|
|
24
|
+
exports.default = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const Spinner = props => {
|
|
10
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
11
|
+
const spinnerStyle = {
|
|
12
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
borderRadius: "50%",
|
|
15
|
+
borderWidth: props.borderWidth || 2,
|
|
16
|
+
borderStyle: "solid",
|
|
17
|
+
borderColor: "rgb(0,120,212) rgb(199,224,244) rgb(199,224,244)",
|
|
18
|
+
borderImage: "initial",
|
|
19
|
+
animationName: "spin",
|
|
20
|
+
animationDuration: "1.3s",
|
|
21
|
+
animationIterationCount: "infinite",
|
|
22
|
+
animationTimingFunction: "cubic-bezier(0.53, 0.21, 0.29, 0.67)",
|
|
23
|
+
width: props.size || 20,
|
|
24
|
+
height: props.size || 20
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("style", null, `
|
|
27
|
+
@keyframes spin {
|
|
28
|
+
0% {
|
|
29
|
+
transform: rotate(0deg);
|
|
30
|
+
}
|
|
31
|
+
100% {
|
|
32
|
+
transform: rotate(360deg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`), /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
className: "spinner",
|
|
37
|
+
style: spinnerStyle
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
var _default = Spinner;
|
|
41
|
+
exports.default = _default;
|
|
@@ -50,4 +50,5 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
50
50
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 40] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
|
|
51
51
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 41] = "SET_SURVEY_MODE";
|
|
52
52
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 42] = "SET_CONFIRMATION_STATE";
|
|
53
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 43] = "SET_POST_CHAT_PARTICIPANT_TYPE";
|
|
53
54
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -59,7 +59,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
59
59
|
unreadMessageCount: 0,
|
|
60
60
|
conversationEndedBy: _Constants.ConversationEndEntity.NotSet,
|
|
61
61
|
chatDisconnectEventReceived: false,
|
|
62
|
-
selectedSurveyMode: null
|
|
62
|
+
selectedSurveyMode: null,
|
|
63
|
+
postChatParticipantType: undefined
|
|
63
64
|
},
|
|
64
65
|
uiStates: {
|
|
65
66
|
showConfirmationPane: false,
|
|
@@ -331,6 +331,14 @@ const createReducer = () => {
|
|
|
331
331
|
confirmationState: action.payload
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_PARTICIPANT_TYPE:
|
|
335
|
+
return {
|
|
336
|
+
...state,
|
|
337
|
+
appStates: {
|
|
338
|
+
...state.appStates,
|
|
339
|
+
postChatParticipantType: action.payload
|
|
340
|
+
}
|
|
341
|
+
};
|
|
334
342
|
default:
|
|
335
343
|
return state;
|
|
336
344
|
}
|