@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.cjs.js CHANGED
@@ -1148,7 +1148,8 @@ var Customize = function Customize(_ref) {
1148
1148
  onCreateTheme = _ref.onCreateTheme,
1149
1149
  onApplyTheme = _ref.onApplyTheme,
1150
1150
  isApplyingTheme = _ref.isApplyingTheme,
1151
- onPropertiesChange = _ref.onPropertiesChange;
1151
+ onPropertiesChange = _ref.onPropertiesChange,
1152
+ onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
1152
1153
  var _useTranslation = reactI18next.useTranslation(),
1153
1154
  t = _useTranslation.t;
1154
1155
  var _useState = react.useState({}),
@@ -1194,9 +1195,10 @@ var Customize = function Customize(_ref) {
1194
1195
  }
1195
1196
  return updateTheme(themeToSave, {
1196
1197
  onSuccess: function onSuccess() {
1197
- return resetForm({
1198
+ resetForm({
1198
1199
  values: values
1199
1200
  });
1201
+ onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 || onUpdateThemeSuccess(values);
1200
1202
  }
1201
1203
  });
1202
1204
  };
@@ -1532,11 +1534,13 @@ var Card = function Card(_ref) {
1532
1534
  },
1533
1535
  menuItems: [{
1534
1536
  key: "edit",
1537
+ "data-cy": "edit-theme-menu-item",
1535
1538
  label: t("neetoThemes.common.edit"),
1536
1539
  isVisible: neetoCist.isPresent(onEditTheme),
1537
1540
  onClick: handleEditTheme
1538
1541
  }, {
1539
1542
  key: "clone",
1543
+ "data-cy": "clone-theme-menu-item",
1540
1544
  label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
1541
1545
  onClick: handleCloneTheme
1542
1546
  }, {
@@ -1767,7 +1771,8 @@ var Sidebar = function Sidebar(_ref) {
1767
1771
  var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
1768
1772
  var thumbnail = _ref.thumbnail,
1769
1773
  onPropertiesChange = _ref.onPropertiesChange,
1770
- onApplyThemeSuccess = _ref.onApplyThemeSuccess;
1774
+ onApplyThemeSuccess = _ref.onApplyThemeSuccess,
1775
+ onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
1771
1776
  var _useState = react.useState(DESIGN_SCREENS.THEMES),
1772
1777
  _useState2 = _slicedToArray__default["default"](_useState, 2),
1773
1778
  currentScreen = _useState2[0],
@@ -1834,7 +1839,7 @@ var Sidebar = function Sidebar(_ref) {
1834
1839
  });
1835
1840
  setThemeBeingApplied({});
1836
1841
  setCurrentScreen(DESIGN_SCREENS.THEMES);
1837
- onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess();
1842
+ onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
1838
1843
  }
1839
1844
  }),
1840
1845
  applyTheme = _useApplyTheme.mutate,
@@ -1930,6 +1935,7 @@ var Sidebar = function Sidebar(_ref) {
1930
1935
  onApplyTheme: onApplyTheme,
1931
1936
  onCreateTheme: onCreateTheme,
1932
1937
  onPropertiesChange: onPropertiesChange,
1938
+ onUpdateThemeSuccess: onUpdateThemeSuccess,
1933
1939
  theme: themeToEdit.current,
1934
1940
  themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
1935
1941
  }), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
@@ -1959,7 +1965,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
1959
1965
  _ref$isTemplateThemes = _ref.isTemplateThemesEnabled,
1960
1966
  isTemplateThemesEnabled = _ref$isTemplateThemes === void 0 ? false : _ref$isTemplateThemes,
1961
1967
  _ref$onApplyThemeSucc = _ref.onApplyThemeSuccess,
1962
- onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? neetoCist.noop : _ref$onApplyThemeSucc;
1968
+ onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? neetoCist.noop : _ref$onApplyThemeSucc,
1969
+ _ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
1970
+ onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? neetoCist.noop : _ref$onUpdateThemeSuc;
1963
1971
  var _useThemeStore = useThemeStore(function (store) {
1964
1972
  return {
1965
1973
  setThemeState: store["setThemeState"]
@@ -2008,6 +2016,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2008
2016
  children: [/*#__PURE__*/jsxRuntime.jsx(Sidebar, {
2009
2017
  onApplyThemeSuccess: onApplyThemeSuccess,
2010
2018
  onPropertiesChange: onPropertiesChange,
2019
+ onUpdateThemeSuccess: onUpdateThemeSuccess,
2011
2020
  thumbnail: thumbnail
2012
2021
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
2013
2022
  className: "neeto-themes-preview__wrapper",