@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.js
CHANGED
|
@@ -892,6 +892,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
892
892
|
if ((options == null ? void 0 : options.maxWidth) || (options == null ? void 0 : options.minWidth)) {
|
|
893
893
|
frame.style.width = "100%";
|
|
894
894
|
}
|
|
895
|
+
if (options == null ? void 0 : options.initialHeight) {
|
|
896
|
+
frame.height = options.initialHeight;
|
|
897
|
+
}
|
|
895
898
|
return frame;
|
|
896
899
|
}
|
|
897
900
|
_findFrame() {
|
|
@@ -1115,21 +1118,31 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1115
1118
|
if (container) this.container = container;
|
|
1116
1119
|
}
|
|
1117
1120
|
async load() {
|
|
1118
|
-
var _a2, _b, _c, _d, _e;
|
|
1121
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1119
1122
|
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1120
|
-
const
|
|
1123
|
+
const initialHeight = (_e = (_d = (_c = this.context.widgetConfig) == null ? void 0 : _c.values) == null ? void 0 : _d.brandingConfig) == null ? void 0 : _e.loadingHeight;
|
|
1124
|
+
const sizes = (_f = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _f.embeddedWidgets;
|
|
1121
1125
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "";
|
|
1122
1126
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "";
|
|
1123
|
-
|
|
1127
|
+
console.log({
|
|
1128
|
+
brandingConfig,
|
|
1129
|
+
initialHeight,
|
|
1130
|
+
widgetConfig: this.context.widgetConfig
|
|
1131
|
+
});
|
|
1132
|
+
const frame = this._createFrame({
|
|
1133
|
+
minWidth,
|
|
1134
|
+
maxWidth,
|
|
1135
|
+
initialHeight
|
|
1136
|
+
});
|
|
1124
1137
|
const element = this._findElement();
|
|
1125
|
-
if ((
|
|
1138
|
+
if ((_g = this.context) == null ? void 0 : _g.container) {
|
|
1126
1139
|
element.style.visibility = "hidden";
|
|
1127
1140
|
element.style.height = "0";
|
|
1128
1141
|
element.style["overflow-y"] = "hidden";
|
|
1129
1142
|
}
|
|
1130
1143
|
if (this.container) {
|
|
1131
1144
|
if (element.shadowRoot) {
|
|
1132
|
-
if (((
|
|
1145
|
+
if (((_h = element.shadowRoot.lastChild) == null ? void 0 : _h.nodeName) === "IFRAME") {
|
|
1133
1146
|
element.shadowRoot.replaceChild(frame, element.shadowRoot.lastChild);
|
|
1134
1147
|
} else {
|
|
1135
1148
|
element.shadowRoot.appendChild(frame);
|
|
@@ -1148,14 +1161,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1148
1161
|
}
|
|
1149
1162
|
const frameDoc = contentWindow.document;
|
|
1150
1163
|
frameDoc.open();
|
|
1151
|
-
|
|
1152
|
-
frameDoc.write(
|
|
1153
|
-
|
|
1154
|
-
|
|
1164
|
+
console.log({ content: this.content });
|
|
1165
|
+
frameDoc.write(`
|
|
1166
|
+
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1167
|
+
${this.content}
|
|
1168
|
+
<style data-styles>
|
|
1169
|
+
html:not(.hydrated) { visibility:hidden; }
|
|
1170
|
+
</style>
|
|
1171
|
+
`);
|
|
1155
1172
|
frameDoc.close();
|
|
1156
1173
|
domready(frameDoc, async () => {
|
|
1157
1174
|
const _sqh = contentWindow.squatch || contentWindow.widgetIdent;
|
|
1158
|
-
frame.height = frameDoc.body.scrollHeight;
|
|
1175
|
+
frame.height = initialHeight || frameDoc.body.scrollHeight;
|
|
1176
|
+
console.log({ height: frameDoc.body.scrollHeight });
|
|
1159
1177
|
const ro = new contentWindow["ResizeObserver"]((entries) => {
|
|
1160
1178
|
for (const entry of entries) {
|
|
1161
1179
|
const { height } = entry.contentRect;
|