@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/async.d.ts CHANGED
@@ -14,6 +14,7 @@ declare global {
14
14
  squatchConfig: Omit<ConfigOptions, "tenantAlias">;
15
15
  impactToken: string;
16
16
  impactConfig: Omit<ConfigOptions, "tenantAlias">;
17
+ SquatchBrandingConfig: any;
17
18
  }
18
19
  }
19
20
  /** @hidden */
@@ -1108,7 +1108,7 @@ class EmbedWidget extends Widget {
1108
1108
  if (container) this.container = container;
1109
1109
  }
1110
1110
  async load() {
1111
- var _a2, _b, _c, _d, _e;
1111
+ var _a2, _b, _c;
1112
1112
  const frame = this._createFrame();
1113
1113
  const element = this._findElement();
1114
1114
  if ((_a2 = this.context) == null ? void 0 : _a2.container) {
@@ -1116,16 +1116,15 @@ class EmbedWidget extends Widget {
1116
1116
  element.style.height = "0";
1117
1117
  element.style["overflow-y"] = "hidden";
1118
1118
  }
1119
- console.log({ context: this.context });
1120
- const brandingConfig = (_c = (_b = this.context.widgetConfig) == null ? void 0 : _b.values) == null ? void 0 : _c.SquatchBrandingConfig;
1121
- const sizes = (_d = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _d.embeddedWidgets;
1119
+ const brandingConfig = window.SquatchBrandingConfig;
1120
+ const sizes = (_b = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _b.embeddedWidgets;
1122
1121
  const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "100%";
1123
1122
  const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "100%";
1124
1123
  element.style.maxWidth = maxWidth;
1125
1124
  element.style.minWidth = minWidth;
1126
1125
  if (this.container) {
1127
1126
  if (element.shadowRoot) {
1128
- if (((_e = element.shadowRoot.lastChild) == null ? void 0 : _e.nodeName) === "IFRAME") {
1127
+ if (((_c = element.shadowRoot.lastChild) == null ? void 0 : _c.nodeName) === "IFRAME") {
1129
1128
  element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1130
1129
  } else {
1131
1130
  element.shadowRoot.appendChild(frame);
@@ -1248,10 +1247,10 @@ class PopupWidget extends Widget {
1248
1247
  }
1249
1248
  }
1250
1249
  _createPopupDialog() {
1251
- var _a2, _b, _c;
1250
+ var _a2;
1252
1251
  const dialog = document.createElement("dialog");
1253
- const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.SquatchBrandingConfig;
1254
- const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
1252
+ const brandingConfig = window.SquatchBrandingConfig;
1253
+ const sizes = (_a2 = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _a2.popupWidgets;
1255
1254
  const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "100%";
1256
1255
  const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
1257
1256
  dialog.id = this.id;
@@ -1888,6 +1887,7 @@ class DeclarativeWidget extends HTMLElement {
1888
1887
  __publicField(this, "loaded");
1889
1888
  __publicField(this, "_setWidget", (res, config) => {
1890
1889
  var _a2;
1890
+ console.log({ res });
1891
1891
  const params = {
1892
1892
  api: this.widgetApi,
1893
1893
  content: res.template,
@@ -1895,8 +1895,7 @@ class DeclarativeWidget extends HTMLElement {
1895
1895
  type: config.type,
1896
1896
  user: config.user,
1897
1897
  container: this.container || void 0,
1898
- engagementMedium: this.type,
1899
- widgetConfig: res.widgetConfig
1898
+ engagementMedium: this.type
1900
1899
  },
1901
1900
  type: this.widgetType,
1902
1901
  domain: ((_a2 = this.config) == null ? void 0 : _a2.domain) || DEFAULT_DOMAIN,