@bigbinary/neeto-molecules 5.3.10 → 5.3.12

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.
@@ -8,7 +8,6 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
9
9
  var neetoAtoms = require('@bigbinary/neeto-atoms');
10
10
  var classnames = require('classnames');
11
- var useStateWithDependency = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useStateWithDependency');
12
11
  var ramda = require('ramda');
13
12
  var reactI18next = require('react-i18next');
14
13
  var i18next = require('i18next');
@@ -1634,12 +1633,23 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
1634
1633
  _useState2 = _slicedToArray(_useState, 2),
1635
1634
  isScriptLoading = _useState2[0],
1636
1635
  setIsScriptLoading = _useState2[1];
1637
- var _useStateWithDependen = useStateWithDependency(function () {
1636
+ var _useState3 = React.useState(function () {
1638
1637
  return buildDefaultCustomization(options);
1639
- }, [options === null || options === void 0 || (_options$iframe = options.iframe) === null || _options$iframe === void 0 ? void 0 : _options$iframe.iframeUrl]),
1640
- _useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
1641
- customizations = _useStateWithDependen2[0],
1642
- setCustomizations = _useStateWithDependen2[1];
1638
+ }),
1639
+ _useState4 = _slicedToArray(_useState3, 2),
1640
+ customizations = _useState4[0],
1641
+ setCustomizations = _useState4[1];
1642
+ var iframeUrl = options === null || options === void 0 || (_options$iframe = options.iframe) === null || _options$iframe === void 0 ? void 0 : _options$iframe.iframeUrl;
1643
+ React.useEffect(function () {
1644
+ setCustomizations(function (prevState) {
1645
+ var _prevState$iframe;
1646
+ return ((_prevState$iframe = prevState.iframe) === null || _prevState$iframe === void 0 ? void 0 : _prevState$iframe.iframeUrl) === iframeUrl ? prevState : _objectSpread$1(_objectSpread$1({}, prevState), {}, {
1647
+ iframe: _objectSpread$1(_objectSpread$1({}, prevState.iframe), {}, {
1648
+ iframeUrl: iframeUrl
1649
+ })
1650
+ });
1651
+ });
1652
+ }, [iframeUrl]);
1643
1653
  var description = customizations[selectedEmbed].description;
1644
1654
  var customization = customizations[selectedEmbed];
1645
1655
  var CustomizationComponent = EMBED_CUSTOMIZATION_COMPONENTS[selectedEmbed];
@@ -1859,7 +1869,7 @@ var ProductEmbed = function ProductEmbed(_ref) {
1859
1869
  queryParamsProps: queryParamsProps
1860
1870
  });
1861
1871
  }, []);
1862
- return selectedEmbed ? /*#__PURE__*/jsxRuntime.jsx(EmbedRenderer, {
1872
+ return selectedEmbed ? /*#__PURE__*/React.createElement(EmbedRenderer, {
1863
1873
  className: className,
1864
1874
  customEmbedScriptPath: customEmbedScriptPath,
1865
1875
  customPreviewIframeUrl: customPreviewIframeUrl,
@@ -1871,7 +1881,8 @@ var ProductEmbed = function ProductEmbed(_ref) {
1871
1881
  otherCustomizations: otherCustomizations,
1872
1882
  queryParamsProps: queryParamsProps,
1873
1883
  selectedEmbed: selectedEmbed,
1874
- supportedLanguages: supportedLanguages
1884
+ supportedLanguages: supportedLanguages,
1885
+ key: id
1875
1886
  }) : /*#__PURE__*/jsxRuntime.jsx(EmbedSelector, {
1876
1887
  goBackLink: goBackLink,
1877
1888
  options: options,