@myop/sdk 0.3.25 → 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.4fb657bf.js → _IframeSDK.c817b148.js} +25 -23
- package/dist/cjs/_IframeSDK.c817b148.js.map +7 -0
- package/dist/cjs/_IframeSDK.dd678e0d.min.js +1 -0
- package/dist/cjs/{_WebComponentSDK.949eae52.js → _WebComponentSDK.4cff169e.js} +25 -23
- package/dist/cjs/{_WebComponentSDK.949eae52.js.map → _WebComponentSDK.4cff169e.js.map} +2 -2
- package/dist/cjs/_WebComponentSDK.c0523c9e.min.js +1 -0
- package/dist/cjs/{_hostSDK.664e938c.js → _hostSDK.0100402a.js} +25 -23
- package/dist/cjs/_hostSDK.0100402a.js.map +7 -0
- 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 +26 -24
- 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 +26 -24
- package/dist/module/Iframe/index.js.map +2 -2
- package/dist/module/SDK.js +26 -24
- 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 +26 -24
- package/dist/module/host/index.js.map +2 -2
- package/dist/module/webcomponent/index.js +26 -24
- package/dist/module/webcomponent/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.1f1af47b.min.js +0 -1
- package/dist/cjs/_IframeSDK.4fb657bf.js.map +0 -7
- package/dist/cjs/_WebComponentSDK.05217c76.min.js +0 -1
- package/dist/cjs/_hostSDK.664e938c.js.map +0 -7
- package/dist/cjs/_hostSDK.d90560a4.min.js +0 -1
|
@@ -1673,16 +1673,12 @@ var MyopIframeComponent = class extends BaseMyopComponent {
|
|
|
1673
1673
|
if (!shouldAutoWidth && !shouldAutoHeight) {
|
|
1674
1674
|
iframe.style.width = typeof resolvedExplicitWidth === "number" ? "".concat(resolvedExplicitWidth, "px") : "100%";
|
|
1675
1675
|
iframe.style.height = typeof resolvedExplicitHeight === "number" ? "".concat(resolvedExplicitHeight, "px") : "100%";
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
autoSizingWidth: false,
|
|
1683
|
-
autoSizingHeight: false
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1676
|
+
(_g = opts == null ? void 0 : opts.onSizeChange) == null ? void 0 : _g.call(opts, {
|
|
1677
|
+
width: typeof resolvedExplicitWidth === "number" ? resolvedExplicitWidth : void 0,
|
|
1678
|
+
height: typeof resolvedExplicitHeight === "number" ? resolvedExplicitHeight : void 0,
|
|
1679
|
+
autoSizingWidth: false,
|
|
1680
|
+
autoSizingHeight: false
|
|
1681
|
+
});
|
|
1686
1682
|
return;
|
|
1687
1683
|
}
|
|
1688
1684
|
const prevTransition = iframe.style.transition;
|
|
@@ -1705,22 +1701,28 @@ var MyopIframeComponent = class extends BaseMyopComponent {
|
|
|
1705
1701
|
const prevMinWidth = container.style.minWidth;
|
|
1706
1702
|
if (needsHeightCollapse) container.style.minHeight = "".concat(currentIframeHeight, "px");
|
|
1707
1703
|
if (needsWidthCollapse) container.style.minWidth = "".concat(currentIframeWidth, "px");
|
|
1708
|
-
const measureStyle = contentDoc.createElement("style");
|
|
1709
|
-
measureStyle.id = "__myop_measure";
|
|
1710
|
-
const rules = [];
|
|
1711
|
-
if (needsHeightCollapse) {
|
|
1712
|
-
rules.push("height: auto !important", "min-height: 0 !important", "max-height: none !important");
|
|
1713
|
-
}
|
|
1714
|
-
if (needsWidthCollapse) {
|
|
1715
|
-
rules.push("width: auto !important", "min-width: 0 !important", "max-width: none !important");
|
|
1716
|
-
}
|
|
1717
|
-
measureStyle.textContent = "*, *::before, *::after { ".concat(rules.join("; "), "; flex-basis: auto !important; flex-grow: 0 !important; }");
|
|
1718
|
-
contentDoc.head.appendChild(measureStyle);
|
|
1719
1704
|
if (needsHeightCollapse) iframe.style.height = "0px";
|
|
1720
1705
|
if (needsWidthCollapse) iframe.style.width = "0px";
|
|
1721
1706
|
contentWidth = Math.ceil(Math.max(contentDoc.documentElement.scrollWidth, contentDoc.body.scrollWidth, contentDoc.body.getBoundingClientRect().width));
|
|
1722
1707
|
contentHeight = Math.ceil(Math.max(contentDoc.documentElement.scrollHeight, contentDoc.body.scrollHeight, contentDoc.body.getBoundingClientRect().height));
|
|
1723
|
-
|
|
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
|
+
}
|
|
1724
1726
|
container.style.minHeight = prevMinHeight;
|
|
1725
1727
|
container.style.minWidth = prevMinWidth;
|
|
1726
1728
|
}
|
|
@@ -2041,7 +2043,7 @@ var WebcomponentLoader = class extends BaseMyopLoader {
|
|
|
2041
2043
|
};
|
|
2042
2044
|
|
|
2043
2045
|
// version:myop-sdk-version
|
|
2044
|
-
var myop_sdk_version_default = "0.3.
|
|
2046
|
+
var myop_sdk_version_default = "0.3.27";
|
|
2045
2047
|
|
|
2046
2048
|
// src/webcomponent/messageHandlers/BaseWebComponentMessageHandler.ts
|
|
2047
2049
|
var BaseWebComponentMessageHandler = class extends BaseContextMessageHandler {
|