@redneckz/wildless-cms-uni-blocks 0.14.231 → 0.14.232

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 (97) hide show
  1. package/bundle/EventBus/defaultEventBus.d.ts +2 -2
  2. package/bundle/bundle.umd.js +8 -8
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  5. package/bundle/hooks/useLocation.d.ts +2 -7
  6. package/bundle/hooks/useRegions.d.ts +1 -0
  7. package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  8. package/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  9. package/dist/EventBus/defaultEventBus.d.ts +2 -2
  10. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  11. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  12. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  13. package/dist/hooks/useLocation.d.ts +2 -7
  14. package/dist/hooks/useLocation.js.map +1 -1
  15. package/dist/hooks/useRegions.d.ts +1 -0
  16. package/dist/hooks/useRegions.js.map +1 -1
  17. package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  18. package/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  19. package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  20. package/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  21. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  22. package/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  23. package/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  24. package/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  25. package/lib/EventBus/defaultEventBus.d.ts +2 -2
  26. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  27. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  28. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  29. package/lib/hooks/useLocation.d.ts +2 -7
  30. package/lib/hooks/useLocation.js.map +1 -1
  31. package/lib/hooks/useRegions.d.ts +1 -0
  32. package/lib/hooks/useRegions.js.map +1 -1
  33. package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  34. package/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  35. package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  36. package/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  37. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  38. package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  39. package/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  40. package/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  41. package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -2
  42. package/mobile/bundle/bundle.umd.js +8 -8
  43. package/mobile/bundle/bundle.umd.min.js +1 -1
  44. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  45. package/mobile/bundle/hooks/useLocation.d.ts +2 -7
  46. package/mobile/bundle/hooks/useRegions.d.ts +1 -0
  47. package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  48. package/mobile/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  49. package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -2
  50. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  51. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  52. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  53. package/mobile/dist/hooks/useLocation.d.ts +2 -7
  54. package/mobile/dist/hooks/useLocation.js.map +1 -1
  55. package/mobile/dist/hooks/useRegions.d.ts +1 -0
  56. package/mobile/dist/hooks/useRegions.js.map +1 -1
  57. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  58. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  59. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  60. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  61. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  62. package/mobile/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  63. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  64. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  65. package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -2
  66. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  67. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  68. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  69. package/mobile/lib/hooks/useLocation.d.ts +2 -7
  70. package/mobile/lib/hooks/useLocation.js.map +1 -1
  71. package/mobile/lib/hooks/useRegions.d.ts +1 -0
  72. package/mobile/lib/hooks/useRegions.js.map +1 -1
  73. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  74. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  75. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  76. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  77. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  78. package/mobile/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  79. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  80. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  81. package/mobile/src/EventBus/defaultEventBus.ts +2 -2
  82. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  83. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  84. package/mobile/src/hooks/useLocation.ts +6 -13
  85. package/mobile/src/hooks/useRegions.ts +1 -0
  86. package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  87. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  88. package/mobile/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
  89. package/package.json +1 -1
  90. package/src/EventBus/defaultEventBus.ts +2 -2
  91. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  92. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  93. package/src/hooks/useLocation.ts +6 -13
  94. package/src/hooks/useRegions.ts +1 -0
  95. package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  96. package/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  97. package/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
@@ -1,10 +1,10 @@
1
1
  import { type TabActivationEvent } from '../components/Tabs/TabActivationEvent';
2
- import { type RegionData } from '../hooks/useLocation';
2
+ import { type Region } from '../hooks/useRegions';
3
3
  import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
4
4
  import { type PopupAction } from '../ui-kit/PopupManager/PopupAction';
5
5
  import { EventBus } from './EventBus';
6
6
  interface GlobalEventMap {
7
- location: RegionData;
7
+ location: Region;
8
8
  dialog: DialogAction;
9
9
  popup: PopupAction;
10
10
  tab: TabActivationEvent;
@@ -3069,9 +3069,9 @@
3069
3069
  .map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
3070
3070
  };
3071
3071
 
3072
- const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
3072
+ const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, onClick, children }) => {
3073
3073
  const link = useLink({ isRemote });
3074
- const linkProps = link({ href, target });
3074
+ const linkProps = link({ href, target, onClick });
3075
3075
  const Tag = href ? 'a' : 'div';
3076
3076
  return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), role: href ? 'link' : 'none', children: children }));
3077
3077
  });
@@ -4106,9 +4106,9 @@
4106
4106
  return (jsxs("div", { className: "flex gap-s items-center", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }) })) : null] }));
4107
4107
  });
4108
4108
 
4109
- const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-xs sm:mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
4110
- onChangeLocation && onChangeLocation(region);
4111
- }, type: "button", children: jsx(Text, { size: "text-l", font: "font-light", children: region.name || '' }) }) }, region.id));
4109
+ const renderRegion = (onChangeLocation) => (region) => region.name ? (jsx(LinkWrapper, { isRemote: true, href: `/branches/${region.slug}`, className: "mb-xs sm:mb-2xs hover:text-primary-hover", onClick: () => {
4110
+ onChangeLocation && onChangeLocation(region);
4111
+ }, children: jsx(Text, { size: "text-l", font: "font-light", children: region.name }) }, String(region.id))) : null;
4112
4112
 
4113
4113
  const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
4114
4114
 
@@ -4120,7 +4120,7 @@
4120
4120
  const SEARCH_TERM_MIN_LENGTH = 3;
4121
4121
  const LocationDialog = JSX(({ foreignOffices, defaultLocation }) => {
4122
4122
  const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
4123
- const link = useLink({ isRemote: true, basePath: '/' });
4123
+ const link = useLink({ isRemote: true });
4124
4124
  const { href } = link({ href: `/branches/${currentLocation.slug}` });
4125
4125
  const [query, setQuery] = useState('');
4126
4126
  const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
@@ -4130,7 +4130,7 @@
4130
4130
  selectCurrentLocation(region);
4131
4131
  close();
4132
4132
  }, []);
4133
- return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsxs("div", { className: "mb-s", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx(LinkButton, { href: href, onClick: () => selectCurrentLocation(currentLocation), children: jsx(Text, { color: "text-primary-main", children: currentLocation.name }) })] })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4133
+ return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { isRemote: true, href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4134
4134
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
4135
4135
  .map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
4136
4136
  });
@@ -6005,7 +6005,7 @@
6005
6005
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6006
6006
  });
6007
6007
 
6008
- const packageVersion = "0.14.230";
6008
+ const packageVersion = "0.14.231";
6009
6009
 
6010
6010
  exports.Blocks = Blocks;
6011
6011
  exports.ContentPage = ContentPage;