@redneckz/wildless-cms-uni-blocks 0.14.910 → 0.14.912
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/bundle/Env.d.ts +2 -0
- package/bundle/bundle.umd.js +15 -8
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Footer/LinkList.d.ts +1 -0
- package/dist/Env.d.ts +2 -0
- package/dist/Env.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/components/Footer/LinkList.d.ts +1 -0
- package/dist/components/Footer/LinkList.js +2 -2
- package/dist/components/Footer/LinkList.js.map +1 -1
- package/dist/services/search/tokenize.js +4 -1
- package/dist/services/search/tokenize.js.map +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.js +5 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/Sitemap/Sitemap.js +5 -1
- package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/lib/Env.d.ts +2 -0
- package/lib/Env.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/components/Footer/LinkList.d.ts +1 -0
- package/lib/components/Footer/LinkList.js +2 -2
- package/lib/components/Footer/LinkList.js.map +1 -1
- package/lib/services/search/tokenize.js +4 -1
- package/lib/services/search/tokenize.js.map +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.fixture.d.ts +2 -0
- package/lib/ui-kit/SearchDialog/SearchDialog.js +5 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/Sitemap/Sitemap.js +5 -1
- package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/mobile/bundle/Env.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +5 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Footer/LinkList.d.ts +1 -0
- package/mobile/dist/Env.d.ts +2 -0
- package/mobile/dist/Env.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/components/Footer/LinkList.d.ts +1 -0
- package/mobile/dist/components/Footer/LinkList.js +2 -2
- package/mobile/dist/components/Footer/LinkList.js.map +1 -1
- package/mobile/dist/services/search/tokenize.js +4 -1
- package/mobile/dist/services/search/tokenize.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +5 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/Env.d.ts +2 -0
- package/mobile/lib/Env.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/components/Footer/LinkList.d.ts +1 -0
- package/mobile/lib/components/Footer/LinkList.js +2 -2
- package/mobile/lib/components/Footer/LinkList.js.map +1 -1
- package/mobile/lib/services/search/tokenize.js +4 -1
- package/mobile/lib/services/search/tokenize.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +5 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/src/Env.ts +2 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
- package/mobile/src/components/Footer/LinkList.tsx +3 -2
- package/mobile/src/services/search/tokenize.ts +8 -1
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +11 -1
- package/package.json +1 -1
- package/src/Env.ts +2 -0
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
- package/src/components/Footer/LinkList.tsx +3 -2
- package/src/icons/IconName.ts +4 -4
- package/src/services/search/tokenize.ts +8 -1
- package/src/ui-kit/SearchDialog/SearchDialog.fixture.tsx +782 -0
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +11 -1
- package/src/ui-kit/Sitemap/Sitemap.tsx +25 -7
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type TopMenuItemProps } from '../../data/NavigationData';
|
|
4
|
+
import { env } from '../../Env';
|
|
4
5
|
import { type LinkProps } from '../../model/LinkProps';
|
|
5
6
|
import type { OnCloseProps } from '../../model/OnCloseProps';
|
|
6
7
|
import { useSearch, type SearchResult } from '../../services/search/useSearch';
|
|
7
8
|
import { zip } from '../../utils/fp/zip';
|
|
9
|
+
import { getBasePath } from '../../utils/getBasePath';
|
|
8
10
|
import { joinPath } from '../../utils/url';
|
|
9
11
|
import { Dialog } from '../DialogManager/Dialog';
|
|
10
12
|
import { Sitemap } from '../Sitemap/Sitemap';
|
|
@@ -15,8 +17,16 @@ export interface SearchDialogProps extends OnCloseProps {
|
|
|
15
17
|
navigationItems?: TopMenuItemProps[];
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
const IS_SINGLE_SEARCH_INDEX = Boolean(env.SINGLE_SEARCH_INDEX);
|
|
21
|
+
|
|
18
22
|
export const SearchDialog = JSX<SearchDialogProps>(({ initialQuery, navigationItems, onClose }) => {
|
|
19
|
-
const
|
|
23
|
+
const basePath = getBasePath(env.SITE_URL);
|
|
24
|
+
|
|
25
|
+
const basePathList = useMemo(
|
|
26
|
+
() => (IS_SINGLE_SEARCH_INDEX ? [basePath] : navigationItems?.map((_) => _.href || '/')),
|
|
27
|
+
[navigationItems],
|
|
28
|
+
);
|
|
29
|
+
|
|
20
30
|
const [searchResult, searchInputProps] = useSearch({
|
|
21
31
|
basePathList,
|
|
22
32
|
initialQuery,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { LinkList } from '../../components/Footer/LinkList';
|
|
3
3
|
import { type TopMenuItemProps } from '../../data/NavigationData';
|
|
4
|
+
import { env } from '../../Env';
|
|
4
5
|
import { useLink } from '../../hooks/useLink';
|
|
5
6
|
import { getAspectsAttributes } from '../../utils/dataAttributes';
|
|
6
7
|
import { style } from '../../utils/style';
|
|
@@ -8,19 +9,36 @@ import { isVisibleItem } from './isVisibleItem';
|
|
|
8
9
|
import { type SitemapProps } from './SitemapProps';
|
|
9
10
|
|
|
10
11
|
const FOOTER_AREA_KEYS = ['all', 'footer'];
|
|
12
|
+
const IS_SINGLE_SEARCH_INDEX = Boolean(env.SINGLE_SEARCH_INDEX);
|
|
11
13
|
|
|
12
14
|
export const Sitemap = JSX<SitemapProps>(({ className, navigationItems }) => {
|
|
13
15
|
const link = useLink();
|
|
14
16
|
|
|
17
|
+
const filteredItems = navigationItems?.filter(isVisibleItem(FOOTER_AREA_KEYS))?.map(link) ?? [];
|
|
18
|
+
|
|
19
|
+
const [firstItem] = filteredItems;
|
|
20
|
+
|
|
15
21
|
return (
|
|
16
|
-
<div
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
<div className="space-y-2">
|
|
23
|
+
{IS_SINGLE_SEARCH_INDEX ? (
|
|
24
|
+
<div>
|
|
25
|
+
<LinkList
|
|
26
|
+
className="columns-3 space-y-3 gap-x-6xl"
|
|
27
|
+
items={firstItem?.items}
|
|
28
|
+
isFlex={false}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
) : (
|
|
32
|
+
<div
|
|
33
|
+
role="menu"
|
|
34
|
+
className={style(
|
|
35
|
+
'w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2',
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
{filteredItems?.map(renderColumn)}
|
|
40
|
+
</div>
|
|
21
41
|
)}
|
|
22
|
-
>
|
|
23
|
-
{navigationItems?.filter(isVisibleItem(FOOTER_AREA_KEYS)).map(link).map(renderColumn)}
|
|
24
42
|
</div>
|
|
25
43
|
);
|
|
26
44
|
});
|