@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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +17 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +15 -8
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +15 -8
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +15 -8
- package/mobile/bundle/bundle.umd.js +17 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +15 -8
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +15 -8
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +15 -8
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- package/mobile/src/model/HeadlineType.ts +16 -8
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +7 -2
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +16 -7
- package/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- 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:
|
|
16
|
-
height:
|
|
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
|
-
|
|
280
|
-
|
|
287
|
+
dynamicQueryParamText={{
|
|
288
|
+
queryParam: 'utm_source',
|
|
281
289
|
value: 'вашей компании',
|
|
290
|
+
textType: 'title',
|
|
282
291
|
}}
|
|
283
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
23
|
-
|
|
22
|
+
dynamicQueryParamText = {},
|
|
23
|
+
dynamicTextSource,
|
|
24
24
|
description,
|
|
25
|
+
title,
|
|
25
26
|
...rest
|
|
26
27
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
59
|
+
dynamicQueryParamText: DynamicText = {},
|
|
53
60
|
valuesList: Record<string, string>[] = [],
|
|
54
|
-
|
|
61
|
+
text = '',
|
|
55
62
|
) => {
|
|
56
|
-
const {
|
|
63
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
57
64
|
const sessionQuery = saveSessionQuery();
|
|
58
|
-
const utmValue =
|
|
59
|
-
const dynamicValue = valuesList.find(
|
|
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 ?
|
|
70
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
62
71
|
};
|
|
63
72
|
|
|
64
|
-
const
|
|
73
|
+
const getQueryParamValue = (queryParam: string, queryString: string) => {
|
|
65
74
|
const params = new URLSearchParams(queryString);
|
|
66
75
|
|
|
67
|
-
return params.get(
|
|
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
|
-
|
|
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
|
|
50
|
-
/** @title Динамическое описание по значению
|
|
51
|
-
|
|
49
|
+
export type DynamicTextProps = {
|
|
50
|
+
/** @title Динамическое описание по значению query-параметра */
|
|
51
|
+
dynamicQueryParamText?: DynamicText;
|
|
52
52
|
/** @title Справочник значений */
|
|
53
|
-
|
|
53
|
+
dynamicTextSource?: JSONRefObject;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export type HeadlineCommonProps = TitleProps &
|
|
57
57
|
DescriptionProps &
|
|
58
58
|
AlignProps &
|
|
59
59
|
AdditionalDescriptionProps &
|
|
60
|
-
|
|
60
|
+
DynamicTextProps;
|
|
61
61
|
|
|
62
62
|
export type HeadlineProps = HeadlineCommonProps & {
|
|
63
63
|
headlineVersion?: HeadlineVersion;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export type
|
|
67
|
-
/** @title
|
|
68
|
-
|
|
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';
|