@bigbinary/neeto-molecules 4.0.62 → 4.0.63
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/ProductEmbed.js
CHANGED
|
@@ -1497,17 +1497,29 @@ var FloatingPopup = function FloatingPopup(_ref) {
|
|
|
1497
1497
|
});
|
|
1498
1498
|
};
|
|
1499
1499
|
|
|
1500
|
+
function useIframeHeightReset(iframeRef, dynamicHeight) {
|
|
1501
|
+
React.useEffect(function () {
|
|
1502
|
+
if (!(dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value) && iframeRef !== null && iframeRef !== void 0 && iframeRef.current) {
|
|
1503
|
+
iframeRef.current.style.height = "";
|
|
1504
|
+
}
|
|
1505
|
+
}, [dynamicHeight === null || dynamicHeight === void 0 ? void 0 : dynamicHeight.value, iframeRef]);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1500
1508
|
var Iframe = function Iframe(_ref) {
|
|
1501
1509
|
var iframeURL = _ref.iframeURL,
|
|
1502
1510
|
customization = _ref.customization;
|
|
1503
1511
|
var height = customization.height,
|
|
1504
1512
|
width = customization.width,
|
|
1505
|
-
iframeTitle = customization.iframeTitle
|
|
1513
|
+
iframeTitle = customization.iframeTitle,
|
|
1514
|
+
dynamicHeight = customization.dynamicHeight;
|
|
1515
|
+
var iframeRef = React.useRef(null);
|
|
1516
|
+
useIframeHeightReset(iframeRef, dynamicHeight);
|
|
1506
1517
|
return /*#__PURE__*/jsxRuntime.jsx("iframe", {
|
|
1507
1518
|
allowFullScreen: true,
|
|
1508
1519
|
className: "m-auto",
|
|
1509
1520
|
frameBorder: "0",
|
|
1510
1521
|
height: "".concat(height, "%"),
|
|
1522
|
+
ref: iframeRef,
|
|
1511
1523
|
src: iframeURL,
|
|
1512
1524
|
title: iframeTitle,
|
|
1513
1525
|
width: "".concat(width, "%")
|
|
@@ -1518,10 +1530,14 @@ var Inline = function Inline(_ref) {
|
|
|
1518
1530
|
var iframeURL = _ref.iframeURL,
|
|
1519
1531
|
customization = _ref.customization;
|
|
1520
1532
|
var height = customization.height,
|
|
1521
|
-
width = customization.width
|
|
1533
|
+
width = customization.width,
|
|
1534
|
+
dynamicHeight = customization.dynamicHeight;
|
|
1535
|
+
var iframeRef = React.useRef(null);
|
|
1536
|
+
useIframeHeightReset(iframeRef, dynamicHeight);
|
|
1522
1537
|
return /*#__PURE__*/jsxRuntime.jsx("iframe", {
|
|
1523
1538
|
className: "m-auto",
|
|
1524
1539
|
height: "".concat(height, "%"),
|
|
1540
|
+
ref: iframeRef,
|
|
1525
1541
|
src: iframeURL,
|
|
1526
1542
|
width: "".concat(width, "%")
|
|
1527
1543
|
});
|