@saasquatch/squatch-js 2.8.2-33 → 2.8.2-35
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/coverage/clover.xml +944 -0
- package/coverage/coverage-final.json +22 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +1714 -0
- package/dist/squatch.cjs.js +31 -26
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +31 -26
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +31 -26
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/dist/widgets/PopupWidget.d.ts +2 -2
- package/package.json +1 -1
package/dist/squatch.js
CHANGED
|
@@ -1168,6 +1168,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1168
1168
|
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1169
1169
|
(_g = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _g.brandFont
|
|
1170
1170
|
)}" as="style">` : ""}
|
|
1171
|
+
<link rel="dns-prefetch" href="https://res.cloudinary.com">
|
|
1172
|
+
<link rel="preconnect" href="https://res.cloudinary.com" crossorigin>
|
|
1171
1173
|
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1172
1174
|
<style data-styles>
|
|
1173
1175
|
html { visibility:hidden;}
|
|
@@ -1275,11 +1277,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1275
1277
|
};
|
|
1276
1278
|
}
|
|
1277
1279
|
}
|
|
1278
|
-
_createPopupDialog() {
|
|
1279
|
-
var _a2
|
|
1280
|
+
_createPopupDialog(brandingConfig) {
|
|
1281
|
+
var _a2;
|
|
1280
1282
|
const dialog = document.createElement("dialog");
|
|
1281
|
-
const
|
|
1282
|
-
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
|
|
1283
|
+
const sizes = (_a2 = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _a2.popupWidgets;
|
|
1283
1284
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "auto";
|
|
1284
1285
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
|
|
1285
1286
|
dialog.id = this.id;
|
|
@@ -1295,14 +1296,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1295
1296
|
return dialog;
|
|
1296
1297
|
}
|
|
1297
1298
|
async load() {
|
|
1298
|
-
var _a2;
|
|
1299
|
-
const
|
|
1299
|
+
var _a2, _b, _c, _d, _e;
|
|
1300
|
+
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1301
|
+
const initialHeight = brandingConfig == null ? void 0 : brandingConfig.loadingHeight;
|
|
1302
|
+
const frame = this._createFrame({ initialHeight });
|
|
1300
1303
|
this._initialiseCTA();
|
|
1301
1304
|
const element = this.container ? this._findElement() : document.body;
|
|
1302
1305
|
const dialogParent = element.shadowRoot || element;
|
|
1303
|
-
const dialog = this._createPopupDialog();
|
|
1306
|
+
const dialog = this._createPopupDialog(brandingConfig);
|
|
1304
1307
|
dialog.appendChild(frame);
|
|
1305
|
-
if (((
|
|
1308
|
+
if (((_c = dialogParent.lastChild) == null ? void 0 : _c.nodeName) === "DIALOG") {
|
|
1306
1309
|
dialogParent.replaceChild(dialog, dialogParent.lastChild);
|
|
1307
1310
|
} else {
|
|
1308
1311
|
dialogParent.appendChild(dialog);
|
|
@@ -1313,27 +1316,29 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1313
1316
|
}
|
|
1314
1317
|
const frameDoc = contentWindow.document;
|
|
1315
1318
|
frameDoc.open();
|
|
1316
|
-
|
|
1317
|
-
frameDoc.write(
|
|
1318
|
-
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1319
|
-
);
|
|
1319
|
+
const domain = this.widgetApi.domain;
|
|
1320
1320
|
frameDoc.write(`
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1321
|
+
${((_d = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _d.brandFont) ? `
|
|
1322
|
+
<link rel="preconnect" href="https://fast${domain === "https://staging.referralsaasquatch.com" && "-staging"}.ssqt.io">
|
|
1323
|
+
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
1324
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
1325
|
+
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1326
|
+
(_e = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _e.brandFont
|
|
1327
|
+
)}" as="style">` : ""}
|
|
1328
|
+
<link rel="dns-prefetch" href="https://res.cloudinary.com">
|
|
1329
|
+
<link rel="preconnect" href="https://res.cloudinary.com" crossorigin>
|
|
1330
|
+
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1331
|
+
<style data-styles>
|
|
1332
|
+
html { visibility:hidden;}
|
|
1333
|
+
</style>
|
|
1334
|
+
${this.content}
|
|
1335
|
+
|
|
1336
|
+
`);
|
|
1332
1337
|
frameDoc.close();
|
|
1333
1338
|
_log$6("Popup template loaded into iframe");
|
|
1334
|
-
await this._setupResizeHandler(frame);
|
|
1339
|
+
await this._setupResizeHandler(frame, initialHeight);
|
|
1335
1340
|
}
|
|
1336
|
-
async _setupResizeHandler(frame) {
|
|
1341
|
+
async _setupResizeHandler(frame, initialHeight) {
|
|
1337
1342
|
const { contentWindow } = frame;
|
|
1338
1343
|
if (!contentWindow) {
|
|
1339
1344
|
throw new Error("Frame needs a content window");
|
|
@@ -1341,7 +1346,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1341
1346
|
const frameDoc = contentWindow.document;
|
|
1342
1347
|
domready(frameDoc, async () => {
|
|
1343
1348
|
frameDoc.body.style.overflowY = "hidden";
|
|
1344
|
-
frame.height =
|
|
1349
|
+
frame.height = initialHeight || frameDoc.body.offsetHeight;
|
|
1345
1350
|
const ro = new contentWindow["ResizeObserver"]((entries) => {
|
|
1346
1351
|
for (const entry of entries) {
|
|
1347
1352
|
const { top, bottom } = entry.contentRect;
|