@bigbinary/neeto-themes-frontend 4.0.3 → 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';
|
|
@@ -1817,10 +1817,9 @@ var Themes = function Themes(_ref) {
|
|
|
1817
1817
|
}, shallow),
|
|
1818
1818
|
entityType = _useConfigStore.entityType,
|
|
1819
1819
|
entityId = _useConfigStore.entityId;
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
setSearchQuery = _useState2[1];
|
|
1820
|
+
var _useQueryParams = useQueryParams(),
|
|
1821
|
+
_useQueryParams$searc = _useQueryParams.searchTerm,
|
|
1822
|
+
searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
|
|
1824
1823
|
var _useCloneTheme = useCloneTheme(),
|
|
1825
1824
|
cloneTheme = _useCloneTheme.mutate;
|
|
1826
1825
|
var _useApplyGlobalTheme = useApplyGlobalTheme(),
|
|
@@ -1845,10 +1844,10 @@ var Themes = function Themes(_ref) {
|
|
|
1845
1844
|
setTheme(theme);
|
|
1846
1845
|
};
|
|
1847
1846
|
var filteredDefaultThemes = defaultThemes.filter(function (theme) {
|
|
1848
|
-
return theme.name.toLowerCase().includes(
|
|
1847
|
+
return theme.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
1849
1848
|
});
|
|
1850
1849
|
var filteredThemes = themes.filter(function (theme) {
|
|
1851
|
-
return theme.name.toLowerCase().includes(
|
|
1850
|
+
return theme.name.toLowerCase().includes(searchTerm.toLowerCase());
|
|
1852
1851
|
});
|
|
1853
1852
|
var isSearchFieldVisible = (themes === null || themes === void 0 ? void 0 : themes.length) + (defaultThemes === null || defaultThemes === void 0 ? void 0 : defaultThemes.length) > 10;
|
|
1854
1853
|
var handleCloneTheme = function handleCloneTheme(data) {
|
|
@@ -1885,14 +1884,14 @@ var Themes = function Themes(_ref) {
|
|
|
1885
1884
|
className: "mb-6 space-y-3",
|
|
1886
1885
|
children: [isSearchFieldVisible && /*#__PURE__*/jsx(Search, {
|
|
1887
1886
|
autoFocus: true,
|
|
1887
|
+
enableUrlSync: true,
|
|
1888
1888
|
autoComplete: "off",
|
|
1889
1889
|
className: "mb-4 mt-1 px-6",
|
|
1890
|
-
placeholder: t("neetoThemes.common.searchThemes")
|
|
1891
|
-
onSearch: setSearchQuery
|
|
1890
|
+
placeholder: t("neetoThemes.common.searchThemes")
|
|
1892
1891
|
}), isEmpty(filteredThemes) && isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsx(Typography, {
|
|
1893
1892
|
className: "text-center",
|
|
1894
|
-
style: "body2",
|
|
1895
1893
|
"data-cy": "no-data-title",
|
|
1894
|
+
style: "body2",
|
|
1896
1895
|
children: t("neetoThemes.common.noResultsFound")
|
|
1897
1896
|
}), isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxs(Fragment, {
|
|
1898
1897
|
children: [/*#__PURE__*/jsx(Typography, {
|