@saasquatch/squatch-js 2.8.2-18 → 2.8.2-19

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.
@@ -1132,24 +1132,24 @@ class EmbedWidget extends Widget {
1132
1132
  // element.style.height = "0";
1133
1133
  // element.style["overflow-y"] = "hidden";
1134
1134
  // }
1135
- // if (this.container) {
1136
- // if (element.shadowRoot) {
1137
- // if (element.shadowRoot.lastChild?.nodeName === "IFRAME") {
1138
- // element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1139
- // } else {
1140
- // element.shadowRoot.appendChild(frame);
1141
- // }
1142
- // }
1143
- // // Widget reloaded - replace existing element
1144
- // else if (element.firstChild) {
1145
- // element.replaceChild(frame, element.firstChild);
1146
- // // Add iframe for the first time
1135
+ // if (this.container) {
1136
+ // if (element.shadowRoot) {
1137
+ // if (element.shadowRoot.lastChild?.nodeName === "IFRAME") {
1138
+ // element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1147
1139
  // } else {
1148
- // element.appendChild(frame);
1140
+ // element.shadowRoot.appendChild(frame);
1149
1141
  // }
1150
- // } else if (!element.firstChild || element.firstChild.nodeName === "#text") {
1142
+ // }
1143
+ // // Widget reloaded - replace existing element
1144
+ // else if (element.firstChild) {
1145
+ // element.replaceChild(frame, element.firstChild);
1146
+ // // Add iframe for the first time
1147
+ // } else {
1151
1148
  // element.appendChild(frame);
1152
1149
  // }
1150
+ // } else if (!element.firstChild || element.firstChild.nodeName === "#text") {
1151
+ // element.appendChild(frame);
1152
+ // }
1153
1153
  // const { contentWindow } = frame;
1154
1154
  // if (!contentWindow) {
1155
1155
  // throw new Error("Frame needs a content window");
@@ -1205,9 +1205,6 @@ class EmbedWidget extends Widget {
1205
1205
  initialHeight
1206
1206
  });
1207
1207
  const element = this._findElement();
1208
- const injectContents = (target) => {
1209
- target.appendChild(frame);
1210
- };
1211
1208
  if ((_i = this.context) == null ? void 0 : _i.container) {
1212
1209
  element.style.visibility = "hidden";
1213
1210
  element.style.height = "0";
@@ -1218,15 +1215,15 @@ class EmbedWidget extends Widget {
1218
1215
  if (((_j = element.shadowRoot.lastChild) == null ? void 0 : _j.nodeName) === "IFRAME") {
1219
1216
  element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
1220
1217
  } else {
1221
- injectContents(element.shadowRoot);
1218
+ element.shadowRoot.appendChild(frame);
1222
1219
  }
1223
1220
  } else if (element.firstChild) {
1224
1221
  element.replaceChild(frame, element.firstChild);
1225
1222
  } else {
1226
- injectContents(element);
1223
+ element.appendChild(frame);
1227
1224
  }
1228
1225
  } else if (!element.firstChild || element.firstChild.nodeName === "#text") {
1229
- injectContents(element);
1226
+ element.appendChild(frame);
1230
1227
  }
1231
1228
  const { contentWindow } = frame;
1232
1229
  if (!contentWindow) {