@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/ProductEmbed.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallow } from 'zustand/shallow';
|
|
2
|
-
import { useEffect, useState, useMemo } from 'react';
|
|
2
|
+
import { useEffect, useState, useMemo, useRef } from 'react';
|
|
3
3
|
import { isPresent, filterBy, hyphenate, noop } from '@bigbinary/neeto-cist';
|
|
4
4
|
import { useLocation, useHistory } from 'react-router-dom';
|
|
5
5
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
@@ -1495,17 +1495,29 @@ var FloatingPopup = function FloatingPopup(_ref) {
|
|
|
1495
1495
|
});
|
|
1496
1496
|
};
|
|
1497
1497
|
|
|
1498
|
+
function useIframeHeightReset(iframeRef, dynamicHeight) {
|
|
1499
|
+
useEffect(function () {
|
|
1500
|
+
if (!(dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value) && iframeRef !== null && iframeRef !== void 0 && iframeRef.current) {
|
|
1501
|
+
iframeRef.current.style.height = "";
|
|
1502
|
+
}
|
|
1503
|
+
}, [dynamicHeight === null || dynamicHeight === void 0 ? void 0 : dynamicHeight.value, iframeRef]);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1498
1506
|
var Iframe = function Iframe(_ref) {
|
|
1499
1507
|
var iframeURL = _ref.iframeURL,
|
|
1500
1508
|
customization = _ref.customization;
|
|
1501
1509
|
var height = customization.height,
|
|
1502
1510
|
width = customization.width,
|
|
1503
|
-
iframeTitle = customization.iframeTitle
|
|
1511
|
+
iframeTitle = customization.iframeTitle,
|
|
1512
|
+
dynamicHeight = customization.dynamicHeight;
|
|
1513
|
+
var iframeRef = useRef(null);
|
|
1514
|
+
useIframeHeightReset(iframeRef, dynamicHeight);
|
|
1504
1515
|
return /*#__PURE__*/jsx("iframe", {
|
|
1505
1516
|
allowFullScreen: true,
|
|
1506
1517
|
className: "m-auto",
|
|
1507
1518
|
frameBorder: "0",
|
|
1508
1519
|
height: "".concat(height, "%"),
|
|
1520
|
+
ref: iframeRef,
|
|
1509
1521
|
src: iframeURL,
|
|
1510
1522
|
title: iframeTitle,
|
|
1511
1523
|
width: "".concat(width, "%")
|
|
@@ -1516,10 +1528,14 @@ var Inline = function Inline(_ref) {
|
|
|
1516
1528
|
var iframeURL = _ref.iframeURL,
|
|
1517
1529
|
customization = _ref.customization;
|
|
1518
1530
|
var height = customization.height,
|
|
1519
|
-
width = customization.width
|
|
1531
|
+
width = customization.width,
|
|
1532
|
+
dynamicHeight = customization.dynamicHeight;
|
|
1533
|
+
var iframeRef = useRef(null);
|
|
1534
|
+
useIframeHeightReset(iframeRef, dynamicHeight);
|
|
1520
1535
|
return /*#__PURE__*/jsx("iframe", {
|
|
1521
1536
|
className: "m-auto",
|
|
1522
1537
|
height: "".concat(height, "%"),
|
|
1538
|
+
ref: iframeRef,
|
|
1523
1539
|
src: iframeURL,
|
|
1524
1540
|
width: "".concat(width, "%")
|
|
1525
1541
|
});
|