@saasquatch/squatch-js 2.8.0 → 2.8.2-1
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/coverage/clover.xml +708 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +1276 -0
- package/dist/squatch.cjs.js +28 -10
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +28 -10
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +28 -10
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/dist/widgets/Widget.d.ts +1 -0
- package/package.json +1 -1
package/dist/squatch.cjs.js
CHANGED
|
@@ -890,6 +890,9 @@ class Widget {
|
|
|
890
890
|
if ((options == null ? void 0 : options.maxWidth) || (options == null ? void 0 : options.minWidth)) {
|
|
891
891
|
frame.style.width = "100%";
|
|
892
892
|
}
|
|
893
|
+
if (options == null ? void 0 : options.initialHeight) {
|
|
894
|
+
frame.height = options.initialHeight;
|
|
895
|
+
}
|
|
893
896
|
return frame;
|
|
894
897
|
}
|
|
895
898
|
_findFrame() {
|
|
@@ -1113,21 +1116,31 @@ class EmbedWidget extends Widget {
|
|
|
1113
1116
|
if (container) this.container = container;
|
|
1114
1117
|
}
|
|
1115
1118
|
async load() {
|
|
1116
|
-
var _a2, _b, _c, _d, _e;
|
|
1119
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1117
1120
|
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1118
|
-
const
|
|
1121
|
+
const initialHeight = (_e = (_d = (_c = this.context.widgetConfig) == null ? void 0 : _c.values) == null ? void 0 : _d.brandingConfig) == null ? void 0 : _e.loadingHeight;
|
|
1122
|
+
const sizes = (_f = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _f.embeddedWidgets;
|
|
1119
1123
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "";
|
|
1120
1124
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "";
|
|
1121
|
-
|
|
1125
|
+
console.log({
|
|
1126
|
+
brandingConfig,
|
|
1127
|
+
initialHeight,
|
|
1128
|
+
widgetConfig: this.context.widgetConfig
|
|
1129
|
+
});
|
|
1130
|
+
const frame = this._createFrame({
|
|
1131
|
+
minWidth,
|
|
1132
|
+
maxWidth,
|
|
1133
|
+
initialHeight
|
|
1134
|
+
});
|
|
1122
1135
|
const element = this._findElement();
|
|
1123
|
-
if ((
|
|
1136
|
+
if ((_g = this.context) == null ? void 0 : _g.container) {
|
|
1124
1137
|
element.style.visibility = "hidden";
|
|
1125
1138
|
element.style.height = "0";
|
|
1126
1139
|
element.style["overflow-y"] = "hidden";
|
|
1127
1140
|
}
|
|
1128
1141
|
if (this.container) {
|
|
1129
1142
|
if (element.shadowRoot) {
|
|
1130
|
-
if (((
|
|
1143
|
+
if (((_h = element.shadowRoot.lastChild) == null ? void 0 : _h.nodeName) === "IFRAME") {
|
|
1131
1144
|
element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
|
|
1132
1145
|
} else {
|
|
1133
1146
|
element.shadowRoot.appendChild(frame);
|
|
@@ -1146,14 +1159,19 @@ class EmbedWidget extends Widget {
|
|
|
1146
1159
|
}
|
|
1147
1160
|
const frameDoc = contentWindow.document;
|
|
1148
1161
|
frameDoc.open();
|
|
1149
|
-
|
|
1150
|
-
frameDoc.write(
|
|
1151
|
-
|
|
1152
|
-
|
|
1162
|
+
console.log({ content: this.content });
|
|
1163
|
+
frameDoc.write(`
|
|
1164
|
+
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1165
|
+
${this.content}
|
|
1166
|
+
<style data-styles>
|
|
1167
|
+
html:not(.hydrated) { visibility:hidden; }
|
|
1168
|
+
</style>
|
|
1169
|
+
`);
|
|
1153
1170
|
frameDoc.close();
|
|
1154
1171
|
domready(frameDoc, async () => {
|
|
1155
1172
|
const _sqh = contentWindow.squatch || contentWindow.widgetIdent;
|
|
1156
|
-
frame.height = frameDoc.body.scrollHeight;
|
|
1173
|
+
frame.height = initialHeight || frameDoc.body.scrollHeight;
|
|
1174
|
+
console.log({ height: frameDoc.body.scrollHeight });
|
|
1157
1175
|
const ro = new contentWindow["ResizeObserver"]((entries) => {
|
|
1158
1176
|
for (const entry of entries) {
|
|
1159
1177
|
const { height } = entry.contentRect;
|