@microsoft/omnichannel-chat-widget 1.8.2-main.5199342 → 1.8.2-main.fc93d3d
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/README.md +2 -0
- package/lib/cjs/common/Constants.js +9 -1
- package/lib/cjs/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +18 -7
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +29 -1
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +18 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +31 -7
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +15 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +22 -11
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/controller/componentController.js +2 -2
- package/lib/cjs/firstresponselatency/util.js +52 -27
- package/lib/cjs/plugins/newMessageEventHandler.js +12 -6
- package/lib/esm/common/Constants.js +7 -0
- package/lib/esm/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +18 -7
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +29 -1
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +16 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +33 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +16 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +5 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +22 -11
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/controller/componentController.js +2 -2
- package/lib/esm/firstresponselatency/util.js +49 -25
- package/lib/esm/plugins/newMessageEventHandler.js +12 -6
- package/lib/types/common/Constants.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- package/lib/types/firstresponselatency/util.d.ts +17 -0
- package/lib/types/plugins/newMessageEventHandler.d.ts +1 -1
- package/package.json +3 -3
|
@@ -56,7 +56,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
const WebChatContainerStateful = props => {
|
|
59
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2,
|
|
59
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain9, _props$webChatContain10;
|
|
60
60
|
(0, _react2.useEffect)(() => {
|
|
61
61
|
uiTimer = (0, _utils.createTimer)();
|
|
62
62
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -185,20 +185,24 @@ const WebChatContainerStateful = props => {
|
|
|
185
185
|
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
|
|
189
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color} !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
188
192
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
189
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
193
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp3 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp3 === void 0 ? void 0 : (_webChatContainerProp4 = _webChatContainerProp3.userMessageBoxStyles) === null || _webChatContainerProp4 === void 0 ? void 0 : _webChatContainerProp4.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
193
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
197
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp5 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp5 === void 0 ? void 0 : (_webChatContainerProp6 = _webChatContainerProp5.systemMessageBoxStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
div[class="ac-textBlock"] *,
|
|
197
|
-
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
201
|
+
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
198
202
|
|
|
199
203
|
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
200
204
|
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
201
|
-
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (
|
|
205
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp8 !== void 0 && _webChatContainerProp8.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
.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 {
|
|
@@ -210,15 +214,15 @@ const WebChatContainerStateful = props => {
|
|
|
210
214
|
div[class="ac-textBlock"] a:visited,
|
|
211
215
|
div[class="ac-textBlock"] a:hover,
|
|
212
216
|
div[class="ac-textBlock"] a:active {
|
|
213
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
217
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
214
218
|
}
|
|
215
219
|
|
|
216
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
220
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
217
221
|
|
|
218
222
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
219
223
|
/* Fallback for browsers that don't support mask */
|
|
220
224
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
221
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
225
|
+
filter: ${(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.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
222
226
|
height: .75em;
|
|
223
227
|
width: .75em;
|
|
224
228
|
margin-left: .25em;
|
|
@@ -228,7 +232,7 @@ const WebChatContainerStateful = props => {
|
|
|
228
232
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
229
233
|
/* Fallback for browsers that don't support mask */
|
|
230
234
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
231
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
235
|
+
filter: ${(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.filter) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.filter)};
|
|
232
236
|
height: .75em;
|
|
233
237
|
width: .75em;
|
|
234
238
|
margin-left: .25em;
|
|
@@ -238,7 +242,7 @@ const WebChatContainerStateful = props => {
|
|
|
238
242
|
/* Modern browsers with mask support */
|
|
239
243
|
@supports (mask: url()) or (-webkit-mask: url()) {
|
|
240
244
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
241
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
245
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp15 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp15 === void 0 ? void 0 : (_webChatContainerProp16 = _webChatContainerProp15.receivedMessageAnchorStyles) === null || _webChatContainerProp16 === void 0 ? void 0 : _webChatContainerProp16.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)} !important;
|
|
242
246
|
background-image: none !important;
|
|
243
247
|
filter: none !important;
|
|
244
248
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -248,7 +252,7 @@ const WebChatContainerStateful = props => {
|
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
251
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
255
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp17 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp17 === void 0 ? void 0 : (_webChatContainerProp18 = _webChatContainerProp17.sentMessageAnchorStyles) === null || _webChatContainerProp18 === void 0 ? void 0 : _webChatContainerProp18.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)} !important;
|
|
252
256
|
background-image: none !important;
|
|
253
257
|
filter: none !important;
|
|
254
258
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -266,18 +270,18 @@ const WebChatContainerStateful = props => {
|
|
|
266
270
|
.ms_lcw_webchat_received_message a:visited,
|
|
267
271
|
.ms_lcw_webchat_received_message a:hover,
|
|
268
272
|
.ms_lcw_webchat_received_message a:active {
|
|
269
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
273
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp19 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp19 === void 0 ? void 0 : (_webChatContainerProp20 = _webChatContainerProp19.receivedMessageAnchorStyles) === null || _webChatContainerProp20 === void 0 ? void 0 : _webChatContainerProp20.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
270
274
|
}
|
|
271
275
|
.ms_lcw_webchat_sent_message a:link,
|
|
272
276
|
.ms_lcw_webchat_sent_message a:visited,
|
|
273
277
|
.ms_lcw_webchat_sent_message a:hover,
|
|
274
278
|
.ms_lcw_webchat_sent_message a:active {
|
|
275
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
279
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp21 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp21 === void 0 ? void 0 : (_webChatContainerProp22 = _webChatContainerProp21.sentMessageAnchorStyles) === null || _webChatContainerProp22 === void 0 ? void 0 : _webChatContainerProp22.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
// we had a nasty bug long time ago with crashing borders messing with the sendbox, so if customer adds this value, they need to deal with that
|
|
279
283
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
280
|
-
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
284
|
+
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp23 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp23 === void 0 ? void 0 : _webChatContainerProp23.bubbleBorderRadius) ?? 0} !important; /* Override border-radius */
|
|
281
285
|
}
|
|
282
286
|
|
|
283
287
|
.webchat__stacked-layout_container>div {
|
|
@@ -14,13 +14,13 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
14
14
|
******/
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
17
|
-
const channelDataMiddleware = _ref => {
|
|
17
|
+
const channelDataMiddleware = addConversationalSurveyTagsCallback => _ref => {
|
|
18
18
|
let {
|
|
19
19
|
dispatch
|
|
20
20
|
} = _ref;
|
|
21
21
|
return next => action => {
|
|
22
|
-
var _action$payload,
|
|
23
|
-
if ((action === null ||
|
|
22
|
+
var _action, _action2, _action2$payload, _action2$payload$acti;
|
|
23
|
+
if (((_action = action) === null || _action === void 0 ? void 0 : _action.type) === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && (_action2 = action) !== null && _action2 !== void 0 && (_action2$payload = _action2.payload) !== null && _action2$payload !== void 0 && (_action2$payload$acti = _action2$payload.activity) !== null && _action2$payload$acti !== void 0 && _action2$payload$acti.channelData) {
|
|
24
24
|
const channelIdTag = `${_Constants.Constants.channelIdKey}${_Constants.Constants.ChannelId}`;
|
|
25
25
|
const customerMessageTag = `${_Constants.Constants.CustomerTag}`;
|
|
26
26
|
if (action.payload.activity.channelData.tags) {
|
|
@@ -34,6 +34,7 @@ const channelDataMiddleware = _ref => {
|
|
|
34
34
|
action.payload.activity.channelData.tags = [channelIdTag];
|
|
35
35
|
action.payload.activity.channelData.tags.push(customerMessageTag);
|
|
36
36
|
}
|
|
37
|
+
action = addConversationalSurveyTagsCallback(action);
|
|
37
38
|
action.payload.activity.channelData.metadata = {
|
|
38
39
|
deliveryMode: _omnichannelChatSdk.DeliveryMode.Bridged
|
|
39
40
|
};
|
|
@@ -16,27 +16,33 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
16
16
|
******/
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
19
|
-
const createConversationEndMiddleware = conversationEndCallback => _ref => {
|
|
19
|
+
const createConversationEndMiddleware = (conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback) => _ref => {
|
|
20
20
|
let {
|
|
21
21
|
dispatch
|
|
22
22
|
} = _ref;
|
|
23
23
|
return next => action => {
|
|
24
24
|
var _action$payload;
|
|
25
25
|
if ((action === null || action === void 0 ? void 0 : action.type) == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
26
|
-
var _activity$from2, _activity$
|
|
26
|
+
var _activity$from2, _activity$channelData17, _activity$channelData18;
|
|
27
27
|
const activity = action.payload.activity;
|
|
28
28
|
if (activity.channelId === "ACS_CHANNEL") {
|
|
29
29
|
var _activity$from;
|
|
30
30
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _DirectLineSenderRole.DirectLineSenderRole.Bot) {
|
|
31
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
|
|
31
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6, _activity$channelData7, _activity$channelData8, _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12, _activity$channelData13, _activity$channelData14, _activity$channelData15, _activity$channelData16;
|
|
32
32
|
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(_Constants.Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.supervisorForceCloseMessageTag))) {
|
|
33
33
|
conversationEndCallback();
|
|
34
34
|
}
|
|
35
|
+
if ((_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && (_activity$channelData8 = _activity$channelData7.tags) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.includes(_Constants.Constants.systemMessageTag) && ((_activity$channelData9 = activity.channelData) !== null && _activity$channelData9 !== void 0 && (_activity$channelData10 = _activity$channelData9.tags) !== null && _activity$channelData10 !== void 0 && _activity$channelData10.includes(_Constants.Constants.startConversationalSurveyMessageTag) || (_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.tags) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.includes(_Constants.Constants.startConversationalSurveyMessageTag))) {
|
|
36
|
+
startConversationalSurveyCallback();
|
|
37
|
+
}
|
|
38
|
+
if ((_activity$channelData13 = activity.channelData) !== null && _activity$channelData13 !== void 0 && (_activity$channelData14 = _activity$channelData13.tags) !== null && _activity$channelData14 !== void 0 && _activity$channelData14.includes(_Constants.Constants.systemMessageTag) && (_activity$channelData15 = activity.channelData) !== null && _activity$channelData15 !== void 0 && (_activity$channelData16 = _activity$channelData15.tags) !== null && _activity$channelData16 !== void 0 && _activity$channelData16.includes(_Constants.Constants.endConversationalSurveyMessageTag)) {
|
|
39
|
+
endConversationalSurveyCallback();
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$
|
|
37
|
-
var _activity$
|
|
42
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$channelData17 = activity.channelData) === null || _activity$channelData17 === void 0 ? void 0 : _activity$channelData17.type) === _MessageType.MessageTypes.Thread && (_activity$channelData18 = activity.channelData) !== null && _activity$channelData18 !== void 0 && _activity$channelData18.properties) {
|
|
43
|
+
var _activity$channelData19, _activity$channelData20, _activity$channelData21, _activity$channelData22;
|
|
38
44
|
// IC3
|
|
39
|
-
if (((_activity$
|
|
45
|
+
if (((_activity$channelData19 = activity.channelData) === null || _activity$channelData19 === void 0 ? void 0 : (_activity$channelData20 = _activity$channelData19.properties) === null || _activity$channelData20 === void 0 ? void 0 : _activity$channelData20.isdeleted) === _Constants.Constants.truePascal || !((_activity$channelData21 = activity.channelData) !== null && _activity$channelData21 !== void 0 && (_activity$channelData22 = _activity$channelData21.properties) !== null && _activity$channelData22 !== void 0 && _activity$channelData22.containsExternalEntitiesListeningAll)) {
|
|
40
46
|
conversationEndCallback();
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -52,5 +52,7 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
52
52
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
|
|
53
53
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
|
|
54
54
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
|
|
55
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
55
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 45] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
56
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 46] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
57
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 47] = "GET_IN_MEMORY_STATE";
|
|
56
58
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -83,7 +83,9 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
83
83
|
conversationEndedBy: _Constants.ConversationEndEntity.NotSet,
|
|
84
84
|
chatDisconnectEventReceived: false,
|
|
85
85
|
selectedSurveyMode: null,
|
|
86
|
-
postChatParticipantType: undefined
|
|
86
|
+
postChatParticipantType: undefined,
|
|
87
|
+
isConversationalSurvey: false,
|
|
88
|
+
isConversationalSurveyEnabled: false
|
|
87
89
|
},
|
|
88
90
|
uiStates: {
|
|
89
91
|
showConfirmationPane: false,
|
|
@@ -656,6 +656,36 @@ const reducer = (state, action) => {
|
|
|
656
656
|
postChatParticipantType: action.payload
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATIONAL_SURVEY_ENABLED:
|
|
660
|
+
inMemory = {
|
|
661
|
+
...inMemory,
|
|
662
|
+
appStates: {
|
|
663
|
+
...inMemory.appStates,
|
|
664
|
+
isConversationalSurveyEnabled: action.payload
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
return {
|
|
668
|
+
...state,
|
|
669
|
+
appStates: {
|
|
670
|
+
...state.appStates,
|
|
671
|
+
isConversationalSurveyEnabled: action.payload
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATIONAL_SURVEY_DISPLAY:
|
|
675
|
+
inMemory = {
|
|
676
|
+
...inMemory,
|
|
677
|
+
appStates: {
|
|
678
|
+
...inMemory.appStates,
|
|
679
|
+
isConversationalSurvey: action.payload
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
return {
|
|
683
|
+
...state,
|
|
684
|
+
appStates: {
|
|
685
|
+
...state.appStates,
|
|
686
|
+
isConversationalSurvey: action.payload
|
|
687
|
+
}
|
|
688
|
+
};
|
|
659
689
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE:
|
|
660
690
|
return inMemory;
|
|
661
691
|
default:
|
|
@@ -27,7 +27,7 @@ const shouldShowEmailTranscriptPane = state => {
|
|
|
27
27
|
};
|
|
28
28
|
exports.shouldShowEmailTranscriptPane = shouldShowEmailTranscriptPane;
|
|
29
29
|
const shouldShowWebChatContainer = state => {
|
|
30
|
-
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive;
|
|
30
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive || state.appStates.conversationState === _ConversationState.ConversationState.Postchat && state.appStates.isConversationalSurveyEnabled && state.appStates.isConversationalSurvey;
|
|
31
31
|
};
|
|
32
32
|
exports.shouldShowWebChatContainer = shouldShowWebChatContainer;
|
|
33
33
|
const shouldShowLoadingPane = state => {
|
|
@@ -60,7 +60,7 @@ const shouldShowConfirmationPane = state => {
|
|
|
60
60
|
};
|
|
61
61
|
exports.shouldShowConfirmationPane = shouldShowConfirmationPane;
|
|
62
62
|
const shouldShowPostChatSurveyPane = state => {
|
|
63
|
-
return state.appStates.conversationState === _ConversationState.ConversationState.Postchat;
|
|
63
|
+
return state.appStates.conversationState === _ConversationState.ConversationState.Postchat && !state.appStates.isConversationalSurvey;
|
|
64
64
|
};
|
|
65
65
|
exports.shouldShowPostChatSurveyPane = shouldShowPostChatSurveyPane;
|
|
66
66
|
const shouldShowCallingContainer = state => {
|
|
@@ -3,41 +3,66 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.polyfillMessagePayloadForEvent = exports.isHistoryMessage = exports.getScenarioType = exports.createTrackingMessage = exports.buildMessagePayload = void 0;
|
|
6
|
+
exports.polyfillMessagePayloadForEvent = exports.isHistoryMessage = exports.getScenarioType = exports.extractTimestampFromId = exports.createTrackingMessage = exports.buildMessagePayload = void 0;
|
|
7
7
|
var _Constants = require("./Constants");
|
|
8
8
|
var _Constants2 = require("../common/Constants");
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether a given activity is a historical message.
|
|
11
|
+
*
|
|
12
|
+
* This function checks if the activity is a message type and uses a combination
|
|
13
|
+
* of legacy tags and timestamp-based logic to determine if the message is historical.
|
|
14
|
+
*
|
|
15
|
+
* @param {IActivity} activity - The activity object to evaluate.
|
|
16
|
+
* @param {number} startTime - The start time (in milliseconds since epoch) to compare against.
|
|
17
|
+
* @returns {boolean} - Returns true if the activity is a historical message, false otherwise.
|
|
18
|
+
*
|
|
19
|
+
* Logic:
|
|
20
|
+
* - If the activity type is not a message, it is not historical.
|
|
21
|
+
* - If the activity contains a legacy history message tag, it is considered historical.
|
|
22
|
+
* - Otherwise, the function extracts a timestamp from the activity ID using `extractTimestampFromId`.
|
|
23
|
+
* - If the ID is valid and the timestamp is older than the start time, the message is historical.
|
|
24
|
+
*/
|
|
9
25
|
const isHistoryMessage = (activity, startTime) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
var _activity$channelData, _activity$channelData2;
|
|
27
|
+
// Only process message activities
|
|
28
|
+
if ((activity === null || activity === void 0 ? void 0 : activity.type) !== _Constants2.Constants.message) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
15
31
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
// Legacy check for history message tag
|
|
33
|
+
if (activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants2.Constants.historyMessageTag)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const activityId = extractTimestampFromId(activity);
|
|
37
|
+
const isValidId = !isNaN(activityId) && activityId > 0;
|
|
38
|
+
const isOlderThanStartTime = activityId < startTime;
|
|
39
|
+
const isHistoryById = isValidId && isOlderThanStartTime;
|
|
40
|
+
return isHistoryById;
|
|
41
|
+
};
|
|
42
|
+
exports.isHistoryMessage = isHistoryMessage;
|
|
43
|
+
const extractTimestampFromId = activity => {
|
|
44
|
+
const id = (activity === null || activity === void 0 ? void 0 : activity.id) ?? "";
|
|
20
45
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
// Helper function to get timestamp fallback
|
|
47
|
+
const getTimestampFallback = () => {
|
|
48
|
+
const timestamp = new Date((activity === null || activity === void 0 ? void 0 : activity.timestamp) ?? "").getTime();
|
|
49
|
+
return isNaN(timestamp) ? 0 : timestamp;
|
|
50
|
+
};
|
|
25
51
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
console.error("Error in parsing activity id: ", e);
|
|
52
|
+
// Check if ID looks like a UUID (contains dashes or is very long)
|
|
53
|
+
const UUID_LENGTH_THRESHOLD = 13; // Threshold to distinguish UUIDs from epoch timestamps
|
|
54
|
+
if (id.includes("-") || id.length > UUID_LENGTH_THRESHOLD) {
|
|
55
|
+
// Likely UUID, use timestamp instead
|
|
56
|
+
return getTimestampFallback();
|
|
57
|
+
}
|
|
58
|
+
const activityId = parseInt(id);
|
|
59
|
+
// if activity id is not a number, then we use timestamp field
|
|
60
|
+
if (isNaN(activityId)) {
|
|
61
|
+
return getTimestampFallback();
|
|
37
62
|
}
|
|
38
|
-
return
|
|
63
|
+
return activityId;
|
|
39
64
|
};
|
|
40
|
-
exports.
|
|
65
|
+
exports.extractTimestampFromId = extractTimestampFromId;
|
|
41
66
|
const buildMessagePayload = (activity, userId) => {
|
|
42
67
|
var _text, _text2, _activity$channelData3, _activity$from;
|
|
43
68
|
return {
|
|
@@ -12,13 +12,13 @@ var _Constants2 = require("../common/Constants");
|
|
|
12
12
|
var _FirstResponseLatencyTracker = require("../firstresponselatency/FirstResponseLatencyTracker");
|
|
13
13
|
var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
|
|
14
14
|
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
15
|
-
const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
15
|
+
const createOnNewAdapterActivityHandler = (chatId, userId, startTime) => {
|
|
16
16
|
// Hooking the message tracker in the listener, a bit invasive but easier to control.
|
|
17
17
|
const firstResponseLatencyTracker = new _FirstResponseLatencyTracker.FirstResponseLatencyTracker();
|
|
18
18
|
// epoch time in utc for when start to listen.
|
|
19
19
|
// We dont longer have a mechanism to know if a message is history or new, so any message older than the time we start listening will be considered a history message.
|
|
20
20
|
// this is a workaround for the fact that we dont have a way to identify if a message is history or new, and it will provide consistency across different scenarios
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
let isHistoryMessageReceivedEventRaised = false;
|
|
23
23
|
const onNewAdapterActivityHandler = activity => {
|
|
24
24
|
raiseMessageEvent(activity);
|
|
@@ -41,6 +41,7 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
const systemMessageStrategy = activity => {
|
|
44
|
+
var _TelemetryManager$Int3;
|
|
44
45
|
const payload = (0, _util.buildMessagePayload)(activity, userId);
|
|
45
46
|
payload.messageType = _Constants2.Constants.systemMessageTag;
|
|
46
47
|
if ((0, _util.isHistoryMessage)(activity, startTime)) {
|
|
@@ -48,6 +49,11 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
48
49
|
historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.conversationId));
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
52
|
+
const newMessageReceivedEvent = {
|
|
53
|
+
eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
|
|
54
|
+
payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int3 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : _TelemetryManager$Int3.conversationId)
|
|
55
|
+
};
|
|
56
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
|
|
51
57
|
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
52
58
|
Event: _TelemetryConstants.TelemetryEvent.SystemMessageReceived,
|
|
53
59
|
Description: "System message received"
|
|
@@ -83,20 +89,20 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
83
89
|
return true;
|
|
84
90
|
};
|
|
85
91
|
const receivedMessageStrategy = activity => {
|
|
86
|
-
var _TelemetryManager$
|
|
92
|
+
var _TelemetryManager$Int5;
|
|
87
93
|
if (!isValidMessage(activity)) return;
|
|
88
94
|
const isHistoryMessageReceived = (0, _util.isHistoryMessage)(activity, startTime);
|
|
89
95
|
const payload = (0, _util.buildMessagePayload)(activity, userId);
|
|
90
96
|
payload.messageType = _Constants2.Constants.userMessageTag;
|
|
91
97
|
if (isHistoryMessageReceived) {
|
|
92
|
-
var _TelemetryManager$
|
|
93
|
-
historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$
|
|
98
|
+
var _TelemetryManager$Int4;
|
|
99
|
+
historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int4 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int4 === void 0 ? void 0 : _TelemetryManager$Int4.conversationId));
|
|
94
100
|
return;
|
|
95
101
|
}
|
|
96
102
|
firstResponseLatencyTracker.stopClock(payload);
|
|
97
103
|
const newMessageReceivedEvent = {
|
|
98
104
|
eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
|
|
99
|
-
payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$
|
|
105
|
+
payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int5 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int5 === void 0 ? void 0 : _TelemetryManager$Int5.conversationId)
|
|
100
106
|
};
|
|
101
107
|
_omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
|
|
102
108
|
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -16,6 +16,9 @@ _defineProperty(Constants, "channelMessageTag", "channel");
|
|
|
16
16
|
_defineProperty(Constants, "historyMessageTag", "history");
|
|
17
17
|
_defineProperty(Constants, "agentEndConversationMessageTag", "agentendconversation");
|
|
18
18
|
_defineProperty(Constants, "supervisorForceCloseMessageTag", "supervisorforceclosedconversation");
|
|
19
|
+
_defineProperty(Constants, "endConversationalSurveyMessageTag", "endconversationalsurvey");
|
|
20
|
+
_defineProperty(Constants, "startConversationalSurveyMessageTag", "startconversationalsurvey");
|
|
21
|
+
_defineProperty(Constants, "c2ConversationalSurveyMessageTag", "c2conversationalsurvey");
|
|
19
22
|
_defineProperty(Constants, "receivedMessageClassName", "ms_lcw_webchat_received_message");
|
|
20
23
|
_defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message");
|
|
21
24
|
_defineProperty(Constants, "webchatChannelId", "webchat");
|
|
@@ -220,6 +223,10 @@ export let ConversationMode;
|
|
|
220
223
|
ConversationMode["Regular"] = "192350000";
|
|
221
224
|
ConversationMode["Persistent"] = "192350001";
|
|
222
225
|
})(ConversationMode || (ConversationMode = {}));
|
|
226
|
+
export let SurveyProvider;
|
|
227
|
+
(function (SurveyProvider) {
|
|
228
|
+
SurveyProvider["MicrosoftCopilotStudio"] = "600990001";
|
|
229
|
+
})(SurveyProvider || (SurveyProvider = {}));
|
|
223
230
|
export let LiveWorkItemState;
|
|
224
231
|
(function (LiveWorkItemState) {
|
|
225
232
|
LiveWorkItemState["Active"] = "Active";
|
|
@@ -25,8 +25,11 @@ const DraggableChatWidget = props => {
|
|
|
25
25
|
};
|
|
26
26
|
const calculateOffsetsWithinViewport = useCallback((id, offset, delta) => {
|
|
27
27
|
const draggableElement = document.getElementById(id);
|
|
28
|
+
if (isNullOrUndefined(draggableElement)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
28
31
|
const positionRelativeToViewport = draggableElement.getBoundingClientRect();
|
|
29
|
-
if (isNullOrUndefined(
|
|
32
|
+
if (isNullOrUndefined(positionRelativeToViewport) || isNullOrUndefined(offset.offsetLeft) || isNullOrUndefined(offset.offsetTop)) {
|
|
30
33
|
return;
|
|
31
34
|
}
|
|
32
35
|
let offsetLeft = offset.offsetLeft;
|
|
@@ -68,6 +71,9 @@ const DraggableChatWidget = props => {
|
|
|
68
71
|
}
|
|
69
72
|
const cacheInitialPosition = () => {
|
|
70
73
|
const draggableElement = document.getElementById(props.elementId);
|
|
74
|
+
if (isNullOrUndefined(draggableElement)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
71
77
|
const offsetLeft = draggableElement.offsetLeft;
|
|
72
78
|
const offsetTop = draggableElement.offsetTop;
|
|
73
79
|
setInitialPosition({
|
|
@@ -77,6 +83,9 @@ const DraggableChatWidget = props => {
|
|
|
77
83
|
};
|
|
78
84
|
const calculateOffsets = () => {
|
|
79
85
|
const draggableElement = document.getElementById(props.elementId);
|
|
86
|
+
if (isNullOrUndefined(draggableElement)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
80
89
|
const offsetLeft = draggableElement.offsetLeft;
|
|
81
90
|
const offsetTop = draggableElement.offsetTop;
|
|
82
91
|
|
|
@@ -111,6 +120,9 @@ const DraggableChatWidget = props => {
|
|
|
111
120
|
resetPosition(initialPosition);
|
|
112
121
|
} else if (state.appStates.isMinimized) {
|
|
113
122
|
const draggableElement = document.getElementById(props.elementId);
|
|
123
|
+
if (isNullOrUndefined(draggableElement)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
114
126
|
const offsetLeft = draggableElement.offsetLeft;
|
|
115
127
|
const offsetTop = draggableElement.offsetTop;
|
|
116
128
|
if (!cachedPosition) {
|
|
@@ -135,6 +147,9 @@ const DraggableChatWidget = props => {
|
|
|
135
147
|
|
|
136
148
|
// Update position via DOM manipulation to prevent <Stack/> continuously rendering on style change causing high CPU spike
|
|
137
149
|
const draggableElement = document.getElementById(props.elementId);
|
|
150
|
+
if (isNullOrUndefined(draggableElement)) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
138
153
|
repositionElement(draggableElement, offsetLeft, offsetTop);
|
|
139
154
|
setPosition({
|
|
140
155
|
offsetLeft,
|
|
@@ -16,7 +16,7 @@ import { uuidv4 } from "@microsoft/omnichannel-chat-sdk";
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
17
|
const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter) => {
|
|
18
18
|
try {
|
|
19
|
-
var _conversationDetails$, _state$domainStates, _state$
|
|
19
|
+
var _conversationDetails$, _state$domainStates, _state$appStates5;
|
|
20
20
|
const {
|
|
21
21
|
chatConfig
|
|
22
22
|
} = props;
|
|
@@ -27,7 +27,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
27
27
|
|
|
28
28
|
// Use Case: When post chat is not configured
|
|
29
29
|
if ((conversationDetails === null || conversationDetails === void 0 ? void 0 : (_conversationDetails$ = conversationDetails.canRenderPostChat) === null || _conversationDetails$ === void 0 ? void 0 : _conversationDetails$.toLowerCase()) === Constants.false) {
|
|
30
|
-
var _state$appStates;
|
|
30
|
+
var _state$appStates, _state$appStates2, _state$appStates3;
|
|
31
31
|
// If ended by customer, just close chat
|
|
32
32
|
if ((state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.conversationEndedBy) === ConversationEndEntity.Customer) {
|
|
33
33
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
@@ -38,6 +38,13 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// Use Case: If ended by Agent, stay chat in InActive state
|
|
41
|
+
let isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
42
|
+
if (isConversationalSurveyEnabled && ((state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.conversationEndedBy) === ConversationEndEntity.Agent || (state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.conversationEndedBy) === ConversationEndEntity.Bot)) {
|
|
43
|
+
dispatch({
|
|
44
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
45
|
+
payload: ConversationState.InActive
|
|
46
|
+
});
|
|
47
|
+
}
|
|
41
48
|
return;
|
|
42
49
|
}
|
|
43
50
|
|
|
@@ -53,7 +60,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
53
60
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
61
|
const postchatContext = (await getPostChatContext(facadeChatSDK, state, dispatch)) ?? (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.postChatContext);
|
|
55
62
|
if (postchatContext === undefined) {
|
|
56
|
-
var _state$
|
|
63
|
+
var _state$appStates4;
|
|
57
64
|
BroadcastService.postMessage({
|
|
58
65
|
eventName: BroadcastEvent.OnWidgetError,
|
|
59
66
|
payload: {
|
|
@@ -62,7 +69,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
62
69
|
});
|
|
63
70
|
|
|
64
71
|
// For Customer intiated conversations, just close chat widget
|
|
65
|
-
if ((state === null || state === void 0 ? void 0 : (_state$
|
|
72
|
+
if ((state === null || state === void 0 ? void 0 : (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.conversationEndedBy) === ConversationEndEntity.Customer) {
|
|
66
73
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
67
74
|
Event: TelemetryEvent.PrepareEndChat,
|
|
68
75
|
Description: PrepareEndChatDescriptionConstants.ConversationEndedByCustomerWithInvalidPostChat
|
|
@@ -80,11 +87,11 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
// Log PrepareEndChat if conversation ended by customer (bot and agent cases are handled in LiveChatWidgetStateful.tsx)
|
|
83
|
-
if (state !== null && state !== void 0 && (_state$
|
|
84
|
-
var _state$
|
|
90
|
+
if (state !== null && state !== void 0 && (_state$appStates5 = state.appStates) !== null && _state$appStates5 !== void 0 && _state$appStates5.conversationEndedBy) {
|
|
91
|
+
var _state$appStates6;
|
|
85
92
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
86
93
|
Event: TelemetryEvent.PrepareEndChat,
|
|
87
|
-
Description: `${PrepareEndChatDescriptionConstants.ConversationEndedByCustomerWithInvalidPostChat} ${state === null || state === void 0 ? void 0 : (_state$
|
|
94
|
+
Description: `${PrepareEndChatDescriptionConstants.ConversationEndedByCustomerWithInvalidPostChat} ${state === null || state === void 0 ? void 0 : (_state$appStates6 = state.appStates) === null || _state$appStates6 === void 0 ? void 0 : _state$appStates6.conversationEndedBy}.`
|
|
88
95
|
});
|
|
89
96
|
}
|
|
90
97
|
const persistentEnabled = isPersistentEnabled(chatConfig);
|
|
@@ -256,6 +263,10 @@ export const closeChatStateCleanUp = dispatch => {
|
|
|
256
263
|
payload: undefined
|
|
257
264
|
});
|
|
258
265
|
// dispatch({ type: LiveChatWidgetActionType.SET_CONVERSATION_STATE, payload: ConversationState.Closed });
|
|
266
|
+
dispatch({
|
|
267
|
+
type: LiveChatWidgetActionType.SET_CONVERSATIONAL_SURVEY_DISPLAY,
|
|
268
|
+
payload: false
|
|
269
|
+
});
|
|
259
270
|
dispatch({
|
|
260
271
|
type: LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
261
272
|
payload: undefined
|