@saasquatch/squatch-js 2.8.2-12 → 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 -53
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +23 -53
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +23 -53
- 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
|
@@ -2463,27 +2463,21 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
2465
|
async connectedCallback() {
|
|
2466
|
-
var _a2;
|
|
2467
2466
|
this.loaded = true;
|
|
2468
2467
|
this.container = this.getAttribute("container");
|
|
2469
2468
|
const skeletonHTML = `
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
</div>
|
|
2475
|
-
`;
|
|
2469
|
+
<div>
|
|
2470
|
+
<h1>Do I see this text ????</h1>
|
|
2471
|
+
</div>
|
|
2472
|
+
`;
|
|
2476
2473
|
const skeletonContainer = document.createElement("div");
|
|
2477
2474
|
skeletonContainer.id = "loading-skeleton";
|
|
2478
2475
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
if (this.shadowRoot) {
|
|
2483
|
-
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2484
|
-
}
|
|
2476
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2477
|
+
root.innerHTML = "";
|
|
2478
|
+
root.appendChild(skeletonContainer);
|
|
2485
2479
|
await this.renderWidget();
|
|
2486
|
-
const loadingElement =
|
|
2480
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2487
2481
|
if (loadingElement) {
|
|
2488
2482
|
loadingElement.remove();
|
|
2489
2483
|
}
|
|
@@ -2513,54 +2507,30 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2513
2507
|
}
|
|
2514
2508
|
}
|
|
2515
2509
|
async connectedCallback() {
|
|
2510
|
+
var _a2;
|
|
2516
2511
|
this.loaded = true;
|
|
2517
2512
|
this.container = this.getAttribute("container");
|
|
2518
2513
|
const skeletonHTML = `
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
`;
|
|
2525
|
-
console.log(
|
|
2526
|
-
"/////////////////////////////////TESTING//////////////////////////////"
|
|
2527
|
-
);
|
|
2514
|
+
<div>
|
|
2515
|
+
<h1>Dynamic Content</h1>
|
|
2516
|
+
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2517
|
+
</div>
|
|
2518
|
+
`;
|
|
2528
2519
|
const skeletonContainer = document.createElement("div");
|
|
2529
2520
|
skeletonContainer.id = "loading-skeleton";
|
|
2530
2521
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
if (root.firstChild) {
|
|
2534
|
-
root.insertBefore(skeletonContainer, root.firstChild);
|
|
2535
|
-
} else {
|
|
2536
|
-
root.appendChild(skeletonContainer);
|
|
2522
|
+
if (!this.shadowRoot) {
|
|
2523
|
+
this.attachShadow({ mode: "open" });
|
|
2537
2524
|
}
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
this.addEventListener("sq:load", removeSkeleton);
|
|
2546
|
-
try {
|
|
2547
|
-
await this.renderWidget();
|
|
2548
|
-
console.log("Widget rendered (initialization complete)");
|
|
2549
|
-
setTimeout(() => {
|
|
2550
|
-
const el = root.getElementById("loading-skeleton");
|
|
2551
|
-
if (el) {
|
|
2552
|
-
console.warn("Removing skeleton via timeout (load event missing)");
|
|
2553
|
-
el.remove();
|
|
2554
|
-
}
|
|
2555
|
-
}, 5e3);
|
|
2556
|
-
} catch (err) {
|
|
2557
|
-
console.error("Critical Error in renderWidget:", err);
|
|
2558
|
-
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();
|
|
2559
2532
|
}
|
|
2560
2533
|
if (this.getAttribute("open") !== null) this.open();
|
|
2561
|
-
console.log(
|
|
2562
|
-
"/////////////////////////////////DO YOU SEE THIS CONSOLE LOG????//////////////////////////////"
|
|
2563
|
-
);
|
|
2564
2534
|
}
|
|
2565
2535
|
}
|
|
2566
2536
|
class SquatchEmbed extends DeclarativeEmbedWidget {
|