@saasquatch/squatch-js 2.8.2-3 → 2.8.2-30
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 +308 -387
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +308 -387
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +308 -387
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/dist/widgets/SkeletonTemplate.d.ts +3 -2
- package/dist/widgets/declarative/DeclarativeWidget.d.ts +1 -0
- package/package.json +1 -1
package/dist/squatch.cjs.js
CHANGED
|
@@ -1108,351 +1108,6 @@ function delay(duration) {
|
|
|
1108
1108
|
setTimeout(resolve, duration);
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
|
-
const getSkeleton = ({
|
|
1112
|
-
height = "500px",
|
|
1113
|
-
skeletonBackgroundColor = "#e0e0e0",
|
|
1114
|
-
skeletonShimmerColor = "#f5f5f5",
|
|
1115
|
-
borderColor = "#ccc"
|
|
1116
|
-
}) => {
|
|
1117
|
-
return `
|
|
1118
|
-
<style>
|
|
1119
|
-
* {
|
|
1120
|
-
box-sizing: border-box;
|
|
1121
|
-
padding: 0;
|
|
1122
|
-
margin: 0;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
.widget-container {
|
|
1126
|
-
background: white;
|
|
1127
|
-
width: 100%;
|
|
1128
|
-
max-width: 900px;
|
|
1129
|
-
padding: 40px;
|
|
1130
|
-
border-radius: 12px;
|
|
1131
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
1132
|
-
box-sizing: border-box;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
@keyframes shimmer {
|
|
1136
|
-
0% {
|
|
1137
|
-
background-position: -100% 0;
|
|
1138
|
-
}
|
|
1139
|
-
100% {
|
|
1140
|
-
background-position: 100% 0;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
.skeleton {
|
|
1145
|
-
background: ${skeletonBackgroundColor};
|
|
1146
|
-
background: linear-gradient(
|
|
1147
|
-
90deg,
|
|
1148
|
-
${skeletonBackgroundColor} 25%,
|
|
1149
|
-
${skeletonShimmerColor} 50%,
|
|
1150
|
-
${skeletonBackgroundColor} 75%
|
|
1151
|
-
);
|
|
1152
|
-
background-size: 200% 100%;
|
|
1153
|
-
animation: shimmer 1.5s infinite linear;
|
|
1154
|
-
border-radius: 6px;
|
|
1155
|
-
margin-bottom: 12px;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
.sk-title-lg {
|
|
1159
|
-
height: 36px;
|
|
1160
|
-
width: 50%;
|
|
1161
|
-
margin-bottom: 16px;
|
|
1162
|
-
}
|
|
1163
|
-
.sk-title-md {
|
|
1164
|
-
height: 28px;
|
|
1165
|
-
width: 30%;
|
|
1166
|
-
margin-bottom: 20px;
|
|
1167
|
-
margin-top: 40px;
|
|
1168
|
-
}
|
|
1169
|
-
.sk-text {
|
|
1170
|
-
height: 16px;
|
|
1171
|
-
width: 80%;
|
|
1172
|
-
margin-bottom: 8px;
|
|
1173
|
-
}
|
|
1174
|
-
.sk-text-short {
|
|
1175
|
-
width: 40%;
|
|
1176
|
-
}
|
|
1177
|
-
.sk-label {
|
|
1178
|
-
height: 14px;
|
|
1179
|
-
width: 25%;
|
|
1180
|
-
margin-bottom: 10px;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
.hero-section {
|
|
1184
|
-
display: flex;
|
|
1185
|
-
gap: 40px;
|
|
1186
|
-
margin-bottom: 40px;
|
|
1187
|
-
border-bottom: 1px solid ${borderColor};
|
|
1188
|
-
padding-bottom: 40px;
|
|
1189
|
-
flex-direction: row;
|
|
1190
|
-
}
|
|
1191
|
-
.hero-content {
|
|
1192
|
-
flex: 1;
|
|
1193
|
-
display: flex;
|
|
1194
|
-
flex-direction: column;
|
|
1195
|
-
justify-content: center;
|
|
1196
|
-
}
|
|
1197
|
-
.hero-image {
|
|
1198
|
-
flex: 1;
|
|
1199
|
-
height: 300px;
|
|
1200
|
-
border-radius: 12px;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
.share-section {
|
|
1204
|
-
margin-bottom: 40px;
|
|
1205
|
-
}
|
|
1206
|
-
.sk-input {
|
|
1207
|
-
height: 50px;
|
|
1208
|
-
width: 100%;
|
|
1209
|
-
border-radius: 8px;
|
|
1210
|
-
margin-bottom: 16px;
|
|
1211
|
-
}
|
|
1212
|
-
.social-buttons {
|
|
1213
|
-
display: flex;
|
|
1214
|
-
gap: 12px;
|
|
1215
|
-
}
|
|
1216
|
-
.sk-btn-social {
|
|
1217
|
-
flex: 1;
|
|
1218
|
-
height: 50px;
|
|
1219
|
-
border-radius: 8px;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
.stats-section {
|
|
1223
|
-
display: flex;
|
|
1224
|
-
gap: 24px;
|
|
1225
|
-
margin-bottom: 40px;
|
|
1226
|
-
padding: 30px 0;
|
|
1227
|
-
border-top: 1px solid ${borderColor};
|
|
1228
|
-
border-bottom: 1px solid ${borderColor};
|
|
1229
|
-
}
|
|
1230
|
-
.stat-card {
|
|
1231
|
-
flex: 1;
|
|
1232
|
-
display: flex;
|
|
1233
|
-
flex-direction: column;
|
|
1234
|
-
align-items: center;
|
|
1235
|
-
}
|
|
1236
|
-
.stat-divider {
|
|
1237
|
-
padding-left: 24px;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
.sk-stat-num {
|
|
1241
|
-
height: 48px;
|
|
1242
|
-
width: 120px;
|
|
1243
|
-
margin-bottom: 8px;
|
|
1244
|
-
}
|
|
1245
|
-
.sk-stat-label {
|
|
1246
|
-
height: 18px;
|
|
1247
|
-
width: 80px;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
.table-header {
|
|
1251
|
-
display: flex;
|
|
1252
|
-
gap: 16px;
|
|
1253
|
-
margin-bottom: 16px;
|
|
1254
|
-
}
|
|
1255
|
-
.sk-th {
|
|
1256
|
-
height: 16px;
|
|
1257
|
-
}
|
|
1258
|
-
.table-row {
|
|
1259
|
-
display: flex;
|
|
1260
|
-
align-items: center;
|
|
1261
|
-
gap: 16px;
|
|
1262
|
-
padding: 16px 0;
|
|
1263
|
-
border-bottom: 1px solid ${borderColor};
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
.col-user {
|
|
1267
|
-
flex: 2;
|
|
1268
|
-
}
|
|
1269
|
-
.col-status {
|
|
1270
|
-
flex: 1;
|
|
1271
|
-
}
|
|
1272
|
-
.col-reward {
|
|
1273
|
-
flex: 2;
|
|
1274
|
-
}
|
|
1275
|
-
.col-date {
|
|
1276
|
-
flex: 1;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
.sk-badge {
|
|
1280
|
-
height: 28px;
|
|
1281
|
-
width: 90px;
|
|
1282
|
-
border-radius: 14px;
|
|
1283
|
-
}
|
|
1284
|
-
.sk-reward-block {
|
|
1285
|
-
height: 36px;
|
|
1286
|
-
width: 100%;
|
|
1287
|
-
border-radius: 6px;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
.pagination {
|
|
1291
|
-
display: flex;
|
|
1292
|
-
justify-content: flex-end;
|
|
1293
|
-
gap: 8px;
|
|
1294
|
-
margin-top: 24px;
|
|
1295
|
-
}
|
|
1296
|
-
.sk-btn-page {
|
|
1297
|
-
height: 36px;
|
|
1298
|
-
width: 64px;
|
|
1299
|
-
border-radius: 6px;
|
|
1300
|
-
margin-bottom: 0;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
@media (max-width: 768px) {
|
|
1304
|
-
body {
|
|
1305
|
-
padding: 20px;
|
|
1306
|
-
}
|
|
1307
|
-
.widget-container {
|
|
1308
|
-
padding: 24px;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
.hero-section {
|
|
1312
|
-
flex-direction: column-reverse;
|
|
1313
|
-
gap: 24px;
|
|
1314
|
-
}
|
|
1315
|
-
.hero-image {
|
|
1316
|
-
height: 220px;
|
|
1317
|
-
width: 100%;
|
|
1318
|
-
}
|
|
1319
|
-
.sk-title-lg {
|
|
1320
|
-
width: 80%;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
.col-date {
|
|
1324
|
-
display: none;
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
@media (max-width: 480px) {
|
|
1329
|
-
body {
|
|
1330
|
-
padding: 10px;
|
|
1331
|
-
}
|
|
1332
|
-
.widget-container {
|
|
1333
|
-
padding: 16px;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
.sk-stat-num {
|
|
1337
|
-
width: 80px;
|
|
1338
|
-
height: 40px;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
.col-reward {
|
|
1342
|
-
display: none;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
.col-user {
|
|
1346
|
-
flex: 3;
|
|
1347
|
-
}
|
|
1348
|
-
.col-status {
|
|
1349
|
-
flex: 2;
|
|
1350
|
-
display: flex;
|
|
1351
|
-
justify-content: flex-end;
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
</style>
|
|
1355
|
-
|
|
1356
|
-
<div class="widget-container">
|
|
1357
|
-
<div class="hero-section">
|
|
1358
|
-
<div class="hero-content">
|
|
1359
|
-
<div class="skeleton sk-title-lg"></div>
|
|
1360
|
-
<div class="skeleton sk-text"></div>
|
|
1361
|
-
<div class="skeleton sk-text sk-text-short"></div>
|
|
1362
|
-
</div>
|
|
1363
|
-
<div class="skeleton hero-image"></div>
|
|
1364
|
-
</div>
|
|
1365
|
-
|
|
1366
|
-
<div class="share-section">
|
|
1367
|
-
<div class="skeleton sk-label"></div>
|
|
1368
|
-
<div class="skeleton sk-input"></div>
|
|
1369
|
-
<div class="social-buttons">
|
|
1370
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1371
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1372
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1373
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1374
|
-
</div>
|
|
1375
|
-
</div>
|
|
1376
|
-
|
|
1377
|
-
<div
|
|
1378
|
-
class="skeleton sk-title-md"
|
|
1379
|
-
style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"
|
|
1380
|
-
></div>
|
|
1381
|
-
<div
|
|
1382
|
-
class="skeleton sk-text"
|
|
1383
|
-
style="width: 60%; margin-left: auto; margin-right: auto"
|
|
1384
|
-
></div>
|
|
1385
|
-
|
|
1386
|
-
<div class="stats-section">
|
|
1387
|
-
<div class="stat-card">
|
|
1388
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1389
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1390
|
-
</div>
|
|
1391
|
-
<div class="stat-card stat-divider">
|
|
1392
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1393
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1394
|
-
</div>
|
|
1395
|
-
</div>
|
|
1396
|
-
|
|
1397
|
-
<div class="skeleton sk-title-md"></div>
|
|
1398
|
-
|
|
1399
|
-
<div class="table-header">
|
|
1400
|
-
<div class="skeleton sk-th col-user"></div>
|
|
1401
|
-
<div class="skeleton sk-th col-status"></div>
|
|
1402
|
-
<div class="skeleton sk-th col-reward"></div>
|
|
1403
|
-
<div class="skeleton sk-th col-date"></div>
|
|
1404
|
-
</div>
|
|
1405
|
-
|
|
1406
|
-
<div class="table-row">
|
|
1407
|
-
<div class="col-user">
|
|
1408
|
-
<div class="skeleton sk-text" style="width: 70%; margin: 0"></div>
|
|
1409
|
-
</div>
|
|
1410
|
-
<div class="col-status">
|
|
1411
|
-
<div class="skeleton sk-badge" style="margin: 0"></div>
|
|
1412
|
-
</div>
|
|
1413
|
-
<div class="col-reward">
|
|
1414
|
-
<div class="skeleton sk-reward-block" style="margin: 0"></div>
|
|
1415
|
-
</div>
|
|
1416
|
-
<div class="col-date">
|
|
1417
|
-
<div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
|
|
1418
|
-
</div>
|
|
1419
|
-
</div>
|
|
1420
|
-
<div class="table-row">
|
|
1421
|
-
<div class="col-user">
|
|
1422
|
-
<div class="skeleton sk-text" style="width: 60%; margin: 0"></div>
|
|
1423
|
-
</div>
|
|
1424
|
-
<div class="col-status">
|
|
1425
|
-
<div class="skeleton sk-badge" style="margin: 0"></div>
|
|
1426
|
-
</div>
|
|
1427
|
-
<div class="col-reward">
|
|
1428
|
-
<div class="skeleton sk-reward-block" style="margin: 0"></div>
|
|
1429
|
-
</div>
|
|
1430
|
-
<div class="col-date">
|
|
1431
|
-
<div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
|
|
1432
|
-
</div>
|
|
1433
|
-
</div>
|
|
1434
|
-
<div class="table-row">
|
|
1435
|
-
<div class="col-user">
|
|
1436
|
-
<div class="skeleton sk-text" style="width: 75%; margin: 0"></div>
|
|
1437
|
-
</div>
|
|
1438
|
-
<div class="col-status">
|
|
1439
|
-
<div class="skeleton sk-badge" style="margin: 0"></div>
|
|
1440
|
-
</div>
|
|
1441
|
-
<div class="col-reward">
|
|
1442
|
-
<div class="skeleton sk-reward-block" style="margin: 0"></div>
|
|
1443
|
-
</div>
|
|
1444
|
-
<div class="col-date">
|
|
1445
|
-
<div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
|
|
1446
|
-
</div>
|
|
1447
|
-
</div>
|
|
1448
|
-
|
|
1449
|
-
<div class="pagination">
|
|
1450
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1451
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1452
|
-
</div>
|
|
1453
|
-
</div>
|
|
1454
|
-
`;
|
|
1455
|
-
};
|
|
1456
1111
|
const _log$7 = browserExports.debug("squatch-js:EMBEDwidget");
|
|
1457
1112
|
class EmbedWidget extends Widget {
|
|
1458
1113
|
constructor(params, container) {
|
|
@@ -1464,60 +1119,37 @@ class EmbedWidget extends Widget {
|
|
|
1464
1119
|
}
|
|
1465
1120
|
}
|
|
1466
1121
|
async load() {
|
|
1467
|
-
var _a2, _b, _c, _d, _e, _f, _g
|
|
1122
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
1468
1123
|
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1469
1124
|
const initialHeight = brandingConfig == null ? void 0 : brandingConfig.loadingHeight;
|
|
1470
|
-
const
|
|
1471
|
-
const skeletonShimmerColor = (_f = (_e = brandingConfig == null ? void 0 : brandingConfig.color) == null ? void 0 : _e.loadingSkeleton) == null ? void 0 : _f.animationBackground;
|
|
1472
|
-
const borderColor = (_g = brandingConfig == null ? void 0 : brandingConfig.border) == null ? void 0 : _g.borderColor;
|
|
1473
|
-
const sizes = (_h = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _h.embeddedWidgets;
|
|
1125
|
+
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.embeddedWidgets;
|
|
1474
1126
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "";
|
|
1475
1127
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "";
|
|
1476
|
-
console.log({
|
|
1477
|
-
brandingConfig,
|
|
1478
|
-
initialHeight,
|
|
1479
|
-
widgetConfig: this.context.widgetConfig
|
|
1480
|
-
});
|
|
1481
|
-
const skeletonHTML = getSkeleton({
|
|
1482
|
-
height: initialHeight,
|
|
1483
|
-
skeletonBackgroundColor,
|
|
1484
|
-
skeletonShimmerColor,
|
|
1485
|
-
borderColor
|
|
1486
|
-
});
|
|
1487
|
-
const skeletonContainer = document.createElement("div");
|
|
1488
|
-
skeletonContainer.innerHTML = skeletonHTML;
|
|
1489
1128
|
const frame = this._createFrame({
|
|
1490
1129
|
minWidth,
|
|
1491
1130
|
maxWidth,
|
|
1492
1131
|
initialHeight
|
|
1493
1132
|
});
|
|
1494
1133
|
const element = this._findElement();
|
|
1495
|
-
|
|
1496
|
-
frame.style.display = "none";
|
|
1497
|
-
const injectContents = (target) => {
|
|
1498
|
-
target.appendChild(skeletonContainer);
|
|
1499
|
-
target.appendChild(frame);
|
|
1500
|
-
};
|
|
1501
|
-
if ((_i = this.context) == null ? void 0 : _i.container) {
|
|
1134
|
+
if ((_d = this.context) == null ? void 0 : _d.container) {
|
|
1502
1135
|
element.style.visibility = "hidden";
|
|
1503
1136
|
element.style.height = "0";
|
|
1504
1137
|
element.style["overflow-y"] = "hidden";
|
|
1505
1138
|
}
|
|
1506
1139
|
if (this.container) {
|
|
1507
1140
|
if (element.shadowRoot) {
|
|
1508
|
-
if (((
|
|
1141
|
+
if (((_e = element.shadowRoot.lastChild) == null ? void 0 : _e.nodeName) === "IFRAME") {
|
|
1509
1142
|
element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
|
|
1510
1143
|
} else {
|
|
1511
|
-
|
|
1144
|
+
element.shadowRoot.appendChild(frame);
|
|
1512
1145
|
}
|
|
1513
1146
|
} else if (element.firstChild) {
|
|
1514
|
-
element.
|
|
1515
|
-
injectContents(element);
|
|
1147
|
+
element.replaceChild(frame, element.firstChild);
|
|
1516
1148
|
} else {
|
|
1517
|
-
|
|
1149
|
+
element.appendChild(frame);
|
|
1518
1150
|
}
|
|
1519
1151
|
} else if (!element.firstChild || element.firstChild.nodeName === "#text") {
|
|
1520
|
-
|
|
1152
|
+
element.appendChild(frame);
|
|
1521
1153
|
}
|
|
1522
1154
|
const { contentWindow } = frame;
|
|
1523
1155
|
if (!contentWindow) {
|
|
@@ -1525,16 +1157,15 @@ class EmbedWidget extends Widget {
|
|
|
1525
1157
|
}
|
|
1526
1158
|
const frameDoc = contentWindow.document;
|
|
1527
1159
|
frameDoc.open();
|
|
1528
|
-
console.log({ content: this.content, context: this.context, this: this });
|
|
1529
1160
|
const domain = this.widgetApi.domain;
|
|
1530
1161
|
frameDoc.write(`
|
|
1531
|
-
${((
|
|
1162
|
+
${((_f = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _f.brandFont) ? `
|
|
1532
1163
|
<link rel="preconnect" href="https://fast${domain === "https://staging.referralsaasquatch.com" && "-staging"}.ssqt.io">
|
|
1533
1164
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
1534
1165
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
1535
1166
|
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1536
|
-
(
|
|
1537
|
-
)}" as="style">`}
|
|
1167
|
+
(_g = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _g.brandFont
|
|
1168
|
+
)}" as="style">` : ""}
|
|
1538
1169
|
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1539
1170
|
<style data-styles>
|
|
1540
1171
|
html { visibility:hidden;}
|
|
@@ -1544,10 +1175,6 @@ class EmbedWidget extends Widget {
|
|
|
1544
1175
|
`);
|
|
1545
1176
|
frameDoc.close();
|
|
1546
1177
|
domready(frameDoc, async () => {
|
|
1547
|
-
if (skeletonContainer && skeletonContainer.parentNode) {
|
|
1548
|
-
skeletonContainer.parentNode.removeChild(skeletonContainer);
|
|
1549
|
-
}
|
|
1550
|
-
frame.style.display = "block";
|
|
1551
1178
|
const _sqh = contentWindow.squatch || contentWindow.widgetIdent;
|
|
1552
1179
|
frame.height = initialHeight || frameDoc.body.scrollHeight;
|
|
1553
1180
|
console.log({ height: frameDoc.body.scrollHeight });
|
|
@@ -2232,6 +1859,264 @@ function _getAutoConfig() {
|
|
|
2232
1859
|
}
|
|
2233
1860
|
};
|
|
2234
1861
|
}
|
|
1862
|
+
const getSkeleton = ({
|
|
1863
|
+
type = "verified-access",
|
|
1864
|
+
height = "500px",
|
|
1865
|
+
skeletonBackgroundColor = "#e0e0e0",
|
|
1866
|
+
skeletonShimmerColor = "#f5f5f5"
|
|
1867
|
+
}) => {
|
|
1868
|
+
const referrerHTML = `
|
|
1869
|
+
<div class="hero-section">
|
|
1870
|
+
<div class="hero-content">
|
|
1871
|
+
<div class="skeleton sk-title-lg"></div>
|
|
1872
|
+
<div class="skeleton sk-text"></div>
|
|
1873
|
+
<div class="skeleton sk-text sk-text-short"></div>
|
|
1874
|
+
</div>
|
|
1875
|
+
<div class="skeleton hero-image"></div>
|
|
1876
|
+
</div>
|
|
1877
|
+
|
|
1878
|
+
<div class="share-section">
|
|
1879
|
+
<div class="skeleton sk-label"></div>
|
|
1880
|
+
<div class="skeleton sk-input"></div>
|
|
1881
|
+
<div class="social-buttons">
|
|
1882
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1883
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1884
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1885
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1886
|
+
</div>
|
|
1887
|
+
</div>
|
|
1888
|
+
|
|
1889
|
+
<div class="skeleton sk-title-md" style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"></div>
|
|
1890
|
+
<div class="skeleton sk-text" style="width: 60%; margin-left: auto; margin-right: auto"></div>
|
|
1891
|
+
|
|
1892
|
+
<div class="stats-section">
|
|
1893
|
+
<div class="stat-card">
|
|
1894
|
+
<div class="skeleton sk-stat-num"></div>
|
|
1895
|
+
<div class="skeleton sk-stat-label"></div>
|
|
1896
|
+
</div>
|
|
1897
|
+
<div class="stat-card stat-divider">
|
|
1898
|
+
<div class="skeleton sk-stat-num"></div>
|
|
1899
|
+
<div class="skeleton sk-stat-label"></div>
|
|
1900
|
+
</div>
|
|
1901
|
+
</div>
|
|
1902
|
+
|
|
1903
|
+
<div class="skeleton sk-title-md"></div>
|
|
1904
|
+
|
|
1905
|
+
<div class="table-header">
|
|
1906
|
+
<div class="skeleton sk-th col-user"></div>
|
|
1907
|
+
<div class="skeleton sk-th col-status"></div>
|
|
1908
|
+
<div class="skeleton sk-th col-reward"></div>
|
|
1909
|
+
<div class="skeleton sk-th col-date"></div>
|
|
1910
|
+
</div>
|
|
1911
|
+
|
|
1912
|
+
<div class="table-row">
|
|
1913
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 70%; margin: 0"></div></div>
|
|
1914
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1915
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1916
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1917
|
+
</div>
|
|
1918
|
+
|
|
1919
|
+
<div class="table-row">
|
|
1920
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 60%; margin: 0"></div></div>
|
|
1921
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1922
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1923
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1924
|
+
</div>
|
|
1925
|
+
|
|
1926
|
+
<div class="table-row">
|
|
1927
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 75%; margin: 0"></div></div>
|
|
1928
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1929
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1930
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1931
|
+
</div>
|
|
1932
|
+
|
|
1933
|
+
<div class="pagination">
|
|
1934
|
+
<div class="skeleton sk-btn-page"></div>
|
|
1935
|
+
<div class="skeleton sk-btn-page"></div>
|
|
1936
|
+
</div>
|
|
1937
|
+
`;
|
|
1938
|
+
const instantAccessHTML = `
|
|
1939
|
+
<div class="hero-section instant-access-layout">
|
|
1940
|
+
<div class="skeleton hero-image ia-image"></div>
|
|
1941
|
+
|
|
1942
|
+
<div class="hero-content ia-content">
|
|
1943
|
+
<div class="skeleton sk-title-lg ia-center"></div>
|
|
1944
|
+
<div class="skeleton sk-text ia-center"></div>
|
|
1945
|
+
|
|
1946
|
+
<div class="skeleton sk-btn-action"></div>
|
|
1947
|
+
|
|
1948
|
+
<div class="skeleton sk-label"></div>
|
|
1949
|
+
<div class="input-group">
|
|
1950
|
+
<div class="skeleton sk-input"></div>
|
|
1951
|
+
<div class="skeleton sk-btn-copy"></div>
|
|
1952
|
+
</div>
|
|
1953
|
+
|
|
1954
|
+
<div class="skeleton sk-text-short ia-center" style="margin-top: 20px; width: 30%"></div>
|
|
1955
|
+
<div class="skeleton sk-text-short ia-center" style="width: 20%"></div>
|
|
1956
|
+
</div>
|
|
1957
|
+
</div>
|
|
1958
|
+
`;
|
|
1959
|
+
return `
|
|
1960
|
+
<style>
|
|
1961
|
+
* {
|
|
1962
|
+
box-sizing: border-box;
|
|
1963
|
+
padding: 0;
|
|
1964
|
+
margin: 0;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
.widget-container {
|
|
1968
|
+
background: white;
|
|
1969
|
+
width: 100%;
|
|
1970
|
+
padding: 40px;
|
|
1971
|
+
box-sizing: border-box;
|
|
1972
|
+
overflow: hidden;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
@keyframes shimmer {
|
|
1976
|
+
0% { background-position: -100% 0; }
|
|
1977
|
+
100% { background-position: 100% 0; }
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
.skeleton {
|
|
1981
|
+
background: ${skeletonBackgroundColor};
|
|
1982
|
+
background: linear-gradient(
|
|
1983
|
+
90deg,
|
|
1984
|
+
${skeletonBackgroundColor} 25%,
|
|
1985
|
+
${skeletonShimmerColor} 50%,
|
|
1986
|
+
${skeletonBackgroundColor} 75%
|
|
1987
|
+
);
|
|
1988
|
+
background-size: 200% 100%;
|
|
1989
|
+
animation: shimmer 1.5s infinite linear;
|
|
1990
|
+
border-radius: 6px;
|
|
1991
|
+
margin-bottom: 12px;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
/* Typography Skeletons */
|
|
1995
|
+
.sk-title-lg { height: 36px; width: 80%; margin-bottom: 16px; }
|
|
1996
|
+
.sk-title-md { height: 28px; width: 30%; margin-bottom: 20px; margin-top: 40px; }
|
|
1997
|
+
.sk-text { height: 16px; width: 90%; margin-bottom: 8px; }
|
|
1998
|
+
.sk-text-short { width: 40%; }
|
|
1999
|
+
.sk-label { height: 14px; width: 25%; margin-bottom: 10px; }
|
|
2000
|
+
|
|
2001
|
+
/* Layouts */
|
|
2002
|
+
.hero-section {
|
|
2003
|
+
display: flex;
|
|
2004
|
+
gap: 40px;
|
|
2005
|
+
margin-bottom: 40px;
|
|
2006
|
+
padding-bottom: 40px;
|
|
2007
|
+
flex-direction: row;
|
|
2008
|
+
height: 100%;
|
|
2009
|
+
/* Removed border-bottom */
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
.hero-content {
|
|
2013
|
+
flex: 1;
|
|
2014
|
+
display: flex;
|
|
2015
|
+
flex-direction: column;
|
|
2016
|
+
justify-content: center;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
.hero-image {
|
|
2020
|
+
flex: 1;
|
|
2021
|
+
height: 300px;
|
|
2022
|
+
border-radius: 12px;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
/* -- Specific Instant Access Overrides -- */
|
|
2026
|
+
.instant-access-layout {
|
|
2027
|
+
margin-bottom: 0;
|
|
2028
|
+
padding-bottom: 0;
|
|
2029
|
+
align-items: center;
|
|
2030
|
+
}
|
|
2031
|
+
.ia-image {
|
|
2032
|
+
height: 400px;
|
|
2033
|
+
}
|
|
2034
|
+
.ia-center {
|
|
2035
|
+
margin-left: auto;
|
|
2036
|
+
margin-right: auto;
|
|
2037
|
+
}
|
|
2038
|
+
.ia-content {
|
|
2039
|
+
align-items: center;
|
|
2040
|
+
text-align: center;
|
|
2041
|
+
}
|
|
2042
|
+
.sk-btn-action {
|
|
2043
|
+
height: 45px;
|
|
2044
|
+
width: 140px;
|
|
2045
|
+
border-radius: 6px;
|
|
2046
|
+
margin: 24px auto;
|
|
2047
|
+
}
|
|
2048
|
+
.input-group {
|
|
2049
|
+
display: flex;
|
|
2050
|
+
gap: 10px;
|
|
2051
|
+
width: 100%;
|
|
2052
|
+
max-width: 400px;
|
|
2053
|
+
}
|
|
2054
|
+
.sk-btn-copy {
|
|
2055
|
+
height: 50px;
|
|
2056
|
+
width: 120px;
|
|
2057
|
+
border-radius: 8px;
|
|
2058
|
+
}
|
|
2059
|
+
/* ------------------------------------- */
|
|
2060
|
+
|
|
2061
|
+
.share-section { margin-bottom: 40px; }
|
|
2062
|
+
.sk-input { height: 50px; width: 100%; border-radius: 8px; margin-bottom: 16px; }
|
|
2063
|
+
|
|
2064
|
+
.social-buttons { display: flex; gap: 12px; }
|
|
2065
|
+
.sk-btn-social { flex: 1; height: 50px; border-radius: 8px; }
|
|
2066
|
+
|
|
2067
|
+
.stats-section {
|
|
2068
|
+
display: flex;
|
|
2069
|
+
gap: 24px;
|
|
2070
|
+
margin-bottom: 40px;
|
|
2071
|
+
padding: 30px 0;
|
|
2072
|
+
/* Removed border-top and border-bottom */
|
|
2073
|
+
}
|
|
2074
|
+
.stat-card { flex: 1; display: flex; flex-direction: column; align-items: center; }
|
|
2075
|
+
.stat-divider { padding-left: 24px; }
|
|
2076
|
+
.sk-stat-num { height: 48px; width: 120px; margin-bottom: 8px; }
|
|
2077
|
+
.sk-stat-label { height: 18px; width: 80px; }
|
|
2078
|
+
|
|
2079
|
+
/* Table Styles */
|
|
2080
|
+
.table-header { display: flex; gap: 16px; margin-bottom: 16px; }
|
|
2081
|
+
.sk-th { height: 16px; }
|
|
2082
|
+
.table-row {
|
|
2083
|
+
display: flex;
|
|
2084
|
+
align-items: center;
|
|
2085
|
+
gap: 16px;
|
|
2086
|
+
padding: 16px 0;
|
|
2087
|
+
/* Removed border-bottom */
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
.col-user { flex: 2; }
|
|
2091
|
+
.col-status { flex: 1; }
|
|
2092
|
+
.col-reward { flex: 2; }
|
|
2093
|
+
.col-date { flex: 1; }
|
|
2094
|
+
|
|
2095
|
+
.sk-badge { height: 28px; width: 90px; border-radius: 14px; }
|
|
2096
|
+
.sk-reward-block { height: 36px; width: 100%; border-radius: 6px; }
|
|
2097
|
+
|
|
2098
|
+
.pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
|
|
2099
|
+
.sk-btn-page { height: 36px; width: 64px; border-radius: 6px; margin-bottom: 0; }
|
|
2100
|
+
|
|
2101
|
+
@media (max-width: 768px) {
|
|
2102
|
+
body { padding: 20px; }
|
|
2103
|
+
.widget-container { padding: 24px; }
|
|
2104
|
+
|
|
2105
|
+
.hero-section { flex-direction: column-reverse; gap: 24px; }
|
|
2106
|
+
.instant-access-layout { flex-direction: column; }
|
|
2107
|
+
|
|
2108
|
+
.hero-image { height: 220px; width: 100%; }
|
|
2109
|
+
.sk-title-lg { width: 100%; }
|
|
2110
|
+
|
|
2111
|
+
.col-date { display: none; }
|
|
2112
|
+
}
|
|
2113
|
+
</style>
|
|
2114
|
+
|
|
2115
|
+
<div class="widget-container">
|
|
2116
|
+
${type === "verified-access" ? referrerHTML : instantAccessHTML}
|
|
2117
|
+
</div>
|
|
2118
|
+
`;
|
|
2119
|
+
};
|
|
2235
2120
|
const _log$2 = browserExports.debug("squatch-js:decodeUserJwt");
|
|
2236
2121
|
function decodeUserJwt(tokenStr) {
|
|
2237
2122
|
var _a2;
|
|
@@ -2370,6 +2255,12 @@ class DeclarativeWidget extends HTMLElement {
|
|
|
2370
2255
|
domain: (config == null ? void 0 : config.domain) || ((_b = this.config) == null ? void 0 : _b.domain) || DEFAULT_DOMAIN
|
|
2371
2256
|
});
|
|
2372
2257
|
}
|
|
2258
|
+
getWidgetType(widgetType) {
|
|
2259
|
+
if (widgetType && (widgetType.includes("websiteReferralWidget") || widgetType.includes("friendWidget"))) {
|
|
2260
|
+
return "instant-access";
|
|
2261
|
+
}
|
|
2262
|
+
return "verified-access";
|
|
2263
|
+
}
|
|
2373
2264
|
async renderPasswordlessVariant() {
|
|
2374
2265
|
this._setupApis();
|
|
2375
2266
|
_log$1("Rendering as an Instant Access widget");
|
|
@@ -2465,12 +2356,26 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2465
2356
|
}
|
|
2466
2357
|
}
|
|
2467
2358
|
async connectedCallback() {
|
|
2468
|
-
var _a2, _b;
|
|
2469
2359
|
this.loaded = true;
|
|
2470
2360
|
this.container = this.getAttribute("container");
|
|
2361
|
+
this.widgetType = this.getAttribute("widget") || void 0;
|
|
2362
|
+
console.log("widget type", this.widgetType);
|
|
2363
|
+
const skeletonWidgetType = this.getWidgetType(this.widgetType);
|
|
2364
|
+
const skeletonHTML = getSkeleton({
|
|
2365
|
+
height: "100%",
|
|
2366
|
+
type: skeletonWidgetType
|
|
2367
|
+
});
|
|
2368
|
+
const skeletonContainer = document.createElement("div");
|
|
2369
|
+
skeletonContainer.id = "loading-skeleton";
|
|
2370
|
+
skeletonContainer.innerHTML = skeletonHTML;
|
|
2371
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2372
|
+
root.innerHTML = "";
|
|
2373
|
+
root.appendChild(skeletonContainer);
|
|
2471
2374
|
await this.renderWidget();
|
|
2472
|
-
const
|
|
2473
|
-
if (
|
|
2375
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2376
|
+
if (loadingElement) {
|
|
2377
|
+
loadingElement.remove();
|
|
2378
|
+
}
|
|
2474
2379
|
if (this.getAttribute("open") !== null) this.open();
|
|
2475
2380
|
}
|
|
2476
2381
|
}
|
|
@@ -2499,7 +2404,23 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2499
2404
|
async connectedCallback() {
|
|
2500
2405
|
this.loaded = true;
|
|
2501
2406
|
this.container = this.getAttribute("container");
|
|
2407
|
+
this.widgetType = this.getAttribute("widget") || void 0;
|
|
2408
|
+
const skeletonWidgetType = this.getWidgetType(this.widgetType);
|
|
2409
|
+
const skeletonHTML = getSkeleton({
|
|
2410
|
+
height: "100%",
|
|
2411
|
+
type: skeletonWidgetType
|
|
2412
|
+
});
|
|
2413
|
+
const skeletonContainer = document.createElement("div");
|
|
2414
|
+
skeletonContainer.id = "loading-skeleton";
|
|
2415
|
+
skeletonContainer.innerHTML = skeletonHTML;
|
|
2416
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2417
|
+
root.innerHTML = "";
|
|
2418
|
+
root.appendChild(skeletonContainer);
|
|
2502
2419
|
await this.renderWidget();
|
|
2420
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2421
|
+
if (loadingElement) {
|
|
2422
|
+
loadingElement.remove();
|
|
2423
|
+
}
|
|
2503
2424
|
if (this.getAttribute("open") !== null) this.open();
|
|
2504
2425
|
}
|
|
2505
2426
|
}
|