@saasquatch/squatch-js 2.8.2-8 → 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 +14 -13
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +14 -13
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +14 -13
- 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
|
@@ -2472,6 +2472,7 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2472
2472
|
<div>
|
|
2473
2473
|
<h1>Dynamic Content</h1>
|
|
2474
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>
|
|
2475
2476
|
</div>
|
|
2476
2477
|
`;
|
|
2477
2478
|
const skeletonContainer = document.createElement("div");
|
|
@@ -2514,28 +2515,28 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2514
2515
|
}
|
|
2515
2516
|
}
|
|
2516
2517
|
async connectedCallback() {
|
|
2517
|
-
var _a2;
|
|
2518
2518
|
this.loaded = true;
|
|
2519
2519
|
this.container = this.getAttribute("container");
|
|
2520
2520
|
const skeletonHTML = `
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
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
|
+
`;
|
|
2526
2527
|
const skeletonContainer = document.createElement("div");
|
|
2527
2528
|
skeletonContainer.id = "loading-skeleton";
|
|
2528
2529
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
if (this.shadowRoot) {
|
|
2533
|
-
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2534
|
-
}
|
|
2530
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2531
|
+
root.innerHTML = "";
|
|
2532
|
+
root.appendChild(skeletonContainer);
|
|
2535
2533
|
await this.renderWidget();
|
|
2536
|
-
const loadingElement =
|
|
2534
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2537
2535
|
if (loadingElement) {
|
|
2538
2536
|
loadingElement.remove();
|
|
2537
|
+
console.log("Skeleton removed successfully");
|
|
2538
|
+
} else {
|
|
2539
|
+
console.warn("Could not find skeleton to remove");
|
|
2539
2540
|
}
|
|
2540
2541
|
if (this.getAttribute("open") !== null) this.open();
|
|
2541
2542
|
}
|