@saasquatch/squatch-js 2.8.2-2 → 2.8.2-4
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 +17 -2
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +17 -2
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +17 -2
- 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
|
@@ -1457,7 +1457,9 @@ class EmbedWidget extends Widget {
|
|
|
1457
1457
|
super(params);
|
|
1458
1458
|
__publicField(this, "show", this.open);
|
|
1459
1459
|
__publicField(this, "hide", this.close);
|
|
1460
|
-
if (container)
|
|
1460
|
+
if (container) {
|
|
1461
|
+
this.container = container;
|
|
1462
|
+
}
|
|
1461
1463
|
}
|
|
1462
1464
|
async load() {
|
|
1463
1465
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
@@ -1488,6 +1490,7 @@ class EmbedWidget extends Widget {
|
|
|
1488
1490
|
initialHeight
|
|
1489
1491
|
});
|
|
1490
1492
|
const element = this._findElement();
|
|
1493
|
+
element.innerHTML = skeletonHTML;
|
|
1491
1494
|
frame.style.display = "none";
|
|
1492
1495
|
const injectContents = (target) => {
|
|
1493
1496
|
target.appendChild(skeletonContainer);
|
|
@@ -1529,7 +1532,7 @@ class EmbedWidget extends Widget {
|
|
|
1529
1532
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
1530
1533
|
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1531
1534
|
(_l = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _l.brandFont
|
|
1532
|
-
)}">`}
|
|
1535
|
+
)}" as="style">`}
|
|
1533
1536
|
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1534
1537
|
<style data-styles>
|
|
1535
1538
|
html { visibility:hidden;}
|
|
@@ -2463,6 +2466,18 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
|
2463
2466
|
var _a2, _b;
|
|
2464
2467
|
this.loaded = true;
|
|
2465
2468
|
this.container = this.getAttribute("container");
|
|
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
|
+
}
|
|
2466
2481
|
await this.renderWidget();
|
|
2467
2482
|
const slot = (_a2 = this.shadowRoot && Array.from(this.shadowRoot.children)) == null ? void 0 : _a2.find((c) => c.tagName === "SLOT");
|
|
2468
2483
|
if (slot) (_b = this.shadowRoot) == null ? void 0 : _b.removeChild(slot);
|