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