@saasquatch/squatch-js 2.8.2-13 → 2.8.2-14
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 +23 -72
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +23 -72
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +23 -72
- 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
|
@@ -2466,49 +2466,22 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2466
2466
|
this.loaded = true;
|
|
2467
2467
|
this.container = this.getAttribute("container");
|
|
2468
2468
|
const skeletonHTML = `
|
|
2469
|
-
<div
|
|
2470
|
-
<h1>
|
|
2469
|
+
<div>
|
|
2470
|
+
<h1>Do I see this text ????</h1>
|
|
2471
2471
|
</div>
|
|
2472
2472
|
`;
|
|
2473
|
-
console.log(
|
|
2474
|
-
"/////////////////////////////////TESTING//////////////////////////////"
|
|
2475
|
-
);
|
|
2476
2473
|
const skeletonContainer = document.createElement("div");
|
|
2477
2474
|
skeletonContainer.id = "loading-skeleton";
|
|
2478
2475
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2479
|
-
skeletonContainer.style.width = "100%";
|
|
2480
2476
|
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
const el = root.getElementById("loading-skeleton");
|
|
2488
|
-
if (el) {
|
|
2489
|
-
el.remove();
|
|
2490
|
-
console.log("Skeleton removed successfully via event");
|
|
2491
|
-
}
|
|
2492
|
-
};
|
|
2493
|
-
this.addEventListener("sq:load", removeSkeleton);
|
|
2494
|
-
try {
|
|
2495
|
-
await this.renderWidget();
|
|
2496
|
-
console.log("Widget rendered (initialization complete)");
|
|
2497
|
-
setTimeout(() => {
|
|
2498
|
-
const el = root.getElementById("loading-skeleton");
|
|
2499
|
-
if (el) {
|
|
2500
|
-
console.warn("Removing skeleton via timeout (load event missing)");
|
|
2501
|
-
el.remove();
|
|
2502
|
-
}
|
|
2503
|
-
}, 5e3);
|
|
2504
|
-
} catch (err) {
|
|
2505
|
-
console.error("Critical Error in renderWidget:", err);
|
|
2506
|
-
removeSkeleton();
|
|
2477
|
+
root.innerHTML = "";
|
|
2478
|
+
root.appendChild(skeletonContainer);
|
|
2479
|
+
await this.renderWidget();
|
|
2480
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2481
|
+
if (loadingElement) {
|
|
2482
|
+
loadingElement.remove();
|
|
2507
2483
|
}
|
|
2508
2484
|
if (this.getAttribute("open") !== null) this.open();
|
|
2509
|
-
console.log(
|
|
2510
|
-
"/////////////////////////////////DO YOU SEE THIS CONSOLE LOG????//////////////////////////////"
|
|
2511
|
-
);
|
|
2512
2485
|
}
|
|
2513
2486
|
}
|
|
2514
2487
|
class DeclarativePopupWidget extends DeclarativeWidget {
|
|
@@ -2534,52 +2507,30 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2534
2507
|
}
|
|
2535
2508
|
}
|
|
2536
2509
|
async connectedCallback() {
|
|
2510
|
+
var _a2;
|
|
2537
2511
|
this.loaded = true;
|
|
2538
2512
|
this.container = this.getAttribute("container");
|
|
2539
2513
|
const skeletonHTML = `
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
"/////////////////////////////////TESTING//////////////////////////////"
|
|
2546
|
-
);
|
|
2514
|
+
<div>
|
|
2515
|
+
<h1>Dynamic Content</h1>
|
|
2516
|
+
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2517
|
+
</div>
|
|
2518
|
+
`;
|
|
2547
2519
|
const skeletonContainer = document.createElement("div");
|
|
2548
2520
|
skeletonContainer.id = "loading-skeleton";
|
|
2549
2521
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
if (root.firstChild) {
|
|
2553
|
-
root.insertBefore(skeletonContainer, root.firstChild);
|
|
2554
|
-
} else {
|
|
2555
|
-
root.appendChild(skeletonContainer);
|
|
2522
|
+
if (!this.shadowRoot) {
|
|
2523
|
+
this.attachShadow({ mode: "open" });
|
|
2556
2524
|
}
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
this.addEventListener("sq:load", removeSkeleton);
|
|
2565
|
-
try {
|
|
2566
|
-
await this.renderWidget();
|
|
2567
|
-
console.log("Widget rendered (initialization complete)");
|
|
2568
|
-
setTimeout(() => {
|
|
2569
|
-
const el = root.getElementById("loading-skeleton");
|
|
2570
|
-
if (el) {
|
|
2571
|
-
console.warn("Removing skeleton via timeout (load event missing)");
|
|
2572
|
-
el.remove();
|
|
2573
|
-
}
|
|
2574
|
-
}, 5e3);
|
|
2575
|
-
} catch (err) {
|
|
2576
|
-
console.error("Critical Error in renderWidget:", err);
|
|
2577
|
-
removeSkeleton();
|
|
2525
|
+
if (this.shadowRoot) {
|
|
2526
|
+
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2527
|
+
}
|
|
2528
|
+
await this.renderWidget();
|
|
2529
|
+
const loadingElement = (_a2 = this.shadowRoot) == null ? void 0 : _a2.getElementById("loading-skeleton");
|
|
2530
|
+
if (loadingElement) {
|
|
2531
|
+
loadingElement.remove();
|
|
2578
2532
|
}
|
|
2579
2533
|
if (this.getAttribute("open") !== null) this.open();
|
|
2580
|
-
console.log(
|
|
2581
|
-
"/////////////////////////////////DO YOU SEE THIS CONSOLE LOG????//////////////////////////////"
|
|
2582
|
-
);
|
|
2583
2534
|
}
|
|
2584
2535
|
}
|
|
2585
2536
|
class SquatchEmbed extends DeclarativeEmbedWidget {
|