@bigbinary/neeto-themes-frontend 4.0.2 → 4.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { shallow } from 'zustand/shallow';
|
|
2
2
|
import { Suspense, lazy, useEffect, createElement, useState, useRef, memo, useCallback } from 'react';
|
|
3
3
|
import { hyphenate, isPresent, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
|
|
4
|
-
import { useMutationWithInvalidation, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
+
import { useMutationWithInvalidation, useQueryParams, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
5
5
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
6
6
|
import { useTranslation, Trans } from 'react-i18next';
|
|
7
7
|
import { B as BASE_URL, b as scrollElementIntoView, c as setCustomCSS, g as getDominantColorFromUrl, i as isEditThemeRoute, d as isFunction, e as isNewThemeRoute } from './index-2IfOfZWw.js';
|
|
@@ -1766,6 +1766,7 @@ var Card = function Card(_ref) {
|
|
|
1766
1766
|
key: "delete",
|
|
1767
1767
|
"data-cy": "delete-theme-menu-item",
|
|
1768
1768
|
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.delete"),
|
|
1769
|
+
isDisabled: isApplyingTheme,
|
|
1769
1770
|
isVisible: isFunction(onDeleteTheme),
|
|
1770
1771
|
onClick: function onClick(e) {
|
|
1771
1772
|
e.stopPropagation();
|
|
@@ -1816,10 +1817,9 @@ var Themes = function Themes(_ref) {
|
|
|
1816
1817
|
}, shallow),
|
|
1817
1818
|
entityType = _useConfigStore.entityType,
|
|
1818
1819
|
entityId = _useConfigStore.entityId;
|
|
1819
|
-
var
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
setSearchQuery = _useState2[1];
|
|
1820
|
+
var _useQueryParams = useQueryParams(),
|
|
1821
|
+
_useQueryParams$searc = _useQueryParams.searchTerm,
|
|
1822
|
+
searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
|
|
1823
1823
|
var _useCloneTheme = useCloneTheme(),
|
|
1824
1824
|
cloneTheme = _useCloneTheme.mutate;
|
|
1825
1825
|
var _useApplyGlobalTheme = useApplyGlobalTheme(),
|
|
@@ -1844,10 +1844,10 @@ var Themes = function Themes(_ref) {
|
|
|
1844
1844
|
setTheme(theme);
|
|
1845
1845
|
};
|
|
1846
1846
|
var filteredDefaultThemes = defaultThemes.filter(function (theme) {
|
|
1847
|
-
return theme.name.toLowerCase().includes(
|
|
1847
|
+
return theme.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
1848
1848
|
});
|
|
1849
1849
|
var filteredThemes = themes.filter(function (theme) {
|
|
1850
|
-
return theme.name.toLowerCase().includes(
|
|
1850
|
+
return theme.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
1851
1851
|
});
|
|
1852
1852
|
var isSearchFieldVisible = (themes === null || themes === void 0 ? void 0 : themes.length) + (defaultThemes === null || defaultThemes === void 0 ? void 0 : defaultThemes.length) > 10;
|
|
1853
1853
|
var handleCloneTheme = function handleCloneTheme(data) {
|
|
@@ -1884,14 +1884,14 @@ var Themes = function Themes(_ref) {
|
|
|
1884
1884
|
className: "mb-6 space-y-3",
|
|
1885
1885
|
children: [isSearchFieldVisible && /*#__PURE__*/jsx(Search, {
|
|
1886
1886
|
autoFocus: true,
|
|
1887
|
+
enableUrlSync: true,
|
|
1887
1888
|
autoComplete: "off",
|
|
1888
1889
|
className: "mb-4 mt-1 px-6",
|
|
1889
|
-
placeholder: t("neetoThemes.common.searchThemes")
|
|
1890
|
-
onSearch: setSearchQuery
|
|
1890
|
+
placeholder: t("neetoThemes.common.searchThemes")
|
|
1891
1891
|
}), isEmpty(filteredThemes) && isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsx(Typography, {
|
|
1892
1892
|
className: "text-center",
|
|
1893
|
-
style: "body2",
|
|
1894
1893
|
"data-cy": "no-data-title",
|
|
1894
|
+
style: "body2",
|
|
1895
1895
|
children: t("neetoThemes.common.noResultsFound")
|
|
1896
1896
|
}), isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxs(Fragment, {
|
|
1897
1897
|
children: [/*#__PURE__*/jsx(Typography, {
|