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