@saasquatch/squatch-js 2.8.2-17 → 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.
- package/dist/squatch.cjs.js +17 -22
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +17 -22
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +17 -22
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/package.json +1 -1
package/dist/squatch.cjs.js
CHANGED
|
@@ -1132,24 +1132,24 @@ class EmbedWidget extends Widget {
|
|
|
1132
1132
|
// element.style.height = "0";
|
|
1133
1133
|
// element.style["overflow-y"] = "hidden";
|
|
1134
1134
|
// }
|
|
1135
|
-
//
|
|
1136
|
-
//
|
|
1137
|
-
//
|
|
1138
|
-
//
|
|
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
|
-
// }
|
|
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,10 +1205,6 @@ class EmbedWidget extends Widget {
|
|
|
1205
1205
|
initialHeight
|
|
1206
1206
|
});
|
|
1207
1207
|
const element = this._findElement();
|
|
1208
|
-
frame.style.display = "none";
|
|
1209
|
-
const injectContents = (target) => {
|
|
1210
|
-
target.appendChild(frame);
|
|
1211
|
-
};
|
|
1212
1208
|
if ((_i = this.context) == null ? void 0 : _i.container) {
|
|
1213
1209
|
element.style.visibility = "hidden";
|
|
1214
1210
|
element.style.height = "0";
|
|
@@ -1219,15 +1215,15 @@ class EmbedWidget extends Widget {
|
|
|
1219
1215
|
if (((_j = element.shadowRoot.lastChild) == null ? void 0 : _j.nodeName) === "IFRAME") {
|
|
1220
1216
|
element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
|
|
1221
1217
|
} else {
|
|
1222
|
-
|
|
1218
|
+
element.shadowRoot.appendChild(frame);
|
|
1223
1219
|
}
|
|
1224
1220
|
} else if (element.firstChild) {
|
|
1225
1221
|
element.replaceChild(frame, element.firstChild);
|
|
1226
1222
|
} else {
|
|
1227
|
-
|
|
1223
|
+
element.appendChild(frame);
|
|
1228
1224
|
}
|
|
1229
1225
|
} else if (!element.firstChild || element.firstChild.nodeName === "#text") {
|
|
1230
|
-
|
|
1226
|
+
element.appendChild(frame);
|
|
1231
1227
|
}
|
|
1232
1228
|
const { contentWindow } = frame;
|
|
1233
1229
|
if (!contentWindow) {
|
|
@@ -1235,7 +1231,6 @@ class EmbedWidget extends Widget {
|
|
|
1235
1231
|
}
|
|
1236
1232
|
const frameDoc = contentWindow.document;
|
|
1237
1233
|
frameDoc.open();
|
|
1238
|
-
console.log({ content: this.content, context: this.context, this: this });
|
|
1239
1234
|
const domain = this.widgetApi.domain;
|
|
1240
1235
|
frameDoc.write(`
|
|
1241
1236
|
${((_k = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _k.brandFont) && `
|