@bigbinary/neeto-molecules 5.3.9 → 5.3.11

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.
@@ -7,7 +7,6 @@ var reactRouterDom = require('react-router-dom');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
9
9
  var classnames = require('classnames');
10
- var useStateWithDependency = require('@bigbinary/neeto-commons-frontend/react-utils/useStateWithDependency');
11
10
  var LeftArrow = require('@bigbinary/neeto-icons/LeftArrow');
12
11
  var Button = require('@bigbinary/neetoui/Button');
13
12
  var Typography = require('@bigbinary/neetoui/Typography');
@@ -1646,12 +1645,23 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
1646
1645
  _useState2 = _slicedToArray(_useState, 2),
1647
1646
  isScriptLoading = _useState2[0],
1648
1647
  setIsScriptLoading = _useState2[1];
1649
- var _useStateWithDependen = useStateWithDependency(function () {
1648
+ var _useState3 = React.useState(function () {
1650
1649
  return buildDefaultCustomization(options);
1651
- }, [options === null || options === void 0 || (_options$iframe = options.iframe) === null || _options$iframe === void 0 ? void 0 : _options$iframe.iframeUrl]),
1652
- _useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
1653
- customizations = _useStateWithDependen2[0],
1654
- setCustomizations = _useStateWithDependen2[1];
1650
+ }),
1651
+ _useState4 = _slicedToArray(_useState3, 2),
1652
+ customizations = _useState4[0],
1653
+ setCustomizations = _useState4[1];
1654
+ var iframeUrl = options === null || options === void 0 || (_options$iframe = options.iframe) === null || _options$iframe === void 0 ? void 0 : _options$iframe.iframeUrl;
1655
+ React.useEffect(function () {
1656
+ setCustomizations(function (prevState) {
1657
+ var _prevState$iframe;
1658
+ return ((_prevState$iframe = prevState.iframe) === null || _prevState$iframe === void 0 ? void 0 : _prevState$iframe.iframeUrl) === iframeUrl ? prevState : _objectSpread$1(_objectSpread$1({}, prevState), {}, {
1659
+ iframe: _objectSpread$1(_objectSpread$1({}, prevState.iframe), {}, {
1660
+ iframeUrl: iframeUrl
1661
+ })
1662
+ });
1663
+ });
1664
+ }, [iframeUrl]);
1655
1665
  var description = customizations[selectedEmbed].description;
1656
1666
  var customization = customizations[selectedEmbed];
1657
1667
  var CustomizationComponent = EMBED_CUSTOMIZATION_COMPONENTS[selectedEmbed];
@@ -1853,7 +1863,7 @@ var ProductEmbed = function ProductEmbed(_ref) {
1853
1863
  queryParamsProps: queryParamsProps
1854
1864
  });
1855
1865
  }, []);
1856
- return selectedEmbed ? /*#__PURE__*/jsxRuntime.jsx(EmbedRenderer, {
1866
+ return selectedEmbed ? /*#__PURE__*/React.createElement(EmbedRenderer, {
1857
1867
  className: className,
1858
1868
  customEmbedScriptPath: customEmbedScriptPath,
1859
1869
  customPreviewIframeUrl: customPreviewIframeUrl,
@@ -1865,7 +1875,8 @@ var ProductEmbed = function ProductEmbed(_ref) {
1865
1875
  otherCustomizations: otherCustomizations,
1866
1876
  queryParamsProps: queryParamsProps,
1867
1877
  selectedEmbed: selectedEmbed,
1868
- supportedLanguages: supportedLanguages
1878
+ supportedLanguages: supportedLanguages,
1879
+ key: id
1869
1880
  }) : /*#__PURE__*/jsxRuntime.jsx(EmbedSelector, {
1870
1881
  goBackLink: goBackLink,
1871
1882
  options: options,