@myop/sdk 0.3.26 → 0.3.27
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/cjs/{_IframeSDK.f8e27dc0.js → _IframeSDK.c817b148.js} +19 -13
- package/dist/cjs/_IframeSDK.c817b148.js.map +7 -0
- package/dist/cjs/_IframeSDK.dd678e0d.min.js +1 -0
- package/dist/cjs/{_WebComponentSDK.f8bc2f3a.js → _WebComponentSDK.4cff169e.js} +19 -13
- package/dist/cjs/{_WebComponentSDK.f8bc2f3a.js.map → _WebComponentSDK.4cff169e.js.map} +2 -2
- package/dist/cjs/_WebComponentSDK.c0523c9e.min.js +1 -0
- package/dist/cjs/{_hostSDK.9c5e7767.js → _hostSDK.0100402a.js} +19 -13
- package/dist/cjs/{_hostSDK.9c5e7767.js.map → _hostSDK.0100402a.js.map} +2 -2
- package/dist/cjs/_hostSDK.54316b46.min.js +1 -0
- package/dist/cjs/myop_sdk.js +11 -11
- package/dist/cjs/myop_sdk.js.map +1 -1
- package/dist/cjs/myop_sdk.min.js +1 -1
- package/dist/cjs-bundled/myop_sdk.bundled.js +20 -14
- package/dist/cjs-bundled/myop_sdk.bundled.js.map +2 -2
- package/dist/cjs-bundled/myop_sdk.bundled.min.js +1 -1
- package/dist/module/Iframe/index.js +20 -14
- package/dist/module/Iframe/index.js.map +2 -2
- package/dist/module/SDK.js +20 -14
- package/dist/module/SDK.js.map +2 -2
- package/dist/module/embeddedSDK.js +1 -1
- package/dist/module/host/embeddedSDK.js +1 -1
- package/dist/module/host/index.js +20 -14
- package/dist/module/host/index.js.map +2 -2
- package/dist/module/webcomponent/index.js +20 -14
- package/dist/module/webcomponent/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.8724e6a9.min.js +0 -1
- package/dist/cjs/_IframeSDK.f8e27dc0.js.map +0 -7
- package/dist/cjs/_WebComponentSDK.9222ca02.min.js +0 -1
- package/dist/cjs/_hostSDK.e2851f6a.min.js +0 -1
|
@@ -1701,22 +1701,28 @@ var MyopIframeComponent = class extends BaseMyopComponent {
|
|
|
1701
1701
|
const prevMinWidth = container.style.minWidth;
|
|
1702
1702
|
if (needsHeightCollapse) container.style.minHeight = "".concat(currentIframeHeight, "px");
|
|
1703
1703
|
if (needsWidthCollapse) container.style.minWidth = "".concat(currentIframeWidth, "px");
|
|
1704
|
-
const measureStyle = contentDoc.createElement("style");
|
|
1705
|
-
measureStyle.id = "__myop_measure";
|
|
1706
|
-
const rules = [];
|
|
1707
|
-
if (needsHeightCollapse) {
|
|
1708
|
-
rules.push("height: auto !important", "min-height: 0 !important", "max-height: none !important");
|
|
1709
|
-
}
|
|
1710
|
-
if (needsWidthCollapse) {
|
|
1711
|
-
rules.push("width: auto !important", "min-width: 0 !important", "max-width: none !important");
|
|
1712
|
-
}
|
|
1713
|
-
measureStyle.textContent = "*, *::before, *::after { ".concat(rules.join("; "), "; flex-basis: auto !important; flex-grow: 0 !important; }");
|
|
1714
|
-
contentDoc.head.appendChild(measureStyle);
|
|
1715
1704
|
if (needsHeightCollapse) iframe.style.height = "0px";
|
|
1716
1705
|
if (needsWidthCollapse) iframe.style.width = "0px";
|
|
1717
1706
|
contentWidth = Math.ceil(Math.max(contentDoc.documentElement.scrollWidth, contentDoc.body.scrollWidth, contentDoc.body.getBoundingClientRect().width));
|
|
1718
1707
|
contentHeight = Math.ceil(Math.max(contentDoc.documentElement.scrollHeight, contentDoc.body.scrollHeight, contentDoc.body.getBoundingClientRect().height));
|
|
1719
|
-
|
|
1708
|
+
const needsNuclearHeight = needsHeightCollapse && contentHeight < 2;
|
|
1709
|
+
const needsNuclearWidth = needsWidthCollapse && contentWidth < 2;
|
|
1710
|
+
if (needsNuclearHeight || needsNuclearWidth) {
|
|
1711
|
+
const measureStyle = contentDoc.createElement("style");
|
|
1712
|
+
measureStyle.id = "__myop_measure";
|
|
1713
|
+
const rules = [];
|
|
1714
|
+
if (needsNuclearHeight) {
|
|
1715
|
+
rules.push("height: auto !important", "min-height: 0 !important", "max-height: none !important");
|
|
1716
|
+
}
|
|
1717
|
+
if (needsNuclearWidth) {
|
|
1718
|
+
rules.push("width: auto !important", "min-width: 0 !important", "max-width: none !important");
|
|
1719
|
+
}
|
|
1720
|
+
measureStyle.textContent = "*, *::before, *::after { ".concat(rules.join("; "), "; flex-basis: auto !important; flex-grow: 0 !important; }");
|
|
1721
|
+
contentDoc.head.appendChild(measureStyle);
|
|
1722
|
+
contentWidth = Math.ceil(Math.max(contentDoc.documentElement.scrollWidth, contentDoc.body.scrollWidth, contentDoc.body.getBoundingClientRect().width));
|
|
1723
|
+
contentHeight = Math.ceil(Math.max(contentDoc.documentElement.scrollHeight, contentDoc.body.scrollHeight, contentDoc.body.getBoundingClientRect().height));
|
|
1724
|
+
measureStyle.remove();
|
|
1725
|
+
}
|
|
1720
1726
|
container.style.minHeight = prevMinHeight;
|
|
1721
1727
|
container.style.minWidth = prevMinWidth;
|
|
1722
1728
|
}
|
|
@@ -2037,7 +2043,7 @@ var WebcomponentLoader = class extends BaseMyopLoader {
|
|
|
2037
2043
|
};
|
|
2038
2044
|
|
|
2039
2045
|
// version:myop-sdk-version
|
|
2040
|
-
var myop_sdk_version_default = "0.3.
|
|
2046
|
+
var myop_sdk_version_default = "0.3.27";
|
|
2041
2047
|
|
|
2042
2048
|
// src/webcomponent/messageHandlers/BaseWebComponentMessageHandler.ts
|
|
2043
2049
|
var BaseWebComponentMessageHandler = class extends BaseContextMessageHandler {
|