@microsoft/omnichannel-chat-widget 1.7.3 → 1.7.4-main.f0f5d34

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.
@@ -6,18 +6,41 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.DesignerChatSDK = void 0;
7
7
  var _DesignerChatAdapter = require("./DesignerChatAdapter");
8
8
  var _mockchatsdk = require("./mockchatsdk");
9
+ 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; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ 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); }
9
12
  class DesignerChatSDK extends _mockchatsdk.MockChatSDK {
10
13
  constructor() {
11
14
  super();
15
+ _defineProperty(this, "localeId", this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
12
16
  }
13
17
  createChatAdapter() {
14
18
  return new _DesignerChatAdapter.DesignerChatAdapter();
15
19
  }
20
+ /**
21
+ * If the widget is running in designer mode, we mock the initialize response. We don't want
22
+ * any interactions with a real server in when designing LCW widget visually in Modern Admin.
23
+ *
24
+ * - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
25
+ * - msdyn_callingoptions was changed to disable calling functionality
26
+ */
16
27
  getLiveChatConfig() {
17
28
  return {
18
29
  LiveWSAndLiveChatEngJoin: {
30
+ msdyn_widgetthemecolor: "19236002",
31
+ // msdyn_callingoptions was changed to disable calling functionality
32
+ msdyn_callingoptions: "192350000",
33
+ msdyn_widgettitle: "Let\u0027s chat",
34
+ msdyn_conversationmode: "192350000",
35
+ msdyn_avatarurl: "https://oc-cdn-ocprod.azureedge.net/livechatwidget/images/chatIcon.svg",
36
+ msdyn_name: "Let's Chat",
19
37
  msdyn_postconversationsurveyenable: "false",
20
- msdyn_conversationmode: "192350000"
38
+ OutOfOperatingHours: "False",
39
+ ShowWidget: "True"
40
+ },
41
+ ChatWidgetLanguage: {
42
+ msdyn_localeid: "1033",
43
+ msdyn_languagename: "English - United States"
21
44
  }
22
45
  };
23
46
  }
package/lib/cjs/index.js CHANGED
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "encodeComponentString", {
33
33
  return _omnichannelChatComponents.encodeComponentString;
34
34
  }
35
35
  });
36
+ Object.defineProperty(exports, "getMockChatSDKIfApplicable", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _getMockChatSDKIfApplicable.getMockChatSDKIfApplicable;
40
+ }
41
+ });
36
42
  Object.defineProperty(exports, "getWidgetCacheId", {
37
43
  enumerable: true,
38
44
  get: function () {
@@ -63,4 +69,5 @@ var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore")
63
69
  var _utils = require("./common/utils");
64
70
  var _ConversationState = require("./contexts/common/ConversationState");
65
71
  var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
72
+ var _getMockChatSDKIfApplicable = require("./components/livechatwidget/common/getMockChatSDKIfApplicable");
66
73
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,17 +1,40 @@
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ 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); }
1
4
  import { DesignerChatAdapter } from "./DesignerChatAdapter";
2
5
  import { MockChatSDK } from "./mockchatsdk";
3
6
  export class DesignerChatSDK extends MockChatSDK {
4
7
  constructor() {
5
8
  super();
9
+ _defineProperty(this, "localeId", this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
6
10
  }
7
11
  createChatAdapter() {
8
12
  return new DesignerChatAdapter();
9
13
  }
14
+ /**
15
+ * If the widget is running in designer mode, we mock the initialize response. We don't want
16
+ * any interactions with a real server in when designing LCW widget visually in Modern Admin.
17
+ *
18
+ * - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
19
+ * - msdyn_callingoptions was changed to disable calling functionality
20
+ */
10
21
  getLiveChatConfig() {
11
22
  return {
12
23
  LiveWSAndLiveChatEngJoin: {
24
+ msdyn_widgetthemecolor: "19236002",
25
+ // msdyn_callingoptions was changed to disable calling functionality
26
+ msdyn_callingoptions: "192350000",
27
+ msdyn_widgettitle: "Let\u0027s chat",
28
+ msdyn_conversationmode: "192350000",
29
+ msdyn_avatarurl: "https://oc-cdn-ocprod.azureedge.net/livechatwidget/images/chatIcon.svg",
30
+ msdyn_name: "Let's Chat",
13
31
  msdyn_postconversationsurveyenable: "false",
14
- msdyn_conversationmode: "192350000"
32
+ OutOfOperatingHours: "False",
33
+ ShowWidget: "True"
34
+ },
35
+ ChatWidgetLanguage: {
36
+ msdyn_localeid: "1033",
37
+ msdyn_languagename: "English - United States"
15
38
  }
16
39
  };
17
40
  }
package/lib/esm/index.js CHANGED
@@ -4,5 +4,6 @@ import useChatSDKStore from "./hooks/useChatSDKStore";
4
4
  import { getWidgetCacheId, getWidgetEndChatEventName } from "./common/utils";
5
5
  import { ConversationState } from "./contexts/common/ConversationState";
6
6
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
7
+ export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
7
8
  export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore };
8
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
@@ -3,10 +3,29 @@ import { MockChatSDK } from "./mockchatsdk";
3
3
  export declare class DesignerChatSDK extends MockChatSDK {
4
4
  constructor();
5
5
  createChatAdapter(): DesignerChatAdapter;
6
+ localeId: string;
7
+ /**
8
+ * If the widget is running in designer mode, we mock the initialize response. We don't want
9
+ * any interactions with a real server in when designing LCW widget visually in Modern Admin.
10
+ *
11
+ * - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
12
+ * - msdyn_callingoptions was changed to disable calling functionality
13
+ */
6
14
  getLiveChatConfig(): {
7
15
  LiveWSAndLiveChatEngJoin: {
8
- msdyn_postconversationsurveyenable: string;
16
+ msdyn_widgetthemecolor: string;
17
+ msdyn_callingoptions: string;
18
+ msdyn_widgettitle: string;
9
19
  msdyn_conversationmode: string;
20
+ msdyn_avatarurl: string;
21
+ msdyn_name: string;
22
+ msdyn_postconversationsurveyenable: string;
23
+ OutOfOperatingHours: string;
24
+ ShowWidget: string;
25
+ };
26
+ ChatWidgetLanguage: {
27
+ msdyn_localeid: string;
28
+ msdyn_languagename: string;
10
29
  };
11
30
  };
12
31
  }
@@ -4,5 +4,6 @@ import useChatSDKStore from "./hooks/useChatSDKStore";
4
4
  import { getWidgetCacheId, getWidgetEndChatEventName } from "./common/utils";
5
5
  import { ConversationState } from "./contexts/common/ConversationState";
6
6
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
7
+ export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
7
8
  export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore };
8
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.3",
3
+ "version": "1.7.4-main.f0f5d34",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",