@bigbinary/neeto-themes-frontend 2.0.8 → 2.0.10
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/README.md +88 -18
- package/dist/index.cjs.js +17 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/types.d.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -930,7 +930,9 @@ var Properties = function Properties(_ref) {
|
|
|
930
930
|
var index = findIndexBy({
|
|
931
931
|
key: name
|
|
932
932
|
}, values.properties);
|
|
933
|
-
if (index !== -1
|
|
933
|
+
if (index !== -1 && values.properties[index].value !== value) {
|
|
934
|
+
setFieldValue("properties[".concat(index, "].value"), value);
|
|
935
|
+
}
|
|
934
936
|
setVariable(snakeToCamelCase(name), variableValue !== null && variableValue !== void 0 ? variableValue : value);
|
|
935
937
|
};
|
|
936
938
|
var handleOverlayChange = function handleOverlayChange(key, value) {
|
|
@@ -1096,7 +1098,8 @@ var Customize = function Customize(_ref) {
|
|
|
1096
1098
|
onCreateTheme = _ref.onCreateTheme,
|
|
1097
1099
|
onApplyTheme = _ref.onApplyTheme,
|
|
1098
1100
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1099
|
-
onPropertiesChange = _ref.onPropertiesChange
|
|
1101
|
+
onPropertiesChange = _ref.onPropertiesChange,
|
|
1102
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
|
|
1100
1103
|
var _useTranslation = useTranslation(),
|
|
1101
1104
|
t = _useTranslation.t;
|
|
1102
1105
|
var _useState = useState({}),
|
|
@@ -1142,9 +1145,10 @@ var Customize = function Customize(_ref) {
|
|
|
1142
1145
|
}
|
|
1143
1146
|
return updateTheme(themeToSave, {
|
|
1144
1147
|
onSuccess: function onSuccess() {
|
|
1145
|
-
|
|
1148
|
+
resetForm({
|
|
1146
1149
|
values: values
|
|
1147
1150
|
});
|
|
1151
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 || onUpdateThemeSuccess(values);
|
|
1148
1152
|
}
|
|
1149
1153
|
});
|
|
1150
1154
|
};
|
|
@@ -1480,11 +1484,13 @@ var Card = function Card(_ref) {
|
|
|
1480
1484
|
},
|
|
1481
1485
|
menuItems: [{
|
|
1482
1486
|
key: "edit",
|
|
1487
|
+
"data-cy": "edit-theme-menu-item",
|
|
1483
1488
|
label: t("neetoThemes.common.edit"),
|
|
1484
1489
|
isVisible: isPresent(onEditTheme),
|
|
1485
1490
|
onClick: handleEditTheme
|
|
1486
1491
|
}, {
|
|
1487
1492
|
key: "clone",
|
|
1493
|
+
"data-cy": "clone-theme-menu-item",
|
|
1488
1494
|
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
|
|
1489
1495
|
onClick: handleCloneTheme
|
|
1490
1496
|
}, {
|
|
@@ -1715,7 +1721,8 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1715
1721
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
|
|
1716
1722
|
var thumbnail = _ref.thumbnail,
|
|
1717
1723
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
1718
|
-
onApplyThemeSuccess = _ref.onApplyThemeSuccess
|
|
1724
|
+
onApplyThemeSuccess = _ref.onApplyThemeSuccess,
|
|
1725
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
|
|
1719
1726
|
var _useState = useState(DESIGN_SCREENS.THEMES),
|
|
1720
1727
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1721
1728
|
currentScreen = _useState2[0],
|
|
@@ -1782,7 +1789,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1782
1789
|
});
|
|
1783
1790
|
setThemeBeingApplied({});
|
|
1784
1791
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1785
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess();
|
|
1792
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
|
|
1786
1793
|
}
|
|
1787
1794
|
}),
|
|
1788
1795
|
applyTheme = _useApplyTheme.mutate,
|
|
@@ -1878,6 +1885,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1878
1885
|
onApplyTheme: onApplyTheme,
|
|
1879
1886
|
onCreateTheme: onCreateTheme,
|
|
1880
1887
|
onPropertiesChange: onPropertiesChange,
|
|
1888
|
+
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
1881
1889
|
theme: themeToEdit.current,
|
|
1882
1890
|
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1883
1891
|
}), /*#__PURE__*/jsx(MemoizedAlert, {
|
|
@@ -1907,7 +1915,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1907
1915
|
_ref$isTemplateThemes = _ref.isTemplateThemesEnabled,
|
|
1908
1916
|
isTemplateThemesEnabled = _ref$isTemplateThemes === void 0 ? false : _ref$isTemplateThemes,
|
|
1909
1917
|
_ref$onApplyThemeSucc = _ref.onApplyThemeSuccess,
|
|
1910
|
-
onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? noop : _ref$onApplyThemeSucc
|
|
1918
|
+
onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? noop : _ref$onApplyThemeSucc,
|
|
1919
|
+
_ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
|
|
1920
|
+
onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? noop : _ref$onUpdateThemeSuc;
|
|
1911
1921
|
var _useThemeStore = useThemeStore(function (store) {
|
|
1912
1922
|
return {
|
|
1913
1923
|
setThemeState: store["setThemeState"]
|
|
@@ -1956,6 +1966,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1956
1966
|
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
1957
1967
|
onApplyThemeSuccess: onApplyThemeSuccess,
|
|
1958
1968
|
onPropertiesChange: onPropertiesChange,
|
|
1969
|
+
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
1959
1970
|
thumbnail: thumbnail
|
|
1960
1971
|
}), /*#__PURE__*/jsx("div", {
|
|
1961
1972
|
className: "neeto-themes-preview__wrapper",
|