@bigbinary/neeto-molecules 4.0.118 → 4.0.119

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.
@@ -1431,11 +1431,11 @@ var ElementPopup = function ElementPopup(_ref) {
1431
1431
  return "popup-button-".concat(Math.random().toString().substring(2, 10));
1432
1432
  }, [iframeURL]);
1433
1433
  React.useEffect(function () {
1434
+ var _window$appName;
1434
1435
  var element = document.getElementById(elementSelectorId);
1435
- if (element) {
1436
- var _window$globalProps$a;
1437
- (_window$globalProps$a = window[globalProps.appName.replace(/^neeto/i, "neeto")]) === null || _window$globalProps$a === void 0 || _window$globalProps$a.embed(element, iframeURL);
1438
- }
1436
+ if (!element) return;
1437
+ var appName = globalProps.appName.replace(/^neeto/i, "neeto");
1438
+ (_window$appName = window[appName]) === null || _window$appName === void 0 || _window$appName.embed(element, iframeURL);
1439
1439
  }, [iframeURL]);
1440
1440
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1441
1441
  className: "relative h-full w-full overflow-hidden",
@@ -1470,11 +1470,11 @@ var FloatingPopup = function FloatingPopup(_ref) {
1470
1470
  return "popup-button-".concat(Math.random().toString().substring(2, 10));
1471
1471
  }, [iframeURL]);
1472
1472
  React.useEffect(function () {
1473
+ var _window$appName;
1473
1474
  var element = document.getElementById(elementSelectorId);
1474
- if (element) {
1475
- var _window$globalProps$a;
1476
- (_window$globalProps$a = window[globalProps.appName.replace(/^neeto/i, "neeto")]) === null || _window$globalProps$a === void 0 || _window$globalProps$a.embed(element, iframeURL);
1477
- }
1475
+ if (!element) return;
1476
+ var appName = globalProps.appName.replace(/^neeto/i, "neeto");
1477
+ (_window$appName = window[appName]) === null || _window$appName === void 0 || _window$appName.embed(element, iframeURL);
1478
1478
  }, [iframeURL]);
1479
1479
  React.useEffect(function () {
1480
1480
  var btn = document.getElementById(elementSelectorId);
@@ -1553,15 +1553,22 @@ var buildQueryParams = function buildQueryParams() {
1553
1553
  }, {});
1554
1554
  return _objectSpread$1(_objectSpread$1({}, existingQueryParams), activeOptions);
1555
1555
  };
1556
- var buildIframeURL = function buildIframeURL(iframeURL, queryParams, customization) {
1557
- var url = new URL(iframeURL);
1556
+ var buildIframeURL = function buildIframeURL(_ref) {
1557
+ var previewURL = _ref.previewURL,
1558
+ selectedEmbed = _ref.selectedEmbed,
1559
+ queryParams = _ref.queryParams,
1560
+ customization = _ref.customization;
1561
+ var url = new URL(previewURL);
1558
1562
  var params = buildQueryParams(customization, queryParams);
1559
- Object.entries(params).forEach(function (_ref) {
1560
- var _ref2 = _slicedToArray(_ref, 2),
1561
- name = _ref2[0],
1562
- value = _ref2[1];
1563
+ Object.entries(params).forEach(function (_ref2) {
1564
+ var _ref3 = _slicedToArray(_ref2, 2),
1565
+ name = _ref3[0],
1566
+ value = _ref3[1];
1563
1567
  url.searchParams.append(name, value);
1564
1568
  });
1569
+ if (selectedEmbed === EMBED_OPTIONS.FLOATING_POPUP || selectedEmbed === EMBED_OPTIONS.ELEMENT_POPUP) {
1570
+ url.searchParams.set("dynamicHeight", "true");
1571
+ }
1565
1572
  return url.toString();
1566
1573
  };
1567
1574
 
@@ -1580,7 +1587,12 @@ var Preview = function Preview(_ref) {
1580
1587
  queryParams = _useProductEmbedStore.queryParams;
1581
1588
  var preview = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, Inline), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopup), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopup), EMBED_OPTIONS.IFRAME, Iframe);
1582
1589
  var previewURL = customPreviewIframeUrl || "".concat(location.origin, "/embed/").concat(id);
1583
- var iframeURL = buildIframeURL(previewURL, queryParams, customization);
1590
+ var iframeURL = buildIframeURL({
1591
+ previewURL: previewURL,
1592
+ selectedEmbed: selectedEmbed,
1593
+ queryParams: queryParams,
1594
+ customization: customization
1595
+ });
1584
1596
  var Component = preview[selectedEmbed];
1585
1597
  if (isScriptLoading) {
1586
1598
  return /*#__PURE__*/jsxRuntime.jsx("div", {