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