@bigbinary/neeto-themes-frontend 3.0.2 → 3.0.4
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.
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"headerTabs": {
|
|
56
56
|
"themes": "Themes"
|
|
57
57
|
},
|
|
58
|
+
"helpPopover": {
|
|
59
|
+
"title": "Themes",
|
|
60
|
+
"description": "Personalize your {{entityType}} to match your brand."
|
|
61
|
+
},
|
|
58
62
|
"themes": {
|
|
59
63
|
"systemThemes": "System themes",
|
|
60
64
|
"customThemes": "Custom themes",
|
|
@@ -63,7 +67,7 @@
|
|
|
63
67
|
"delete": "Delete",
|
|
64
68
|
"setAsGlobalTheme": {
|
|
65
69
|
"label": "Set as global theme",
|
|
66
|
-
"helpText": "Enabling this will set this theme as the default theme, automatically applying it to all your future {{entityType}}s.",
|
|
70
|
+
"helpText": "Enabling this will set this theme as the default theme, automatically applying it to all your future {{entityType}}s. This theme will also be applied to the {{entityType}}s that uses the previous global theme.",
|
|
67
71
|
"tooltipContent": "This theme is currently set as the global theme. Select another theme to change it."
|
|
68
72
|
}
|
|
69
73
|
},
|
|
@@ -140,7 +140,7 @@ var useListThemes = function useListThemes(entityId) {
|
|
|
140
140
|
};
|
|
141
141
|
var useCreateTheme = function useCreateTheme() {
|
|
142
142
|
return useMutationWithInvalidation(themesApi.create, {
|
|
143
|
-
keysToInvalidate: [[QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
143
|
+
keysToInvalidate: [[QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.THEME_ENTITY_DETAILS], [QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
144
144
|
});
|
|
145
145
|
};
|
|
146
146
|
var useUpdateTheme = function useUpdateTheme(themeId) {
|
|
@@ -172,7 +172,7 @@ var useApplyTheme = function useApplyTheme(_ref) {
|
|
|
172
172
|
};
|
|
173
173
|
var useApplyGlobalTheme = function useApplyGlobalTheme() {
|
|
174
174
|
return useMutationWithInvalidation(themesApi.applyGlobalTheme, {
|
|
175
|
-
keysToInvalidate: [[QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
175
|
+
keysToInvalidate: [[QUERY_KEYS.GLOBAL_THEME_DETAILS], [QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.THEME_ENTITY_DETAILS]]
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
|
|
@@ -1154,6 +1154,7 @@ var Customize = function Customize(_ref) {
|
|
|
1154
1154
|
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1155
1155
|
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3;
|
|
1156
1156
|
var isThemeGlobalTheme = (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
|
|
1157
|
+
var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
|
|
1157
1158
|
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
1158
1159
|
var submitBtnRef = useRef(null);
|
|
1159
1160
|
var _useCreateTheme = useCreateTheme(),
|
|
@@ -1288,7 +1289,6 @@ var Customize = function Customize(_ref) {
|
|
|
1288
1289
|
appendTo: function appendTo() {
|
|
1289
1290
|
return document.body;
|
|
1290
1291
|
},
|
|
1291
|
-
disabled: isEditingCurrentlyAppliedTheme,
|
|
1292
1292
|
position: "top",
|
|
1293
1293
|
reference: submitBtnRef,
|
|
1294
1294
|
trigger: "click",
|
|
@@ -1325,6 +1325,7 @@ var Customize = function Customize(_ref) {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
})]
|
|
1327
1327
|
}),
|
|
1328
|
+
disabled: isEditingCurrentlyAppliedTheme || isCurrentThemeAndGlobalThemeSame && values.shouldSetAsGlobalTheme,
|
|
1328
1329
|
onMount: setPopoverInstance
|
|
1329
1330
|
})]
|
|
1330
1331
|
});
|
|
@@ -1640,6 +1641,7 @@ var Themes = function Themes(_ref) {
|
|
|
1640
1641
|
thumbnail = _ref.thumbnail,
|
|
1641
1642
|
themeBeingApplied = _ref.themeBeingApplied,
|
|
1642
1643
|
onApplyTheme = _ref.onApplyTheme,
|
|
1644
|
+
onApplyGlobalThemeSuccess = _ref.onApplyGlobalThemeSuccess,
|
|
1643
1645
|
isApplyingTheme = _ref.isApplyingTheme;
|
|
1644
1646
|
var _useTranslation = useTranslation(),
|
|
1645
1647
|
t = _useTranslation.t;
|
|
@@ -1708,6 +1710,10 @@ var Themes = function Themes(_ref) {
|
|
|
1708
1710
|
applyGlobalTheme({
|
|
1709
1711
|
themeId: themeId,
|
|
1710
1712
|
payload: payload
|
|
1713
|
+
}, {
|
|
1714
|
+
onSuccess: function onSuccess() {
|
|
1715
|
+
onApplyGlobalThemeSuccess === null || onApplyGlobalThemeSuccess === void 0 ? void 0 : onApplyGlobalThemeSuccess();
|
|
1716
|
+
}
|
|
1711
1717
|
});
|
|
1712
1718
|
};
|
|
1713
1719
|
if (isLoading || isCurrentThemeLoading || isLoadingGlobalTheme) {
|
|
@@ -1801,18 +1807,37 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1801
1807
|
themeToEdit = _ref.themeToEdit;
|
|
1802
1808
|
var _useTranslation = useTranslation(),
|
|
1803
1809
|
t = _useTranslation.t;
|
|
1810
|
+
var _useConfigStore = useConfigStore(function (store) {
|
|
1811
|
+
return {
|
|
1812
|
+
entityType: store["entityType"],
|
|
1813
|
+
helpDocUrl: store["helpDocUrl"]
|
|
1814
|
+
};
|
|
1815
|
+
}, shallow),
|
|
1816
|
+
entityType = _useConfigStore.entityType,
|
|
1817
|
+
helpDocUrl = _useConfigStore.helpDocUrl;
|
|
1804
1818
|
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1805
1819
|
if (currentScreen === DESIGN_SCREENS.THEMES) {
|
|
1806
1820
|
return /*#__PURE__*/jsx("div", {
|
|
1807
1821
|
className: "neeto-themes-sidebar__header px-6 lg:px-5 xl:px-6",
|
|
1808
1822
|
children: /*#__PURE__*/jsxs("div", {
|
|
1809
1823
|
className: "flex items-center justify-between space-x-2",
|
|
1810
|
-
children: [/*#__PURE__*/
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1824
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1825
|
+
className: "flex space-x-2",
|
|
1826
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1827
|
+
"data-cy": "themes-header",
|
|
1828
|
+
lineHeight: "normal",
|
|
1829
|
+
style: "h3",
|
|
1830
|
+
weight: "semibold",
|
|
1831
|
+
children: t("neetoThemes.build.leftSideBar.headerTabs.themes")
|
|
1832
|
+
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
1833
|
+
helpLinkProps: helpDocUrl && {
|
|
1834
|
+
href: helpDocUrl
|
|
1835
|
+
},
|
|
1836
|
+
title: t("neetoThemes.build.leftSideBar.helpPopover.title"),
|
|
1837
|
+
description: t("neetoThemes.build.leftSideBar.helpPopover.description", {
|
|
1838
|
+
entityType: entityType
|
|
1839
|
+
})
|
|
1840
|
+
})]
|
|
1816
1841
|
}), /*#__PURE__*/jsx("div", {
|
|
1817
1842
|
className: "self-end",
|
|
1818
1843
|
children: /*#__PURE__*/jsx(Button, {
|
|
@@ -1863,7 +1888,8 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1863
1888
|
var thumbnail = _ref.thumbnail,
|
|
1864
1889
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
1865
1890
|
onApplyThemeSuccess = _ref.onApplyThemeSuccess,
|
|
1866
|
-
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess
|
|
1891
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess,
|
|
1892
|
+
onApplyGlobalThemeSuccess = _ref.onApplyGlobalThemeSuccess;
|
|
1867
1893
|
var _useState = useState(DESIGN_SCREENS.THEMES),
|
|
1868
1894
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1869
1895
|
currentScreen = _useState2[0],
|
|
@@ -2034,6 +2060,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
2034
2060
|
highlightTheme: highlightTheme,
|
|
2035
2061
|
isApplyingTheme: isApplyingTheme,
|
|
2036
2062
|
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
2063
|
+
onApplyGlobalThemeSuccess: onApplyGlobalThemeSuccess,
|
|
2037
2064
|
onApplyTheme: onApplyTheme,
|
|
2038
2065
|
themeBeingApplied: themeBeingApplied,
|
|
2039
2066
|
themeToHighlight: themeToHighlight,
|
|
@@ -2084,12 +2111,16 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
2084
2111
|
entityId = _ref.entityId,
|
|
2085
2112
|
thumbnail = _ref.thumbnail,
|
|
2086
2113
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
2114
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
2115
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? null : _ref$helpDocUrl,
|
|
2087
2116
|
_ref$isTemplateThemes = _ref.isTemplateThemesEnabled,
|
|
2088
2117
|
isTemplateThemesEnabled = _ref$isTemplateThemes === void 0 ? false : _ref$isTemplateThemes,
|
|
2089
2118
|
_ref$onApplyThemeSucc = _ref.onApplyThemeSuccess,
|
|
2090
2119
|
onApplyThemeSuccess = _ref$onApplyThemeSucc === void 0 ? noop : _ref$onApplyThemeSucc,
|
|
2091
2120
|
_ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
|
|
2092
|
-
onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? noop : _ref$onUpdateThemeSuc
|
|
2121
|
+
onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? noop : _ref$onUpdateThemeSuc,
|
|
2122
|
+
_ref$onApplyGlobalThe = _ref.onApplyGlobalThemeSuccess,
|
|
2123
|
+
onApplyGlobalThemeSuccess = _ref$onApplyGlobalThe === void 0 ? noop : _ref$onApplyGlobalThe;
|
|
2093
2124
|
var _useThemeStore = useThemeStore(function (store) {
|
|
2094
2125
|
return {
|
|
2095
2126
|
setThemeState: store["setThemeState"]
|
|
@@ -2116,7 +2147,8 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
2116
2147
|
setConfigState({
|
|
2117
2148
|
entityType: entityType,
|
|
2118
2149
|
entityId: entityId,
|
|
2119
|
-
isTemplateThemesEnabled: isTemplateThemesEnabled
|
|
2150
|
+
isTemplateThemesEnabled: isTemplateThemesEnabled,
|
|
2151
|
+
helpDocUrl: helpDocUrl
|
|
2120
2152
|
});
|
|
2121
2153
|
}, []);
|
|
2122
2154
|
useEffect(function () {
|
|
@@ -2125,7 +2157,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
2125
2157
|
previewingTheme: currentTheme
|
|
2126
2158
|
});
|
|
2127
2159
|
setTheme(currentTheme);
|
|
2128
|
-
}, [isLoading, entityId]);
|
|
2160
|
+
}, [isLoading, entityId, currentTheme]);
|
|
2129
2161
|
useEffect(function () {
|
|
2130
2162
|
if (isNotPresent(currentTheme)) return;
|
|
2131
2163
|
setThemeState({
|
|
@@ -2136,6 +2168,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
2136
2168
|
return /*#__PURE__*/jsxs("div", {
|
|
2137
2169
|
className: "neeto-themes__wrapper",
|
|
2138
2170
|
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
2171
|
+
onApplyGlobalThemeSuccess: onApplyGlobalThemeSuccess,
|
|
2139
2172
|
onApplyThemeSuccess: onApplyThemeSuccess,
|
|
2140
2173
|
onPropertiesChange: onPropertiesChange,
|
|
2141
2174
|
onUpdateThemeSuccess: onUpdateThemeSuccess,
|