@saasquatch/squatch-js 2.8.2-13 → 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 -72
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +23 -72
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +23 -72
- 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
|
@@ -2468,49 +2468,22 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2468
2468
|
this.loaded = true;
|
|
2469
2469
|
this.container = this.getAttribute("container");
|
|
2470
2470
|
const skeletonHTML = `
|
|
2471
|
-
<div
|
|
2472
|
-
<h1>
|
|
2471
|
+
<div>
|
|
2472
|
+
<h1>Do I see this text ????</h1>
|
|
2473
2473
|
</div>
|
|
2474
2474
|
`;
|
|
2475
|
-
console.log(
|
|
2476
|
-
"/////////////////////////////////TESTING//////////////////////////////"
|
|
2477
|
-
);
|
|
2478
2475
|
const skeletonContainer = document.createElement("div");
|
|
2479
2476
|
skeletonContainer.id = "loading-skeleton";
|
|
2480
2477
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2481
|
-
skeletonContainer.style.width = "100%";
|
|
2482
2478
|
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
const el = root.getElementById("loading-skeleton");
|
|
2490
|
-
if (el) {
|
|
2491
|
-
el.remove();
|
|
2492
|
-
console.log("Skeleton removed successfully via event");
|
|
2493
|
-
}
|
|
2494
|
-
};
|
|
2495
|
-
this.addEventListener("sq:load", removeSkeleton);
|
|
2496
|
-
try {
|
|
2497
|
-
await this.renderWidget();
|
|
2498
|
-
console.log("Widget rendered (initialization complete)");
|
|
2499
|
-
setTimeout(() => {
|
|
2500
|
-
const el = root.getElementById("loading-skeleton");
|
|
2501
|
-
if (el) {
|
|
2502
|
-
console.warn("Removing skeleton via timeout (load event missing)");
|
|
2503
|
-
el.remove();
|
|
2504
|
-
}
|
|
2505
|
-
}, 5e3);
|
|
2506
|
-
} catch (err) {
|
|
2507
|
-
console.error("Critical Error in renderWidget:", err);
|
|
2508
|
-
removeSkeleton();
|
|
2479
|
+
root.innerHTML = "";
|
|
2480
|
+
root.appendChild(skeletonContainer);
|
|
2481
|
+
await this.renderWidget();
|
|
2482
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2483
|
+
if (loadingElement) {
|
|
2484
|
+
loadingElement.remove();
|
|
2509
2485
|
}
|
|
2510
2486
|
if (this.getAttribute("open") !== null) this.open();
|
|
2511
|
-
console.log(
|
|
2512
|
-
"/////////////////////////////////DO YOU SEE THIS CONSOLE LOG????//////////////////////////////"
|
|
2513
|
-
);
|
|
2514
2487
|
}
|
|
2515
2488
|
}
|
|
2516
2489
|
class DeclarativePopupWidget extends DeclarativeWidget {
|
|
@@ -2536,52 +2509,30 @@ class DeclarativePopupWidget extends DeclarativeWidget {
|
|
|
2536
2509
|
}
|
|
2537
2510
|
}
|
|
2538
2511
|
async connectedCallback() {
|
|
2512
|
+
var _a2;
|
|
2539
2513
|
this.loaded = true;
|
|
2540
2514
|
this.container = this.getAttribute("container");
|
|
2541
2515
|
const skeletonHTML = `
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
"/////////////////////////////////TESTING//////////////////////////////"
|
|
2548
|
-
);
|
|
2516
|
+
<div>
|
|
2517
|
+
<h1>Dynamic Content</h1>
|
|
2518
|
+
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2519
|
+
</div>
|
|
2520
|
+
`;
|
|
2549
2521
|
const skeletonContainer = document.createElement("div");
|
|
2550
2522
|
skeletonContainer.id = "loading-skeleton";
|
|
2551
2523
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
if (root.firstChild) {
|
|
2555
|
-
root.insertBefore(skeletonContainer, root.firstChild);
|
|
2556
|
-
} else {
|
|
2557
|
-
root.appendChild(skeletonContainer);
|
|
2524
|
+
if (!this.shadowRoot) {
|
|
2525
|
+
this.attachShadow({ mode: "open" });
|
|
2558
2526
|
}
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
this.addEventListener("sq:load", removeSkeleton);
|
|
2567
|
-
try {
|
|
2568
|
-
await this.renderWidget();
|
|
2569
|
-
console.log("Widget rendered (initialization complete)");
|
|
2570
|
-
setTimeout(() => {
|
|
2571
|
-
const el = root.getElementById("loading-skeleton");
|
|
2572
|
-
if (el) {
|
|
2573
|
-
console.warn("Removing skeleton via timeout (load event missing)");
|
|
2574
|
-
el.remove();
|
|
2575
|
-
}
|
|
2576
|
-
}, 5e3);
|
|
2577
|
-
} catch (err) {
|
|
2578
|
-
console.error("Critical Error in renderWidget:", err);
|
|
2579
|
-
removeSkeleton();
|
|
2527
|
+
if (this.shadowRoot) {
|
|
2528
|
+
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2529
|
+
}
|
|
2530
|
+
await this.renderWidget();
|
|
2531
|
+
const loadingElement = (_a2 = this.shadowRoot) == null ? void 0 : _a2.getElementById("loading-skeleton");
|
|
2532
|
+
if (loadingElement) {
|
|
2533
|
+
loadingElement.remove();
|
|
2580
2534
|
}
|
|
2581
2535
|
if (this.getAttribute("open") !== null) this.open();
|
|
2582
|
-
console.log(
|
|
2583
|
-
"/////////////////////////////////DO YOU SEE THIS CONSOLE LOG????//////////////////////////////"
|
|
2584
|
-
);
|
|
2585
2536
|
}
|
|
2586
2537
|
}
|
|
2587
2538
|
class SquatchEmbed extends DeclarativeEmbedWidget {
|