@saasquatch/squatch-js 2.8.2-7 → 2.8.2-9
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 +21 -25
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +21 -25
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +21 -25
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/package.json +1 -1
package/dist/squatch.cjs.js
CHANGED
|
@@ -2464,31 +2464,6 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2464
2464
|
break;
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
// async connectedCallback() {
|
|
2468
|
-
// this.loaded = true;
|
|
2469
|
-
// this.container = this.getAttribute("container");
|
|
2470
|
-
// // Dynamically assign arbitrary HTML content before rendering the widget
|
|
2471
|
-
// const dynamicContent = `
|
|
2472
|
-
// <div>
|
|
2473
|
-
// <h1>Dynamic Content</h1>
|
|
2474
|
-
// <p>This content was dynamically added to the widget before it loaded.</p>
|
|
2475
|
-
// </div>
|
|
2476
|
-
// `;
|
|
2477
|
-
// if (this.container) {
|
|
2478
|
-
// const containerElement = document.querySelector(this.container);
|
|
2479
|
-
// if (containerElement) {
|
|
2480
|
-
// containerElement.innerHTML = dynamicContent;
|
|
2481
|
-
// }
|
|
2482
|
-
// }
|
|
2483
|
-
// // Render the widget after setting the dynamic content
|
|
2484
|
-
// await this.renderWidget();
|
|
2485
|
-
// const slot = (
|
|
2486
|
-
// this.shadowRoot && Array.from(this.shadowRoot.children)
|
|
2487
|
-
// )?.find((c) => c.tagName === "SLOT") as Node;
|
|
2488
|
-
// if (slot) this.shadowRoot?.removeChild(slot);
|
|
2489
|
-
// if (this.getAttribute("open") !== null) this.open();
|
|
2490
|
-
// }
|
|
2491
|
-
// }
|
|
2492
2467
|
async connectedCallback() {
|
|
2493
2468
|
var _a2;
|
|
2494
2469
|
this.loaded = true;
|
|
@@ -2497,6 +2472,7 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2497
2472
|
<div>
|
|
2498
2473
|
<h1>Dynamic Content</h1>
|
|
2499
2474
|
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2475
|
+
<p>This content comes from the embeded widget class</p>
|
|
2500
2476
|
</div>
|
|
2501
2477
|
`;
|
|
2502
2478
|
const skeletonContainer = document.createElement("div");
|
|
@@ -2541,7 +2517,27 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2541
2517
|
async connectedCallback() {
|
|
2542
2518
|
this.loaded = true;
|
|
2543
2519
|
this.container = this.getAttribute("container");
|
|
2520
|
+
const skeletonHTML = `
|
|
2521
|
+
<div>
|
|
2522
|
+
<h1>Dynamic Content</h1>
|
|
2523
|
+
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2524
|
+
<p>This content comes from the embedded widget class</p>
|
|
2525
|
+
</div>
|
|
2526
|
+
`;
|
|
2527
|
+
const skeletonContainer = document.createElement("div");
|
|
2528
|
+
skeletonContainer.id = "loading-skeleton";
|
|
2529
|
+
skeletonContainer.innerHTML = skeletonHTML;
|
|
2530
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2531
|
+
root.innerHTML = "";
|
|
2532
|
+
root.appendChild(skeletonContainer);
|
|
2544
2533
|
await this.renderWidget();
|
|
2534
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2535
|
+
if (loadingElement) {
|
|
2536
|
+
loadingElement.remove();
|
|
2537
|
+
console.log("Skeleton removed successfully");
|
|
2538
|
+
} else {
|
|
2539
|
+
console.warn("Could not find skeleton to remove");
|
|
2540
|
+
}
|
|
2545
2541
|
if (this.getAttribute("open") !== null) this.open();
|
|
2546
2542
|
}
|
|
2547
2543
|
}
|