@saasquatch/squatch-js 2.8.0-2 → 2.8.0-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/dist/squatch.js CHANGED
@@ -1110,7 +1110,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1110
1110
  if (container) this.container = container;
1111
1111
  }
1112
1112
  async load() {
1113
- var _a2, _b, _c, _d, _e;
1113
+ var _a2, _b, _c;
1114
1114
  const frame = this._createFrame();
1115
1115
  const element = this._findElement();
1116
1116
  if ((_a2 = this.context) == null ? void 0 : _a2.container) {
@@ -1118,16 +1118,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1118
1118
  element.style.height = "0";
1119
1119
  element.style["overflow-y"] = "hidden";
1120
1120
  }
1121
- console.log({ context: this.context });
1122
- const brandingConfig = (_c = (_b = this.context.widgetConfig) == null ? void 0 : _b.values) == null ? void 0 : _c.SquatchBrandingConfig;
1123
- const sizes = (_d = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _d.embeddedWidgets;
1121
+ const brandingConfig = window.SquatchBrandingConfig;
1122
+ const sizes = (_b = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _b.embeddedWidgets;
1124
1123
  const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "100%";
1125
1124
  const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "100%";
1126
1125
  element.style.maxWidth = maxWidth;
1127
1126
  element.style.minWidth = minWidth;
1128
1127
  if (this.container) {
1129
1128
  if (element.shadowRoot) {
1130
- if (((_e = element.shadowRoot.lastChild) == null ? void 0 : _e.nodeName) === "IFRAME") {
1129
+ if (((_c = element.shadowRoot.lastChild) == null ? void 0 : _c.nodeName) === "IFRAME") {
1131
1130
  element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1132
1131
  } else {
1133
1132
  element.shadowRoot.appendChild(frame);
@@ -1250,10 +1249,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1250
1249
  }
1251
1250
  }
1252
1251
  _createPopupDialog() {
1253
- var _a2, _b, _c;
1252
+ var _a2;
1254
1253
  const dialog = document.createElement("dialog");
1255
- const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.SquatchBrandingConfig;
1256
- const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
1254
+ const brandingConfig = window.SquatchBrandingConfig;
1255
+ const sizes = (_a2 = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _a2.popupWidgets;
1257
1256
  const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "100%";
1258
1257
  const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
1259
1258
  dialog.id = this.id;
@@ -1890,6 +1889,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1890
1889
  __publicField(this, "loaded");
1891
1890
  __publicField(this, "_setWidget", (res, config) => {
1892
1891
  var _a2;
1892
+ console.log({ res });
1893
1893
  const params = {
1894
1894
  api: this.widgetApi,
1895
1895
  content: res.template,
@@ -1897,8 +1897,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1897
1897
  type: config.type,
1898
1898
  user: config.user,
1899
1899
  container: this.container || void 0,
1900
- engagementMedium: this.type,
1901
- widgetConfig: res.widgetConfig
1900
+ engagementMedium: this.type
1902
1901
  },
1903
1902
  type: this.widgetType,
1904
1903
  domain: ((_a2 = this.config) == null ? void 0 : _a2.domain) || DEFAULT_DOMAIN,