dialogshift-webchat-sdk 2.11.4 → 2.11.6

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.
@@ -261,8 +261,9 @@ var App = /** @class */ (function () {
261
261
  this.widgetManager.renderUnreadWidget(this.options, this.chatConfig);
262
262
  if (this.options.renderWaButton) {
263
263
  this.widgetManager.renderWhatsappButtonWidget(this.chatConfig);
264
- this.widgetManager.renderWhatsappWindowWidget(this.options);
265
264
  }
265
+ // Always render the window widget because it is possible to configure only the button in the chat window
266
+ this.widgetManager.renderWhatsappWindowWidget(this.options);
266
267
  this.widgetManager.renderIframeBox();
267
268
  this.broadcast.on('ready', function () {
268
269
  _this.ready = true;
@@ -485,6 +486,13 @@ var App = /** @class */ (function () {
485
486
  App.prototype.getConfig = function () {
486
487
  return this.chatConfig;
487
488
  };
489
+ App.prototype.getClientConfig = function () {
490
+ var _a;
491
+ return {
492
+ clientid: this.options.id,
493
+ channel: ((_a = this.options.context) === null || _a === void 0 ? void 0 : _a.channel) ? this.options.context.channel : 'pwa-embed',
494
+ };
495
+ };
488
496
  App.prototype.setInitialElement = function (initialElement) {
489
497
  var mergedInitialElement = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.mergeDeep)(this.options.initialElement, initialElement);
490
498
  this.options.initialElement = mergedInitialElement;
@@ -1249,6 +1257,9 @@ var createFacade = function (instance) {
1249
1257
  getConfig: function () {
1250
1258
  return instance.getConfig();
1251
1259
  },
1260
+ getClientConfig: function () {
1261
+ return instance.getClientConfig();
1262
+ },
1252
1263
  setUnreadCounter: function (amount) {
1253
1264
  instance.getWidgetManager().getUnreadWidget().setCounter(amount);
1254
1265
  },
@@ -1810,7 +1821,9 @@ var WidgetManager = /** @class */ (function () {
1810
1821
  type: 'before:hide',
1811
1822
  callback: function () {
1812
1823
  _this.iframeWidget.show();
1813
- _this.whatsappButtonWidget.toggle(false);
1824
+ if (_this.whatsappButtonWidget) {
1825
+ _this.whatsappButtonWidget.toggle(false);
1826
+ }
1814
1827
  },
1815
1828
  },
1816
1829
  {
@@ -2103,7 +2116,7 @@ var ApiService = /** @class */ (function () {
2103
2116
  url += "context=".concat(encodeURIComponent(JSON.stringify(options.context)));
2104
2117
  }
2105
2118
  url.indexOf('?') === -1 ? (url += '?origin=sdk') : (url += '&origin=sdk');
2106
- url += '&v=2.3.16';
2119
+ url += "&v=".concat("2.11.6");
2107
2120
  if (options.debug) {
2108
2121
  url += "&debug=".concat(options.debug);
2109
2122
  }
@@ -4042,12 +4055,6 @@ var WrapperWidget = /** @class */ (function (_super) {
4042
4055
  /******/ if (cachedModule !== undefined) {
4043
4056
  /******/ return cachedModule.exports;
4044
4057
  /******/ }
4045
- /******/ // Check if module exists (development only)
4046
- /******/ if (__webpack_modules__[moduleId] === undefined) {
4047
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
4048
- /******/ e.code = 'MODULE_NOT_FOUND';
4049
- /******/ throw e;
4050
- /******/ }
4051
4058
  /******/ // Create a new module (and put it into the cache)
4052
4059
  /******/ var module = __webpack_module_cache__[moduleId] = {
4053
4060
  /******/ // no module.id needed
@@ -4056,6 +4063,12 @@ var WrapperWidget = /** @class */ (function (_super) {
4056
4063
  /******/ };
4057
4064
  /******/
4058
4065
  /******/ // Execute the module function
4066
+ /******/ if (!(moduleId in __webpack_modules__)) {
4067
+ /******/ delete __webpack_module_cache__[moduleId];
4068
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
4069
+ /******/ e.code = 'MODULE_NOT_FOUND';
4070
+ /******/ throw e;
4071
+ /******/ }
4059
4072
  /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
4060
4073
  /******/
4061
4074
  /******/ // Return the exports of the module