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