@redneckz/wildless-cms-uni-blocks 0.14.975 → 0.14.977

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 (55) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +17 -12
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/GalleryLayout/utils.d.ts +1 -1
  5. package/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
  6. package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  7. package/bundle/model/HeadlineType.d.ts +15 -8
  8. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
  9. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  10. package/dist/components/GalleryLayout/utils.d.ts +1 -1
  11. package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  12. package/dist/components/ProductBlock/ProductBlock.js +15 -10
  13. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  14. package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  15. package/dist/model/HeadlineType.d.ts +15 -8
  16. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
  17. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  18. package/lib/components/GalleryLayout/utils.d.ts +1 -1
  19. package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  20. package/lib/components/ProductBlock/ProductBlock.js +15 -10
  21. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  22. package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  23. package/lib/model/HeadlineType.d.ts +15 -8
  24. package/mobile/bundle/bundle.umd.js +17 -12
  25. package/mobile/bundle/bundle.umd.min.js +1 -1
  26. package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -1
  27. package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
  28. package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  29. package/mobile/bundle/model/HeadlineType.d.ts +15 -8
  30. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
  31. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  32. package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -1
  33. package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
  34. package/mobile/dist/components/ProductBlock/ProductBlock.js +15 -10
  35. package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  36. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  37. package/mobile/dist/model/HeadlineType.d.ts +15 -8
  38. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
  39. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  40. package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -1
  41. package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
  42. package/mobile/lib/components/ProductBlock/ProductBlock.js +15 -10
  43. package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  44. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
  45. package/mobile/lib/model/HeadlineType.d.ts +15 -8
  46. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
  47. package/mobile/src/components/ProductBlock/ProductBlock.tsx +26 -17
  48. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -5
  49. package/mobile/src/model/HeadlineType.ts +16 -8
  50. package/package.json +1 -1
  51. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
  52. package/src/components/ProductBlock/ProductBlock.fixture.tsx +16 -7
  53. package/src/components/ProductBlock/ProductBlock.tsx +26 -17
  54. package/src/components/ProductBlock/ProductBlockContent.ts +2 -5
  55. package/src/model/HeadlineType.ts +16 -8
@@ -12,12 +12,20 @@ const image: Picture = {
12
12
  format: 'webp',
13
13
  alt: 'Потребительский кредит наличными',
14
14
  size: {
15
- width: 280,
16
- height: 280,
15
+ width: 510,
16
+ height: 510,
17
17
  },
18
18
  };
19
19
 
20
20
  const benefits: BenefitItemContent[] = [
21
+ {
22
+ isDotted: true,
23
+ icon: {
24
+ sources: [],
25
+ iconVersion: 'normal',
26
+ },
27
+ __html: '<h2>ПРИВЕДИ ДРУГА В БАНК И ПОЛУЧИ ДО 1500 БАЛЛОВ</h2><p><br></p>',
28
+ },
21
29
  {
22
30
  label: 'До 5 млн ₽',
23
31
  description: 'Кредитный лимит',
@@ -268,19 +276,20 @@ export default {
268
276
  <div className="container grid grid-cols-12">
269
277
  <ProductBlock
270
278
  className="col-span-12"
271
- title="Потребительский кредит наличными"
279
+ title="Для всех зарплатных клиентов вашей компании действует специальная программа:"
272
280
  headlineVersion="L"
273
- description="Для всех зарплатных клиентов вашей компании действует специальная программа:"
281
+ description="ПРИВЕДИ ДРУГА И ПОЛУЧИ 1500 БОНУСОВ"
274
282
  benefits={benefits}
275
283
  benefitsVersion="white"
276
284
  buttons={buttonsSecond}
277
285
  image={image}
278
286
  version="secondary"
279
- dynamicUtmDescription={{
280
- utm: 'utm_source',
287
+ dynamicQueryParamText={{
288
+ queryParam: 'utm_source',
281
289
  value: 'вашей компании',
290
+ textType: 'title',
282
291
  }}
283
- dynamicDescriptionSource={{
292
+ dynamicTextSource={{
284
293
  $ref: '/wcms-resources/referal-programm.json',
285
294
  }}
286
295
  />
@@ -1,5 +1,5 @@
1
1
  import type { JSONRefObject } from '../../data/JSONRefObject';
2
- import { type DynamicDescription } from '../../model/HeadlineType';
2
+ import { type DynamicText } from '../../model/HeadlineType';
3
3
  import { BaseProductTile } from '../../ui-kit/BaseProductTile/BaseProductTile';
4
4
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
5
  import { UniBlock } from '../../UniBlock/UniBlock';
@@ -9,7 +9,7 @@ import { style } from '../../utils/style';
9
9
  import { type ProductBlockContent } from './ProductBlockContent';
10
10
 
11
11
  export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
12
- dynamicDescriptionSource?: JSONRefObject & {
12
+ dynamicTextSource?: JSONRefObject & {
13
13
  list?: Record<string, string>[];
14
14
  };
15
15
  }
@@ -19,17 +19,24 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
19
19
  className,
20
20
  padding,
21
21
  defaultPadding,
22
- dynamicUtmDescription,
23
- dynamicDescriptionSource,
22
+ dynamicQueryParamText = {},
23
+ dynamicTextSource,
24
24
  description,
25
+ title,
25
26
  ...rest
26
27
  }) => {
27
- const formatDescription = getFormatDescription(
28
- dynamicUtmDescription,
29
- dynamicDescriptionSource?.list,
30
- description,
28
+ const { textType } = dynamicQueryParamText;
29
+ const formatText = getFormatDescription(
30
+ dynamicQueryParamText,
31
+ dynamicTextSource?.list,
32
+ textType === 'title' ? title : description,
31
33
  );
32
34
 
35
+ const textProps = {
36
+ title: textType === 'title' ? formatText : title,
37
+ description: textType === 'description' ? formatText : description,
38
+ };
39
+
33
40
  return (
34
41
  <BlockWrapper
35
42
  className={style('overflow-hidden flex flex-col gap-3xl box-border', className)}
@@ -39,8 +46,8 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
39
46
  <BaseProductTile
40
47
  defaultPadding={defaultPadding || 'p-6xl'}
41
48
  padding={padding}
42
- description={formatDescription}
43
49
  className="grow h-full"
50
+ {...textProps}
44
51
  {...rest}
45
52
  />
46
53
  </BlockWrapper>
@@ -49,20 +56,22 @@ export const ProductBlock = UniBlock<ProductBlockProps>(
49
56
  );
50
57
 
51
58
  const getFormatDescription = (
52
- dynamicUtmDescription: DynamicDescription = {},
59
+ dynamicQueryParamText: DynamicText = {},
53
60
  valuesList: Record<string, string>[] = [],
54
- description = '',
61
+ text = '',
55
62
  ) => {
56
- const { utm, value } = dynamicUtmDescription;
63
+ const { queryParam, value } = dynamicQueryParamText;
57
64
  const sessionQuery = saveSessionQuery();
58
- const utmValue = getUtmValue(utm ?? 'utm_source', sessionQuery);
59
- const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
65
+ const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
66
+ const dynamicValue = valuesList.find(
67
+ (item) => item?.id?.toLowerCase() === utmValue?.toLowerCase(),
68
+ )?.value;
60
69
 
61
- return dynamicValue ? description.replace(String(value), dynamicValue) : description;
70
+ return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
62
71
  };
63
72
 
64
- const getUtmValue = (utm: string, queryString: string) => {
73
+ const getQueryParamValue = (queryParam: string, queryString: string) => {
65
74
  const params = new URLSearchParams(queryString);
66
75
 
67
- return params.get(utm);
76
+ return params.get(queryParam);
68
77
  };
@@ -1,7 +1,4 @@
1
- import {
2
- type AdditionalDescriptionProps,
3
- type DynamicDescriptionProps,
4
- } from '../../model/HeadlineType';
1
+ import { type AdditionalDescriptionProps, type DynamicTextProps } from '../../model/HeadlineType';
5
2
  import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
6
3
  import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
7
4
 
@@ -11,7 +8,7 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
11
8
  export type ProductBlockContent = UniBlockContent &
12
9
  BaseProductTileContent &
13
10
  AdditionalDescriptionProps &
14
- DynamicDescriptionProps & {
11
+ DynamicTextProps & {
15
12
  /** @title Отображать кнопку возврата */
16
13
  backwardButton?: boolean;
17
14
  };
@@ -46,26 +46,34 @@ export type AdditionalDescriptionProps = {
46
46
  additionalDescription?: string;
47
47
  };
48
48
 
49
- export type DynamicDescriptionProps = {
50
- /** @title Динамическое описание по значению utm-метки */
51
- dynamicUtmDescription?: DynamicDescription;
49
+ export type DynamicTextProps = {
50
+ /** @title Динамическое описание по значению query-параметра */
51
+ dynamicQueryParamText?: DynamicText;
52
52
  /** @title Справочник значений */
53
- dynamicDescriptionSource?: JSONRefObject;
53
+ dynamicTextSource?: JSONRefObject;
54
54
  };
55
55
 
56
56
  export type HeadlineCommonProps = TitleProps &
57
57
  DescriptionProps &
58
58
  AlignProps &
59
59
  AdditionalDescriptionProps &
60
- DynamicDescriptionProps;
60
+ DynamicTextProps;
61
61
 
62
62
  export type HeadlineProps = HeadlineCommonProps & {
63
63
  headlineVersion?: HeadlineVersion;
64
64
  };
65
65
 
66
- export type DynamicDescription = {
67
- /** @title utm-метка */
68
- utm?: string;
66
+ export type DynamicText = {
67
+ /** @title query-параметр */
68
+ queryParam?: string;
69
69
  /** @title Заменяемый текст */
70
70
  value?: string;
71
+ /** @title Тип текста, где будет произведена замена */
72
+ textType?: TextType;
71
73
  };
74
+
75
+ /**
76
+ * @title Тип текста
77
+ * @enumNames ["Описание", "Заголовок"]
78
+ */
79
+ export type TextType = 'description' | 'title';