@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.js
CHANGED
|
@@ -2474,6 +2474,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2474
2474
|
<div>
|
|
2475
2475
|
<h1>Dynamic Content</h1>
|
|
2476
2476
|
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2477
|
+
<p>This content comes from the embeded widget class</p>
|
|
2477
2478
|
</div>
|
|
2478
2479
|
`;
|
|
2479
2480
|
const skeletonContainer = document.createElement("div");
|
|
@@ -2516,28 +2517,28 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2516
2517
|
}
|
|
2517
2518
|
}
|
|
2518
2519
|
async connectedCallback() {
|
|
2519
|
-
var _a2;
|
|
2520
2520
|
this.loaded = true;
|
|
2521
2521
|
this.container = this.getAttribute("container");
|
|
2522
2522
|
const skeletonHTML = `
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2523
|
+
<div>
|
|
2524
|
+
<h1>Dynamic Content</h1>
|
|
2525
|
+
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2526
|
+
<p>This content comes from the embedded widget class</p>
|
|
2527
|
+
</div>
|
|
2528
|
+
`;
|
|
2528
2529
|
const skeletonContainer = document.createElement("div");
|
|
2529
2530
|
skeletonContainer.id = "loading-skeleton";
|
|
2530
2531
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
if (this.shadowRoot) {
|
|
2535
|
-
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2536
|
-
}
|
|
2532
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2533
|
+
root.innerHTML = "";
|
|
2534
|
+
root.appendChild(skeletonContainer);
|
|
2537
2535
|
await this.renderWidget();
|
|
2538
|
-
const loadingElement =
|
|
2536
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2539
2537
|
if (loadingElement) {
|
|
2540
2538
|
loadingElement.remove();
|
|
2539
|
+
console.log("Skeleton removed successfully");
|
|
2540
|
+
} else {
|
|
2541
|
+
console.warn("Could not find skeleton to remove");
|
|
2541
2542
|
}
|
|
2542
2543
|
if (this.getAttribute("open") !== null) this.open();
|
|
2543
2544
|
}
|