@saasquatch/squatch-js 2.8.2-28 → 2.8.2-29

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.
@@ -1119,13 +1119,10 @@ class EmbedWidget extends Widget {
1119
1119
  }
1120
1120
  }
1121
1121
  async load() {
1122
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1122
+ var _a2, _b, _c, _d, _e, _f, _g;
1123
1123
  const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
1124
1124
  const initialHeight = brandingConfig == null ? void 0 : brandingConfig.loadingHeight;
1125
- (_d = (_c = brandingConfig == null ? void 0 : brandingConfig.color) == null ? void 0 : _c.loadingSkeleton) == null ? void 0 : _d.background;
1126
- (_f = (_e = brandingConfig == null ? void 0 : brandingConfig.color) == null ? void 0 : _e.loadingSkeleton) == null ? void 0 : _f.animationBackground;
1127
- (_g = brandingConfig == null ? void 0 : brandingConfig.border) == null ? void 0 : _g.borderColor;
1128
- const sizes = (_h = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _h.embeddedWidgets;
1125
+ const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.embeddedWidgets;
1129
1126
  const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "";
1130
1127
  const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "";
1131
1128
  const frame = this._createFrame({
@@ -1134,14 +1131,14 @@ class EmbedWidget extends Widget {
1134
1131
  initialHeight
1135
1132
  });
1136
1133
  const element = this._findElement();
1137
- if ((_i = this.context) == null ? void 0 : _i.container) {
1134
+ if ((_d = this.context) == null ? void 0 : _d.container) {
1138
1135
  element.style.visibility = "hidden";
1139
1136
  element.style.height = "0";
1140
1137
  element.style["overflow-y"] = "hidden";
1141
1138
  }
1142
1139
  if (this.container) {
1143
1140
  if (element.shadowRoot) {
1144
- if (((_j = element.shadowRoot.lastChild) == null ? void 0 : _j.nodeName) === "IFRAME") {
1141
+ if (((_e = element.shadowRoot.lastChild) == null ? void 0 : _e.nodeName) === "IFRAME") {
1145
1142
  element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1146
1143
  } else {
1147
1144
  element.shadowRoot.appendChild(frame);
@@ -1162,12 +1159,12 @@ class EmbedWidget extends Widget {
1162
1159
  frameDoc.open();
1163
1160
  const domain = this.widgetApi.domain;
1164
1161
  frameDoc.write(`
1165
- ${((_k = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _k.brandFont) ? `
1162
+ ${((_f = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _f.brandFont) ? `
1166
1163
  <link rel="preconnect" href="https://fast${domain === "https://staging.referralsaasquatch.com" && "-staging"}.ssqt.io">
1167
1164
  <link rel="preconnect" href="https://fonts.gstatic.com">
1168
1165
  <link rel="preconnect" href="https://fonts.googleapis.com">
1169
1166
  <link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
1170
- (_l = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _l.brandFont
1167
+ (_g = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _g.brandFont
1171
1168
  )}" as="style">` : ""}
1172
1169
  <script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
1173
1170
  <style data-styles>
@@ -2355,6 +2352,8 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
2355
2352
  async connectedCallback() {
2356
2353
  this.loaded = true;
2357
2354
  this.container = this.getAttribute("container");
2355
+ this.widgetType = this.getAttribute("widget") || void 0;
2356
+ console.log("widget type", this.widgetType);
2358
2357
  const skeletonHTML = getSkeleton({
2359
2358
  height: "100%",
2360
2359
  type: "instant-access"
@@ -2398,6 +2397,8 @@ class DeclarativePopupWidget extends DeclarativeWidget {
2398
2397
  async connectedCallback() {
2399
2398
  this.loaded = true;
2400
2399
  this.container = this.getAttribute("container");
2400
+ this.widgetType = this.getAttribute("widget") || void 0;
2401
+ console.log("widget type", this.widgetType);
2401
2402
  const skeletonHTML = getSkeleton({ height: "100%" });
2402
2403
  const skeletonContainer = document.createElement("div");
2403
2404
  skeletonContainer.id = "loading-skeleton";