@bigbinary/neeto-themes-frontend 2.0.8 → 2.0.9

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/index.js CHANGED
@@ -1096,7 +1096,8 @@ var Customize = function Customize(_ref) {
1096
1096
  onCreateTheme = _ref.onCreateTheme,
1097
1097
  onApplyTheme = _ref.onApplyTheme,
1098
1098
  isApplyingTheme = _ref.isApplyingTheme,
1099
- onPropertiesChange = _ref.onPropertiesChange;
1099
+ onPropertiesChange = _ref.onPropertiesChange,
1100
+ onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
1100
1101
  var _useTranslation = useTranslation(),
1101
1102
  t = _useTranslation.t;
1102
1103
  var _useState = useState({}),
@@ -1142,9 +1143,10 @@ var Customize = function Customize(_ref) {
1142
1143
  }
1143
1144
  return updateTheme(themeToSave, {
1144
1145
  onSuccess: function onSuccess() {
1145
- return resetForm({
1146
+ resetForm({
1146
1147
  values: values
1147
1148
  });
1149
+ onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 || onUpdateThemeSuccess(values);
1148
1150
  }
1149
1151
  });
1150
1152
  };
@@ -1480,11 +1482,13 @@ var Card = function Card(_ref) {
1480
1482
  },
1481
1483
  menuItems: [{
1482
1484
  key: "edit",
1485
+ "data-cy": "edit-theme-menu-item",
1483
1486
  label: t("neetoThemes.common.edit"),
1484
1487
  isVisible: isPresent(onEditTheme),
1485
1488
  onClick: handleEditTheme
1486
1489
  }, {
1487
1490
  key: "clone",
1491
+ "data-cy": "clone-theme-menu-item",
1488
1492
  label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
1489
1493
  onClick: handleCloneTheme
1490
1494
  }, {
@@ -1715,7 +1719,8 @@ var Sidebar = function Sidebar(_ref) {
1715
1719
  var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
1716
1720
  var thumbnail = _ref.thumbnail,
1717
1721
  onPropertiesChange = _ref.onPropertiesChange,
1718
- onApplyThemeSuccess = _ref.onApplyThemeSuccess;
1722
+ onApplyThemeSuccess = _ref.onApplyThemeSuccess,
1723
+ onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
1719
1724
  var _useState = useState(DESIGN_SCREENS.THEMES),
1720
1725
  _useState2 = _slicedToArray(_useState, 2),
1721
1726
  currentScreen = _useState2[0],
@@ -1782,7 +1787,7 @@ var Sidebar = function Sidebar(_ref) {
1782
1787
  });
1783
1788
  setThemeBeingApplied({});
1784
1789
  setCurrentScreen(DESIGN_SCREENS.THEMES);
1785
- onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess();
1790
+ onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
1786
1791
  }
1787
1792
  }),
1788
1793
  applyTheme = _useApplyTheme.mutate,
@@ -1878,6 +1883,7 @@ var Sidebar = function Sidebar(_ref) {
1878
1883
  onApplyTheme: onApplyTheme,
1879
1884
  onCreateTheme: onCreateTheme,
1880
1885
  onPropertiesChange: onPropertiesChange,
1886
+ onUpdateThemeSuccess: onUpdateThemeSuccess,
1881
1887
  theme: themeToEdit.current,
1882
1888
  themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
1883
1889
  }), /*#__PURE__*/jsx(MemoizedAlert, {
@@ -1907,7 +1913,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
1907
1913
  _ref$isTemplateThemes = _ref.isTemplateThemesEnabled,
1908
1914
  isTemplateThemesEnabled = _ref$isTemplateThemes === void 0 ? false : _ref$isTemplateThemes,
1909
1915
  _ref$onApplyThemeSucc = _ref.onApplyThemeSuccess,
1910
- onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? noop : _ref$onApplyThemeSucc;
1916
+ onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? noop : _ref$onApplyThemeSucc,
1917
+ _ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
1918
+ onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? noop : _ref$onUpdateThemeSuc;
1911
1919
  var _useThemeStore = useThemeStore(function (store) {
1912
1920
  return {
1913
1921
  setThemeState: store["setThemeState"]
@@ -1956,6 +1964,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
1956
1964
  children: [/*#__PURE__*/jsx(Sidebar, {
1957
1965
  onApplyThemeSuccess: onApplyThemeSuccess,
1958
1966
  onPropertiesChange: onPropertiesChange,
1967
+ onUpdateThemeSuccess: onUpdateThemeSuccess,
1959
1968
  thumbnail: thumbnail
1960
1969
  }), /*#__PURE__*/jsx("div", {
1961
1970
  className: "neeto-themes-preview__wrapper",