@microsoft/omnichannel-chat-widget 1.8.3-main.b5b8289 → 1.8.3
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/components/citationpanestateful/CitationPaneStateful.js +1 -0
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +8 -8
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +27 -10
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/cjs/index.js +9 -1
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +1 -0
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +8 -8
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +27 -10
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +14 -5
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +0 -2
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -189,6 +189,7 @@ const CitationPaneStateful = props => {
|
|
|
189
189
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
190
190
|
style: wrapperStyles
|
|
191
191
|
}, /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.CitationPane, {
|
|
192
|
+
componentOverrides: props === null || props === void 0 ? void 0 : props.componentOverrides,
|
|
192
193
|
controlProps: controlProps,
|
|
193
194
|
styleProps: mergedStyleProps
|
|
194
195
|
})));
|
|
@@ -22,13 +22,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
24
|
const LiveChatWidget = props => {
|
|
25
|
-
var _props$
|
|
25
|
+
var _props$featureConfigP, _props$chatConfig, _props$chatConfig$Liv, _props$chatConfig2, _props$chatConfig2$Li;
|
|
26
26
|
const reducer = (0, _createReducer.createReducer)();
|
|
27
27
|
const [state, dispatch] = (0, _react.useReducer)(reducer, (0, _LiveChatWidgetContextInitialState.getLiveChatWidgetContextInitialState)(props));
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
29
|
const [adapter, setAdapter] = (0, _react.useState)(undefined);
|
|
30
30
|
const [facadeChatSDK, setFacadeChatSDK] = (0, _react.useState)(undefined);
|
|
31
|
-
const chatSDK = (0, _getMockChatSDKIfApplicable.getMockChatSDKIfApplicable)(props.chatSDK, props === null || props === void 0 ? void 0 :
|
|
31
|
+
const chatSDK = (0, _getMockChatSDKIfApplicable.getMockChatSDKIfApplicable)(props.chatSDK, props === null || props === void 0 ? void 0 : props.mock);
|
|
32
32
|
const disableReauthentication = ((_props$featureConfigP = props.featureConfigProps) === null || _props$featureConfigP === void 0 ? void 0 : _props$featureConfigP.disableReauthentication) === true;
|
|
33
33
|
(0, _overridePropsOnMockIfApplicable.default)(props);
|
|
34
34
|
if (!props.chatConfig) {
|
|
@@ -38,14 +38,14 @@ const LiveChatWidget = props => {
|
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
39
|
const isAuthenticatedChat = !!((_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig$Liv = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig$Liv !== void 0 && _props$chatConfig$Liv.msdyn_javascriptclientfunction) || (0, _liveChatConfigUtils.isPersistentChatEnabled)((_props$chatConfig2 = props.chatConfig) === null || _props$chatConfig2 === void 0 ? void 0 : (_props$chatConfig2$Li = _props$chatConfig2.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig2$Li === void 0 ? void 0 : _props$chatConfig2$Li.msdyn_conversationmode);
|
|
40
40
|
if (!facadeChatSDK) {
|
|
41
|
-
var _props$
|
|
41
|
+
var _props$mock;
|
|
42
42
|
setFacadeChatSDK(new _FacadeChatSDK.FacadeChatSDK({
|
|
43
43
|
"chatSDK": chatSDK,
|
|
44
44
|
"chatConfig": props.chatConfig,
|
|
45
45
|
"isAuthenticated": isAuthenticatedChat,
|
|
46
46
|
"getAuthToken": props === null || props === void 0 ? void 0 : props.getAuthToken,
|
|
47
47
|
//when type is not undefined, it means the SDK is mocked
|
|
48
|
-
"isSDKMocked": !(0, _utils.isNullOrUndefined)(props === null || props === void 0 ? void 0 : (_props$
|
|
48
|
+
"isSDKMocked": !(0, _utils.isNullOrUndefined)(props === null || props === void 0 ? void 0 : (_props$mock = props.mock) === null || _props$mock === void 0 ? void 0 : _props$mock.type)
|
|
49
49
|
}, disableReauthentication));
|
|
50
50
|
}
|
|
51
51
|
(0, _react.useEffect)(() => {
|
|
@@ -8,14 +8,15 @@ var _DemoChatSDK = require("../../webchatcontainerstateful/common/DemoChatSDK");
|
|
|
8
8
|
var _DesignerChatSDK = require("../../webchatcontainerstateful/common/DesignerChatSDK");
|
|
9
9
|
var _mockchatsdk = require("../../webchatcontainerstateful/common/mockchatsdk");
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const getMockChatSDKIfApplicable = (chatSDK,
|
|
12
|
-
if (type) {
|
|
13
|
-
switch (type.toLowerCase()) {
|
|
11
|
+
const getMockChatSDKIfApplicable = (chatSDK, mockProps) => {
|
|
12
|
+
if (mockProps !== null && mockProps !== void 0 && mockProps.type) {
|
|
13
|
+
switch (mockProps.type.toLowerCase()) {
|
|
14
14
|
case "demo":
|
|
15
15
|
chatSDK = new _DemoChatSDK.DemoChatSDK();
|
|
16
16
|
break;
|
|
17
17
|
case "designer":
|
|
18
18
|
chatSDK = new _DesignerChatSDK.DesignerChatSDK();
|
|
19
|
+
chatSDK.mockMessages = mockProps === null || mockProps === void 0 ? void 0 : mockProps.mockMessages;
|
|
19
20
|
break;
|
|
20
21
|
default:
|
|
21
22
|
chatSDK = new _mockchatsdk.MockChatSDK();
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
const overridePropsOnMockIfApplicable = props => {
|
|
8
8
|
var _props$mock, _props$mock2;
|
|
9
9
|
if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
|
|
10
|
+
var _props$mock3, _props$mock3$mockMess;
|
|
10
11
|
if (!props.webChatContainerProps) {
|
|
11
12
|
props.webChatContainerProps = {};
|
|
12
13
|
}
|
|
@@ -22,7 +23,7 @@ const overridePropsOnMockIfApplicable = props => {
|
|
|
22
23
|
props.webChatContainerProps = {
|
|
23
24
|
...props.webChatContainerProps,
|
|
24
25
|
webChatProps: {
|
|
25
|
-
disabled:
|
|
26
|
+
disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
|
|
26
27
|
...props.webChatContainerProps.webChatProps,
|
|
27
28
|
overrideLocalizedStrings: {
|
|
28
29
|
TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LiveChatWidgetMockType = void 0;
|
|
7
|
+
let LiveChatWidgetMockType;
|
|
8
|
+
exports.LiveChatWidgetMockType = LiveChatWidgetMockType;
|
|
4
9
|
(function (LiveChatWidgetMockType) {
|
|
5
10
|
LiveChatWidgetMockType["Test"] = "Test";
|
|
6
11
|
LiveChatWidgetMockType["Demo"] = "Demo";
|
|
7
|
-
|
|
12
|
+
LiveChatWidgetMockType["Designer"] = "Designer";
|
|
13
|
+
})(LiveChatWidgetMockType || (exports.LiveChatWidgetMockType = LiveChatWidgetMockType = {}));
|
|
@@ -877,42 +877,42 @@ const LiveChatWidgetStateful = props => {
|
|
|
877
877
|
|
|
878
878
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
879
879
|
return directLine && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
880
|
-
::-webkit-scrollbar {
|
|
880
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
|
|
881
881
|
width: ${scrollbarProps.width};
|
|
882
882
|
}
|
|
883
883
|
|
|
884
|
-
::-webkit-scrollbar-track {
|
|
884
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
885
885
|
background: ${scrollbarProps.trackBackgroundColor};
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
::-webkit-scrollbar-thumb {
|
|
888
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
889
889
|
background: ${scrollbarProps.thumbBackgroundColor};
|
|
890
890
|
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
-
::-webkit-scrollbar-thumb:hover {
|
|
893
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
894
894
|
background: ${scrollbarProps.thumbHoverColor};
|
|
895
895
|
}
|
|
896
896
|
|
|
897
897
|
/* High Contrast mode support - optimized for all variants */
|
|
898
898
|
@media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
|
|
899
|
-
::-webkit-scrollbar-track {
|
|
899
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
900
900
|
background: Canvas !important;
|
|
901
901
|
border: 1px solid CanvasText !important;
|
|
902
902
|
}
|
|
903
903
|
|
|
904
|
-
::-webkit-scrollbar-thumb {
|
|
904
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
905
905
|
background: CanvasText !important;
|
|
906
906
|
border: 1px solid Canvas !important;
|
|
907
907
|
min-height: 20px !important;
|
|
908
908
|
}
|
|
909
909
|
|
|
910
|
-
::-webkit-scrollbar-thumb:hover {
|
|
910
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
911
911
|
background: Highlight !important;
|
|
912
912
|
border: 1px solid CanvasText !important;
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
-
::-webkit-scrollbar-corner {
|
|
915
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
|
|
916
916
|
background: Canvas !important;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
@@ -18,6 +18,7 @@ var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScen
|
|
|
18
18
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
19
19
|
var _WebChatActionType = require("./webchatcontroller/enums/WebChatActionType");
|
|
20
20
|
var _WebChatStoreLoader = require("./webchatcontroller/WebChatStoreLoader");
|
|
21
|
+
var _fontUtils = require("./common/utils/fontUtils");
|
|
21
22
|
var _defaultAdaptiveCardStyles = require("./common/defaultStyles/defaultAdaptiveCardStyles");
|
|
22
23
|
var _defaultMiddlewareLocalizedTexts = require("./common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
23
24
|
var _defaultReceivedMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles");
|
|
@@ -57,7 +58,13 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
60
|
const WebChatContainerStateful = props => {
|
|
60
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$
|
|
61
|
+
var _props$webChatContain, _defaultWebChatContai, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp24, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
62
|
+
// Create a font family that includes emoji support, based on the primary font or default
|
|
63
|
+
const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles;
|
|
64
|
+
const primaryFont = (webChatStyles === null || webChatStyles === void 0 ? void 0 : webChatStyles.primaryFont) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.primaryFont);
|
|
65
|
+
|
|
66
|
+
// Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
|
|
67
|
+
const fontFamilyWithEmojis = (0, _fontUtils.createIOSOptimizedEmojiFont)(primaryFont);
|
|
61
68
|
(0, _react2.useEffect)(() => {
|
|
62
69
|
uiTimer = (0, _utils.createTimer)();
|
|
63
70
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -141,7 +148,7 @@ const WebChatContainerStateful = props => {
|
|
|
141
148
|
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
142
149
|
};
|
|
143
150
|
(0, _react2.useEffect)(() => {
|
|
144
|
-
var _props$
|
|
151
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
145
152
|
if ((0, _utils.getDeviceType)() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
|
|
146
153
|
const chatHistoryElement = document.querySelector(`.${_Constants.HtmlClassNames.webChatHistoryContainer}`);
|
|
147
154
|
if (chatHistoryElement) {
|
|
@@ -159,7 +166,7 @@ const WebChatContainerStateful = props => {
|
|
|
159
166
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
160
167
|
Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
|
|
161
168
|
});
|
|
162
|
-
if (((_props$
|
|
169
|
+
if (((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.renderingMiddlewareProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
163
170
|
try {
|
|
164
171
|
localStorage;
|
|
165
172
|
sessionStorage;
|
|
@@ -174,8 +181,8 @@ const WebChatContainerStateful = props => {
|
|
|
174
181
|
}
|
|
175
182
|
}, []);
|
|
176
183
|
(0, _react2.useEffect)(() => {
|
|
177
|
-
var _props$
|
|
178
|
-
if (!((_props$
|
|
184
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
185
|
+
if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain5 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain5 !== void 0 && _props$webChatContain5.disabled)) {
|
|
179
186
|
return;
|
|
180
187
|
}
|
|
181
188
|
if (!window.BroadcastChannel) {
|
|
@@ -267,8 +274,8 @@ const WebChatContainerStateful = props => {
|
|
|
267
274
|
}
|
|
268
275
|
|
|
269
276
|
.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 {
|
|
270
|
-
background-color: ${((_props$
|
|
271
|
-
color:${((_props$
|
|
277
|
+
background-color: ${((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : (_props$webChatContain7 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.bubbleBackground) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
|
|
278
|
+
color:${((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.webChatStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.bubbleTextColor) ?? ((_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
|
|
272
279
|
}
|
|
273
280
|
|
|
274
281
|
div[class="ac-textBlock"] a:link,
|
|
@@ -346,7 +353,7 @@ const WebChatContainerStateful = props => {
|
|
|
346
353
|
}
|
|
347
354
|
|
|
348
355
|
.webchat__stacked-layout_container>div {
|
|
349
|
-
background: ${(props === null || props === void 0 ? void 0 : (_props$
|
|
356
|
+
background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : (_props$webChatContain11 = _props$webChatContain10.containerStyles) === null || _props$webChatContain11 === void 0 ? void 0 : _props$webChatContain11.background) ?? ""}
|
|
350
357
|
}
|
|
351
358
|
.webchat__toast_text {
|
|
352
359
|
display: flex;
|
|
@@ -373,6 +380,15 @@ const WebChatContainerStateful = props => {
|
|
|
373
380
|
height: 100% !important;
|
|
374
381
|
}
|
|
375
382
|
|
|
383
|
+
.webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
|
|
384
|
+
font-family: ${fontFamilyWithEmojis} !important;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* Suggested actions carousel previous/next navigation focus */
|
|
388
|
+
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
389
|
+
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
|
|
390
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
391
|
+
|
|
376
392
|
`), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
377
393
|
styles: containerStyles,
|
|
378
394
|
className: "webchat__stacked-layout_container"
|
|
@@ -381,8 +397,9 @@ const WebChatContainerStateful = props => {
|
|
|
381
397
|
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || _Constants.HtmlAttributeNames.ocwCitationPaneTitle,
|
|
382
398
|
contentHtml: citationPaneText,
|
|
383
399
|
onClose: () => setCitationPaneOpen(false),
|
|
384
|
-
|
|
385
|
-
|
|
400
|
+
componentOverrides: (_props$citationPanePr3 = props.citationPaneProps) === null || _props$citationPanePr3 === void 0 ? void 0 : _props$citationPanePr3.componentOverrides,
|
|
401
|
+
controlProps: (_props$citationPanePr4 = props.citationPaneProps) === null || _props$citationPanePr4 === void 0 ? void 0 : _props$citationPanePr4.controlProps,
|
|
402
|
+
styleProps: (_props$citationPanePr5 = props.citationPaneProps) === null || _props$citationPanePr5 === void 0 ? void 0 : _props$citationPanePr5.styleProps
|
|
386
403
|
}));
|
|
387
404
|
};
|
|
388
405
|
exports.WebChatContainerStateful = WebChatContainerStateful;
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DesignerChatAdapter = void 0;
|
|
7
|
-
var _Observable = require("rxjs/Observable");
|
|
8
|
-
var _mockadapter = _interopRequireDefault(require("./mockadapter"));
|
|
9
7
|
var _chatAdapterUtils = require("./utils/chatAdapterUtils");
|
|
8
|
+
var _mockadapter = _interopRequireDefault(require("./mockadapter"));
|
|
9
|
+
var _Observable = require("rxjs/Observable");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
12
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
14
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
15
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -20,25 +18,56 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "
|
|
|
20
18
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
20
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
24
|
let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
24
25
|
_inherits(DesignerChatAdapter, _MockAdapter);
|
|
25
26
|
var _super = _createSuper(DesignerChatAdapter);
|
|
26
|
-
function DesignerChatAdapter() {
|
|
27
|
+
function DesignerChatAdapter(messages) {
|
|
27
28
|
var _this;
|
|
28
29
|
_classCallCheck(this, DesignerChatAdapter);
|
|
29
30
|
_this = _super.call(this);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "messages", void 0);
|
|
32
|
+
_this.messages = messages;
|
|
33
|
+
if (_this.messages) {
|
|
34
|
+
if (_this.messages.length > 0) {
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
var _this$messages;
|
|
37
|
+
(_this$messages = _this.messages) === null || _this$messages === void 0 ? void 0 : _this$messages.forEach((msg, index) => {
|
|
38
|
+
_this.processMessage(msg, index);
|
|
39
|
+
});
|
|
40
|
+
}, 1000); // Initial 1 second delay to ensure activityObserver is ready
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
// Default hardcoded flow
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
46
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Please accept terms and conditions to proceed. Visit the link for terms and conditions <a href=\"\">here</a>.", undefined, 0);
|
|
47
|
+
_this.postUserActivity("I need to change my address.", 0);
|
|
48
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
49
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(_this.activityObserver, "John has joined the chat", 100);
|
|
50
|
+
(0, _chatAdapterUtils.postAgentMessageActivity)(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
51
|
+
_this.postUserActivity("I have trouble visiting the signin page <a href=\"\">signin</a>.", 0);
|
|
52
|
+
}, 1000);
|
|
53
|
+
}
|
|
39
54
|
return _this;
|
|
40
55
|
}
|
|
41
56
|
_createClass(DesignerChatAdapter, [{
|
|
57
|
+
key: "processMessage",
|
|
58
|
+
value: function processMessage(msg, index) {
|
|
59
|
+
if (msg.text) {
|
|
60
|
+
if (msg.suggestedActions) {
|
|
61
|
+
(0, _chatAdapterUtils.postAgentSuggestedActionsActivity)(this.activityObserver, msg.text, msg.suggestedActions, index * 100);
|
|
62
|
+
} else {
|
|
63
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, msg.text, undefined, index * 100);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (msg.attachments && msg.attachments.length > 0) {
|
|
67
|
+
(0, _chatAdapterUtils.postAgentAttachmentActivity)(this.activityObserver, msg.attachments, index * 100, msg.attachmentLayout);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
42
71
|
key: "postUserActivity",
|
|
43
72
|
value: function postUserActivity(text) {
|
|
44
73
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
@@ -26,13 +26,18 @@ let DesignerChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
|
26
26
|
var _this;
|
|
27
27
|
_classCallCheck(this, DesignerChatSDK);
|
|
28
28
|
_this = _super.call(this);
|
|
29
|
+
/**
|
|
30
|
+
* Create a chat adapter for the designer. Uses this.mockMessages if set.
|
|
31
|
+
*/
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "mockMessages", void 0);
|
|
29
33
|
_defineProperty(_assertThisInitialized(_this), "localeId", _this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
30
34
|
return _this;
|
|
31
35
|
}
|
|
32
36
|
_createClass(DesignerChatSDK, [{
|
|
33
37
|
key: "createChatAdapter",
|
|
34
38
|
value: function createChatAdapter() {
|
|
35
|
-
|
|
39
|
+
const adapter = new _DesignerChatAdapter.DesignerChatAdapter(this.mockMessages);
|
|
40
|
+
return adapter;
|
|
36
41
|
}
|
|
37
42
|
}, {
|
|
38
43
|
key: "getLiveChatConfig",
|
package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js
CHANGED
|
@@ -23,7 +23,7 @@ const defaultWebChatStyles = {
|
|
|
23
23
|
bubbleTextColor: "White",
|
|
24
24
|
hideSendBox: false,
|
|
25
25
|
hideUploadButton: true,
|
|
26
|
-
primaryFont: "Segoe UI, Arial, sans-serif",
|
|
26
|
+
primaryFont: "Segoe UI, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\"",
|
|
27
27
|
rootHeight: "100%",
|
|
28
28
|
rootWidth: "100%",
|
|
29
29
|
sendBoxTextWrap: true,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.postSystemMessageActivity = exports.postEchoActivity = exports.postBotTypingActivity = exports.postBotMessageActivity = exports.postBotAttachmentActivity = exports.postAgentMessageActivity = exports.customerUser = exports.botUser = exports.agentUser = void 0;
|
|
6
|
+
exports.postSystemMessageActivity = exports.postEchoActivity = exports.postBotTypingActivity = exports.postBotMessageActivity = exports.postBotAttachmentActivity = exports.postAgentSuggestedActionsActivity = exports.postAgentMessageActivity = exports.postAgentAttachmentActivity = exports.customerUser = exports.botUser = exports.agentUser = void 0;
|
|
7
7
|
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
8
8
|
const customerUser = {
|
|
9
9
|
id: "usedId",
|
|
@@ -112,4 +112,38 @@ const postBotAttachmentActivity = function (activityObserver) {
|
|
|
112
112
|
});
|
|
113
113
|
}, delay);
|
|
114
114
|
};
|
|
115
|
-
exports.postBotAttachmentActivity = postBotAttachmentActivity;
|
|
115
|
+
exports.postBotAttachmentActivity = postBotAttachmentActivity;
|
|
116
|
+
const postAgentAttachmentActivity = function (activityObserver) {
|
|
117
|
+
let attachments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
118
|
+
let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
119
|
+
let attachmentLayout = arguments.length > 3 ? arguments[3] : undefined;
|
|
120
|
+
setTimeout(() => {
|
|
121
|
+
activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
|
|
122
|
+
id: (0, _omnichannelChatSdk.uuidv4)(),
|
|
123
|
+
from: {
|
|
124
|
+
...agentUser
|
|
125
|
+
},
|
|
126
|
+
attachments,
|
|
127
|
+
attachmentLayout,
|
|
128
|
+
type: "message",
|
|
129
|
+
timestamp: new Date().toISOString()
|
|
130
|
+
});
|
|
131
|
+
}, delay);
|
|
132
|
+
};
|
|
133
|
+
exports.postAgentAttachmentActivity = postAgentAttachmentActivity;
|
|
134
|
+
const postAgentSuggestedActionsActivity = function (activityObserver, text, suggestedActions) {
|
|
135
|
+
let delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1000;
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
|
|
138
|
+
id: (0, _omnichannelChatSdk.uuidv4)(),
|
|
139
|
+
from: {
|
|
140
|
+
...agentUser
|
|
141
|
+
},
|
|
142
|
+
text,
|
|
143
|
+
type: "message",
|
|
144
|
+
suggestedActions,
|
|
145
|
+
timestamp: new Date().toISOString()
|
|
146
|
+
});
|
|
147
|
+
}, delay);
|
|
148
|
+
};
|
|
149
|
+
exports.postAgentSuggestedActionsActivity = postAgentSuggestedActionsActivity;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createIOSOptimizedEmojiFont = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Utility functions for font handling and emoji support
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a font family optimized for iOS emoji support
|
|
13
|
+
* Uses system-ui as the primary font for better emoji rendering on iOS
|
|
14
|
+
* @param primaryFont - The base font family string (optional, used as fallback)
|
|
15
|
+
* @returns Font family string optimized for iOS emoji support
|
|
16
|
+
*/
|
|
17
|
+
const createIOSOptimizedEmojiFont = primaryFont => {
|
|
18
|
+
// For iOS emoji support, system-ui should be first
|
|
19
|
+
const baseFont = "system-ui";
|
|
20
|
+
const emojiSupport = "\"Apple Color Emoji\", \"Segoe UI Emoji\"";
|
|
21
|
+
if (!primaryFont || primaryFont.includes("system-ui") || primaryFont.includes("Apple Color Emoji")) {
|
|
22
|
+
return `${baseFont}, ${emojiSupport}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Add configured font as fallback after emoji fonts
|
|
26
|
+
return `${baseFont}, ${emojiSupport}, ${primaryFont}`;
|
|
27
|
+
};
|
|
28
|
+
exports.createIOSOptimizedEmojiFont = createIOSOptimizedEmojiFont;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.defaultAvatarTextStyles = void 0;
|
|
7
7
|
const defaultAvatarTextStyles = {
|
|
8
8
|
margin: "0",
|
|
9
|
-
fontFamily: "
|
|
9
|
+
fontFamily: "'Segoe UI', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', Arial, sans-serif",
|
|
10
10
|
fontWeight: 600,
|
|
11
11
|
fontSize: "13px",
|
|
12
12
|
lineHeight: "18px",
|
|
@@ -11,7 +11,7 @@ const defaultSystemMessageStyles = {
|
|
|
11
11
|
fontSize: "12px",
|
|
12
12
|
borderRadius: 0,
|
|
13
13
|
minHeight: "auto",
|
|
14
|
-
fontFamily: "Segoe UI",
|
|
14
|
+
fontFamily: "'Segoe UI', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', Arial, sans-serif",
|
|
15
15
|
lineHeight: "16px",
|
|
16
16
|
padding: "0px 10px 0 10px"
|
|
17
17
|
};
|
package/lib/cjs/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var _exportNames = {
|
|
|
14
14
|
useChatSDKStore: true,
|
|
15
15
|
useFacadeChatSDKStore: true,
|
|
16
16
|
LiveChatWidget: true,
|
|
17
|
-
getMockChatSDKIfApplicable: true
|
|
17
|
+
getMockChatSDKIfApplicable: true,
|
|
18
|
+
LiveChatWidgetMockType: true
|
|
18
19
|
};
|
|
19
20
|
Object.defineProperty(exports, "BroadcastService", {
|
|
20
21
|
enumerable: true,
|
|
@@ -34,6 +35,12 @@ Object.defineProperty(exports, "LiveChatWidget", {
|
|
|
34
35
|
return _LiveChatWidget.default;
|
|
35
36
|
}
|
|
36
37
|
});
|
|
38
|
+
Object.defineProperty(exports, "LiveChatWidgetMockType", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _IMockProps.LiveChatWidgetMockType;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
37
44
|
Object.defineProperty(exports, "decodeComponentString", {
|
|
38
45
|
enumerable: true,
|
|
39
46
|
get: function () {
|
|
@@ -90,6 +97,7 @@ var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore")
|
|
|
90
97
|
var _useFacadeChatSDKStore = _interopRequireDefault(require("./hooks/useFacadeChatSDKStore"));
|
|
91
98
|
var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
|
|
92
99
|
var _getMockChatSDKIfApplicable = require("./components/livechatwidget/common/getMockChatSDKIfApplicable");
|
|
100
|
+
var _IMockProps = require("./components/livechatwidget/interfaces/IMockProps");
|
|
93
101
|
var _renderingmiddlewares = require("./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares");
|
|
94
102
|
Object.keys(_renderingmiddlewares).forEach(function (key) {
|
|
95
103
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -180,6 +180,7 @@ export const CitationPaneStateful = props => {
|
|
|
180
180
|
}), /*#__PURE__*/React.createElement("div", {
|
|
181
181
|
style: wrapperStyles
|
|
182
182
|
}, /*#__PURE__*/React.createElement(CitationPane, {
|
|
183
|
+
componentOverrides: props === null || props === void 0 ? void 0 : props.componentOverrides,
|
|
183
184
|
controlProps: controlProps,
|
|
184
185
|
styleProps: mergedStyleProps
|
|
185
186
|
})));
|
|
@@ -13,13 +13,13 @@ import { isPersistentChatEnabled } from "./common/liveChatConfigUtils";
|
|
|
13
13
|
import overridePropsOnMockIfApplicable from "./common/overridePropsOnMockIfApplicable";
|
|
14
14
|
import { registerTelemetryLoggers } from "./common/registerTelemetryLoggers";
|
|
15
15
|
export const LiveChatWidget = props => {
|
|
16
|
-
var _props$
|
|
16
|
+
var _props$featureConfigP, _props$chatConfig, _props$chatConfig$Liv, _props$chatConfig2, _props$chatConfig2$Li;
|
|
17
17
|
const reducer = createReducer();
|
|
18
18
|
const [state, dispatch] = useReducer(reducer, getLiveChatWidgetContextInitialState(props));
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
20
|
const [adapter, setAdapter] = useState(undefined);
|
|
21
21
|
const [facadeChatSDK, setFacadeChatSDK] = useState(undefined);
|
|
22
|
-
const chatSDK = getMockChatSDKIfApplicable(props.chatSDK, props === null || props === void 0 ? void 0 :
|
|
22
|
+
const chatSDK = getMockChatSDKIfApplicable(props.chatSDK, props === null || props === void 0 ? void 0 : props.mock);
|
|
23
23
|
const disableReauthentication = ((_props$featureConfigP = props.featureConfigProps) === null || _props$featureConfigP === void 0 ? void 0 : _props$featureConfigP.disableReauthentication) === true;
|
|
24
24
|
overridePropsOnMockIfApplicable(props);
|
|
25
25
|
if (!props.chatConfig) {
|
|
@@ -29,14 +29,14 @@ export const LiveChatWidget = props => {
|
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
30
|
const isAuthenticatedChat = !!((_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig$Liv = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig$Liv !== void 0 && _props$chatConfig$Liv.msdyn_javascriptclientfunction) || isPersistentChatEnabled((_props$chatConfig2 = props.chatConfig) === null || _props$chatConfig2 === void 0 ? void 0 : (_props$chatConfig2$Li = _props$chatConfig2.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig2$Li === void 0 ? void 0 : _props$chatConfig2$Li.msdyn_conversationmode);
|
|
31
31
|
if (!facadeChatSDK) {
|
|
32
|
-
var _props$
|
|
32
|
+
var _props$mock;
|
|
33
33
|
setFacadeChatSDK(new FacadeChatSDK({
|
|
34
34
|
"chatSDK": chatSDK,
|
|
35
35
|
"chatConfig": props.chatConfig,
|
|
36
36
|
"isAuthenticated": isAuthenticatedChat,
|
|
37
37
|
"getAuthToken": props === null || props === void 0 ? void 0 : props.getAuthToken,
|
|
38
38
|
//when type is not undefined, it means the SDK is mocked
|
|
39
|
-
"isSDKMocked": !isNullOrUndefined(props === null || props === void 0 ? void 0 : (_props$
|
|
39
|
+
"isSDKMocked": !isNullOrUndefined(props === null || props === void 0 ? void 0 : (_props$mock = props.mock) === null || _props$mock === void 0 ? void 0 : _props$mock.type)
|
|
40
40
|
}, disableReauthentication));
|
|
41
41
|
}
|
|
42
42
|
useEffect(() => {
|
|
@@ -3,14 +3,15 @@ import { DesignerChatSDK } from "../../webchatcontainerstateful/common/DesignerC
|
|
|
3
3
|
import { MockChatSDK } from "../../webchatcontainerstateful/common/mockchatsdk";
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
export const getMockChatSDKIfApplicable = (chatSDK,
|
|
7
|
-
if (type) {
|
|
8
|
-
switch (type.toLowerCase()) {
|
|
6
|
+
export const getMockChatSDKIfApplicable = (chatSDK, mockProps) => {
|
|
7
|
+
if (mockProps !== null && mockProps !== void 0 && mockProps.type) {
|
|
8
|
+
switch (mockProps.type.toLowerCase()) {
|
|
9
9
|
case "demo":
|
|
10
10
|
chatSDK = new DemoChatSDK();
|
|
11
11
|
break;
|
|
12
12
|
case "designer":
|
|
13
13
|
chatSDK = new DesignerChatSDK();
|
|
14
|
+
chatSDK.mockMessages = mockProps === null || mockProps === void 0 ? void 0 : mockProps.mockMessages;
|
|
14
15
|
break;
|
|
15
16
|
default:
|
|
16
17
|
chatSDK = new MockChatSDK();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const overridePropsOnMockIfApplicable = props => {
|
|
2
2
|
var _props$mock, _props$mock2;
|
|
3
3
|
if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
|
|
4
|
+
var _props$mock3, _props$mock3$mockMess;
|
|
4
5
|
if (!props.webChatContainerProps) {
|
|
5
6
|
props.webChatContainerProps = {};
|
|
6
7
|
}
|
|
@@ -16,7 +17,7 @@ const overridePropsOnMockIfApplicable = props => {
|
|
|
16
17
|
props.webChatContainerProps = {
|
|
17
18
|
...props.webChatContainerProps,
|
|
18
19
|
webChatProps: {
|
|
19
|
-
disabled:
|
|
20
|
+
disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
|
|
20
21
|
...props.webChatContainerProps.webChatProps,
|
|
21
22
|
overrideLocalizedStrings: {
|
|
22
23
|
TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export let LiveChatWidgetMockType;
|
|
2
2
|
(function (LiveChatWidgetMockType) {
|
|
3
3
|
LiveChatWidgetMockType["Test"] = "Test";
|
|
4
4
|
LiveChatWidgetMockType["Demo"] = "Demo";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
LiveChatWidgetMockType["Designer"] = "Designer";
|
|
6
|
+
})(LiveChatWidgetMockType || (LiveChatWidgetMockType = {}));
|
|
@@ -869,42 +869,42 @@ export const LiveChatWidgetStateful = props => {
|
|
|
869
869
|
|
|
870
870
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
871
871
|
return directLine && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
|
|
872
|
-
::-webkit-scrollbar {
|
|
872
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
|
|
873
873
|
width: ${scrollbarProps.width};
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
::-webkit-scrollbar-track {
|
|
876
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
877
877
|
background: ${scrollbarProps.trackBackgroundColor};
|
|
878
878
|
}
|
|
879
879
|
|
|
880
|
-
::-webkit-scrollbar-thumb {
|
|
880
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
881
881
|
background: ${scrollbarProps.thumbBackgroundColor};
|
|
882
882
|
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
883
883
|
}
|
|
884
884
|
|
|
885
|
-
::-webkit-scrollbar-thumb:hover {
|
|
885
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
886
886
|
background: ${scrollbarProps.thumbHoverColor};
|
|
887
887
|
}
|
|
888
888
|
|
|
889
889
|
/* High Contrast mode support - optimized for all variants */
|
|
890
890
|
@media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
|
|
891
|
-
::-webkit-scrollbar-track {
|
|
891
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
892
892
|
background: Canvas !important;
|
|
893
893
|
border: 1px solid CanvasText !important;
|
|
894
894
|
}
|
|
895
895
|
|
|
896
|
-
::-webkit-scrollbar-thumb {
|
|
896
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
897
897
|
background: CanvasText !important;
|
|
898
898
|
border: 1px solid Canvas !important;
|
|
899
899
|
min-height: 20px !important;
|
|
900
900
|
}
|
|
901
901
|
|
|
902
|
-
::-webkit-scrollbar-thumb:hover {
|
|
902
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
903
903
|
background: Highlight !important;
|
|
904
904
|
border: 1px solid CanvasText !important;
|
|
905
905
|
}
|
|
906
906
|
|
|
907
|
-
::-webkit-scrollbar-corner {
|
|
907
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
|
|
908
908
|
background: Canvas !important;
|
|
909
909
|
}
|
|
910
910
|
}
|
|
@@ -12,6 +12,7 @@ import { NotificationScenarios } from "./webchatcontroller/enums/NotificationSce
|
|
|
12
12
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
13
13
|
import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
|
|
14
14
|
import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
|
|
15
|
+
import { createIOSOptimizedEmojiFont } from "./common/utils/fontUtils";
|
|
15
16
|
import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
|
|
16
17
|
import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
17
18
|
import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
|
|
@@ -48,7 +49,13 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
export const WebChatContainerStateful = props => {
|
|
51
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$
|
|
52
|
+
var _props$webChatContain, _defaultWebChatContai, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp24, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
53
|
+
// Create a font family that includes emoji support, based on the primary font or default
|
|
54
|
+
const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? defaultWebChatContainerStatefulProps.webChatStyles;
|
|
55
|
+
const primaryFont = (webChatStyles === null || webChatStyles === void 0 ? void 0 : webChatStyles.primaryFont) ?? ((_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.primaryFont);
|
|
56
|
+
|
|
57
|
+
// Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
|
|
58
|
+
const fontFamilyWithEmojis = createIOSOptimizedEmojiFont(primaryFont);
|
|
52
59
|
useEffect(() => {
|
|
53
60
|
uiTimer = createTimer();
|
|
54
61
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
@@ -132,7 +139,7 @@ export const WebChatContainerStateful = props => {
|
|
|
132
139
|
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
133
140
|
};
|
|
134
141
|
useEffect(() => {
|
|
135
|
-
var _props$
|
|
142
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
136
143
|
if (getDeviceType() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
|
|
137
144
|
const chatHistoryElement = document.querySelector(`.${HtmlClassNames.webChatHistoryContainer}`);
|
|
138
145
|
if (chatHistoryElement) {
|
|
@@ -150,7 +157,7 @@ export const WebChatContainerStateful = props => {
|
|
|
150
157
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
151
158
|
Event: TelemetryEvent.WebChatLoaded
|
|
152
159
|
});
|
|
153
|
-
if (((_props$
|
|
160
|
+
if (((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.renderingMiddlewareProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
154
161
|
try {
|
|
155
162
|
localStorage;
|
|
156
163
|
sessionStorage;
|
|
@@ -165,8 +172,8 @@ export const WebChatContainerStateful = props => {
|
|
|
165
172
|
}
|
|
166
173
|
}, []);
|
|
167
174
|
useEffect(() => {
|
|
168
|
-
var _props$
|
|
169
|
-
if (!((_props$
|
|
175
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
176
|
+
if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain5 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain5 !== void 0 && _props$webChatContain5.disabled)) {
|
|
170
177
|
return;
|
|
171
178
|
}
|
|
172
179
|
if (!window.BroadcastChannel) {
|
|
@@ -258,8 +265,8 @@ export const WebChatContainerStateful = props => {
|
|
|
258
265
|
}
|
|
259
266
|
|
|
260
267
|
.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 {
|
|
261
|
-
background-color: ${((_props$
|
|
262
|
-
color:${((_props$
|
|
268
|
+
background-color: ${((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : (_props$webChatContain7 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.bubbleBackground) ?? ((_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
|
|
269
|
+
color:${((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.webChatStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.bubbleTextColor) ?? ((_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
div[class="ac-textBlock"] a:link,
|
|
@@ -337,7 +344,7 @@ export const WebChatContainerStateful = props => {
|
|
|
337
344
|
}
|
|
338
345
|
|
|
339
346
|
.webchat__stacked-layout_container>div {
|
|
340
|
-
background: ${(props === null || props === void 0 ? void 0 : (_props$
|
|
347
|
+
background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : (_props$webChatContain11 = _props$webChatContain10.containerStyles) === null || _props$webChatContain11 === void 0 ? void 0 : _props$webChatContain11.background) ?? ""}
|
|
341
348
|
}
|
|
342
349
|
.webchat__toast_text {
|
|
343
350
|
display: flex;
|
|
@@ -364,6 +371,15 @@ export const WebChatContainerStateful = props => {
|
|
|
364
371
|
height: 100% !important;
|
|
365
372
|
}
|
|
366
373
|
|
|
374
|
+
.webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
|
|
375
|
+
font-family: ${fontFamilyWithEmojis} !important;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Suggested actions carousel previous/next navigation focus */
|
|
379
|
+
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
380
|
+
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
|
|
381
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
382
|
+
|
|
367
383
|
`), /*#__PURE__*/React.createElement(Stack, {
|
|
368
384
|
styles: containerStyles,
|
|
369
385
|
className: "webchat__stacked-layout_container"
|
|
@@ -372,8 +388,9 @@ export const WebChatContainerStateful = props => {
|
|
|
372
388
|
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || HtmlAttributeNames.ocwCitationPaneTitle,
|
|
373
389
|
contentHtml: citationPaneText,
|
|
374
390
|
onClose: () => setCitationPaneOpen(false),
|
|
375
|
-
|
|
376
|
-
|
|
391
|
+
componentOverrides: (_props$citationPanePr3 = props.citationPaneProps) === null || _props$citationPanePr3 === void 0 ? void 0 : _props$citationPanePr3.componentOverrides,
|
|
392
|
+
controlProps: (_props$citationPanePr4 = props.citationPaneProps) === null || _props$citationPanePr4 === void 0 ? void 0 : _props$citationPanePr4.controlProps,
|
|
393
|
+
styleProps: (_props$citationPanePr5 = props.citationPaneProps) === null || _props$citationPanePr5 === void 0 ? void 0 : _props$citationPanePr5.styleProps
|
|
377
394
|
}));
|
|
378
395
|
};
|
|
379
396
|
export default WebChatContainerStateful;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
4
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
5
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -10,28 +8,59 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "
|
|
|
10
8
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
10
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
|
-
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
import { customerUser, postAgentAttachmentActivity, postAgentMessageActivity, postAgentSuggestedActionsActivity, postBotMessageActivity, postEchoActivity, postSystemMessageActivity } from "./utils/chatAdapterUtils";
|
|
14
15
|
import MockAdapter from "./mockadapter";
|
|
15
|
-
import {
|
|
16
|
+
import { Observable } from "rxjs/Observable";
|
|
16
17
|
export let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
17
18
|
_inherits(DesignerChatAdapter, _MockAdapter);
|
|
18
19
|
var _super = _createSuper(DesignerChatAdapter);
|
|
19
|
-
function DesignerChatAdapter() {
|
|
20
|
+
function DesignerChatAdapter(messages) {
|
|
20
21
|
var _this;
|
|
21
22
|
_classCallCheck(this, DesignerChatAdapter);
|
|
22
23
|
_this = _super.call(this);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
_defineProperty(_assertThisInitialized(_this), "messages", void 0);
|
|
25
|
+
_this.messages = messages;
|
|
26
|
+
if (_this.messages) {
|
|
27
|
+
if (_this.messages.length > 0) {
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
var _this$messages;
|
|
30
|
+
(_this$messages = _this.messages) === null || _this$messages === void 0 ? void 0 : _this$messages.forEach((msg, index) => {
|
|
31
|
+
_this.processMessage(msg, index);
|
|
32
|
+
});
|
|
33
|
+
}, 1000); // Initial 1 second delay to ensure activityObserver is ready
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
// Default hardcoded flow
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
postBotMessageActivity(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
39
|
+
postBotMessageActivity(_this.activityObserver, "Please accept terms and conditions to proceed. Visit the link for terms and conditions <a href=\"\">here</a>.", undefined, 0);
|
|
40
|
+
_this.postUserActivity("I need to change my address.", 0);
|
|
41
|
+
postBotMessageActivity(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
42
|
+
postSystemMessageActivity(_this.activityObserver, "John has joined the chat", 100);
|
|
43
|
+
postAgentMessageActivity(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
44
|
+
_this.postUserActivity("I have trouble visiting the signin page <a href=\"\">signin</a>.", 0);
|
|
45
|
+
}, 1000);
|
|
46
|
+
}
|
|
32
47
|
return _this;
|
|
33
48
|
}
|
|
34
49
|
_createClass(DesignerChatAdapter, [{
|
|
50
|
+
key: "processMessage",
|
|
51
|
+
value: function processMessage(msg, index) {
|
|
52
|
+
if (msg.text) {
|
|
53
|
+
if (msg.suggestedActions) {
|
|
54
|
+
postAgentSuggestedActionsActivity(this.activityObserver, msg.text, msg.suggestedActions, index * 100);
|
|
55
|
+
} else {
|
|
56
|
+
postBotMessageActivity(this.activityObserver, msg.text, undefined, index * 100);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (msg.attachments && msg.attachments.length > 0) {
|
|
60
|
+
postAgentAttachmentActivity(this.activityObserver, msg.attachments, index * 100, msg.attachmentLayout);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
35
64
|
key: "postUserActivity",
|
|
36
65
|
value: function postUserActivity(text) {
|
|
37
66
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
@@ -20,13 +20,18 @@ export let DesignerChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
|
20
20
|
var _this;
|
|
21
21
|
_classCallCheck(this, DesignerChatSDK);
|
|
22
22
|
_this = _super.call(this);
|
|
23
|
+
/**
|
|
24
|
+
* Create a chat adapter for the designer. Uses this.mockMessages if set.
|
|
25
|
+
*/
|
|
26
|
+
_defineProperty(_assertThisInitialized(_this), "mockMessages", void 0);
|
|
23
27
|
_defineProperty(_assertThisInitialized(_this), "localeId", _this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
24
28
|
return _this;
|
|
25
29
|
}
|
|
26
30
|
_createClass(DesignerChatSDK, [{
|
|
27
31
|
key: "createChatAdapter",
|
|
28
32
|
value: function createChatAdapter() {
|
|
29
|
-
|
|
33
|
+
const adapter = new DesignerChatAdapter(this.mockMessages);
|
|
34
|
+
return adapter;
|
|
30
35
|
}
|
|
31
36
|
}, {
|
|
32
37
|
key: "getLiveChatConfig",
|
package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js
CHANGED
|
@@ -17,7 +17,7 @@ export const defaultWebChatStyles = {
|
|
|
17
17
|
bubbleTextColor: "White",
|
|
18
18
|
hideSendBox: false,
|
|
19
19
|
hideUploadButton: true,
|
|
20
|
-
primaryFont: "Segoe UI, Arial, sans-serif",
|
|
20
|
+
primaryFont: "Segoe UI, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\"",
|
|
21
21
|
rootHeight: "100%",
|
|
22
22
|
rootWidth: "100%",
|
|
23
23
|
sendBoxTextWrap: true,
|
|
@@ -97,4 +97,36 @@ export const postBotAttachmentActivity = function (activityObserver) {
|
|
|
97
97
|
timestamp: new Date().toISOString()
|
|
98
98
|
});
|
|
99
99
|
}, delay);
|
|
100
|
+
};
|
|
101
|
+
export const postAgentAttachmentActivity = function (activityObserver) {
|
|
102
|
+
let attachments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
103
|
+
let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
104
|
+
let attachmentLayout = arguments.length > 3 ? arguments[3] : undefined;
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
|
|
107
|
+
id: uuidv4(),
|
|
108
|
+
from: {
|
|
109
|
+
...agentUser
|
|
110
|
+
},
|
|
111
|
+
attachments,
|
|
112
|
+
attachmentLayout,
|
|
113
|
+
type: "message",
|
|
114
|
+
timestamp: new Date().toISOString()
|
|
115
|
+
});
|
|
116
|
+
}, delay);
|
|
117
|
+
};
|
|
118
|
+
export const postAgentSuggestedActionsActivity = function (activityObserver, text, suggestedActions) {
|
|
119
|
+
let delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1000;
|
|
120
|
+
setTimeout(() => {
|
|
121
|
+
activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
|
|
122
|
+
id: uuidv4(),
|
|
123
|
+
from: {
|
|
124
|
+
...agentUser
|
|
125
|
+
},
|
|
126
|
+
text,
|
|
127
|
+
type: "message",
|
|
128
|
+
suggestedActions,
|
|
129
|
+
timestamp: new Date().toISOString()
|
|
130
|
+
});
|
|
131
|
+
}, delay);
|
|
100
132
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for font handling and emoji support
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a font family optimized for iOS emoji support
|
|
7
|
+
* Uses system-ui as the primary font for better emoji rendering on iOS
|
|
8
|
+
* @param primaryFont - The base font family string (optional, used as fallback)
|
|
9
|
+
* @returns Font family string optimized for iOS emoji support
|
|
10
|
+
*/
|
|
11
|
+
export const createIOSOptimizedEmojiFont = primaryFont => {
|
|
12
|
+
// For iOS emoji support, system-ui should be first
|
|
13
|
+
const baseFont = "system-ui";
|
|
14
|
+
const emojiSupport = "\"Apple Color Emoji\", \"Segoe UI Emoji\"";
|
|
15
|
+
if (!primaryFont || primaryFont.includes("system-ui") || primaryFont.includes("Apple Color Emoji")) {
|
|
16
|
+
return `${baseFont}, ${emojiSupport}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Add configured font as fallback after emoji fonts
|
|
20
|
+
return `${baseFont}, ${emojiSupport}, ${primaryFont}`;
|
|
21
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const defaultAvatarTextStyles = {
|
|
2
2
|
margin: "0",
|
|
3
|
-
fontFamily: "
|
|
3
|
+
fontFamily: "'Segoe UI', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', Arial, sans-serif",
|
|
4
4
|
fontWeight: 600,
|
|
5
5
|
fontSize: "13px",
|
|
6
6
|
lineHeight: "18px",
|
|
@@ -5,7 +5,7 @@ export const defaultSystemMessageStyles = {
|
|
|
5
5
|
fontSize: "12px",
|
|
6
6
|
borderRadius: 0,
|
|
7
7
|
minHeight: "auto",
|
|
8
|
-
fontFamily: "Segoe UI",
|
|
8
|
+
fontFamily: "'Segoe UI', 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', Arial, sans-serif",
|
|
9
9
|
lineHeight: "16px",
|
|
10
10
|
padding: "0px 10px 0 10px"
|
|
11
11
|
};
|
package/lib/esm/index.js
CHANGED
|
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
|
|
|
7
7
|
export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
|
|
8
8
|
export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
|
|
9
9
|
export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
|
|
10
|
+
export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
|
|
10
11
|
export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
|
|
11
12
|
export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
|
package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
|
|
2
|
+
export interface ICitationPaneStatefulProps extends ICitationPaneProps {
|
|
3
|
+
/**
|
|
4
|
+
* id: Optional custom ID for the citation pane container
|
|
5
|
+
*/
|
|
4
6
|
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* title: Optional title for the citation pane
|
|
9
|
+
*/
|
|
5
10
|
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* onClose: Optional callback function called when the citation pane is closed
|
|
13
|
+
*/
|
|
6
14
|
onClose?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* contentHtml: Optional HTML content to display in the citation pane
|
|
17
|
+
*/
|
|
7
18
|
contentHtml?: string;
|
|
8
|
-
controlProps?: ICitationPaneControlProps;
|
|
9
|
-
styleProps?: ICitationPaneStyleProps;
|
|
10
19
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { IMockProps } from "../interfaces/IMockProps";
|
|
2
|
+
export declare const getMockChatSDKIfApplicable: (chatSDK: any, mockProps?: IMockProps) => any;
|
|
@@ -3,7 +3,6 @@ import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppIns
|
|
|
3
3
|
import { IAudioNotificationProps } from "../../footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps";
|
|
4
4
|
import { ICallingContainerProps } from "@microsoft/omnichannel-chat-components/lib/types/components/callingcontainer/interfaces/ICallingContainerProps";
|
|
5
5
|
import { IChatButtonProps } from "@microsoft/omnichannel-chat-components/lib/types/components/chatbutton/interfaces/IChatButtonProps";
|
|
6
|
-
import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
|
|
7
6
|
import { ICitationPaneStatefulProps } from "../../citationpanestateful/interfaces/ICitationPaneStatefulProps";
|
|
8
7
|
import { IConfirmationPaneStatefulProps } from "../../confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps";
|
|
9
8
|
import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
|
|
@@ -70,5 +69,4 @@ export interface ILiveChatWidgetProps {
|
|
|
70
69
|
mock?: IMockProps;
|
|
71
70
|
featureConfigProps?: IFeatureConfigProps;
|
|
72
71
|
appInsightsConfig?: IAppInsightsConfig;
|
|
73
|
-
citationProp?: ICitationPaneProps;
|
|
74
72
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { Message } from "botframework-directlinejs";
|
|
2
|
+
export declare enum LiveChatWidgetMockType {
|
|
2
3
|
Test = "Test",
|
|
3
|
-
Demo = "Demo"
|
|
4
|
+
Demo = "Demo",
|
|
5
|
+
Designer = "Designer"
|
|
4
6
|
}
|
|
5
7
|
export interface IMockProps {
|
|
6
8
|
type: LiveChatWidgetMockType;
|
|
9
|
+
mockMessages?: Message[];
|
|
7
10
|
}
|
|
8
|
-
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Message } from "botframework-directlinejs";
|
|
2
|
-
import { Observable } from "rxjs/Observable";
|
|
3
2
|
import MockAdapter from "./mockadapter";
|
|
3
|
+
import { Observable } from "rxjs/Observable";
|
|
4
4
|
export declare class DesignerChatAdapter extends MockAdapter {
|
|
5
|
-
|
|
5
|
+
messages?: Message[];
|
|
6
|
+
constructor(messages?: Message[]);
|
|
7
|
+
private processMessage;
|
|
6
8
|
private postUserActivity;
|
|
7
9
|
postActivity(activity: Message): Observable<string>;
|
|
8
10
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { DesignerChatAdapter } from "./DesignerChatAdapter";
|
|
2
|
+
import { Message } from "botframework-directlinejs";
|
|
2
3
|
import { MockChatSDK } from "./mockchatsdk";
|
|
3
4
|
export declare class DesignerChatSDK extends MockChatSDK {
|
|
4
5
|
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Create a chat adapter for the designer. Uses this.mockMessages if set.
|
|
8
|
+
*/
|
|
9
|
+
mockMessages?: Message[];
|
|
5
10
|
createChatAdapter(): DesignerChatAdapter;
|
|
6
11
|
localeId: string;
|
|
7
12
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, Attachment, Message, User } from "botframework-directlinejs";
|
|
1
|
+
import { Activity, Attachment, AttachmentLayout, CardAction, Message, User } from "botframework-directlinejs";
|
|
2
2
|
import { Subscriber } from "rxjs/Subscriber";
|
|
3
3
|
export declare const customerUser: User;
|
|
4
4
|
export declare const botUser: User;
|
|
@@ -9,3 +9,8 @@ export declare const postAgentMessageActivity: (activityObserver: Subscriber<Act
|
|
|
9
9
|
export declare const postSystemMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, delay?: number) => void;
|
|
10
10
|
export declare const postBotTypingActivity: (activityObserver: Subscriber<Activity> | undefined, delay?: number) => void;
|
|
11
11
|
export declare const postBotAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number) => void;
|
|
12
|
+
export declare const postAgentAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number, attachmentLayout?: AttachmentLayout) => void;
|
|
13
|
+
export declare const postAgentSuggestedActionsActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, suggestedActions: {
|
|
14
|
+
actions: CardAction[];
|
|
15
|
+
to?: string[];
|
|
16
|
+
}, delay?: number) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for font handling and emoji support
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates a font family optimized for iOS emoji support
|
|
6
|
+
* Uses system-ui as the primary font for better emoji rendering on iOS
|
|
7
|
+
* @param primaryFont - The base font family string (optional, used as fallback)
|
|
8
|
+
* @returns Font family string optimized for iOS emoji support
|
|
9
|
+
*/
|
|
10
|
+
export declare const createIOSOptimizedEmojiFont: (primaryFont?: string) => string;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
|
|
|
7
7
|
export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
|
|
8
8
|
export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
|
|
9
9
|
export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
|
|
10
|
+
export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
|
|
10
11
|
export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
|
|
11
12
|
export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.8.3
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@azure/core-tracing": "^1.2.0",
|
|
88
88
|
"@microsoft/applicationinsights-web": "^3.3.6",
|
|
89
|
-
"@microsoft/omnichannel-chat-components": "1.1.
|
|
89
|
+
"@microsoft/omnichannel-chat-components": "1.1.15",
|
|
90
90
|
"@microsoft/omnichannel-chat-sdk": "^1.11.6",
|
|
91
91
|
"@opentelemetry/api": "^1.9.0",
|
|
92
92
|
"abort-controller": "^3",
|