@gravity-ui/page-constructor 1.20.4 → 1.21.0
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/CHANGELOG.md +14 -0
- package/build/cjs/blocks/CardLayout/CardLayout.d.ts +3 -5
- package/build/cjs/blocks/CardLayout/CardLayout.js +2 -6
- package/build/cjs/blocks/FilterBlock/FilterBlock.css +50 -0
- package/build/cjs/blocks/FilterBlock/FilterBlock.d.ts +4 -0
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +48 -0
- package/build/cjs/blocks/FilterBlock/i18n/en.json +3 -0
- package/build/cjs/blocks/FilterBlock/i18n/index.d.ts +2 -0
- package/build/cjs/blocks/FilterBlock/i18n/index.js +8 -0
- package/build/cjs/blocks/FilterBlock/i18n/ru.json +3 -0
- package/build/cjs/blocks/FilterBlock/schema.d.ts +229 -0
- package/build/cjs/blocks/FilterBlock/schema.js +41 -0
- package/build/cjs/blocks/Tabs/Tabs.css +27 -18
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/Button/Button.css +4 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +16 -3
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +7 -4
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +2 -6
- package/build/cjs/constructor-items.d.ts +2 -1
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +8 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.js +13 -14
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -5
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +3 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.d.ts +3 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -7
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +3 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorLoadable/ConstructorLoadable.js +3 -1
- package/build/cjs/context/innerContext/InnerContext.d.ts +4 -1
- package/build/cjs/context/innerContext/InnerContext.js +2 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +26 -3
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/utils/blocks.d.ts +1 -0
- package/build/cjs/utils/blocks.js +6 -1
- package/build/esm/blocks/CardLayout/CardLayout.d.ts +3 -5
- package/build/esm/blocks/CardLayout/CardLayout.js +3 -7
- package/build/esm/blocks/FilterBlock/FilterBlock.css +50 -0
- package/build/esm/blocks/FilterBlock/FilterBlock.d.ts +5 -0
- package/build/esm/blocks/FilterBlock/FilterBlock.js +46 -0
- package/build/esm/blocks/FilterBlock/i18n/en.json +3 -0
- package/build/esm/blocks/FilterBlock/i18n/index.d.ts +2 -0
- package/build/esm/blocks/FilterBlock/i18n/index.js +5 -0
- package/build/esm/blocks/FilterBlock/i18n/ru.json +3 -0
- package/build/esm/blocks/FilterBlock/schema.d.ts +229 -0
- package/build/esm/blocks/FilterBlock/schema.js +38 -0
- package/build/esm/blocks/Tabs/Tabs.css +27 -18
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/Button/Button.css +4 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.css +16 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +7 -4
- package/build/esm/components/ButtonTabs/ButtonTabs.js +2 -6
- package/build/esm/constructor-items.d.ts +2 -1
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +8 -0
- package/build/esm/containers/PageConstructor/PageConstructor.js +15 -16
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -5
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +3 -3
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.d.ts +3 -3
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +5 -7
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +3 -2
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -3
- package/build/esm/containers/PageConstructor/components/ConstructorLoadable/ConstructorLoadable.js +3 -1
- package/build/esm/context/innerContext/InnerContext.d.ts +4 -1
- package/build/esm/context/innerContext/InnerContext.js +2 -0
- package/build/esm/models/constructor-items/blocks.d.ts +26 -3
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/utils/blocks.d.ts +1 -0
- package/build/esm/utils/blocks.js +4 -0
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +26 -3
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/utils/blocks.d.ts +1 -0
- package/server/utils/blocks.js +6 -1
- package/styles/mixins.scss +62 -5
- package/styles/root.scss +10 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
export declare const FilterTagProps: {
|
|
2
|
+
additionalProperties: boolean;
|
|
3
|
+
required: string[];
|
|
4
|
+
properties: {
|
|
5
|
+
id: {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
label: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const FilterItemProps: {
|
|
14
|
+
additionalProperties: boolean;
|
|
15
|
+
required: string[];
|
|
16
|
+
properties: {
|
|
17
|
+
tags: {
|
|
18
|
+
type: string;
|
|
19
|
+
items: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
card: {
|
|
24
|
+
$ref: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const FilterProps: {
|
|
29
|
+
additionalProperties: boolean;
|
|
30
|
+
required: string[];
|
|
31
|
+
properties: {
|
|
32
|
+
allTag: {
|
|
33
|
+
oneOf: {
|
|
34
|
+
type: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
colSizes: {
|
|
38
|
+
type: string;
|
|
39
|
+
additionalProperties: boolean;
|
|
40
|
+
properties: {};
|
|
41
|
+
};
|
|
42
|
+
tags: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
properties: {
|
|
47
|
+
when: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
items: {
|
|
54
|
+
type: string;
|
|
55
|
+
items: {
|
|
56
|
+
type: string;
|
|
57
|
+
properties: {
|
|
58
|
+
when: {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
tagButtonSize: {
|
|
65
|
+
type: string;
|
|
66
|
+
enum: string[];
|
|
67
|
+
};
|
|
68
|
+
title: {
|
|
69
|
+
oneOf: ({
|
|
70
|
+
type: string;
|
|
71
|
+
additionalProperties: boolean;
|
|
72
|
+
required: string[];
|
|
73
|
+
properties: {
|
|
74
|
+
text: {
|
|
75
|
+
type: string;
|
|
76
|
+
contentType: string;
|
|
77
|
+
};
|
|
78
|
+
textSize: {
|
|
79
|
+
type: string;
|
|
80
|
+
enum: string[];
|
|
81
|
+
};
|
|
82
|
+
url: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
resetMargin: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
} | {
|
|
90
|
+
type: string;
|
|
91
|
+
})[];
|
|
92
|
+
};
|
|
93
|
+
description: {
|
|
94
|
+
type: string;
|
|
95
|
+
contentType: string;
|
|
96
|
+
};
|
|
97
|
+
animated: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
anchor: {
|
|
101
|
+
type: string;
|
|
102
|
+
additionalProperties: boolean;
|
|
103
|
+
required: string[];
|
|
104
|
+
properties: {
|
|
105
|
+
text: {
|
|
106
|
+
type: string;
|
|
107
|
+
contentType: string;
|
|
108
|
+
};
|
|
109
|
+
url: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
visible: {
|
|
115
|
+
type: string;
|
|
116
|
+
enum: string[];
|
|
117
|
+
};
|
|
118
|
+
resetPaddings: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
context: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
type: {};
|
|
125
|
+
when: {};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export declare const FilterBlock: {
|
|
129
|
+
'filterable-block': {
|
|
130
|
+
additionalProperties: boolean;
|
|
131
|
+
required: string[];
|
|
132
|
+
properties: {
|
|
133
|
+
allTag: {
|
|
134
|
+
oneOf: {
|
|
135
|
+
type: string;
|
|
136
|
+
}[];
|
|
137
|
+
};
|
|
138
|
+
colSizes: {
|
|
139
|
+
type: string;
|
|
140
|
+
additionalProperties: boolean;
|
|
141
|
+
properties: {};
|
|
142
|
+
};
|
|
143
|
+
tags: {
|
|
144
|
+
type: string;
|
|
145
|
+
items: {
|
|
146
|
+
type: string;
|
|
147
|
+
properties: {
|
|
148
|
+
when: {
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
items: {
|
|
155
|
+
type: string;
|
|
156
|
+
items: {
|
|
157
|
+
type: string;
|
|
158
|
+
properties: {
|
|
159
|
+
when: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
tagButtonSize: {
|
|
166
|
+
type: string;
|
|
167
|
+
enum: string[];
|
|
168
|
+
};
|
|
169
|
+
title: {
|
|
170
|
+
oneOf: ({
|
|
171
|
+
type: string;
|
|
172
|
+
additionalProperties: boolean;
|
|
173
|
+
required: string[];
|
|
174
|
+
properties: {
|
|
175
|
+
text: {
|
|
176
|
+
type: string;
|
|
177
|
+
contentType: string;
|
|
178
|
+
};
|
|
179
|
+
textSize: {
|
|
180
|
+
type: string;
|
|
181
|
+
enum: string[];
|
|
182
|
+
};
|
|
183
|
+
url: {
|
|
184
|
+
type: string;
|
|
185
|
+
};
|
|
186
|
+
resetMargin: {
|
|
187
|
+
type: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
} | {
|
|
191
|
+
type: string;
|
|
192
|
+
})[];
|
|
193
|
+
};
|
|
194
|
+
description: {
|
|
195
|
+
type: string;
|
|
196
|
+
contentType: string;
|
|
197
|
+
};
|
|
198
|
+
animated: {
|
|
199
|
+
type: string;
|
|
200
|
+
};
|
|
201
|
+
anchor: {
|
|
202
|
+
type: string;
|
|
203
|
+
additionalProperties: boolean;
|
|
204
|
+
required: string[];
|
|
205
|
+
properties: {
|
|
206
|
+
text: {
|
|
207
|
+
type: string;
|
|
208
|
+
contentType: string;
|
|
209
|
+
};
|
|
210
|
+
url: {
|
|
211
|
+
type: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
visible: {
|
|
216
|
+
type: string;
|
|
217
|
+
enum: string[];
|
|
218
|
+
};
|
|
219
|
+
resetPaddings: {
|
|
220
|
+
type: string;
|
|
221
|
+
};
|
|
222
|
+
context: {
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
type: {};
|
|
226
|
+
when: {};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AnimatableProps, BlockBaseProps, BlockHeaderProps, containerSizesObject, } from '../../schema/validators/common';
|
|
2
|
+
import { filteredArray } from '../../schema/validators/utils';
|
|
3
|
+
export const FilterTagProps = {
|
|
4
|
+
additionalProperties: false,
|
|
5
|
+
required: ['id', 'label'],
|
|
6
|
+
properties: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
},
|
|
10
|
+
label: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export const FilterItemProps = {
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
required: ['tags', 'card'],
|
|
18
|
+
properties: {
|
|
19
|
+
tags: {
|
|
20
|
+
type: 'array',
|
|
21
|
+
items: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
card: { $ref: 'self#/definitions/card' },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const FilterProps = {
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
required: ['filterTags', 'block'],
|
|
31
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BlockBaseProps), AnimatableProps), BlockHeaderProps), { allTag: { oneOf: [{ type: 'boolean' }, { type: 'string' }] }, colSizes: containerSizesObject, tags: filteredArray(FilterTagProps), items: filteredArray(FilterItemProps), tagButtonSize: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
enum: ['s', 'm', 'l', 'xl'],
|
|
34
|
+
} }),
|
|
35
|
+
};
|
|
36
|
+
export const FilterBlock = {
|
|
37
|
+
'filterable-block': FilterProps,
|
|
38
|
+
};
|
|
@@ -13,11 +13,38 @@ unpredictable css rules order in build */
|
|
|
13
13
|
.pc-tabs-block__block-title_centered > * {
|
|
14
14
|
margin: 0 auto;
|
|
15
15
|
}
|
|
16
|
+
.pc-tabs-block__tabs {
|
|
17
|
+
margin-bottom: 20px;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: nowrap;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
overflow: auto;
|
|
22
|
+
}
|
|
16
23
|
.pc-tabs-block__tabs_centered {
|
|
17
24
|
display: flex;
|
|
18
25
|
justify-content: center;
|
|
19
26
|
flex-wrap: wrap;
|
|
20
27
|
}
|
|
28
|
+
@media (max-width: 769px) {
|
|
29
|
+
.pc-tabs-block__tabs {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-wrap: nowrap;
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
overflow: auto;
|
|
34
|
+
margin-left: -48px;
|
|
35
|
+
margin-right: -48px;
|
|
36
|
+
padding-left: 48px;
|
|
37
|
+
padding-right: 40px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
@media (max-width: 577px) {
|
|
41
|
+
.pc-tabs-block__tabs {
|
|
42
|
+
margin-left: -24px;
|
|
43
|
+
margin-right: -24px;
|
|
44
|
+
padding-left: 24px;
|
|
45
|
+
padding-right: 16px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
21
48
|
.pc-tabs-block__row_reverse {
|
|
22
49
|
flex-direction: row-reverse;
|
|
23
50
|
}
|
|
@@ -65,16 +92,6 @@ unpredictable css rules order in build */
|
|
|
65
92
|
}
|
|
66
93
|
|
|
67
94
|
@media (max-width: 769px) {
|
|
68
|
-
.pc-tabs-block__tabs {
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-wrap: nowrap;
|
|
71
|
-
justify-content: flex-start;
|
|
72
|
-
overflow: auto;
|
|
73
|
-
margin-left: -48px;
|
|
74
|
-
margin-right: -48px;
|
|
75
|
-
padding-left: 48px;
|
|
76
|
-
padding-right: 40px;
|
|
77
|
-
}
|
|
78
95
|
.pc-tabs-block__content-wrapper_margin {
|
|
79
96
|
margin: 0 0 32px 0;
|
|
80
97
|
}
|
|
@@ -86,14 +103,6 @@ unpredictable css rules order in build */
|
|
|
86
103
|
padding-bottom: 0;
|
|
87
104
|
}
|
|
88
105
|
}
|
|
89
|
-
@media (max-width: 577px) {
|
|
90
|
-
.pc-tabs-block__tabs {
|
|
91
|
-
margin-left: -24px;
|
|
92
|
-
margin-right: -24px;
|
|
93
|
-
padding-left: 24px;
|
|
94
|
-
padding-right: 16px;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
106
|
@media (min-width: 769px) {
|
|
98
107
|
.pc-tabs-block.pc-AnimateBlock .pc-tabs-block__media, .pc-AnimateBlock .pc-tabs-block .pc-tabs-block__media {
|
|
99
108
|
position: relative;
|
|
@@ -19,3 +19,4 @@ export { default as HeaderSliderBlock } from './HeaderSlider/HeaderSlider';
|
|
|
19
19
|
export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
20
20
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
21
21
|
export { default as ShareBlock } from './Share/Share';
|
|
22
|
+
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
@@ -19,3 +19,4 @@ export { default as HeaderSliderBlock } from './HeaderSlider/HeaderSlider';
|
|
|
19
19
|
export { default as CardLayoutBlock } from './CardLayout/CardLayout';
|
|
20
20
|
export { default as ContentLayoutBlock } from './ContentLayout/ContentLayout';
|
|
21
21
|
export { default as ShareBlock } from './Share/Share';
|
|
22
|
+
export { default as FilterBlock } from './FilterBlock/FilterBlock';
|
|
@@ -14,6 +14,8 @@ unpredictable css rules order in build */
|
|
|
14
14
|
.pc-button-block_theme_github.pc-button-block_theme_github {
|
|
15
15
|
--yc-button-background-color: var(--pc-monochrome-button-background-color);
|
|
16
16
|
--yc-button-background-color-hover: var(--pc-monochrome-button-background-color-hover);
|
|
17
|
+
}
|
|
18
|
+
.pc-button-block_theme_github.pc-button-block_theme_github, .pc-button-block_theme_github.pc-button-block_theme_github:link, .pc-button-block_theme_github.pc-button-block_theme_github:visited, .pc-button-block_theme_github.pc-button-block_theme_github:active, .pc-button-block_theme_github.pc-button-block_theme_github:focus {
|
|
17
19
|
color: var(--pc-monochrome-button-color);
|
|
18
20
|
}
|
|
19
21
|
.pc-button-block_theme_github.pc-button-block_theme_github:hover {
|
|
@@ -25,6 +27,8 @@ unpredictable css rules order in build */
|
|
|
25
27
|
.pc-button-block_theme_monochrome {
|
|
26
28
|
--yc-button-background-color: var(--pc-monochrome-button-background-color);
|
|
27
29
|
--yc-button-background-color-hover: var(--pc-monochrome-button-background-color-hover);
|
|
30
|
+
}
|
|
31
|
+
.pc-button-block_theme_monochrome, .pc-button-block_theme_monochrome:link, .pc-button-block_theme_monochrome:visited, .pc-button-block_theme_monochrome:active, .pc-button-block_theme_monochrome:focus {
|
|
28
32
|
color: var(--pc-monochrome-button-color);
|
|
29
33
|
}
|
|
30
34
|
.pc-button-block_theme_monochrome:hover {
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-button-tabs {
|
|
4
|
-
margin-bottom: 20px;
|
|
5
|
-
}
|
|
6
3
|
.pc-button-tabs__item {
|
|
7
4
|
margin-right: 8px;
|
|
8
5
|
margin-bottom: 12px;
|
|
6
|
+
--yc-button-background-color: var(--pc-tab-item-background-color);
|
|
7
|
+
--yc-button-background-color-hover: var(--pc-tab-item-background-color-hover);
|
|
8
|
+
}
|
|
9
|
+
.pc-button-tabs__item, .pc-button-tabs__item:link, .pc-button-tabs__item:visited, .pc-button-tabs__item:active, .pc-button-tabs__item:focus {
|
|
10
|
+
color: var(--pc-tab-item-color);
|
|
11
|
+
}
|
|
12
|
+
.pc-button-tabs__item:hover {
|
|
13
|
+
color: var(--pc-tab-item-color);
|
|
9
14
|
}
|
|
10
15
|
.pc-button-tabs__item_active {
|
|
11
16
|
pointer-events: none;
|
|
17
|
+
--yc-button-background-color: var(--pc-selected-tab-item-background-color);
|
|
18
|
+
--yc-button-background-color-hover: var(--pc-selected-tab-item-background-color-hover);
|
|
19
|
+
}
|
|
20
|
+
.pc-button-tabs__item_active, .pc-button-tabs__item_active:link, .pc-button-tabs__item_active:visited, .pc-button-tabs__item_active:active, .pc-button-tabs__item_active:focus {
|
|
21
|
+
color: var(--pc-selected-tab-item-color);
|
|
22
|
+
}
|
|
23
|
+
.pc-button-tabs__item_active:hover {
|
|
24
|
+
color: var(--pc-selected-tab-item-color);
|
|
12
25
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonSize } from '@gravity-ui/uikit';
|
|
1
3
|
import { ButtonProps } from '../../models';
|
|
2
4
|
import './ButtonTabs.css';
|
|
3
5
|
export interface ButtonTabsItemProps extends Omit<ButtonProps, 'url' | 'primary' | 'target' | 'text'> {
|
|
4
|
-
id: string;
|
|
6
|
+
id: string | null;
|
|
5
7
|
title: string;
|
|
6
8
|
}
|
|
7
9
|
export interface ButtonTabsProps {
|
|
8
10
|
className?: string;
|
|
9
11
|
items: ButtonTabsItemProps[];
|
|
10
|
-
activeTab?: string;
|
|
11
|
-
onSelectTab?: (tabId: string) => void;
|
|
12
|
+
activeTab?: string | null;
|
|
13
|
+
onSelectTab?: (tabId: string | null) => void;
|
|
14
|
+
tabSize?: ButtonSize;
|
|
12
15
|
}
|
|
13
|
-
declare const ButtonTabs:
|
|
16
|
+
declare const ButtonTabs: React.FC<ButtonTabsProps>;
|
|
14
17
|
export default ButtonTabs;
|
|
@@ -3,8 +3,7 @@ import { block } from '../../utils';
|
|
|
3
3
|
import { Button } from '../index';
|
|
4
4
|
import './ButtonTabs.css';
|
|
5
5
|
const b = block('button-tabs');
|
|
6
|
-
const ButtonTabs = (
|
|
7
|
-
const { className, items, activeTab, onSelectTab } = props;
|
|
6
|
+
const ButtonTabs = ({ className, items, activeTab, onSelectTab, tabSize = 'l', }) => {
|
|
8
7
|
const activeTabId = useMemo(() => {
|
|
9
8
|
if (activeTab) {
|
|
10
9
|
return activeTab;
|
|
@@ -16,9 +15,6 @@ const ButtonTabs = (props) => {
|
|
|
16
15
|
onSelectTab(tabId);
|
|
17
16
|
}
|
|
18
17
|
}, [onSelectTab]);
|
|
19
|
-
return (React.createElement("div", { className: b(null, className) }, items.map((item) =>
|
|
20
|
-
const isActive = item.id === activeTabId;
|
|
21
|
-
return (React.createElement(Button, { text: item.title, className: b('item', { active: isActive }), key: item.title, size: 'l', onClick: () => handleClick(item.id), theme: isActive ? 'monochrome' : 'normal' }));
|
|
22
|
-
})));
|
|
18
|
+
return (React.createElement("div", { className: b(null, className) }, items.map(({ id, title }) => (React.createElement(Button, { text: title, className: b('item', { active: id === activeTabId }), key: title, size: tabSize, onClick: () => handleClick(id) })))));
|
|
23
19
|
};
|
|
24
20
|
export default ButtonTabs;
|
|
@@ -16,10 +16,11 @@ export declare const blockMap: {
|
|
|
16
16
|
"header-block": (props: import("./models").WithChildren<import("./models").HeaderBlockProps & import("./models").ClassNameProps>) => JSX.Element;
|
|
17
17
|
"icons-block": ({ title, size, items }: import("./models").IconsBlockProps) => JSX.Element;
|
|
18
18
|
"header-slider-block": ({ items, arrows, ...props }: import("./models").HeaderSliderBlockProps) => JSX.Element;
|
|
19
|
-
"card-layout-block": (
|
|
19
|
+
"card-layout-block": import("react").FC<import("./blocks/CardLayout/CardLayout").CardLayoutBlockProps>;
|
|
20
20
|
"content-layout-block": (props: import("./models").ContentLayoutBlockProps) => JSX.Element;
|
|
21
21
|
"share-block": ({ items, title }: import("./models").ShareBlockProps) => JSX.Element;
|
|
22
22
|
"map-block": ({ map, ...props }: import("./models").MapBlockProps) => JSX.Element;
|
|
23
|
+
"filter-block": import("react").FC<import("./models").FilterBlockProps>;
|
|
23
24
|
};
|
|
24
25
|
export declare const subBlockMap: {
|
|
25
26
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockType, SubBlockType } from './models';
|
|
2
2
|
import { Partner, PriceDetailed, MediaCard, NewsCard, TutorialCard, CardWithImage, LayoutItem, BackgroundCard, Content, Quote, Divider, BannerCard, BasicCard, } from './sub-blocks';
|
|
3
|
-
import { BannerBlock, CompaniesBlock, SimpleBlock, MediaBlock, MapBlock, PreviewBlock, InfoBlock, SecurityBlock, SliderBlock, ExtendedFeaturesBlock, PromoFeaturesBlock, QuestionsBlock, TableBlock, TabsBlock, LinkTableBlock, HeaderBlock, IconsBlock, HeaderSliderBlock, CardLayoutBlock, ContentLayoutBlock, ShareBlock, } from './blocks';
|
|
3
|
+
import { BannerBlock, CompaniesBlock, SimpleBlock, MediaBlock, MapBlock, PreviewBlock, InfoBlock, SecurityBlock, SliderBlock, ExtendedFeaturesBlock, PromoFeaturesBlock, QuestionsBlock, TableBlock, TabsBlock, LinkTableBlock, HeaderBlock, IconsBlock, HeaderSliderBlock, CardLayoutBlock, ContentLayoutBlock, ShareBlock, FilterBlock, } from './blocks';
|
|
4
4
|
export const blockMap = {
|
|
5
5
|
[BlockType.SliderBlock]: SliderBlock,
|
|
6
6
|
[BlockType.SimpleBlock]: SimpleBlock,
|
|
@@ -23,6 +23,7 @@ export const blockMap = {
|
|
|
23
23
|
[BlockType.ContentLayoutBlock]: ContentLayoutBlock,
|
|
24
24
|
[BlockType.ShareBlock]: ShareBlock,
|
|
25
25
|
[BlockType.MapBlock]: MapBlock,
|
|
26
|
+
[BlockType.FilterBlock]: FilterBlock,
|
|
26
27
|
};
|
|
27
28
|
export const subBlockMap = {
|
|
28
29
|
[SubBlockType.Divider]: Divider,
|
|
@@ -19,6 +19,14 @@ unpredictable css rules order in build */
|
|
|
19
19
|
--pc-monochrome-button-color: var(--yc-color-text-light-primary);
|
|
20
20
|
--pc-text-header-color: var(--yc-color-text-primary);
|
|
21
21
|
--pc-media-card-meta-info-color: var(--yc-color-text-secondary);
|
|
22
|
+
--pc-tab-item-color: var(--yc-color-text-primary);
|
|
23
|
+
--pc-tab-item-background-color: var(--yc-color-base-generic);
|
|
24
|
+
--pc-tab-item-background-color-hover: var(--yc-color-base-generic-hover);
|
|
25
|
+
--pc-selected-tab-item-color: var(--pc-monochrome-button-color);
|
|
26
|
+
--pc-selected-tab-item-background-color: var(--pc-monochrome-button-background-color);
|
|
27
|
+
--pc-selected-tab-item-background-color-hover: var(
|
|
28
|
+
--pc-monochrome-button-background-color-hover
|
|
29
|
+
);
|
|
22
30
|
}
|
|
23
31
|
.yc-root.yc-root_theme_dark {
|
|
24
32
|
--pc-color-sfx-shadow: var(--yc-color-sfx-shadow);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useContext, useMemo } from 'react';
|
|
3
3
|
import '@doc-tools/transform/dist/js/yfm';
|
|
4
|
-
import { HeaderBlockTypes, BlockTypes, } from '../../models';
|
|
4
|
+
import { HeaderBlockTypes, BlockTypes, SubBlockTypes, } from '../../models';
|
|
5
5
|
import { blockMap, subBlockMap } from '../../constructor-items';
|
|
6
6
|
import { Grid } from '../../grid';
|
|
7
7
|
import BackgroundMedia from '../../components/BackgroundMedia/BackgroundMedia';
|
|
8
|
-
import { block as cnBlock, getCustomBlockTypes, getCustomHeaderTypes, getThemedValue, getCustomItems, } from '../../utils';
|
|
8
|
+
import { block as cnBlock, getCustomBlockTypes, getCustomHeaderTypes, getThemedValue, getCustomItems, getCustomSubBlockTypes, } from '../../utils';
|
|
9
9
|
import { AnimateContext } from '../../context/animateContext';
|
|
10
10
|
import { InnerContext } from '../../context/innerContext';
|
|
11
11
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
@@ -17,21 +17,20 @@ import Layout from '../../navigation/containers/Layout/Layout';
|
|
|
17
17
|
import './PageConstructor.css';
|
|
18
18
|
const b = cnBlock('page-constructor');
|
|
19
19
|
export const Constructor = (props) => {
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
20
|
+
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, navigation, custom, } = props;
|
|
21
|
+
const { context } = useMemo(() => ({
|
|
22
|
+
context: {
|
|
23
|
+
blockTypes: [...BlockTypes, ...getCustomBlockTypes(custom)],
|
|
24
|
+
subBlockTypes: [...SubBlockTypes, ...getCustomSubBlockTypes(custom)],
|
|
25
|
+
headerBlockTypes: [...HeaderBlockTypes, ...getCustomHeaderTypes(custom)],
|
|
26
|
+
itemMap: Object.assign(Object.assign(Object.assign({}, blockMap), subBlockMap), getCustomItems(custom)),
|
|
27
|
+
loadables: custom === null || custom === void 0 ? void 0 : custom.loadable,
|
|
28
|
+
shouldRenderBlock,
|
|
29
|
+
},
|
|
30
|
+
}), [custom, shouldRenderBlock]);
|
|
31
31
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
32
|
-
const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, navigation, } = props;
|
|
33
32
|
const hasFootnotes = footnotes.length > 0;
|
|
34
|
-
const isHeaderBlock = (block) => headerBlockTypes.includes(block.type);
|
|
33
|
+
const isHeaderBlock = (block) => context.headerBlockTypes.includes(block.type);
|
|
35
34
|
const header = blocks === null || blocks === void 0 ? void 0 : blocks.find(isHeaderBlock);
|
|
36
35
|
const restBlocks = blocks === null || blocks === void 0 ? void 0 : blocks.filter((block) => !isHeaderBlock(block));
|
|
37
36
|
const themedBackground = getThemedValue(background, theme);
|
|
@@ -44,7 +43,7 @@ export const Constructor = (props) => {
|
|
|
44
43
|
header && React.createElement(ConstructorHeader, { data: header }),
|
|
45
44
|
React.createElement(Grid, null,
|
|
46
45
|
restBlocks && (React.createElement(ConstructorRow, null,
|
|
47
|
-
React.createElement(ConstructorBlocks, { items: restBlocks
|
|
46
|
+
React.createElement(ConstructorBlocks, { items: restBlocks }))),
|
|
48
47
|
hasFootnotes && (React.createElement(ConstructorRow, null,
|
|
49
48
|
React.createElement(ConstructorFootnotes, { items: footnotes })))))))));
|
|
50
49
|
};
|
package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Block,
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Block, WithChildren } from '../../../../models';
|
|
3
3
|
interface ConstructorBlockProps {
|
|
4
4
|
data: Block;
|
|
5
|
-
Component: ReactElement;
|
|
6
|
-
shouldRenderBlock?: ShouldRenderBlock;
|
|
7
5
|
}
|
|
8
|
-
export declare const ConstructorBlock:
|
|
6
|
+
export declare const ConstructorBlock: React.FC<WithChildren<ConstructorBlockProps>>;
|
|
9
7
|
export {};
|
package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import BlockBase from '../../../../components/BlockBase/BlockBase';
|
|
3
3
|
import { block } from '../../../../utils';
|
|
4
4
|
const b = block('constructor-block');
|
|
5
|
-
export const ConstructorBlock = ({ data,
|
|
6
|
-
const { anchor, visible } = data;
|
|
7
|
-
return (React.createElement(BlockBase, { className: b({ type
|
|
5
|
+
export const ConstructorBlock = ({ data, children, }) => {
|
|
6
|
+
const { anchor, visible, type } = data;
|
|
7
|
+
return (React.createElement(BlockBase, { className: b({ type }), anchor: anchor, visible: visible, resetPaddings: data.resetPaddings }, children));
|
|
8
8
|
};
|
package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConstructorItem as ConstructorItemType } from '../../../../models';
|
|
2
3
|
interface ConstructorBlocksProps {
|
|
3
4
|
items: ConstructorItemType[];
|
|
4
|
-
shouldRenderBlock?: ShouldRenderBlock;
|
|
5
5
|
}
|
|
6
|
-
export declare const ConstructorBlocks:
|
|
6
|
+
export declare const ConstructorBlocks: React.FC<ConstructorBlocksProps>;
|
|
7
7
|
export {};
|
package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js
CHANGED
|
@@ -2,17 +2,15 @@ import _ from 'lodash';
|
|
|
2
2
|
import React, { Fragment, useContext } from 'react';
|
|
3
3
|
import { getBlockKey } from '../../../../utils';
|
|
4
4
|
import { InnerContext } from '../../../../context/innerContext';
|
|
5
|
-
import { BlockIdContext } from '../../../../context/blockIdContext';
|
|
6
5
|
import { ConstructorLoadable } from '../ConstructorLoadable';
|
|
7
6
|
import { ConstructorItem } from '../ConstructorItem';
|
|
8
7
|
import { ConstructorBlock } from '../ConstructorBlock/ConstructorBlock';
|
|
9
|
-
export const ConstructorBlocks = ({ items
|
|
10
|
-
const { blockTypes, loadables, itemMap } = useContext(InnerContext);
|
|
8
|
+
export const ConstructorBlocks = ({ items }) => {
|
|
9
|
+
const { blockTypes, loadables, itemMap, shouldRenderBlock } = useContext(InnerContext);
|
|
11
10
|
const renderer = (parentId = '', item, index) => {
|
|
12
11
|
if (!itemMap[item.type]) {
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
15
|
-
let children;
|
|
16
14
|
let itemElement;
|
|
17
15
|
const key = getBlockKey(item, index);
|
|
18
16
|
const blockId = parentId ? `${parentId}_${key}` : key;
|
|
@@ -28,13 +26,13 @@ export const ConstructorBlocks = ({ items, shouldRenderBlock }) => {
|
|
|
28
26
|
itemElement = (React.createElement(ConstructorLoadable, { block: item, key: blockId, blockKey: blockId, config: config, serviceId: serviceId, params: params }));
|
|
29
27
|
}
|
|
30
28
|
else {
|
|
29
|
+
let children;
|
|
31
30
|
if ('children' in item && item.children) {
|
|
32
31
|
children = item.children.map(renderer.bind(null, blockId));
|
|
33
32
|
}
|
|
34
|
-
itemElement = (React.createElement(
|
|
35
|
-
React.createElement(ConstructorItem, { data: item }, children)));
|
|
33
|
+
itemElement = (React.createElement(ConstructorItem, { data: item, key: blockId, blockKey: blockId }, children));
|
|
36
34
|
}
|
|
37
|
-
return blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item, key: blockId,
|
|
35
|
+
return blockTypes.includes(item.type) ? (React.createElement(ConstructorBlock, { data: item, key: blockId }, itemElement)) : (itemElement);
|
|
38
36
|
};
|
|
39
37
|
return React.createElement(Fragment, null, items.map(renderer.bind(null, '')));
|
|
40
38
|
};
|
package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConstructorItem as ConstructorItemType, WithChildren } from '../../../../models';
|
|
2
2
|
export interface ConstructorItemProps {
|
|
3
3
|
data: ConstructorItemType;
|
|
4
|
+
blockKey?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare const ConstructorItem: ({ data, children }: WithChildren<ConstructorItemProps>) => JSX.Element;
|
|
6
|
-
export declare const ConstructorHeader: ({ data }: Pick<ConstructorItemProps, 'data'>) => JSX.Element;
|
|
6
|
+
export declare const ConstructorItem: ({ data, blockKey, children, }: WithChildren<ConstructorItemProps>) => JSX.Element;
|
|
7
|
+
export declare const ConstructorHeader: ({ data, blockKey, }: Pick<ConstructorItemProps, 'data' | 'blockKey'>) => JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { InnerContext } from '../../../../context/innerContext';
|
|
4
|
-
|
|
4
|
+
import { BlockIdContext } from '../../../../context/blockIdContext';
|
|
5
|
+
export const ConstructorItem = ({ data, blockKey = '', children, }) => {
|
|
5
6
|
const { itemMap } = useContext(InnerContext);
|
|
6
7
|
const { type } = data, rest = __rest(data, ["type"]);
|
|
7
8
|
const Component = itemMap[type];
|
|
8
|
-
return React.createElement(
|
|
9
|
+
return (React.createElement(BlockIdContext.Provider, { value: blockKey },
|
|
10
|
+
React.createElement(Component, Object.assign({}, rest), children)));
|
|
9
11
|
};
|
|
10
|
-
export const ConstructorHeader = ({ data }) => (React.createElement(ConstructorItem, { data: data, key: data.type }));
|
|
12
|
+
export const ConstructorHeader = ({ data, blockKey = '', }) => (React.createElement(ConstructorItem, { data: data, key: data.type, blockKey: blockKey }));
|