@redneckz/wildless-cms-uni-blocks 0.14.195 → 0.14.197

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 (37) hide show
  1. package/bundle/bundle.umd.js +17 -17
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/AdTile/AdTile.js +3 -1
  4. package/dist/components/AdTile/AdTile.js.map +1 -1
  5. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  6. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  7. package/dist/ui-kit/Shimmer/Shimmer.js +1 -1
  8. package/dist/ui-kit/Shimmer/Shimmer.js.map +1 -1
  9. package/lib/common.css +1 -1
  10. package/lib/components/AdTile/AdTile.js +3 -1
  11. package/lib/components/AdTile/AdTile.js.map +1 -1
  12. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  13. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  14. package/lib/ui-kit/Shimmer/Shimmer.js +1 -1
  15. package/lib/ui-kit/Shimmer/Shimmer.js.map +1 -1
  16. package/mobile/bundle/bundle.umd.js +17 -17
  17. package/mobile/bundle/bundle.umd.min.js +1 -1
  18. package/mobile/dist/components/AdTile/AdTile.js +3 -1
  19. package/mobile/dist/components/AdTile/AdTile.js.map +1 -1
  20. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  21. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  22. package/mobile/dist/ui-kit/Shimmer/Shimmer.js +1 -1
  23. package/mobile/dist/ui-kit/Shimmer/Shimmer.js.map +1 -1
  24. package/mobile/lib/common.css +1 -1
  25. package/mobile/lib/components/AdTile/AdTile.js +3 -1
  26. package/mobile/lib/components/AdTile/AdTile.js.map +1 -1
  27. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +2 -2
  28. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
  29. package/mobile/lib/ui-kit/Shimmer/Shimmer.js +1 -1
  30. package/mobile/lib/ui-kit/Shimmer/Shimmer.js.map +1 -1
  31. package/mobile/src/components/AdTile/AdTile.tsx +7 -1
  32. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
  33. package/mobile/src/ui-kit/Shimmer/Shimmer.tsx +1 -1
  34. package/package.json +1 -1
  35. package/src/components/AdTile/AdTile.tsx +7 -1
  36. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
  37. package/src/ui-kit/Shimmer/Shimmer.tsx +1 -1
@@ -74,11 +74,6 @@
74
74
  return JSXTmpl;
75
75
  };
76
76
 
77
- const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
78
-
79
- const isClient = !isSSR();
80
- const ClientOnly = JSX(({ children }) => (isClient ? children : null));
81
-
82
77
  class EventBus {
83
78
  subscribers = {};
84
79
  subjectsStateMap = {};
@@ -156,6 +151,19 @@
156
151
  return (jsx(Tag, { className: style('@container font-sans', isGroup ? 'group' : '', blockStyles[version], isHidden ? 'hidden' : '', padding || defaultPadding, className), ...(isGroup ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor } : {}), role: role, style: inlineStyles, children: children }));
157
152
  });
158
153
 
154
+ const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
155
+
156
+ const isClient = !isSSR();
157
+ const ClientOnly = JSX(({ children }) => (isClient ? children : null));
158
+
159
+ const GOLDEN_RATIO = 1.618;
160
+ const Shimmer = JSX(({ className, size }) => (jsx("figure", { className: style('m-0 mt-xl min-w-[80%]', className), children: renderShimmer(size) })));
161
+ const renderShimmer = (size = 3) => goldenSequence(100, size)
162
+ .map((_) => Math.floor(_))
163
+ .map(renderShimmerItem);
164
+ const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse" }, String(index)));
165
+ const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
166
+
159
167
  const headingTag = (tag) => tag;
160
168
 
161
169
  const styles$2 = {
@@ -795,7 +803,7 @@
795
803
  const { items } = (props.options?.page?.adSourceBook ?? {});
796
804
  const tileIndex = useMemo(() => randomNumber(0, items?.length), [items]);
797
805
  const content = items?.[tileIndex];
798
- return content ? (jsx(ClientOnly, { children: jsx(ProductBlock, { ...content, ...props }) })) : null;
806
+ return content ? (jsx(ClientOnly, { children: jsx(ProductBlock, { ...content, ...props }) })) : (jsx(BlockWrapper, { ...props, children: jsx(Shimmer, {}) }));
799
807
  });
800
808
  const randomNumber = (min = 0, max = 0) => Math.floor(Math.random() * (max - min) + min);
801
809
 
@@ -3849,7 +3857,7 @@
3849
3857
  const handleInputSell = (setCalcState, currencyRatesSell) => (value, currencyFrom, currencyTo) => {
3850
3858
  setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
3851
3859
  const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
3852
- currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate;
3860
+ currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate;
3853
3861
  if (rate) {
3854
3862
  setCalcState({
3855
3863
  inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
@@ -3859,7 +3867,7 @@
3859
3867
  const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, currencyTo, currencyFrom) => {
3860
3868
  setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
3861
3869
  const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
3862
- currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate;
3870
+ currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate;
3863
3871
  if (rate) {
3864
3872
  setCalcState({
3865
3873
  inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
@@ -5210,14 +5218,6 @@
5210
5218
  return (jsx(BlockWrapper, { version: "transparent", className: style(className), defaultPadding: "p-0", ...rest, children: dataType === 'offices' ? jsx(OfficesMap, {}) : jsx(AtmsMap, { data: data }) }));
5211
5219
  });
5212
5220
 
5213
- const GOLDEN_RATIO = 1.618;
5214
- const Shimmer = JSX(({ className, size }) => (jsx("figure", { className: style('m-0 mt-xl min-w-[80%]', className), children: renderShimmer(size) })));
5215
- const renderShimmer = (size = 3) => goldenSequence(100, size)
5216
- .map((_) => Math.floor(_))
5217
- .map(renderShimmerItem);
5218
- const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-xs bg-secondary-light" }, String(index)));
5219
- const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
5220
-
5221
5221
  const Placeholder = JSX(({ className, title, description = 'Блок в разработке...', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border', className), ...rest, children: [jsx(Headline, { className: "max-w-[600px]", title: title, description: description, headlineVersion: "L", align: "text-left", isEmbedded: true }), jsx(Shimmer, {})] })));
5222
5222
 
5223
5223
  const ProductGallery = JSX(({ className = '', padding, slides = [], ...rest }) => {
@@ -6074,7 +6074,7 @@
6074
6074
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6075
6075
  });
6076
6076
 
6077
- const packageVersion = "0.14.194";
6077
+ const packageVersion = "0.14.196";
6078
6078
 
6079
6079
  exports.Blocks = Blocks;
6080
6080
  exports.ContentPage = ContentPage;