@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.
Files changed (72) hide show
  1. package/bundle/Env.d.ts +2 -0
  2. package/bundle/bundle.umd.js +15 -8
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Footer/LinkList.d.ts +1 -0
  5. package/dist/Env.d.ts +2 -0
  6. package/dist/Env.js.map +1 -1
  7. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  8. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  9. package/dist/components/Footer/LinkList.d.ts +1 -0
  10. package/dist/components/Footer/LinkList.js +2 -2
  11. package/dist/components/Footer/LinkList.js.map +1 -1
  12. package/dist/services/search/tokenize.js +4 -1
  13. package/dist/services/search/tokenize.js.map +1 -1
  14. package/dist/ui-kit/SearchDialog/SearchDialog.js +5 -1
  15. package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  16. package/dist/ui-kit/Sitemap/Sitemap.js +5 -1
  17. package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
  18. package/lib/Env.d.ts +2 -0
  19. package/lib/Env.js.map +1 -1
  20. package/lib/common.css +1 -1
  21. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  22. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  23. package/lib/components/Footer/LinkList.d.ts +1 -0
  24. package/lib/components/Footer/LinkList.js +2 -2
  25. package/lib/components/Footer/LinkList.js.map +1 -1
  26. package/lib/services/search/tokenize.js +4 -1
  27. package/lib/services/search/tokenize.js.map +1 -1
  28. package/lib/ui-kit/SearchDialog/SearchDialog.fixture.d.ts +2 -0
  29. package/lib/ui-kit/SearchDialog/SearchDialog.js +5 -1
  30. package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  31. package/lib/ui-kit/Sitemap/Sitemap.js +5 -1
  32. package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
  33. package/mobile/bundle/Env.d.ts +2 -0
  34. package/mobile/bundle/bundle.umd.js +5 -5
  35. package/mobile/bundle/bundle.umd.min.js +1 -1
  36. package/mobile/bundle/components/Footer/LinkList.d.ts +1 -0
  37. package/mobile/dist/Env.d.ts +2 -0
  38. package/mobile/dist/Env.js.map +1 -1
  39. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  40. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  41. package/mobile/dist/components/Footer/LinkList.d.ts +1 -0
  42. package/mobile/dist/components/Footer/LinkList.js +2 -2
  43. package/mobile/dist/components/Footer/LinkList.js.map +1 -1
  44. package/mobile/dist/services/search/tokenize.js +4 -1
  45. package/mobile/dist/services/search/tokenize.js.map +1 -1
  46. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +5 -1
  47. package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  48. package/mobile/lib/Env.d.ts +2 -0
  49. package/mobile/lib/Env.js.map +1 -1
  50. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  51. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  52. package/mobile/lib/components/Footer/LinkList.d.ts +1 -0
  53. package/mobile/lib/components/Footer/LinkList.js +2 -2
  54. package/mobile/lib/components/Footer/LinkList.js.map +1 -1
  55. package/mobile/lib/services/search/tokenize.js +4 -1
  56. package/mobile/lib/services/search/tokenize.js.map +1 -1
  57. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +5 -1
  58. package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
  59. package/mobile/src/Env.ts +2 -0
  60. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
  61. package/mobile/src/components/Footer/LinkList.tsx +3 -2
  62. package/mobile/src/services/search/tokenize.ts +8 -1
  63. package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +11 -1
  64. package/package.json +1 -1
  65. package/src/Env.ts +2 -0
  66. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
  67. package/src/components/Footer/LinkList.tsx +3 -2
  68. package/src/icons/IconName.ts +4 -4
  69. package/src/services/search/tokenize.ts +8 -1
  70. package/src/ui-kit/SearchDialog/SearchDialog.fixture.tsx +782 -0
  71. package/src/ui-kit/SearchDialog/SearchDialog.tsx +11 -1
  72. package/src/ui-kit/Sitemap/Sitemap.tsx +25 -7
package/bundle/Env.d.ts CHANGED
@@ -2,6 +2,8 @@ export interface Env {
2
2
  SITE_URL?: string;
3
3
  SUB_PORTALS?: string;
4
4
  MOBILE?: string;
5
+ SINGLE_SEARCH_INDEX?: string;
6
+ SEARCH_LANG?: string;
5
7
  }
6
8
  export declare const env: Env & {
7
9
  _: Env;
@@ -10381,7 +10381,7 @@
10381
10381
  };
10382
10382
  const handleInputSell = (setCalcState, currencyRatesSell) => (value, currencyFrom, currencyTo) => {
10383
10383
  setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
10384
- const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
10384
+ const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate ||
10385
10385
  currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate;
10386
10386
  if (rate) {
10387
10387
  setCalcState({
@@ -10391,7 +10391,7 @@
10391
10391
  };
10392
10392
  const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, currencyTo, currencyFrom) => {
10393
10393
  setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
10394
- const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
10394
+ const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate ||
10395
10395
  currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate;
10396
10396
  if (rate) {
10397
10397
  setCalcState({
@@ -10420,9 +10420,9 @@
10420
10420
  });
10421
10421
  const getCurrencyRates = (currencies) => currencies?.filter((_) => [1, 2, 3].includes(_?.currency?.id)) || [];
10422
10422
 
10423
- const LinkList = JSX(({ className = '', items }) => {
10423
+ const LinkList = JSX(({ className = '', items, isFlex = true }) => {
10424
10424
  const link = useLink();
10425
- return (jsx("ul", { className: style('flex flex-col gap-s w-full', className), children: items?.map(renderLinkListItem(link)) }));
10425
+ return (jsx("ul", { className: style(isFlex ? 'flex flex-col gap-s' : 'block', 'w-full', className), children: items?.map(renderLinkListItem(link)) }));
10426
10426
  });
10427
10427
  const renderLinkListItem = (link) => ({ dataFooter, ...linkProps }, i) => {
10428
10428
  const { text, href, target, onClick } = link(linkProps);
@@ -10435,9 +10435,12 @@
10435
10435
  const isVisibleItem = (areaKeys) => (_) => !_.displayArea || areaKeys.includes(_.displayArea.toLowerCase());
10436
10436
 
10437
10437
  const FOOTER_AREA_KEYS = ['all', 'footer'];
10438
+ const IS_SINGLE_SEARCH_INDEX$1 = Boolean(env.SINGLE_SEARCH_INDEX);
10438
10439
  const Sitemap = JSX(({ className, navigationItems }) => {
10439
10440
  const link = useLink();
10440
- return (jsx("div", { role: "menu", className: style('w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2', className), children: navigationItems?.filter(isVisibleItem(FOOTER_AREA_KEYS)).map(link).map(renderColumn) }));
10441
+ const filteredItems = navigationItems?.filter(isVisibleItem(FOOTER_AREA_KEYS))?.map(link) ?? [];
10442
+ const [firstItem] = filteredItems;
10443
+ return (jsx("div", { className: "space-y-2", children: IS_SINGLE_SEARCH_INDEX$1 ? (jsx("div", { children: jsx(LinkList, { className: "columns-3 space-y-3 gap-x-6xl", items: firstItem?.items, isFlex: false }) })) : (jsx("div", { role: "menu", className: style('w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2', className), children: filteredItems?.map(renderColumn) })) }));
10441
10444
  });
10442
10445
  const renderColumn = (menuItem, index) => {
10443
10446
  const { text, items = [], href, target = '_self', onClick, dataFooter } = menuItem;
@@ -10556,10 +10559,12 @@
10556
10559
  const sum = (list = []) => list.reduce((a, b) => a + b, 0);
10557
10560
 
10558
10561
  const MIN_TERM_LEN = 3;
10562
+ const LANG = env.SEARCH_LANG;
10559
10563
  const tokenize = (text) => text
10560
10564
  .toLowerCase()
10561
10565
  .split(/[^0-9a-zа-я-]+/)
10562
- .filter((token) => token.length >= MIN_TERM_LEN && !/[0-9a-z]/.test(token));
10566
+ .filter((token) => token.length >= MIN_TERM_LEN &&
10567
+ (LANG === 'en' ? !/[а-яА-ЯёЁ0-9]/.test(token) : !/[0-9a-z]/.test(token)));
10563
10568
 
10564
10569
  const textRank = (queryTokens) => (text) => {
10565
10570
  const textTokens = tokenize(text || '');
@@ -10642,8 +10647,10 @@
10642
10647
  return (jsxs("div", { className: style('relative', className), role: "form", children: [jsx("div", { className: "absolute h-full flex items-center pl-m pointer-events-none", children: jsx(Img, { image: { icon: 'LoupeIcon', iconVersion: 'black' }, width: "24", height: "24" }) }), jsx("input", { className: style('h-14 w-full px-10 text-l text-black box-border rounded-md', inputValidStyle), value: value, type: "text", name: "search-bar-input", placeholder: placeholder, autoFocus: autoFocus, onChange: handleChange, onFocus: onFocus })] }));
10643
10648
  });
10644
10649
 
10650
+ const IS_SINGLE_SEARCH_INDEX = Boolean(env.SINGLE_SEARCH_INDEX);
10645
10651
  const SearchDialog = JSX(({ initialQuery, navigationItems, onClose }) => {
10646
- const basePathList = useMemo(() => navigationItems?.map((_) => _.href || '/'), [navigationItems]);
10652
+ const basePath = getBasePath(env.SITE_URL);
10653
+ const basePathList = useMemo(() => (IS_SINGLE_SEARCH_INDEX ? [basePath] : navigationItems?.map((_) => _.href || '/')), [navigationItems]);
10647
10654
  const [searchResult, searchInputProps] = useSearch({
10648
10655
  basePathList,
10649
10656
  initialQuery,
@@ -12014,7 +12021,7 @@
12014
12021
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
12015
12022
  });
12016
12023
 
12017
- const packageVersion = "0.14.909";
12024
+ const packageVersion = "0.14.911";
12018
12025
 
12019
12026
  exports.Blocks = Blocks;
12020
12027
  exports.ContentPage = ContentPage;